HomeSubjectsUniversityBlogAbout
210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

The network layer moves packets from source host to destination host across multiple networks, handling logical IP addressing, routing and forwarding. Typical questions ask about 32-bit IPv4 and 128-bit IPv6 addresses, address classes and private ranges, subnet masks, CIDR notation and calculating usable hosts in a subnet. Routing items contrast static and dynamic routes, distance-vector protocols like RIP with link-state protocols like OSPF, and the role of BGP between autonomous systems. Also be ready for IP fragmentation and the TTL field, broadcast versus multicast addresses, NAT, ICMP, and how a router chooses the next hop using longest-prefix matching.

Below are 30 practice questions from a pool of 210 Network Layer MCQs, one of 10 topics in Computer Networks & Cloud Computing. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Network LayerEasy

Q1. Which protocol is used to send error messages at the network layer?

  1. A.UDP
  2. B.TCP
  3. C.ARP
  4. D.ICMP✓ Correct

Explanation

ICMP (Internet Control Message Protocol) is used to send error messages and operational information, such as destination unreachable or time exceeded.

Report an error in this question

Network LayerEasy

Q2. What does the TTL field in an IP header stand for?

  1. A.Transfer Type Label
  2. B.Transmission Time Limit
  3. C.Total Transfer Length
  4. D.Time to Live✓ Correct

Explanation

TTL (Time to Live) limits the lifespan of a packet. Each router decrements it by 1, and when it reaches 0, the packet is discarded to prevent infinite loops.

Report an error in this question

Network LayerEasy

Q3. What is the size of an IPv4 address?

  1. A.64 bits
  2. B.128 bits
  3. C.16 bits
  4. D.32 bits✓ Correct

Explanation

An IPv4 address is 32 bits (4 bytes) long, typically written in dotted decimal notation (e.g., 192.168.1.1).

Report an error in this question

Network LayerEasy

Q4. What is the main function of a router?

  1. A.Storing web pages on servers
  2. B.Forwarding packets between networks✓ Correct
  3. C.Providing wireless network access
  4. D.Connecting devices within a LAN

Explanation

A router's main function is to forward packets from one network to another by examining the destination IP address and consulting its routing table.

Report an error in this question

Network LayerEasy

Q5. Which class of IPv4 addresses is used for multicasting?

  1. A.Class B
  2. B.Class D✓ Correct
  3. C.Class C
  4. D.Class A

Explanation

Class D addresses (224.0.0.0 to 239.255.255.255) are reserved for multicast groups.

Report an error in this question

Network LayerEasy

Q6. What tool uses ICMP echo requests to test connectivity?

  1. A.traceroute
  2. B.nslookup
  3. C.ping✓ Correct
  4. D.netstat

Explanation

The ping command uses ICMP echo request and echo reply messages to test whether a remote host is reachable.

Report an error in this question

Network LayerEasy

Q7. What is the default subnet mask for a Class C IPv4 address?

  1. A.255.255.0.0
  2. B.255.255.255.255
  3. C.255.0.0.0
  4. D.255.255.255.0✓ Correct

Explanation

Class C addresses have a default subnet mask of 255.255.255.0, meaning the first 24 bits identify the network and the last 8 bits identify the host.

Report an error in this question

Network LayerEasy

Q8. Which IP address range is reserved for loopback testing?

  1. A.169.254.0.0/16
  2. B.127.0.0.0/8✓ Correct
  3. C.10.0.0.0/8
  4. D.192.168.0.0/16

Explanation

The address range 127.0.0.0/8 is reserved for loopback. The most commonly used loopback address is 127.0.0.1.

Report an error in this question

Network LayerEasy

Q9. What is the purpose of NAT (Network Address Translation)?

  1. A.To translate private IPs to public IPs✓ Correct
  2. B.To compress packets for transfer
  3. C.To assign domain names to hosts
  4. D.To encrypt data during transit

Explanation

NAT translates private (internal) IP addresses to public (external) IP addresses, allowing multiple devices to share a single public IP address.

Report an error in this question

Network LayerMedium

