Engineering, Management, Agriculture and Veterinary MCQs are now live. FPSC, PPSC, EPE, IELTS & GRE coming soon.

Computer Networks: IP Addressing

Electrical Engineering · Computer Networks

27 questions, each with the answer and a worked solution.

Practice interactively and track your score →
Question 1

How many bits make up an IPv4 address?

  1. 32
  2. 48
  3. 64
  4. 128
Show answer & solution

Answer: (A) 32

IPv4 addresses are written as four decimal octets.

Question 2

How many bits make up an IPv6 address?

  1. 32
  2. 48
  3. 64
  4. 128
Show answer & solution

Answer: (D) 128

IPv6 provides a vastly larger address space.

Question 3

How many bits make up a MAC address?

  1. 32
  2. 48
  3. 64
  4. 128
Show answer & solution

Answer: (B) 48

MAC addresses are written as six hexadecimal pairs.

Question 4

What is the default subnet mask of a Class C IPv4 address?

  1. 255.0.0.0
  2. 255.255.0.0
  3. 255.255.255.0
  4. 255.255.255.255
Show answer & solution

Answer: (C) 255.255.255.0

It is written /24 in CIDR notation.

Question 5

What is the range of the first octet for Class A IPv4 addresses?

  1. 1 to 126
  2. 128 to 191
  3. 192 to 223
  4. 224 to 239
Show answer & solution

Answer: (A) 1 to 126

127 is reserved for loopback.

Question 6

What is the range of the first octet for Class B IPv4 addresses?

  1. 1 to 126
  2. 128 to 191
  3. 192 to 223
  4. 240 to 255
Show answer & solution

Answer: (B) 128 to 191

The default mask is 255.255.0.0.

Question 7

How many usable host addresses are there in a /24 subnet?

  1. 252
  2. 254
  3. 255
  4. 256
Show answer & solution

Answer: (B) 254

Network and broadcast addresses are excluded.

Question 8

How many usable host addresses are there in a /26 subnet?

  1. 30
  2. 62
  3. 64
  4. 126
Show answer & solution

Answer: (B) 62

2⁶ − 2 = 62.

Question 9

Which of these is a private IPv4 address range?

  1. 1.1.1.0 to 1.1.1.255
  2. 8.8.8.0 to 8.8.8.255
  3. 192.168.0.0 to 192.168.255.255
  4. 200.0.0.0 to 200.255.255.255
Show answer & solution

Answer: (C) 192.168.0.0 to 192.168.255.255

Other private ranges are 10.0.0.0/8 and 172.16.0.0/12.

Question 10

What is the loopback address used to test the local TCP/IP stack?

  1. 0.0.0.0
  2. 127.0.0.1
  3. 192.168.1.1
  4. 255.255.255.255
Show answer & solution

Answer: (B) 127.0.0.1

Pinging it checks the computer's own network software.

Question 11

Which protocol automatically assigns Internet Protocol addresses to devices within a network?

  1. FTP
  2. SMTP
  3. ARP
  4. DHCP
Show answer & solution

Answer: (D) DHCP

It also supplies the subnet mask, gateway and DNS server.

Question 12

Which protocol translates domain names such as www.example.com into IP addresses?

  1. FTP
  2. ARP
  3. DNS
  4. DHCP
Show answer & solution

Answer: (C) DNS

DNS uses port 53.

Question 13

Which protocol finds the MAC address corresponding to a known IP address on a local network?

  1. DHCP
  2. DNS
  3. ICMP
  4. ARP
Show answer & solution

Answer: (D) ARP

ARP requests are broadcast on the LAN.

Question 14

What does NAT do?

  1. Translates private IP addresses to public addresses for Internet access
  2. Assigns MAC addresses
  3. Encrypts traffic
  4. Resolves domain names
Show answer & solution

Answer: (A) Translates private IP addresses to public addresses for Internet access

NAT lets many devices share one public IP.

Question 15

What is the purpose of a subnet mask?

  1. To encrypt the address
  2. To route email
  3. To assign MAC addresses
  4. To identify which part of an IP address is the network and which is the host
Show answer & solution

Answer: (D) To identify which part of an IP address is the network and which is the host

Bits set to 1 mark the network portion.

Question 16

What is the default gateway of a host?

  1. The router address used to send traffic to other networks
  2. The switch
  3. The DNS server
  4. The MAC address
Show answer & solution

Answer: (A) The router address used to send traffic to other networks

Without it, a host can reach only its local subnet.

Question 17

What is the broadcast address of the network 192.168.1.0/24?

  1. 192.168.1.0
  2. 192.168.1.1
  3. 192.168.1.255
  4. 255.255.255.0
Show answer & solution

Answer: (C) 192.168.1.255

Packets sent here reach all hosts on the subnet.

Question 18

How is an IPv6 address written?

  1. Six hexadecimal pairs
  2. Four decimal numbers separated by dots
  3. Sixteen binary groups
  4. Eight groups of four hexadecimal digits separated by colons
Show answer & solution

Answer: (D) Eight groups of four hexadecimal digits separated by colons

Leading zeros and zero groups can be shortened.

Question 19

What does CIDR notation /20 indicate?

  1. The first 20 bits of the address form the network prefix
  2. The mask is 255.255.255.20
  3. There are 20 networks
  4. There are 20 hosts
Show answer & solution

Answer: (A) The first 20 bits of the address form the network prefix

CIDR replaces fixed class boundaries.

Question 20

What address does a Windows computer assign itself when no DHCP server is available?

  1. 192.168.0.1 always
  2. 127.0.0.1
  3. An APIPA address in the 169.254.x.x range
  4. 0.0.0.0
Show answer & solution

Answer: (C) An APIPA address in the 169.254.x.x range

APIPA allows only local communication.

Question 21

How many usable host addresses are there in a /30 subnet?

  1. 0
  2. 2
  3. 4
  4. 6
Show answer & solution

Answer: (B) 2

/30 subnets are used for point-to-point router links.

Question 22

What is the subnet mask for /16?

  1. 255.0.0.0
  2. 255.255.0.0
  3. 255.255.240.0
  4. 255.255.255.0
Show answer & solution

Answer: (B) 255.255.0.0

Sixteen bits set to 1.

Question 23

What is a public IP address?

  1. A MAC address
  2. A loopback address
  3. An address used only inside homes
  4. An address that is unique and routable on the Internet
Show answer & solution

Answer: (D) An address that is unique and routable on the Internet

ISPs assign public addresses.

Question 24

How many usable host addresses are there in a /28 subnet?

  1. 12
  2. 14
  3. 16
  4. 30
Show answer & solution

Answer: (B) 14

2⁴ − 2 = 14.

Question 25

What is the network address of host 192.168.10.70 with mask 255.255.255.192?

  1. 192.168.10.0
  2. 192.168.10.128
  3. 192.168.10.64
  4. 192.168.10.70
Show answer & solution

Answer: (C) 192.168.10.64

The /26 blocks start at 0, 64, 128 and 192.

Question 26

What is the main reason IPv6 was developed?

  1. To replace Ethernet
  2. To remove routing
  3. To slow down networks
  4. The exhaustion of available IPv4 addresses
Show answer & solution

Answer: (D) The exhaustion of available IPv4 addresses

IPv6 also simplifies headers and auto-configuration.

Question 27

What is a static IP address?

  1. An IP address manually configured that does not change
  2. A loopback address
  3. An address assigned randomly every minute
  4. A MAC address
Show answer & solution

Answer: (A) An IP address manually configured that does not change

Servers and printers often use static addresses.

Practice these 27 questions interactively →