IPv4 Basics MCQs: 10 Solved Network Layer Questions with Explanations

Solve 10 IPv4 and Network Layer MCQs, then verify each answer through field widths, layer counts and a connected hexadecimal-header calculation.

KnowledgeGate Team

Exam prep & CS education

Updated 15 Nov 20268 min read
IPv4 Basics MCQs: 10 Solved Network Layer Questions with Explanations

Basic IPv4 MCQs change direction quickly. IPv4 questions test terminology, layer responsibility, bit-field sizes and hexadecimal header arithmetic. Remembering only that IPv4 has 32-bit addresses will not save marks on IHL, total length or data-link visit counts.

Address basics lead into a connected datagram calculation. Choose an option and write one line of reasoning before revealing each answer. KnowledgeGate's practice bank holds over 30 questions on the Network Layer and IPv4 basics. Use CS Fundamentals for the subject map and Computer Networks MCQs for broader practice.

IPv4 essentials: addresses, layers and header arithmetic

IPv4 path with four network-layer visits, six data-link visits, and header arithmetic.

The data-link layer handles one link at a time. The network layer carries an IP datagram from source to destination through intermediate routers. IPv4 is the IP version with 32-bit addresses.

For S -> R1 -> R2 -> D, the network layer sees the packet at all four devices. The three links are S-R1, R1-R2 and R2-D. Each has two endpoints, so data-link processing occurs 3 x 2 = 6 times.

The partial IPv4 header is:

45 | 00 | 00 54 | 00 03 | 00 00 | 20 | 06

In 0x45, the high nibble is version 4 and the low nibble is IHL 5. IHL counts 32-bit words of 4 bytes, so the header is 5 x 4 = 20 bytes.

The total-length field is 0x0054 = (5 x 16) + 4 = 84 bytes, including header and payload. Payload is 84 - 20 = 64 bytes, and efficiency is (64 / 84) x 100 = 76.190476...%, or 76.19%. As a check, 0x20 = 32 is TTL and 0x06 = 6 identifies TCP.

Use one scratch rule: convert one field at a time and write its unit before checking the options. For the taught version of these network-layer topics, see GATE Guidance by Sanchit Sir.

IPv4 MCQs 1-2: name the protocol and fix the address width

Question 1 (TPSC 2025, Computer Science, Assistant Programmer)

What does the term ‘IP Address’ stand for?

  • A. Internet Protocol Address

  • B. Internet Processor Address

  • C. Internal Protocol Address

  • D. Internet Path Address

Correct answer: A. Internet Protocol Address.

Expand IP before judging the second word. It means Internet Protocol, so an IP address is an Internet Protocol address. Processor, internal and path may sound related to computing or networking, but none expands the standard initialism. That makes A the only definitionally correct choice.

Practise this question on KnowledgeGate.

Question 2 (BPSC 2023, Computer Science, PGT Tier-2)

In a computer network, what is the size of an IP address in IPv4?

  • A. 8 bits

  • B. 32 bits

  • C. 16 bits

  • D. More than one of the above

  • E. None of the above

Correct answer: B. 32 bits.

IPv4 uses exactly 32 bits per address. Dotted-decimal form has four 8-bit octets, so 4 x 8 = 32. The 8-bit and 16-bit values are smaller pieces, not the complete address. Neither catch-all option is needed.

Practise the IPv4 module (question page unavailable).

Network Layer MCQs 3-4: count visits and reject an impossible header

Question 3 (GATE 2013 and BARC 2013, Computer Science)

Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the network layer and the data link layer during a transmission from S to D.

A path with source S, two intermediate routers labelled R, and destination D
  • A. Network layer – 4 times and Data link layer – 4 times

  • B. Network layer – 4 times and Data link layer – 3 times

  • C. Network layer – 4 times and Data link layer – 6 times

  • D. Network layer – 2 times and Data link layer – 6 times

Correct answer: C. Network layer – 4 times and Data link layer – 6 times.

Call the routers R1 and R2. Network-layer processing at S, R1, R2 and D gives 4 visits. Three links, with data-link processing at both endpoints, give 3 x 2 = 6 visits. Counting links instead of endpoints produces the trap answer.

Practise this question on KnowledgeGate.

Question 4 (RSSB 2022, Computer Science, BCI Paper 2)

An IP packet has arrived with the first 8 bits as 00000010 . Which of the following is correct?

  • A. The number of hops this packet can travel is 2

  • B. The total no. of bytes in header is 16 bytes

  • C. The upper layer protocol is ICMP

  • D. The receiver rejects the packet

Correct answer: D. The receiver rejects the packet.

Split the byte into 0000 | 0010. The first nibble says version 0, not IPv4 version 4. IHL says 2 words, or 2 x 4 = 8 bytes, below the valid minimum of 5 words or 20 bytes. The byte is neither TTL nor protocol, so A and C read the wrong field. The packet must be rejected.

Practise the IPv4 module (question page unavailable).

IPv4 header MCQs 5-6: total-length width and maximum datagram size

Question 5 (RPSC 2024, Computer Science, Programmer Paper 1)

