GateAI

GATE CSE CIDR Notation PYQs

Standard yield6.6% of Computer Networks

In GATE CS, CIDR notation is tested as a core network-layer mechanism combining binary arithmetic, bitwise masking, and address boundary alignment. Questions pr… Read the guide

Questions
7
Asked
since 2022
Total marks
13
Marks / paper
0.5

7 GATE CSE CIDR Notation PYQs with solutions, from Computer Networks. Browse all GATE CSE PYQs.

Questions

Every official paper that asked this topic, newest first.

What GATE tests in CIDR Notation

Concepts, patterns, formulas and traps distilled from past papers.

In GATE CS, CIDR notation is tested as a core network-layer mechanism combining binary arithmetic, bitwise masking, and address boundary alignment. Questions predominantly evaluate Longest Prefix Match (LPM) packet forwarding across routing tables, route aggregation/supernetting validity, and host capacity calculations. Recent years emphasize Multi-Select Questions (MSQs) and numerical calculations (NATs) requiring rigorous validation of power-of-two block alignments.

Core concepts

  • CIDR prefix notation (/n) and dotted-decimal subnet masks
  • Longest Prefix Match (LPM) algorithm for IP forwarding
  • Power-of-two block sizing and start address alignment constraints
  • Route aggregation / Supernetting
  • Host bit allocation vs. Network bit allocation
  • Reserved IP addresses (Network ID and Directed Broadcast ID)
  • CIDR notation (/n format)
  • Subnet masking and bitwise AND operation
  • Binary conversion of specific octets
  • Longest Prefix Match (LPM) routing algorithm
  • Router interface forwarding lookup

Recurring question patterns

  • Longest Prefix Match (LPM) Routing Table Lookup

    CommonNAT2 marks2024, 2023

    Given a router forwarding table with multiple CIDR prefixes and interfaces/next-hop routers, determine which interface or router handles a specific destination IP (or compute aggregate packet counts across multiple host destination IPs).

  • CIDR Block Aggregation and Supernetting

    CommonMSQ2 marks2026, 2022

    Given a collection of subnet routes or an ISP address pool with client capacity requirements, determine the valid CIDR prefix(es) that aggregate subnets or represent valid assignable sub-blocks conforming to boundary alignment rules.

  • Exact Prefix Representation of IP Range

    OccasionalMCQ2 marks2024

    Given a contiguous range of IP addresses (start and end addresses), compute the required host bits and prefix length to find the single matching CIDR prefix.

  • Assignable Interface/Host Address Calculation

    OccasionalNAT1 marks2026

    Given a subnet mask in dotted-decimal notation, compute the number of host bits and find the maximum usable host addresses after subtracting network and directed broadcast addresses.

  • Router Forwarding via Longest Prefix Match (LPM)

    CommonMCQ2 marks2025

    Given a destination IPv4 address and a routing table with multiple network prefixes in CIDR slash notation (e.g., /16, /17, /18, /24) and associated interface names, determine the correct egress interface by finding all matching subnets and selecting the one with the maximum prefix length.

Formulas GATE uses

Prefix Length Calculation

Prefix Length=32−h=32−⌈log⁡2(N)⌉\text{Prefix Length} = 32 - h = 32 - \lceil \log_2(N) \rceil

Used to find CIDR mask /n when given a required address block size NN or number of host bits hh.

Assignable Host Addresses

Assignable Hosts=2h−2=232−n−2\text{Assignable Hosts} = 2^{h} - 2 = 2^{32 - n} - 2

Used when calculating valid assignable network interface IP addresses for a subnet with hh host bits.

CIDR Block Boundary Alignment Rule

Start Address (as integer)(mod2h)=0\text{Start Address (as integer)} \pmod{2^h} = 0

Used to check whether a given network base IP address is a valid power-of-two CIDR boundary for block size 2h2^h.

Bitwise Subnet Matching

Destination IP & Subnet Mask=Prefix Network Address\text{Destination IP} \ \&\ \text{Subnet Mask} = \text{Prefix Network Address}

Used for each entry in a routing table during LPM evaluation before picking the longest matching prefix.

Bitwise Subnet Masking

Network ID=IP Address  &  Subnet Mask\text{Network ID} = \text{IP Address} \;\&\; \text{Subnet Mask}

Used to check whether a destination IP address falls within a given CIDR network prefix.

Longest Prefix Match Rule

Selected Route=arg⁡max⁡r∈Matches(PrefixLength(r))\text{Selected Route} = \arg\max_{r \in \text{Matches}} (\text{PrefixLength}(r))

Used to choose the winning routing table entry when more than one prefix matches the destination IP address.

Examiner traps in CIDR Notation

  • Picking an aggregation prefix with correct total size but invalid boundary alignment (e.g., trying to use /21 starting at 164 where 164 is not divisible by 8).
  • Stopping at the first matching prefix instead of checking all entries to find the longest matching prefix length.
  • Forgetting to subtract 2 for network address and broadcast address when asked for assignable interface/host addresses.
  • Applying bitwise AND on decimal octets directly instead of binary bitwise AND.
  • Failing to multiply by packet counts when evaluating multi-host routing distribution NAT problems.
  • Stopping at the first matching entry (e.g., choosing a shorter prefix like /16 before evaluating longer valid prefixes like /18).
  • Errors in decimal-to-binary conversion for the dividing octet (e.g., converting 109 as 01101101 vs 64 as 01000000).
  • Assuming higher numbered interfaces or default routes without verifying exact prefix overlap.

How questions are asked

  • Routing table interface lookup via LPM
  • Multi-host packet distribution count (NAT)
  • Contiguous IP range to CIDR prefix mapping
  • ISP address allocation validity under block boundary constraints (MSQ)
  • Subnet aggregation set identification (MSQ)
  • Usable host address count from subnet mask
  • Identify egress interface from a routing table for a given destination IP

Paper trends

  • Shift from basic 1-mark single-rule lookups to multi-packet counting and multi-option verification (MSQ) testing boundary alignment.

    2026, 2024, 2022

  • Increased use of NAT and MSQ formats over standard MCQs to test precise bitwise evaluation without reliance on option elimination.

    2026, 2024, 2023

  • Recent examinations continue to emphasize binary-level prefix matching where multiple routing table entries match the destination IP, testing whether candidates properly apply the Longest Prefix Match rule rather than picking the first matching route.

    2025

Difficulty notes

Easy items involve direct 1-step calculations such as counting assignable hosts from a mask (2^h - 2) or converting a simple contiguous 2-block range to /23. Medium items require evaluating multiple destination IPs across 4+ routing entries (LPM) or checking multiple MSQ options against both boundary divisibility constraints and allocation boundaries within an ISP pool.