Nepedia
Back to Discover
Advanced Reader
💻

Subnet

technology Maturity 7-9 Next article →

A subnet, or subnetwork, is a logical subdivision of an IP network. The process of dividing a larger network into two or more smaller networks is called subnetting. This practice is essential for organizing how data moves across the digital world. By creating subnets, administrators can manage large networks more effectively. They can also improve routing efficiency within a large organization. Subnetting allows a single network to be partitioned into a hierarchical tree-like structure or even a mesh.

Subnetting Concept-en
Subnetting Concept-en

Every IP address is divided into two logical fields. The first field is the routing prefix, which represents the network number. The second field is the host identifier, which identifies a specific device or interface. All computers belonging to the same subnet share an identical group of most-significant bits in their addresses. This shared prefix tells the network which group a device belongs to. The host identifier then provides a unique local identity for that specific device. This structure allows for precise addressing across different parts of a network.

In IPv4, a network is often characterized by a subnet mask, also known as a netmask. A subnet mask is a bitmask used to separate the prefix from the host identifier. It consists of a sequence of ones followed by a block of zeros. When a computer performs a bitwise AND operation using the IP address and the subnet mask, the result is the routing prefix. For example, if an IPv4 address uses a mask of 255.255.255.0, the first 24 bits are the prefix. The remaining 8 bits are reserved for host addressing.

Subnetting Concept
Subnetting Concept

Modern networks use Classless Inter-Domain Routing, or CIDR, to specify these prefixes. CIDR notation is written as the network address followed by a slash and the bit-length of the prefix. For instance, the notation 192.0.2.0/24 indicates a prefix of 24 bits. This method replaced the older classful networking system. In the classful system, the network prefix was determined by the highest-order bit sequence. This categorized addresses into Classes A, B, and C. CIDR provides much more flexibility in how address space is allocated.

Subnetting involves designating some high-order bits from the host part as part of the network prefix. This action adjusts the subnet mask and divides the network into smaller pieces. The number of available subnets can be calculated as 2 raised to the power of n, where n is the number of bits used for the network portion. The number of available hosts is calculated as 2 raised to the power of h, minus 2, where h is the number of host bits. The subtraction of two accounts for the reserved network and broadcast addresses. For example, a subnet with 6 host bits allows for 62 usable host combinations.

Subnetting Concept-en
Subnetting Concept-en

Traffic moves between subnets using special gateway computers called routers. A router serves as a logical or physical boundary between different subnets. When a router compares the source and destination addresses, it looks at their routing prefixes. If the prefixes differ, the router must exchange the traffic between the subnets. If the prefixes are the same, the data can be sent directly to the target host on the local network. This process ensures that data finds the most efficient path to its destination.

Subnetting Concept
Subnetting Concept

There are different standards for different types of Internet Protocol. IPv4 uses 32-bit addresses, while its successor, IPv6, uses 128-bit addresses. IPv6 has been increasingly deployed since approximately 2006. Because the IPv6 address space is so massive, containing 2^128 addresses, the need to conserve space is not a limiting factor. In IPv6, the routing prefix is typically 32 bits. While IPv4 relies heavily on subnet masks for on-link determination, IPv6 uses the Neighbor Discovery Protocol (NDP). This distinction highlights how different generations of technology handle network organization.

638 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (2)
File:Subnetting Concept-en.svg
Subnetting Concept-en.svg
File:Subnetting Concept.svg
Subnetting Concept.svg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.