Q10. In CIDR notation, what does /28 mean?

  1. A.28 hosts are available on subnet
  2. B.28 bits are for network addressing✓ Correct
  3. C.28 bits are for host addressing
  4. D.28 subnets exist in the network

Explanation

In CIDR notation, /28 means the first 28 bits of the address are used for the network portion, leaving 4 bits for host addresses (14 usable hosts).

Report an error in this question

Network LayerMedium

Q11. What is the maximum hop count in RIP?

  1. A.255
  2. B.16
  3. C.15✓ Correct
  4. D.8

Explanation

RIP uses a maximum hop count of 15. A hop count of 16 means the destination is unreachable, limiting RIP to small networks.

Report an error in this question

Network LayerEasy

Q12. Which of the following is a private IPv4 address?

  1. A.11.0.0.1
  2. B.172.32.0.1
  3. C.8.8.8.8
  4. D.192.168.1.1✓ Correct

Explanation

192.168.1.1 is a private IP address. Private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.

Report an error in this question

Network LayerMedium

Q13. Which routing protocol uses the Bellman-Ford algorithm?

  1. A.RIP✓ Correct
  2. B.OSPF
  3. C.BGP
  4. D.IS-IS

Explanation

RIP (Routing Information Protocol) uses the Bellman-Ford (distance vector) algorithm to determine the best path based on hop count.

Report an error in this question

Network LayerMedium

Q14. OSPF is classified as which type of routing protocol?

  1. A.Path vector
  2. B.Link-state✓ Correct
  3. C.Distance vector
  4. D.Hybrid

Explanation

OSPF (Open Shortest Path First) is a link-state routing protocol that uses Dijkstra's algorithm to compute the shortest path.

Report an error in this question

Network LayerMedium

Q15. How many usable host addresses are available in a /26 subnet?

  1. A.64
  2. B.30
  3. C.62✓ Correct
  4. D.126

Explanation

A /26 subnet has 6 host bits: 2^6 = 64 total addresses. Subtracting the network address and broadcast address gives 62 usable host addresses.

Report an error in this question

Network LayerHard

Q16. In OSPF, what is an Area Border Router (ABR)?

  1. A.A router that runs the BGP protocol
  2. B.A router operating within a single OSPF area
  3. C.A router connecting two or more OSPF areas✓ Correct
  4. D.A router connecting to external networks only

Explanation

An ABR connects two or more OSPF areas, including the backbone area (Area 0). It maintains separate link-state databases for each area.

Report an error in this question

Network LayerHard

Q17. What technique does split horizon use to solve the count-to-infinity problem?

  1. A.Not advertising routes back through learned interfaces✓ Correct
  2. B.Using TTL values to limit the route propagation
  3. C.Sending updates to directly connected routers only
  4. D.Encrypting all routing update messages sent

Explanation

Split horizon prevents a router from advertising a route back through the interface from which the route was originally learned, helping to prevent routing loops.

Report an error in this question

Network LayerMedium

Q18. What is the count-to-infinity problem associated with?

  1. A.Link-state protocols
  2. B.Distance vector protocols✓ Correct
  3. C.Static routing tables
  4. D.Path vector protocols

Explanation

The count-to-infinity problem occurs in distance vector routing protocols where routers slowly increment the distance to an unreachable network, causing slow convergence.

Report an error in this question

Network LayerMedium

Q19. What is the size of an IPv6 address?

  1. A.64 bits
  2. B.32 bits
  3. C.128 bits✓ Correct
  4. D.96 bits

Explanation

An IPv6 address is 128 bits (16 bytes) long, written as eight groups of four hexadecimal digits separated by colons.

Report an error in this question

Network LayerMedium

Q20. Which field in the IPv4 header is used for fragmentation reassembly?

  1. A.Header checksum field
  2. B.Identification field✓ Correct
  3. C.Protocol field
  4. D.TTL field

Explanation

The Identification field, along with Flags and Fragment Offset, is used to identify fragments belonging to the same original datagram for reassembly.

Report an error in this question

Network LayerMedium

Q21. What does DHCP provide?

  1. A.Automatic IP address assignment✓ Correct
  2. B.Email delivery management
  3. C.Routing information exchange
  4. D.Domain name resolution services

