IP addressing, subnetting, DNS, ports and network components: WACE Computer Science Unit 3
“Explain IPv4 and IPv6 addressing, private and public addresses, subnet masks and subnetting, and the role of gateways, DNS, ports and network components; measure and troubleshoot network performance with tools such as ping and traceroute; interpret and draw network diagrams”
IPv4 uses 32-bit addresses (private ranges translated by NAT); IPv6 uses 128 bits. Subnet masks split network and host bits: usable hosts are and subnets start at multiples of the block size. Gateways route traffic out of a subnet, DNS resolves names, ports identify services, and ping and traceroute help locate performance problems.
Jump to a section
What this dot point is asking
This is the most calculation-heavy part of network communications. You need to work with IP addresses and subnets, explain gateways, DNS and ports, know what network components do, measure performance, troubleshoot with ping and traceroute, and read or draw network diagrams.
The answer
IPv4 and IPv6
- IPv4: 32 bits written as four octets (192.168.1.10). About 4.3 billion addresses, now exhausted.
- IPv6: 128 bits written in hexadecimal groups (2001:db8::1). Vast address space; no need for NAT.
- Private addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are used inside networks and translated to a public address by NAT on the router.
Subnet masks and subnetting
The subnet mask (or CIDR prefix such as /24) separates the network part from the host part.
- Borrow bits for subnets: subnets from borrowed bits.
- Block size = where is the number of host bits.
- Usable hosts per subnet = (network and broadcast addresses are reserved).
- Network address = first address in the block; broadcast = last.
| Prefix | Mask (last octet) | Addresses | Usable hosts |
|---|---|---|---|
| /24 | .0 | 256 | 254 |
| /25 | .128 | 128 | 126 |
| /26 | .192 | 64 | 62 |
| /27 | .224 | 32 | 30 |
| /28 | .240 | 16 | 14 |
Gateways, DNS and ports
- Default gateway: the router that forwards traffic leaving the subnet.
- DNS: resolves names to IP addresses (a local resolver asks root, top-level domain and authoritative servers).
- Ports identify services on a host: 80 HTTP, 443 HTTPS, 53 DNS, 25 SMTP, 22 SSH.
Components and performance
Routers (between networks), switches (within a network, using MAC addresses), wireless access points, modems, firewalls and servers. Performance measures: bandwidth (capacity), throughput (actual rate), latency (delay), jitter and packet loss.
Ping, traceroute and diagrams
- Ping tests reachability and round-trip time using ICMP.
- Traceroute lists each hop to a destination and its delay.
- Network diagrams show devices, connections, IP ranges and subnets using standard symbols.
A host is 10.4.9.200/20. Find its network address.
- /20 means 20 network bits: the first two octets and the top 4 bits of the third octet.
- Third octet block size = . Multiples of 16: 0, 16, ... 0 contains 9 (0 to 15).
- Network address: 10.4.0.0; broadcast: 10.4.15.255; usable hosts: .
Forgetting to subtract 2 for usable hosts.
Treating DNS as routing. DNS finds the address; routers deliver the packets.
Confusing bandwidth with latency. A high-bandwidth link can still have high delay.
Practice questions
Original practice questions graded from foundation to exam level, each with a full worked solution. Try them before revealing the solution.
foundation3 marksFor the host 192.168.10.77/24, give the network address, broadcast address and number of usable hosts.Show worked solution →
A /24 mask is 255.255.255.0, so the first three octets are the network part.
- Network address: 192.168.10.0
- Broadcast address: 192.168.10.255
- Usable hosts: (192.168.10.1 to 192.168.10.254)
Marking guide: 1 mark each.
core5 marksA business has the network 192.168.20.0/24 and needs 4 equal subnets. Give the new prefix, subnet mask, and the network address, usable range and broadcast address of the first two subnets.Show worked solution →
4 subnets need 2 extra network bits: /26, mask 255.255.255.192. Each subnet has addresses and 62 usable hosts.
| Subnet | Network | Usable range | Broadcast |
|---|---|---|---|
| 1 | 192.168.20.0 | .1 to .62 | 192.168.20.63 |
| 2 | 192.168.20.64 | .65 to .126 | 192.168.20.127 |
(Subnets 3 and 4 start at .128 and .192.)
Marking guide: 1 mark for /26, 1 mark for the mask, 1 mark for block size, 2 marks for the two subnets.
exam6 marksStaff report that a cloud-based sales system is slow. Explain how you would use ping and traceroute to investigate, and what different results would suggest.Show worked solution →
Ping the default gateway first. If it fails or has high latency, the problem is inside the local network (faulty switch, Wi-Fi congestion, cabling).
Ping a public server (or the cloud service). High latency or packet loss here but not to the gateway suggests a problem between the business and the internet (ISP link congestion).
Ping by name and by IP address. If the IP address works but the name does not resolve, the problem is DNS.
Traceroute to the cloud service shows each hop and its delay. A sudden jump in delay at one hop points to congestion at that router or link; timeouts partway may show a failing or filtering router.
Conclusion: comparing results isolates whether the issue is local, the ISP link, DNS, or the provider, so the right people can fix it.
Marking guide: 1 mark each for gateway ping, external ping, DNS test, traceroute use, interpreting hop delays, and a conclusion.
core5 marksA printer in an office has the address 172.20.45.130/27. (a) Give the subnet mask in dotted decimal. (b) Give the network address and broadcast address of its subnet. (c) Give the range of usable host addresses and the number of usable hosts. (d) State whether the address is private or public, and justify your answer.Show worked solution →
(a) /27 means 27 network bits, so the last octet has 3 network bits (128 + 64 + 32 = 224). Mask: 255.255.255.224.
(b) There are host bits, so the block size is . Blocks in the last octet start at 0, 32, 64, 96, 128, 160 ... and 130 falls in the block 128 to 159.
- Network address: 172.20.45.128
- Broadcast address: 172.20.45.159
(c) Usable range: 172.20.45.129 to 172.20.45.158, which is usable hosts.
(d) Private. The private range 172.16.0.0/12 covers 172.16.0.0 to 172.31.255.255, and 172.20.45.130 lies inside it. The printer cannot be reached directly from the internet; the router uses NAT to translate private addresses to a public address.
Marking guide: 1 mark for the mask; 1 mark for the network and broadcast addresses; 1 mark for the usable range; 1 mark for 30 hosts; 1 mark for private with the range as justification.
exam5 marksExplain why IPv6 was introduced to replace IPv4. In your answer, compare the size of the two address spaces, explain how private IPv4 addresses and NAT have allowed IPv4 to keep working, and explain why NAT is not needed with IPv6.Show worked solution →
- Address space
- An IPv4 address is 32 bits, giving (about 4.3 billion) addresses. An IPv6 address is 128 bits, giving addresses, which is times as many as IPv4. With billions of phones, computers and connected devices, the IPv4 supply of public addresses has run out.
- Private addresses and NAT
- Organisations and homes use private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) inside their networks. These addresses are reused in many networks and are not routed on the internet. The router performs network address translation (NAT), replacing the private source address with its own public address (and keeping track of connections), so many devices share one public address. This has stretched the IPv4 supply.
- IPv6
- Because the IPv6 address space is so vast, every device can be given its own globally unique public address, so translation between private and public addresses is no longer necessary.
Marking guide: 1 mark for 32 versus 128 bits; 1 mark for linking IPv4 exhaustion to device growth; 1 mark for private ranges being reused inside networks; 1 mark for how NAT lets many devices share a public address; 1 mark for why IPv6 removes the need for NAT.
exam14 marksA primary school has been given the private network 192.168.40.0/24. It wants separate subnets of equal size for administration, the computer lab and the library, and each subnet must support up to 55 devices. One spare subnet may be kept for future use. (a) Determine a suitable prefix and subnet mask, justifying your choice. (3 marks) (b) For each subnet, give the network address, usable host range and broadcast address. (4 marks) (c) A lab computer is configured with 192.168.40.100/26 and default gateway 192.168.40.1. It can reach other lab computers but not the internet. Explain the cause and how to fix it. (2 marks) (d) Describe the role of a switch, a router and a wireless access point in the school network. (3 marks) (e) State four details a network diagram of the school network should show. (2 marks)Show worked solution →
(a) Each subnet needs at least 55 usable hosts plus the network and broadcast addresses. Host bits must satisfy : gives only 30, gives 62. So 6 host bits and network bits: /26, mask 255.255.255.192. Borrowing 2 bits from the /24 gives subnets, enough for three subnets plus one spare.
(b) Block size is .
| Subnet | Network | Usable range | Broadcast |
|---|---|---|---|
| Administration | 192.168.40.0 | .1 to .62 | 192.168.40.63 |
| Computer lab | 192.168.40.64 | .65 to .126 | 192.168.40.127 |
| Library | 192.168.40.128 | .129 to .190 | 192.168.40.191 |
| Spare | 192.168.40.192 | .193 to .254 | 192.168.40.255 |
(c) 192.168.40.100/26 is in the subnet 192.168.40.64 to 192.168.40.127, but the gateway 192.168.40.1 is in a different subnet (192.168.40.0/26). Local traffic works because it stays within the subnet, but traffic for the internet is sent to a gateway the computer cannot reach directly. Fix: set the default gateway to the router interface on the lab subnet, for example 192.168.40.65.
(d)
- Switch: connects wired devices within a subnet and forwards frames to the correct port using MAC addresses.
- Router: connects the subnets to each other and to the internet, forwarding packets using IP addresses; it acts as each subnet's default gateway.
- Wireless access point: lets laptops and tablets join the network over Wi-Fi, bridging them onto the wired network.
(e) Any four of: each device (router, switches, access points, servers, printers) using standard symbols; the connections between them; the subnet each area belongs to with its network address and prefix; the router interface or gateway address for each subnet; the internet connection or modem; key static IP addresses.
Marking guide: (a) 1 mark for testing host bits, 1 mark for /26, 1 mark for the mask with the subnet count; (b) 1 mark per correct subnet row; (c) 1 mark for identifying the gateway is in another subnet, 1 mark for a valid fix; (d) 1 mark per component; (e) 1 mark for any two details, 2 marks for four. Total 14.
exam18 marksAn accounting firm's office uses the network 192.168.1.0/24. Staff say the cloud accounting system (server address 203.0.113.25) is very slow. The technician gathers this data. Ping 192.168.1.1 (default gateway): average 2 ms, 0% loss. Ping 203.0.113.25: average 180 ms, 12% loss. Traceroute to 203.0.113.25: hop 1 192.168.1.1 2 ms; hop 2 (ISP router) 9 ms; hop 3 (ISP router) 14 ms; hop 4 (provider link) 158 ms; hop 5 172 ms; hop 6 203.0.113.25 180 ms. (a) Distinguish between bandwidth, throughput and latency. (3 marks) (b) Interpret the two ping results. (3 marks) (c) Use the traceroute to identify where the problem is most likely to be, and justify. (3 marks) (d) Staff also find they can reach the system by typing its IP address but not by typing its domain name. Explain what this suggests. (3 marks) (e) The server accepts HTTPS and SSH connections. Explain the role of port numbers and state the well-known port for each service. (3 marks) (f) The firm wants its guest Wi-Fi on a separate subnet by splitting 192.168.1.0/24 into two equal subnets. Give the prefix and the network and broadcast address of each subnet. (3 marks)Show worked solution →
(a) Bandwidth is the maximum capacity of a link (for example 100 Mbps). Throughput is the actual rate of data successfully transferred, which is usually lower because of congestion and errors. Latency is the delay for data to travel from source to destination, measured in milliseconds. A link can have high bandwidth and still high latency.
(b) The gateway ping (2 ms, no loss) shows the office network, cabling and the router's local interface are working well, so the fault is not inside the office. The server ping (180 ms, 12% loss) shows high delay and significant packet loss somewhere between the office and the cloud server.
(c) Delay grows slowly for hops 1 to 3 (2, 9, 14 ms), then jumps sharply to 158 ms at hop 4 and stays high after it. The problem is most likely congestion or a fault at the hop 4 router or the link between hop 3 and hop 4 (the provider link). The office network and the first ISP routers are not the cause, so the firm should report the evidence to its ISP or cloud provider.
(d) Reaching the server by IP address shows routing works. Failing by name suggests a DNS problem: the name is not being resolved to an IP address, for example because the configured DNS server is unreachable or wrong, or the record is incorrect. DNS finds addresses; it does not deliver the packets, so the two tests separate the issues.
(e) An IP address identifies the host; a port number identifies which service or application on that host should receive the data, so one server can run several services at once. HTTPS uses port 443 and SSH uses port 22.
(f) Two subnets need 1 borrowed bit: /25 (mask 255.255.255.128), 126 usable hosts each.
- Subnet 1: network 192.168.1.0, broadcast 192.168.1.127
- Subnet 2: network 192.168.1.128, broadcast 192.168.1.255
Marking guide: (a) 1 mark each for bandwidth, throughput and latency; (b) 1 mark for the gateway result meaning the local network is fine, 1 mark for identifying high latency and loss, 1 mark for locating it beyond the office; (c) 1 mark for identifying hop 4, 1 mark for the jump in delay as evidence, 1 mark for a sensible conclusion or action; (d) 1 mark for routing working, 1 mark for identifying DNS, 1 mark for a possible cause; (e) 1 mark for the role of ports, 1 mark each for 443 and 22; (f) 1 mark for /25, 1 mark per subnet. Total 18.