Computer Networks for GATE
Computer Networks carries 8 to 10 marks in GATE CS annually. The subject is notable for combining conceptual understanding with precise numerical calculati...
GATE Strategy and Weightage for Computer Networks
Computer Networks carries 8 to 10 marks in GATE CS annually. The subject is notable for combining conceptual understanding with precise numerical calculations, rewarding students who can both reason about protocol behavior and compute exact bandwidth, delay, and addressing values.
The highest-weightage sub-topics based on historical GATE papers are: IP addressing and subnetting (appears almost every year, often as a two-mark problem), sliding window protocols and throughput calculations, TCP congestion control and flow control, and error detection/correction (CRC, Hamming codes). Application layer protocols (DNS, HTTP) and routing algorithms (Dijkstra's for link-state, Bellman-Ford for distance-vector) each contribute one or two questions most years.
For subnetting questions, practice the following mental workflow: convert the mask to binary, determine the network bits, compute the block size (2 raised to the power of host bits), identify the subnet address (zero out host bits), compute the broadcast address (set all host bits to 1), and derive the valid host range. This workflow handles every subnetting variant GATE presents.
For sliding window throughput, the key formula is efficiency equals (window size W) divided by (1 + 2a), where a equals propagation delay divided by transmission time, provided W is less than or equal to (1 + 2a). If W is greater than or equal to (1 + 2a), efficiency equals 1 (sender never stalls). This formula applies to both Go-Back-N and Selective Repeat when the window is large enough; the difference only matters when computing how many frames may need retransmission.
A common two-mark GATE question: a link has bandwidth 10 Mbps, propagation delay 500 ms, and frame size 10,000 bits. Compute the minimum window size for 100 percent efficiency. Transmission time = 10,000 divided by 10,000,000 = 1 ms. a = 500 ms divided by 1 ms = 500. Minimum window = 1 + 2 times 500 = 1001 frames. GATE may also ask which protocol (Go-Back-N or Selective Repeat) requires a smaller sequence number space for a given window size — SR requires half the sequence numbers of GBN for the same window.
Sliding Window Protocols and Error Control for GATE
Sliding window protocols allow multiple frames to be in transit simultaneously, dramatically improving link utilization compared to stop-and-wait. Two main variants appear in GATE: Go-Back-N (GBN) and Selective Repeat (SR).
In stop-and-wait, the sender transmits one frame and waits for acknowledgment before sending the next. Efficiency equals 1 divided by (1 + 2a). For the example above with a = 500, stop-and-wait efficiency is 1/1001 — less than 0.1 percent utilization. This motivates pipelining.
Go-Back-N uses a window size of at most N frames. If frame i is lost or corrupted, the receiver discards frame i and all subsequent frames (even if correct) and sends a NAK for frame i. The sender must retransmit frame i and all frames with sequence numbers from i onward. The sequence number space must be at least N + 1 to distinguish between old and new frames. GBN wastes bandwidth retransmitting correct frames following an error.
Selective Repeat allows the receiver to accept and buffer out-of-order frames. Only the erroneous frame (and any specifically NAKed frames) needs retransmission. Window size is at most N/2 (half the sequence number space) to prevent ambiguity between old frames being retransmitted and new frames from the next window. SR is more complex but wastes less bandwidth on errors.
CRC error detection generates a Frame Check Sequence (FCS) by dividing the message polynomial by the generator polynomial using modulo-2 division. The remainder (FCS) is appended to the message. The receiver divides the entire received frame by the generator; a nonzero remainder indicates an error. GATE questions may ask you to compute the FCS for a given message and generator, or determine whether a received frame contains an error.
Hamming distance of a code equals the minimum number of bit positions in which any two valid codewords differ. To detect d errors, the Hamming distance must be at least d + 1. To correct d errors, the Hamming distance must be at least 2d + 1. A Hamming code with r parity bits can cover data words of up to 2 raised to r minus r minus 1 bits.
Network Layer Calculations and Address Resolution for GATE
The network layer is responsible for logical addressing and routing. For GATE, mastery of IP subnetting calculations, longest-prefix matching in routing tables, and the ARP/ICMP protocol behavior are essential.
Longest-prefix matching is the algorithm routers use to select the best route. Given multiple routing table entries that match a destination IP, the router selects the entry with the longest matching prefix. For example, if routing table contains entries for 192.168.1.0/24 and 192.168.1.128/25, a packet for 192.168.1.200 matches both, but /25 is more specific and wins. GATE may present a routing table and ask which interface a packet uses.
NAT (Network Address Translation) allows multiple devices to share a single public IP address. The NAT router maintains a translation table mapping (private IP, private port) pairs to (public IP, public port) pairs. Outbound packets are rewritten with the public address; inbound packets are rewritten with the private address. NAT complicates peer-to-peer connections because inbound connections cannot find the private host without explicit port-forwarding rules.
ARP (Address Resolution Protocol) maps IP addresses to MAC addresses within a local network. When a device needs the MAC address for an IP, it broadcasts an ARP request; the device with that IP responds with its MAC. The mapping is cached in the ARP table. GATE may trace ARP and routing together: a host sending to a remote subnet sends the packet to its default gateway (router) with the router's MAC address in the Ethernet frame but the final destination's IP in the IP header.
ICMP carries error and informational messages for IP. Ping uses ICMP Echo Request and Echo Reply to test connectivity. Traceroute sends packets with incrementing TTL values; each router that drops a packet (TTL reaches zero) sends an ICMP Time Exceeded message, revealing the path. GATE tests the purpose of TTL in preventing packets from looping indefinitely and how traceroute exploits this mechanism.