Welcome to Module Two of Networking Basics Level Three! In Module One, you learned about network architecture, network topologies, different types of networks, and network performance.
In this module, we are going to learn how computers identify themselves and communicate with other devices on a network. We will explore IP addresses, IPv4, IPv6, subnet masks, CIDR notation, subnetting, and VLSM.
Imagine a large school with 500 students. Every student has a unique admission number that helps the school identify them. Without these numbers, it would be difficult to know which student belongs to a particular record.
Computer networks work in a similar way. Devices use IP addresses to identify themselves and communicate across networks.
At the end of this module, learners should be able to:
An IP address is a unique logical address assigned to a device on an IP network. It helps devices identify one another and send information to the correct destination.
IP stands for Internet Protocol.
Think about your home address. If someone wants to send a letter to you, they need to know where you live. Without an address, the letter may not reach the correct person.
An IP address performs a similar job in computer networking. It helps information reach the correct device.
IP addresses are important for several reasons:
An example of an IPv4 address is:
192.168.1.10
This address contains four numbers separated by full stops. Each number is called an octet.
The four octets are:
192 . 168 . 1 . 10 | | | | 1st 2nd 3rd 4th Octet Octet Octet Octet
Each octet can contain a number between 0 and 255.
Imagine a school with four computer laboratories. Each computer needs an address so that the network can identify it.
| Device | IP Address |
|---|---|
| Computer 1 | 192.168.1.10 |
| Computer 2 | 192.168.1.11 |
| Computer 3 | 192.168.1.12 |
| Printer | 192.168.1.20 |
| Router | 192.168.1.1 |
These devices have different IP addresses within the same example network. This helps the network distinguish between them.
An IP address works like a digital address. It helps information find the correct device on a network.
IPv4 stands for Internet Protocol Version 4. It is one of the most widely used systems for assigning addresses to devices on computer networks.
IPv4 uses a 32-bit address. This means every IPv4 address contains 32 binary digits.
A binary digit is called a bit. It can only have one of two values:
An IPv4 address is divided into four groups of eight bits. Each group is called an octet.
Consider this IPv4 address:
192.168.1.10
It contains four octets:
192 168 1 10 | | | | 8 bits 8 bits 8 bits 8 bits Total = 32 bits
Computers use binary numbers to process information. Unlike the decimal number system we use every day, binary uses only 0 and 1.
The decimal system uses ten digits, from 0 to 9. The binary system uses only two digits.
Each position in an 8-bit binary number has a value.
| Bit Position | Value |
|---|---|
| 1st | 128 |
| 2nd | 64 |
| 3rd | 32 |
| 4th | 16 |
| 5th | 8 |
| 6th | 4 |
| 7th | 2 |
| 8th | 1 |
Let us convert the binary number 00001010 into a decimal number.
The binary number is:
0 0 0 0 1 0 1 0
Now look at the positions containing 1.
128 64 32 16 8 4 2 1 0 0 0 0 1 0 1 0
Add the values where 1 appears:
8 + 2 = 10
Therefore:
00001010 = 10
Now let us convert the decimal number 13 into binary.
We look for values that can be added together to make 13.
8 + 4 + 1 = 13
The 8-bit positions are:
128 64 32 16 8 4 2 1 0 0 0 0 1 1 0 1
Therefore:
13 = 00001101
Binary is important because computers process information using binary values. IP addresses and subnet masks are also represented in binary when computers perform network calculations.
An IPv4 octet contains eight bits. The smallest possible value is 0, while the largest is 255.
| Binary | Decimal |
|---|---|
| 00000000 | 0 |
| 00000001 | 1 |
| 00001010 | 10 |
| 01100100 | 100 |
| 11111111 | 255 |
IPv4 uses 32 bits divided into four octets. Each octet contains eight bits and has a decimal range from 0 to 255.
IPv6 stands for Internet Protocol Version 6. It was developed to provide a much larger number of IP addresses than IPv4.
As more computers, smartphones, smart televisions, cameras, and other devices connect to the internet, the number of available IPv4 addresses becomes limited.
IPv6 helps solve this problem by providing an extremely large address space.
IPv6 uses a 128-bit address. Unlike IPv4, which uses four decimal numbers separated by dots, IPv6 uses hexadecimal numbers separated by colons.
An example of an IPv6 address is:
2001:0db8:0000:0000:0000:ff00:0042:8329
This address contains eight groups called hextets. Each group represents 16 bits.
2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 | | | | | | | | 16 16 16 16 16 16 16 16 bits bits bits bits bits bits bits bits Total = 128 bits
Hexadecimal is a number system that uses 16 symbols. It includes the numbers 0 to 9 and the letters A to F.
| Decimal | Hexadecimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 8 | 8 |
| 9 | 9 |
| 10 | A |
| 11 | B |
| 12 | C |
| 13 | D |
| 14 | E |
| 15 | F |
IPv6 addresses can sometimes contain many zeros. To make them easier to write, certain zeros can be removed using shortening rules.
For example:
Full address: 2001:0db8:0000:0000:0000:ff00:0042:8329 Shortened address: 2001:db8::ff00:42:8329
Two important rules are:
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address Size | 32 bits | 128 bits |
| Format | Decimal | Hexadecimal |
| Separator | Full stop (.) | Colon (:) |
| Example | 192.168.1.10 | 2001:db8::1 |
| Address Capacity | About 4.3 billion addresses | About 3.4 ร 1038 addresses |
IPv4 uses 32 bits, while IPv6 uses 128 bits. IPv6 provides a much larger address space for the growing number of internet-connected devices.
A public IP address is an address that can be used for communication across the public internet. It is normally assigned by an internet service provider or another authorised address management organisation.
Imagine your home has an internet connection. Your internet service provider may assign your router a public IP address so that your home network can communicate with internet services.
A private IP address is an address used inside a private network, such as a home, school, or office network.
Private addresses are not directly routed across the public internet. A router commonly uses Network Address Translation (NAT) to allow devices with private addresses to communicate with internet services.
Common private IPv4 address ranges include:
| Range | Address Range |
|---|---|
| Private Range 1 | 10.0.0.0 โ 10.255.255.255 |
| Private Range 2 | 172.16.0.0 โ 172.31.255.255 |
| Private Range 3 | 192.168.0.0 โ 192.168.255.255 |
INTERNET
|
PUBLIC IP
|
ROUTER
|
PRIVATE LAN
/ | \
PC 1 PC 2 PHONE
192.168 192.168 192.168
.1.10 .1.11 .1.12
In this example, the router connects the private home network to the internet. The computers and phone use private IP addresses. The router uses its internet connection to communicate outside the local network.
| Public IP | Private IP |
|---|---|
| Used for public internet communication. | Used inside private networks. |
| Assigned from publicly available address space. | Selected from designated private address ranges. |
| Must be globally unique while in use. | Can be reused in separate private networks. |
| Example: A public address assigned by an ISP. | Example: 192.168.1.10. |
Using a private IP address does not automatically make a network secure. Firewalls, strong passwords, software updates, and access controls are still important.
Public IP addresses support communication across the internet, while private IP addresses are used inside private networks.
In the traditional classful IPv4 addressing system, IP addresses were divided into five classes: A, B, C, D, and E.
The classes were created to organise IPv4 address allocation according to different network sizes and purposes.
Modern networks commonly use CIDR instead of relying on the old classful system, but understanding address classes helps learners understand the history and structure of IPv4.
| Class | First Octet Range | Traditional Purpose |
|---|---|---|
| A | 1 โ 126 | Large networks |
| B | 128 โ 191 | Medium-sized networks |
| C | 192 โ 223 | Smaller networks |
| D | 224 โ 239 | Multicast communication |
| E | 240 โ 255 | Reserved and experimental purposes |
The addresses beginning with 127 are reserved for loopback testing. They are not ordinary Class A host addresses.
Class A was designed for very large networks. Its traditional default subnet mask is:
255.0.0.0
Example:
25.10.5.1
Class B was designed for medium-sized networks. Its traditional default subnet mask is:
255.255.0.0
Example:
150.20.5.1
Class C was designed for smaller networks. Its traditional default subnet mask is:
255.255.255.0
Example:
200.10.5.1
Class D is used for multicast communication. Multicast allows information to be sent to a selected group of interested devices.
Its address range is:
224.0.0.0 โ 239.255.255.255
Class E is reserved for special purposes and experimental use. It is not used for ordinary public host addressing.
Its address range is:
240.0.0.0 โ 255.255.255.255
Remember the classes using this simple guide:
Traditional IPv4 addressing has five classes. Modern networking mainly uses CIDR, which allows more flexible network address allocation.
A subnet mask is a 32-bit number used with an IPv4 address to identify which part belongs to the network and which part belongs to the host.
In simple language, a subnet mask helps a computer understand which devices belong to its local IP network.
Consider this example:
IP Address: 192.168.1.10 Subnet Mask: 255.255.255.0
The subnet mask tells the computer that the first three octets identify the network portion, while the final octet identifies the host portion.
An IPv4 address contains two important parts:
Example:
IP Address: 192.168.1.10 Mask: 255.255.255.0 Network: 192.168.1 Host: 10
This example uses a /24 network, meaning 24 bits identify the network and eight bits remain for host addressing.
| CIDR | Subnet Mask | Host Bits |
|---|---|---|
| /8 | 255.0.0.0 | 24 |
| /16 | 255.255.0.0 | 16 |
| /24 | 255.255.255.0 | 8 |
| /25 | 255.255.255.128 | 7 |
| /26 | 255.255.255.192 | 6 |
| /27 | 255.255.255.224 | 5 |
| /28 | 255.255.255.240 | 4 |
| /29 | 255.255.255.248 | 3 |
| /30 | 255.255.255.252 | 2 |
CIDR stands for Classless Inter-Domain Routing. It is a method of organising IP addresses that allows flexible network sizes.
CIDR uses a slash followed by a number to show how many bits belong to the network portion.
Example:
192.168.1.10/24
The /24 means that the first 24 bits identify the network. The remaining eight bits are available for host addressing.
Imagine a school has a network:
192.168.10.0/24
This means:
For a normal IPv4 subnet, the common formula for calculating usable host addresses is:
Usable Hosts = 2^h - 2
Where:
Let us calculate the usable hosts in a /24 network.
IPv4 address size = 32 bits
Network bits = 24
Host bits = 32 - 24
Host bits = 8
Usable Hosts = 2^8 - 2
= 256 - 2
= 254
Therefore, a typical /24 IPv4 subnet supports 254 usable host addresses.
| CIDR | Host Bits | Usable Hosts |
|---|---|---|
| /24 | 8 | 254 |
| /25 | 7 | 126 |
| /26 | 6 | 62 |
| /27 | 5 | 30 |
| /28 | 4 | 14 |
| /29 | 3 | 6 |
| /30 | 2 | 2 |
Note: These are the usual usable host counts for ordinary IPv4 subnets. Special-purpose networks may follow different rules.
A subnet mask separates the network portion from the host portion. CIDR notation shows the number of network bits using a slash number.
Subnetting is the process of dividing one larger IP network into smaller networks called subnets.
Imagine a large school with four departments:
Instead of placing every computer into one large network, the school can divide its network into smaller sections. Each department can have its own subnet.
This makes network management and access control easier.
Imagine a school has been given this network:
192.168.1.0/24
The school wants to create four smaller networks. It can divide the original /24 network into four /26 subnets.
Each /26 subnet contains 64 total addresses, with 62 normally available for devices.
| Subnet | Network Address | Usable Host Range | Broadcast |
|---|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.1 โ 192.168.1.62 | 192.168.1.63 |
| 2 | 192.168.1.64/26 | 192.168.1.65 โ 192.168.1.126 | 192.168.1.127 |
| 3 | 192.168.1.128/26 | 192.168.1.129 โ 192.168.1.190 | 192.168.1.191 |
| 4 | 192.168.1.192/26 | 192.168.1.193 โ 192.168.1.254 | 192.168.1.255 |
Let us learn how to divide a /24 network into four equal subnets.
Step One: Identify the original network.
192.168.1.0/24
Step Two: Determine how many subnets are needed.
We need four subnets.
Step Three: Find the number of bits to borrow.
Use this formula:
Number of Subnets = 2^n
We need four subnets:
2^1 = 2 2^2 = 4
Therefore, we borrow two bits.
Step Four: Calculate the new prefix.
Original Prefix = /24
Borrowed Bits = 2
New Prefix = 24 + 2
= /26
Step Five: Calculate the host bits.
Host Bits = 32 - 26
= 6
Step Six: Calculate addresses per subnet.
Total Addresses = 2^6
= 64
Step Seven: Calculate usable host addresses.
Usable Hosts = 64 - 2
= 62
We now have four subnets, each with 64 total addresses and 62 normally usable host addresses.
The subnet increment helps us identify where each subnet begins. For a /26 subnet, the subnet mask is:
255.255.255.192
Subtract the last mask value from 256:
256 - 192 = 64
Therefore, the subnet increment is 64.
The subnet network addresses are:
192.168.1.0 192.168.1.64 192.168.1.128 192.168.1.192
Every ordinary IPv4 subnet has important address types.
Example:
Network: 192.168.1.0/26 First Host: 192.168.1.1 Last Host: 192.168.1.62 Broadcast: 192.168.1.63
Subnetting divides a large network into smaller networks. It helps with network organisation, address management, and traffic control.
VLSM stands for Variable Length Subnet Masking. It is a subnetting method that allows different subnets to use different subnet mask sizes.
In simple language, VLSM allows us to create subnetworks based on how many devices each department actually needs.
Imagine a company has three departments:
Giving every department the same number of addresses may waste many addresses. VLSM allows each department to receive a subnet that is suitable for its requirements.
Suppose an organisation has the network:
192.168.10.0/24
It needs to create networks for three departments:
| Department | Required Hosts |
|---|---|
| Administration | 50 |
| Teachers | 25 |
| Security | 10 |
The first rule is to arrange the departments from the largest host requirement to the smallest.
Administration = 50 hosts Teachers = 25 hosts Security = 10 hosts
Step One: Allocate the largest subnet.
Administration requires 50 usable host addresses. A /26 subnet provides 62 usable addresses.
Network: 192.168.10.0/26 Mask: 255.255.255.192 Usable: 192.168.10.1 - 192.168.10.62 Broadcast: 192.168.10.63
Step Two: Allocate the second subnet.
Teachers require 25 usable host addresses. A /27 subnet provides 30 usable addresses.
Network: 192.168.10.64/27 Mask: 255.255.255.224 Usable: 192.168.10.65 - 192.168.10.94 Broadcast: 192.168.10.95
Step Three: Allocate the third subnet.
Security requires 10 usable host addresses. A /28 subnet provides 14 usable addresses.
Network: 192.168.10.96/28 Mask: 255.255.255.240 Usable: 192.168.10.97 - 192.168.10.110 Broadcast: 192.168.10.111
| Department | Network | Prefix | Usable Hosts |
|---|---|---|---|
| Administration | 192.168.10.0 | /26 | 62 |
| Teachers | 192.168.10.64 | /27 | 30 |
| Security | 192.168.10.96 | /28 | 14 |
Notice that each department receives a subnet that is large enough for its requirements without giving every department the same size.
Always plan the largest subnet first. Then allocate smaller subnets from the remaining available address space.
VLSM allows a network administrator to create different-sized subnets based on the number of devices each network needs.
Supernetting is a method of combining multiple smaller, continuous IP networks into a larger network address block.
It is also known as route aggregation or route summarisation in many networking situations.
Imagine you have four small groups of files that belong together. Instead of managing every group separately, you can organise them under one larger folder.
Supernetting follows a similar idea by combining suitable network address blocks into a larger address block.
Consider these four consecutive networks:
192.168.0.0/24 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24
These four networks can be summarised as:
192.168.0.0/22
This summary represents the address range:
192.168.0.0 - 192.168.3.255
The four /24 networks are combined into one /22 address block. This is possible because the networks are continuous and correctly aligned.
| Subnetting | Supernetting |
|---|---|
| Divides a larger network into smaller networks. | Combines smaller networks into a larger address block. |
| Creates more specific network divisions. | Creates a broader network summary. |
| Often increases the network prefix length. | Often decreases the network prefix length. |
Subnetting divides networks into smaller parts, while supernetting combines suitable smaller networks into a larger address block.
Learning networking is not only about reading explanations. You must also practise assigning addresses, identifying subnet masks, and understanding how devices communicate.
In this lesson, we will use a simple school network example.
Imagine a school has a computer laboratory with 20 computers, one printer, and one router. The school wants to connect all these devices.
The network administrator selects this network:
192.168.20.0/27
The network information is:
| Device | IP Address |
|---|---|
| Router | 192.168.20.1 |
| Computer 1 | 192.168.20.2 |
| Computer 2 | 192.168.20.3 |
| Computer 3 | 192.168.20.4 |
| Computer 4 | 192.168.20.5 |
| Printer | 192.168.20.25 |
The remaining usable addresses can be assigned to additional computers and devices.
Windows provides a command called ipconfig. It displays information about the computer's network connection.
Follow these steps:
ipconfig
You may see information such as:
A default gateway is the device that a computer uses to send information to destinations outside its local network. It is commonly the IP address of a router on the local network.
Example:
IPv4 Address: 192.168.20.2 Subnet Mask: 255.255.255.224 Gateway: 192.168.20.1
In this example, the computer uses the router at 192.168.20.1 when it needs to communicate with destinations outside its local subnet.
The ping command helps test whether another device can be reached over an IP network.
Example:
ping 192.168.20.1
This command tests communication with the example router. The result may show replies or an indication that the destination could not be reached.
A failed ping does not always mean a device is switched off. Firewalls, network settings, and other conditions may block the test.
| Term | Meaning |
|---|---|
| IP Address | A logical address used to identify a device on an IP network. |
| IPv4 | Internet Protocol Version 4, which uses 32-bit addresses. |
| IPv6 | Internet Protocol Version 6, which uses 128-bit addresses. |
| Octet | A group of eight bits in an IPv4 address. |
| Binary | A number system that uses 0 and 1. |
| Hexadecimal | A number system that uses 16 symbols. |
| Subnet Mask | A value used to separate network and host portions of an IPv4 address. |
| CIDR | Classless Inter-Domain Routing. |
| Subnetting | Dividing a larger network into smaller networks. |
| VLSM | Variable Length Subnet Masking. |
| Supernetting | Combining suitable smaller networks into a larger address block. |
| Broadcast Address | An address used to send information to all devices on an IPv4 subnet. |
| Default Gateway | A device used to reach destinations outside the local network. |
| Network Address | An address that identifies a particular subnet. |
| Host Address | An address assigned to a device within a subnet. |
1. What does IP stand for?
2. How many bits does an IPv4 address contain?
3. How many octets are in an IPv4 address?
4. What is the largest decimal value of an IPv4 octet?
5. Which IP version uses 128 bits?
6. Which of the following is a private IPv4 address?
7. What does CIDR stand for?
8. What does a /24 prefix mean?
9. What is subnetting?
10. What does VLSM stand for?
11. Which command displays IP configuration on Windows?
12. Which command can test network communication?
Question 1:
Convert the binary number 00001010 into a decimal number.
Question 2:
Convert the decimal number 15 into an 8-bit binary number.
Question 3:
An IPv4 address uses 32 bits. If 24 bits are used for the network, how many bits remain for the host?
Question 4:
Calculate the number of usable host addresses in a normal IPv4 /26 subnet.
Question 5:
Identify the subnet mask for the following CIDR notation:
192.168.1.0/24
Question 6:
A school has the network 192.168.5.0/24. The administrator wants to divide it into four equal subnets. Determine:
Question 7:
A company has been given the network 192.168.30.0/24. It needs:
Determine suitable subnet sizes using VLSM.
Activity One: Find Your Computer's IP Address
Write down what each of these values means. Use a school computer or another authorised device.
Activity Two: Create an IP Addressing Plan
Imagine you are creating a network for a small office. The office has:
Create a simple table showing a suitable private IP address for each device.
Activity Three: Subnetting Challenge
Use the network 192.168.50.0/24. Divide it into two equal subnets. Identify:
Activity Four: Understand IPv6
Write down the following IPv6 address:
2001:0db8:0000:0000:0000:0000:0000:0001
Try to shorten the address using the IPv6 shortening rules.
In this module, you learned how IP addresses help computers identify one another and communicate across networks.
You explored IPv4, which uses 32-bit addresses, and IPv6, which uses 128-bit addresses. You also learned the differences between public and private IP addresses.
You studied the traditional IPv4 address classes and discovered how subnet masks and CIDR notation separate network and host portions.
You also learned subnetting, which divides a large network into smaller networks, and VLSM, which allows different-sized subnets to be created according to actual requirements.
Finally, you explored supernetting, practical IP address assignment, and basic Windows commands used to examine network configurations.
Every computer, smartphone, and network device needs a way to communicate with other devices. IP addressing provides an important part of that communication.
Learning how IP addresses and subnetting work is an important step towards becoming a network administrator, network engineer, or cybersecurity professional.
Congratulations! You have completed Module Two.
Get ready for Module Three: Routing and Routing Protocols, where you will learn how routers help information travel between different networks.