The word subnetwork (usually shortened to subnet) has two related meanings. In the older and more general meaning, it meant one physical network of an internetwork. In the Internet Protocol (IP), a subnetwork is a division of a classful network. The rest of this article is about the second meaning.
Subnetting an IP network allows a single large network to be broken down into what appear (logically) to be several smaller ones. It was originally introduced before the introduction of classful network numbers in IPv4, to allow a single site to have a number of local area networks. Even after the introduction of classful network numbers, subnetting continued to be useful, as it reduced the number of entries in the Internet-wide routing table (by hiding information about all the individual subnets inside a site). As a side benefit, it also resulted in reduced network overhead, by dividing the parts which receive IP broadcasts.
A network mask, also known as a subnet mask, netmask or address mask, is a bitmask used to tell how many bits in an octet(s) identify the subnetwork, and how many bits provide room for host addresses.
Subnet masks are usually represented in the same representation used for addresses themselves; in IPv4, dotted decimal notation, four numbers from zero to 255 separated by periods, e.g. 255.128.0.0. Since the mask consists of only a series of all ones followed by all zeroes, only those numbers representing such sequences are allowed: 0, 128, 192, 224, 240, 248, 252, 254, and 255.
Less commonly, it can be represented as an eight-digit hexadecimal number (e.g. FF.80.00.00 = 255.128.0.0).
A shorter form, which is known as Classless Inter-Domain Routing (CIDR) notation, gives the network number followed by a slash ("/") and the number of 'one' bits in the binary notation of the netmask (i.e. the number of relevant bits in the network number). For example, 192.0.2.96/28 indicates an IP address where the first 28 bits are used as the network address (same as 255.255.255.240).
| Class | Leading bits | Start | End | Default Subnet Mask in dotted decimal | CIDR notation |
|---|---|---|---|---|---|
| A | 0 | 1.0.0.0 | 126.0.0.0 | 255.0.0.0 | /8 |
| B | 10 | 128.0.0.0 | 191.255.0.0 | 255.255.0.0 | /16 |
| C | 110 | 192.0.0.0 | 223.255.255.0 | 255.255.255.0 | /24 |
| D | 1110 | 224.0.0.0 | 239.255.255.0 | ||
| E | 1111 | 240.0.0.0 | 255.255.255.0 |
Class D multicasting
Class E reserved
Subnetting is the process of allocating bits from the host portion as a network portion. For example, giving the class A network 10.0.0.0 a subnet mask of 255.255.0.0 would break it down into 256 sub-networks (10.0.0.0 to 10.255.0.0), and indicates that the first octet of the IP address shows the network address, the second one shows the subnet number and the last two show the host part. A bitwise AND operation of the host address with the subnet mask extracts the complete subnetwork address (see example below).
Subnet masks are not limited to whole octets, either. For example 255.254.0.0 (or /15) is also a valid mask. Applied to a class A address this would create 128 subnetworks in intervals of two (1.2.0.1 - 1.3.255.254, 1.4.0.1 - 1.5.255.254, etc).
Determining the number of hosts and subnets on a particular network is quite easy, if you know the subnet mask. Say you have the network address 154.4.32.0 with a subnet mask of 255.255.224.0. This network address can also be written as 154.4.32.0/19
possible subnets available according to RFC 1812, otherwise using the old RFC 950 standard the number of usable subnets is 6. This is due to RFC 950 (section 2.1, page 5) not supporting subnets with either all 1s or all 0s.
possible hosts available to each subnetwork.
It is possible to determine the amount of subnets required in each subnet mask along with the amount of hosts.
For example, we will use the class B subnet 255.255.0.0
This is written as 11111111.11111111.00000000.00000000 in binary form.
By adding extra mask bits to our subnet, we can determine the amount of subnets.
11111111.11111111.11000000.00000000 => 255.255.192.0 (/18)
We can now work out the subnet count by getting 2 to the power of how many mask bits we added, in this case we have added 2: which gives us the subnet number. To get the effective subnet count, we subtract 2 from this value.
Using the Least significant bit (lsb) of the subnet, we can find out how many hosts we have. The lsb of 11111111.11111111.11000000.00000000 is 1000000.00000000 => 16384. To get the effect host count, we subtract 2 from this value. This is because of the need for a network and broadcast address.
| Network address range | CIDR notation |
|---|---|
| 10.0.0.0 - 10.255.255.255 | /8 |
| 172.16.0.0 - 172.31.255.255 | /12 |
| 192.168.0.0 - 192.168.255.255 | /16 |
Technically illegal, but still usable, is the extreme first subnetwork; for example, subnet 1.0.0.0 with a subnet mask address of 255.255.0.0. The problem with this subnet is that the unicast address for the subnet is the same as the unicast address for the entire class A network.
Routing | Network addressing | Internet architecture
Subnetz | Subred | sous-réseau | Sottorete | Podsieć | Subrede | Маска подсети | alt ağ maskesi | 子网
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Subnetwork".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world