Chapter 1 · Computer Networks
1.8IP Addressing and Subnetting
How every device gets an address, how IPv4 and IPv6 addresses look, how a network is split into subnets, and what NAT does.
Written and checked by Muhammad Raheel(opens in a new tab)
Full Stack Developer · AI Engineer · Reviewed 21 Oct 2026 · 3 min read
On this page
A letter needs an address to reach the right house. Data on a network is the same. Every device needs its own address, and data uses that address to reach the right place.
Without an IP address, a device cannot talk to anything on the network. So every network device must have one.
IPv4 and IPv6
There are two versions of IP addresses in use. IPv4 is the older one. IPv6 is the newer one.
IPv4
The book's example is 192.168.1.10. It has four numbers with dots between them. Each number is one byte, which is 8 bits, so it can go from 0 to 255. Four bytes make 32 bits in total.
The book splits the address into two parts:
| Part | Value | What it means |
|---|---|---|
| Network part | 192.168.1 | your local network, like a street |
| Host part | 10 | your own device on that network, like a house number |
The book's DO YOU KNOW? box says IPv4 can make about 4.29 billion addresses. That sounds like a lot, but the world now has more devices than that. This is why IPv4 is called "limited".
IPv6
The book's IPv6 example is 2001:0db8:85a3:0000:0000:8a2e:0370:7334. It has 8 groups with colons between them. Each group has 4 hexadecimal digits (0 to 9 and a to f) and holds 16 bits. 8 groups of 16 bits make 128 bits.
| Part | Value | What it means |
|---|---|---|
| Global routing prefix | 2001:0db8:85a3 | the internet company and region |
| Subnet ID | 0000 | your local network inside that company |
| Interface ID | 0000:8a2e:0370:7334 | your own device, such as your laptop |
The second DO YOU KNOW? box says IPv6 has about 3.4×10^38 addresses. The book says it will never run out. Strictly, it is a fixed number, but it is so big that running out is not expected.
Subnetting
A big network can get crowded. Subnetting cuts it into smaller pieces.
The book gives four reasons to do it. It reduces network traffic. It improves performance. It increases security. It helps large networks with management.
In Figure 1.15, the network 192.168.1.0/24 is split into two subnets. Subnet 1 is 192.168.1.0/25 and holds a computer, a network device and a laptop. Subnet 2 is 192.168.1.128/25 and holds a mobile phone and a printer.
Network Address Translation (NAT)
Your home may have many devices but only one connection to the internet. NAT makes that work.
The router does this job. Inside the house, each device has a private address. The outside world only sees the one public address. Because the private addresses stay hidden, the book says NAT also improves network security. NAT is commonly used in networks.
Practice this topic
Short questions
1.What is an IP address?2 marks
Answer
From the book: "An IP address is a unique number assigned to a device. IP stands for Internet Protocol. It helps identify devices on a network. Data uses IP addresses to find its destination." The book's Summary (p.17): "An IP address is a unique address assigned to a device so it can be identified on a network."
2.Write two differences between IPv4 and IPv6.3 marks
Answer
From the book: "IPv4 is an older version of IP addressing. It uses 32-bit numeric addresses. IPv4 has a limited number of addresses. IPv6 is the newer version with 128-bit addresses. IPv6 provides more address space." IPv4 has "4 numbers, each 0-255, separated by dots", while IPv6 has "8 groups of 4 hexadecimal digits, separated by colons".
3.Write the breakdown of the IPv4 address 192.168.1.10.3 marks
Answer
From the book's "Breakdown of IPv4" table: the Network part is 192.168.1, which "Identifies your local network, like "Gulshan Block Street 3"". The Host part is 10, which "Identifies your specific device on that network, like "House #10"". "Each number = 1 Byte = 8 bits", "Total = 32 bits".
4.Name the three parts of the IPv6 address 2001:0db8:85a3:0000:0000:8a2e:0370:7334 given in the book.3 marks
Answer
From the book's "Breakdown of IPv6" table: Global routing prefix 2001:0db8:85a3 ("ISP/region, like "Pakistan, Sindh, Karachi""); Subnet ID 0000 ("Your local network inside the ISP, like "Gulshan area""); Interface ID 0000:8a2e:0370:7334 ("Your specific device, like "Your laptop"").
5.What is subnetting? Write its benefits.3 marks
Answer
From the book: "Subnetting divides a network into smaller parts. Each part is called a subnet (as shown in Figure 1.15). It reduces network traffic. Subnetting improves performance. It increases security. Large networks use subnetting for management." The book's Summary (p.17): "Subnetting is the process of dividing a large network into smaller networks for better management and security."
6.What is Network Address Translation (NAT)?2 marks
Answer
From the book: "NAT stands for Network Address Translation. It allows many devices to share one public IP address. NAT is performed by routers. It hides private IP addresses. This improves network security."
7.How many addresses are possible in IPv4 and in IPv6?2 marks
Answer
From the book's DO YOU KNOW? boxes: "Total IPv4 addresses possible: 4.29 billion". "IPv6 addresses comprise: 2^128 ≈ 3.4×10^38 total addresses." "IPv6 will never run out; it is an astronomically massive number."
Long questions
1.Explain IP addressing. Describe IPv4, IPv6, the default gateway, and subnetting.8 marks
Answer
Cover every part the question names, using the book's text. Note: the default gateway is not taught in 1.8; the book defines it in topic 1.10 (Wi-Fi Security and Router Configuration, under "Router Web Interface"). That 1.10 text is quoted for part 4.
- IP addressing (verbatim, 1.8): "An IP address is a unique number assigned to a device. IP stands for Internet Protocol. It helps identify devices on a network. Data uses IP addresses to find its destination. Every network device must have an IP address. Communication is not possible without it." Summary (p.17): "An IP address is a unique address assigned to a device so it can be identified on a network."
- IPv4 (1.8): "IPv4 is an older version of IP addressing. It uses 32-bit numeric addresses. IPv4 has a limited number of addresses." Example: 192.168.1.10. "IPv4 has 4 numbers, each 0-255, separated by dots." "Each number = 1 Byte = 8 bits", "Total = 32 bits". Breakdown: Network part 192.168.1 (identifies your local network, like "Gulshan Block Street 3"), Host part 10 (identifies your specific device on that network, like "House #10"). DO YOU KNOW?: "Total IPv4 addresses possible: 4.29 billion".
- IPv6 (1.8): "IPv6 is the newer version with 128-bit addresses. IPv6 provides more address space. It supports modern Internet needs." Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334. "IPv6 has 8 groups of 4 hexadecimal digits, separated by colons." "Each group = 16 bits", "Total = 128 bits". Breakdown: Global routing prefix 2001:0db8:85a3 (ISP/region), Subnet ID 0000 (your local network inside the ISP), Interface ID 0000:8a2e:0370:7334 (your specific device). DO YOU KNOW?: "IPv6 addresses comprise: 2^128 ≈ 3.4×10^38 total addresses."
- Default gateway (verbatim, 1.10): "A default gateway connects a local network to other networks. It is usually a router. Data meant for outside networks goes through the gateway. The gateway forwards data to the correct network. Internet access depends on it. Proper gateway setting is necessary."
- Subnetting (verbatim, 1.8): "Subnetting divides a network into smaller parts. Each part is called a subnet (as shown in Figure 1.15). It reduces network traffic. Subnetting improves performance. It increases security. Large networks use subnetting for management." Summary (p.17): "Subnetting is the process of dividing a large network into smaller networks for better management and security." Figure 1.15: Subnetting Example: 192.168.1.0/24 divided into Subnet 1 (192.168.1.0/25) and Subnet 2 (192.168.1.128/25).
Aim for 350-450 words.
2.Compare IPv4 and IPv6. Use the book's examples and explain the breakdown of each address.8 marks
Answer
Cover the sub-heading "IPv4 and IPv6", using the book's text:
- Opening (verbatim): "IPv4 is an older version of IP addressing. It uses 32-bit numeric addresses. IPv4 has a limited number of addresses. IPv6 is the newer version with 128-bit addresses. IPv6 provides more address space. It supports modern Internet needs."
- IPv4: example 192.168.1.10; "4 numbers, each 0-255, separated by dots"; "Each number = 1 Byte = 8 bits"; "Total = 32 bits". Breakdown of IPv4: Network part 192.168.1 ("Identifies your local network, like "Gulshan Block Street 3""), Host part 10 ("Identifies your specific device on that network, like "House #10"").
- IPv6: example 2001:0db8:85a3:0000:0000:8a2e:0370:7334; "8 groups of 4 hexadecimal digits, separated by colons"; "Each group = 16 bits"; "Total = 128 bits". Breakdown of IPv6: Global routing prefix 2001:0db8:85a3 ("ISP/region, like "Pakistan, Sindh, Karachi""), Subnet ID 0000 ("Your local network inside the ISP, like "Gulshan area""), Interface ID 0000:8a2e:0370:7334 ("Your specific device, like "Your laptop"").
- Number of addresses (DO YOU KNOW? boxes): "Total IPv4 addresses possible: 4.29 billion"; "IPv6 addresses comprise: 2^128 ≈ 3.4×10^38 total addresses." "IPv6 will never run out; it is an astronomically massive number."
- A comparison table (32-bit vs 128-bit, dots vs colons, 4 numbers of 0-255 vs 8 groups of hexadecimal digits, older vs newer, limited vs more address space) makes the answer clear.
Aim for 250-350 words.
3.What is subnetting? Explain it with the help of Figure 1.15. Also explain Network Address Translation (NAT).6 marks
Answer
Cover the sub-headings "Subnetting" and "Network Address Translation (NAT)", using the book's text:
- Subnetting (verbatim): "Subnetting divides a network into smaller parts. Each part is called a subnet (as shown in Figure 1.15)."
- Benefits: "It reduces network traffic. Subnetting improves performance. It increases security. Large networks use subnetting for management."
- Figure 1.15: Subnetting Example: draw the network 192.168.1.0/24 at the top, divided into Subnet 1 (192.168.1.0/25, with a computer, a laptop and a network device) and Subnet 2 (192.168.1.128/25, with a mobile phone and a printer).
- NAT (verbatim): "NAT stands for Network Address Translation. It allows many devices to share one public IP address. NAT is performed by routers. It hides private IP addresses. This improves network security. NAT is commonly used in networks."
Aim for 200-300 words.
In this chapter
- 1.1Introduction to Computer Networks
- 1.2Network Architecture and Basic Concepts
- 1.3Types of Computer Networks
- 1.4Networking Devices
- 1.5Network Topologies
- 1.6Network Models and Layers
- 1.7Network Protocols and Services
- 1.8IP Addressing and SubnettingYou are here
- 1.9Home Network Setup and Configuration
- 1.10Wi-Fi Security and Router Configuration
- 1.11Network Diagnostic Tools and Commands
- 1.12Network Performance
- 1.13Network Load Balancing
- 1.14Network Security
- 1.15Data Backup and Recovery
- 1.16Usability and Security Tradeoffs