Computer Network GATE Question Answers with Explanation.
Q1 – Suppose two hosts are connected by a point-to-point link and they are configured to use Stop-and-Wait protocol for reliable data transfer. Identify in which one of the following scenarios, the utilization of the link is the lowest. (GATE 2023)
Â
1. Longer link length and lower transmission rate
2. Longer link length and higher transmission rate
3. Shorter link length and lower transmission rate
4. Shorter link length and higher transmission rate
Ans – (1)
Explanation –
1. Longer link length and lower transmission rate
– Longer link length increases the propagation delay (time taken for a bit to travel from sender to receiver).
– Lower transmission rate means each frame takes more time to be transmitted.
– Lower link utilization due to increased idle time.
2. Longer link length and higher transmission rate
– Longer link length still increases the propagation delay.
– Higher transmission rate reduces the time taken to transmit a frame.
– Moderate link utilization
3. Shorter link length and lower transmission rate
– Shorter link length reduces the propagation delay.
– Lower transmission rate means each frame takes more time to be transmitted.
– Higher link utilization.
4. Shorter link length and higher transmission rate
– Shorter link length reduces the propagation delay.
– Higher transmission rate means frames are transmitted more quickly.
– highest link utilization.
Considering the Stop-and-Wait protocol, option 1 (Longer link length and lower transmission rate) is likely to have the lowest link utilization.Â
Q2 – Which of the following statements is/are INCORRECT about the OSPF (Open Shortest Path First) routing protocol used in the Internet? (GATE 2023)
Â
1. OSPF implements Bellman-Ford algorithm to find shortest paths.
2. OSPF uses Dijkstra’s shortest path algorithm to implement least-cost path routing.
3. OSPF is used as an inter-domain routing protocol.
4. OSPF implements hierarchical routing.
Ans – (1, 3)
Explanation –
OSPF implements Bellman-Ford algorithm to find shortest paths:
- Incorrect. OSPF uses Dijkstra’s algorithm, not Bellman-Ford, to compute the shortest path within an area. Bellman-Ford is used in distance-vector routing protocols like RIP (Routing Information Protocol), while OSPF uses a link-state routing approach.
OSPF uses Dijkstra’s shortest path algorithm to implement least-cost path routing:
- Correct. OSPF uses Dijkstra’s algorithm to calculate the shortest path tree for each router.
OSPF is used as an inter-domain routing protocol:
- Incorrect. OSPF is an intra-domain routing protocol, meaning it is used within a single autonomous system (AS). For inter-domain routing (between ASes), protocols like BGP (Border Gateway Protocol) are used.
OSPF implements hierarchical routing:
- Correct. OSPF supports hierarchical routing by dividing an autonomous system into areas, which helps to reduce the complexity of routing tables and improve network efficiency.
Q3 – Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with Round Trip Time of 150 milliseconds and the maximum segment lifetime of 2 minutes.
Which of the following is/are valid lengths of the Sequence Number field in the myTCP header? (GATE 2023)
1. 30 bits
2. 32 bits
3. 34 bits
4. 36 bits
Ans – (2, 3, 4)
Explanation – To design a reliable byte-stream transport protocol like TCP, called myTCP, over a 100 Mbps network with a round-trip time (RTT) of 150 milliseconds and a maximum segment lifetime (MSL) of 2 minutes, it is important to determine the appropriate sequence number length. The sequence number field must be large enough to ensure that sequence numbers do not wrap around during the maximum segment lifetime, which could cause ambiguity in packet identification. Over a 2-minute period (120 seconds), the network can transmit a significant amount of data, calculated as 1.5 x 10^9 bytes. To avoid wrapping, the sequence number space should be large enough to cover at least this amount of data.
Calculating the number of bits needed to represent 1.5 x 10^9Â bytes results in a minimum of 31 bits. However, analyzing the options given, a 30-bit sequence number is insufficient because it can represent only 1.07 x 10^9Â bytes, which is less than required.
On the other hand, 32-bit, 34-bit, and 36-bit sequence numbers are all valid, as they can represent enough bytes—ranging from 4.29 x 10^9 bytes for 32 bits to 6.87 x 10^10 bytes for 36 bits. Therefore, the valid sequence number lengths for myTCP are 32 bits, 34 bits, and 36 bits.
Q4 – Suppose in a web browser, you click on the www.gate-2023.in URL. The browser cache is empty. The IP address for this URL is not cached in your local host, so a DNS lookup is triggered (by the local DNS server deployed on your local host) over the 3-tier DNS hierarchy in an iterative mode. No resource records are cached anywhere across all DNS servers.
Let RTT denote the round-trip time between your local host and DNS servers in the DNS hierarchy. The round-trip time between the local host and the web server hosting www.gate-2023.in is also equal to RTT. The HTML file associated with the URL is small enough to have negligible transmission time and negligible rendering time by your web browser, which references 10 equally small objects on the same web server.
Which of the following statements is/are CORRECT about the minimum elapsed time between clicking on the URL and your browser fully rendering it? (GATE 2023)
1. 7 RTTs, in case of non-persistent HTTP with 5 parallel TCP connections.
2. 5 RTTs, in case of persistent HTTP with pipelining.
3. 9 RTTs, in case of non-persistent HTTP with 5 parallel TCP connections.
4. 6 RTTs, in case of persistent HTTP with pipelining.
Ans – (3, 4)
Explanation –
Q5 – Consider the following two-dimensional array D in the C programming language, which is stored in row-major order:
int D[128][128];
Demand paging is used for allocating memory and each physical page frame holds 512 elements of the array D. The Least Recently Used (LRU) page-replacement policy is used by the operating system. A total of 30 physical page frames are allocated to a process which executes the following code snippet:
for (int i = 0; i < 128; i++)
  for (int j = 0; j < 128; j++)
           D[j][i] *= 10;
The number of page faults generated during the execution of this code snippet is __________. (GATE 2023)
Ans – (4096)
Explanation – In this problem, we are dealing with a two-dimensional array D[128][128], stored in row-major order, and a program that accesses it in a column-major order.
Given that the array is stored row-wise in memory, but the program accesses it by columns, it means the program will frequently switch between rows during its execution. Since the array is large and the available physical memory is limited to 30 page frames, the demand paging system will frequently need to load new pages into memory.
Each page frame can hold 512 elements, which corresponds to four rows of the array.
However, as the code iterates through each column, it will need to load pages that span across multiple rows. For each iteration of iii (representing a column), 32 different pages are accessed, but with only 30 page frames available, the Least Recently Used (LRU) policy will frequently evict pages, causing page faults when those evicted pages are needed again. This process leads to a high number of page faults as the program progresses through each column. In total, the program generates 4096 page faults, as each column access causes 32 page faults, and there are 128 columns to be processed.
Q6 – Consider a computer system with 57-bit virtual addressing using multi-level tree-structured page tables with L levels for virtual to physical address translation. The page size is 4 KB (1 KB = 1024 B) and a page table entry at any of the levels occupies 8 bytes.
The value of L is _________. (GATE 2023)
Ans – (5)
Explanation –
Q7 – The forwarding table of a router is shown below.
A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID _________. (GATE 2023)
Ans – (3)Â
Explanation –