Computer Networks: practice problems and exam questions

IP addressing and subnetting, binary and hexadecimal numbers, and the protocols and layers of computer networks.

Cram pack (PDF)Formula sheets, method steps and practice problems with full solutions, ready to print.

Topics in this course

  1. IPv4 subnettinghosts per subnet · dividing a network · address rangescalculations
  2. Computer networkskey terms and facts · applying the concepts · cases and analysismultiple choice
  3. Number systemsbinary and hex to decimal · two's complement · bits, ranges and memorycalculations

Exam tips for Computer Networks

  • Write the subnet mask in binary when you are unsure; the network part is the run of ones.
  • The first and last address of a subnet are the network and broadcast addresses, not usable hosts.
  • Know which layer each protocol belongs to: exam questions love TCP versus UDP.

Worked examples

IPv4 subnettingEasy
/2611111111111111111111111111000000network bitshost bits

How many usable host addresses H are there in an IPv4 subnet with prefix /26?

/26

Find H

Show hints
  1. The host part has 32 − p bits.
  2. Subtract 2 for the network and broadcast addresses.
  3. 32 − 26 = 6.
Show the answer and the step-by-step solution

IPv4 subnetting: an address has 32 bits. The prefix /p says how many leading bits identify the network; the remaining 32 − p bits number the hosts. A subnet has 2³²⁻ᵖ addresses, but the first (network address) and last (broadcast address) cannot be given to hosts, so 2³²⁻ᵖ − 2 hosts fit. Exceptions: a /31 (point-to-point link, RFC 3021) uses both of its 2 addresses for hosts, and a /32 is one single address (a single host or a loopback).

Host bits

32 − 26 = 6

Usable hosts

26 − 2 = 64 − 2 = 62

Answer

H = 62
Computer networksMedium

What is the IPv6 loopback address?

  1. A::
  2. B::1
  3. Cfe80::1
  4. Dff02::1
Show hints
  1. The shortened form of an address that is all zeros except the last bit.
  2. Two wrong answers are now crossed out. One of the remaining two is right.
Show the answer and explanation

Why this is the answer

::1 is the loopback address. :: is the unspecified address, fe80::/10 is link-local and ff02::1 is the all-nodes multicast group.

Answer

B · ::1

How practising works

  • “Practise this course” mixes problems from all its topics, like a real exam.
  • Every problem has new values, so you learn the method instead of an answer.
  • Stuck? Open a small hint first, and the full explanation only when you need it.
  • Mock exams are timed and have no hints, and you get your score and a full review at the end.

Calculators for this course

Related courses