The size of ‘total length field’ of IPv4 datagram is –

  • A. 16 bits

  • B. 4 bits

  • C. 8 bits

  • D. 32 bits

Correct answer: A. 16 bits.

The total-length field is 16 bits and counts the complete IPv4 datagram in bytes, including header and payload. Keep nearby widths separate: version and IHL are 4 bits each, TTL and protocol are 8 bits each, and each IPv4 address is 32 bits. For the wider address and prefix foundation, revise IP Addressing and Subnetting Explained.

Practise this question on KnowledgeGate.

Question 6 (Bihar STET 2025, Computer Science)

The maximum length (in bytes) of an IPv4 datagram is:

  • A. 32

  • B. 256

  • C. 1024

  • D. 65535

Correct answer: D. 65535.

The field width explains the limit. An unsigned 16-bit field runs from 0 through 2^16 - 1. Since 2^16 = 65,536, its largest value is 65,535. The maximum IPv4 total length is therefore 65,535 bytes. This protocol limit is not a link's MTU.

Practise this question on KnowledgeGate.

IPv4 header arithmetic: hexadecimal fields and datagram calculations

The partial header supplies the fields for each calculation. The byte boundaries are:

45 | 00 | 00 54 | 00 03 | 00 00 | 20 | 06

Do not add missing bytes or attempt a checksum. The listed fields provide the needed calculation data.

Question 7 (UGC NET 2023, Computer Science)

IP datagram has arrived with following partial information in the header (in hexadecimal)

45000054000300002006……

What is header size?

  • A. 10 Bytes

  • B. 20 Bytes

  • C. 30 Bytes

  • D. 40 Bytes

Correct answer: B. 20 Bytes.

Read 0x45. The high nibble 4 gives the version, and the low nibble 5 gives IHL in 32-bit words. One word is 4 bytes, so the header is 5 x 4 = 20 bytes. The digit 5 means neither 5 bytes nor 5 bits.

Practise this question on KnowledgeGate.

Question 8 (UGC NET 2023, Computer Science)

IP datagram has arrived with following partial information in the header (in hexadecimal)

45000054000300002006……

What is the size of datagram?

  • A. 64 bytes

  • B. 74 bytes

  • C. 84 bytes

  • D. 104 bytes

Correct answer: C. 84 bytes.

Bytes three and four form total length: 00 54, or 0x0054. By place value, (5 x 16) + 4 = 80 + 4 = 84. The datagram is 84 bytes. Total length includes its header, so subtracting 20 would instead calculate the 64-byte payload.

Practise this question on KnowledgeGate.

Question 9 (UGC NET 2023, Computer Science)

IP datagram has arrived with following partial information in the header (in hexadecimal)

45000054000300002006……

What is the efficiency of datagram?

  • A. 76.19%

  • B. 80.50%

  • C. 82.24%

  • D. 85.45%

Correct answer: A. 76.19%.

Use the checked values: total length 84 bytes and header length 20 bytes. Payload is 84 - 20 = 64 bytes. Here, efficiency is payload divided by total size: (64 / 84) x 100 = 76.190476...%, rounded to 76.19%. Dividing by payload or retaining header overhead gives the wrong option.

Practise this question on KnowledgeGate.

IPv4 versus IPv6 MCQ 10: use the defining address-size difference

Question 10 (Beltron Programmer 2025, Computer Science, Shift 2)

What is the main difference between IPv4 and IPv6 addressing?

  • A. IPv6 is slower than IPv4 due to large address size

  • B. IPv6 supports encryption, IPv4 does not

  • C. IPv6 uses 128-bit addresses, while IPv4 uses 32-bit addresses

  • D. IPv4 supports only public addresses, IPv6 supports only private addresses

Correct answer: C. IPv6 uses 128-bit addresses, while IPv4 uses 32-bit addresses.

Address width is the direct comparison: IPv4 uses 32 bits and IPv6 uses 128 bits. Address length alone does not prove A's blanket speed claim. Security is not exclusive to IPv6, so B fails. Both versions have more nuanced scopes than D's public-only and private-only split.

Practise this question on KnowledgeGate.

IPv4 basics: key facts and further practice

Key IPv4 facts for further practice:

  • IPv4 address = 32 bits

  • Version and IHL = 4 bits each

  • IHL unit = 4 bytes

  • Total length = 16 bits and includes header plus payload

  • S -> R1 -> R2 -> D gives 4 network-layer visits and 6 data-link visits

The connected arithmetic chain is 0x45 -> 20-byte header, 0x0054 -> 84-byte datagram, 84 - 20 -> 64-byte payload, and 64 / 84 -> 76.19%.

Maintain a small error log. Label every miss as definition, layer count, field width, hex conversion or unit error. After 24 hours, re-solve only the missed category without looking at the option letters. This tells you whether the error was a forgotten fact or a broken calculation habit.

If masks and subnet arithmetic are the next weak area, continue with Subnetting MCQs: 12 Solved IP Addressing Questions. For a structured revision path across Computer Networks and other core subjects, use Computer Science Fundamentals for Placements by Sanchit Sir.