Explanation

DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses, subnet masks, default gateways, and other network configuration to devices.

Report an error in this question

Network LayerMedium

Q22. Which protocol is used between autonomous systems on the Internet?

  1. A.RIP
  2. B.EIGRP
  3. C.BGP✓ Correct
  4. D.OSPF

Explanation

BGP (Border Gateway Protocol) is the standard exterior gateway protocol used to exchange routing information between autonomous systems on the Internet.

Report an error in this question

Network LayerHard

Q23. In IPv6, what replaces broadcast?

  1. A.No replacement exists
  2. B.Multicast and anycast✓ Correct
  3. C.Unicast addressing
  4. D.Simplex mode

Explanation

IPv6 eliminates broadcast addressing. Its functionality is replaced by multicast (to multiple specific hosts) and anycast (to the nearest host in a group).

Report an error in this question

Network LayerHard

Q24. Given the IP address 172.16.45.14/21, what is the network address?

  1. A.172.16.32.0
  2. B.172.16.40.0✓ Correct
  3. C.172.16.45.0
  4. D.172.16.44.0

Explanation

With /21, the mask is 255.255.248.0. The third octet 45 in binary is 00101101. ANDing with 11111000 gives 00101000 = 40. So the network is 172.16.40.0.

Report an error in this question

Network LayerHard

Q25. What is the purpose of the OSPF Designated Router (DR)?

  1. A.To connect to external autonomous systems
  2. B.To serve as the default gateway for hosts
  3. C.To handle DHCP requests from all clients
  4. D.To reduce adjacencies on multi-access networks✓ Correct

Explanation

The DR reduces adjacencies on multi-access networks. Instead of every router forming adjacencies with every other router, all routers form adjacencies only with the DR and BDR.

Report an error in this question

Network LayerHard

Q26. What is route aggregation (supernetting) and why is it important?

  1. A.Combining network prefixes to reduce routing tables✓ Correct
  2. B.Assigning multiple IP addresses to a single host
  3. C.Creating backup routes for network redundancy
  4. D.Splitting a network into smaller subnets for isolation

Explanation

Route aggregation (supernetting) combines contiguous network prefixes into a single summary route, reducing the size of routing tables and improving router efficiency.

Report an error in this question

Network LayerHard

Q27. What is the function of the Protocol field in the IPv4 header?

  1. A.To indicate the total length of the packet
  2. B.To identify the upper-layer protocol used✓ Correct
  3. C.To store the header checksum for errors
  4. D.To specify the version of IP being used

Explanation

The Protocol field identifies the upper-layer protocol encapsulated in the IP datagram. TCP is 6, UDP is 17, ICMP is 1, and OSPF is 89.

Report an error in this question

Network LayerHard

Q28. A company needs to create 6 subnets from a /24 network. What is the most efficient subnet mask to use?

  1. A./29
  2. B./26
  3. C./28
  4. D./27✓ Correct

Explanation

To create 6 subnets, we need at least 3 borrowed bits (2^3 = 8 subnets >= 6). Starting from /24, borrowing 3 bits gives /27 with 30 usable hosts per subnet.

Report an error in this question

Network LayerHard

Q29. In BGP, what is the AS_PATH attribute used for?

  1. A.Listing traversed ASes to prevent loops✓ Correct
  2. B.Measuring the link bandwidth capacity
  3. C.Encrypting routing updates over links
  4. D.Assigning IP addresses to BGP peers

Explanation

AS_PATH lists all autonomous systems a route advertisement has traversed. It is used for loop prevention (a router rejects routes containing its own AS number) and path selection.

Report an error in this question

Network LayerHard

Q30. What is the main advantage of VLSM (Variable Length Subnet Masking)?

  1. A.It enables faster packet routing overall
  2. B.It simplifies network configuration greatly
  3. C.It provides better security for subnets
  4. D.It allows subnets of different sizes for efficiency✓ Correct

Explanation

VLSM allows different subnets to have different sizes (subnet masks), enabling more efficient use of IP address space by matching subnet size to actual needs.

Report an error in this question

Ready to test yourself on Network Layer?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Network Layer Quiz