Subnetting

March 7 (Day); March 2 (Night)

  • Introduction to Network Addresses:
  • TCP/IP is the most widely used protocol in the world. The Internet uses only IP addressing. In order for a host to access the Internet, it must have an IP address.
  • IP addresses consist of four numbers (between 0-255) separated by dots. Each number is known as an octet.
  • Because each octet can be between 0-255, it can be represented by 8 bits. Therefore, the entire address is represented by 32 bits.
  • In its most basic form, the IP address has two parts: a network ID and a host ID.
  • The network ID portion of an IP address refers to the network. Hosts on a network can communicate directly only with devices that have the same network ID.
  • Hosts might share the same physical segment, but if they have different network IDs, they usually cannot communicate with each other – unless there is another device that can make a connection between the networks. This device is usually a router.
  • Once data reaches the appropriate network, it uses the host portion of the IP address to find the individual computer.
  • All networks have a network address. Usually, it is going to be the lowest value in that particular network.
  • Classes of Network Addresses:
  • There are five classes of IP addresses (A through E). Only the first three classes (A-C) are used regularly.
  • Summary of Network Classes:

Class / 1st Octet / Network/
Host ID / # of
Networks / Hosts per Network
A / 1-126 / N.H.H.H / 126 / 16,777,216
B / 128-191 / N.N.H.H / 16,382 / 65,536
C / 192-223 / N.N.N.H / 2,097,150 / 256
  • In class A addresses, the first octet is the network ID and the last three octets are host ID.
  • Because the last three octets are dedicated to host addresses, this means you can have 16,777,216 hosts on a class A network.
  • We know this because 2^24=16,777,216 OR 256 x 256x 256=16,777,216.
  • In class B addresses, the first two octets are the network ID and the last two octets are host ID.
  • Because the last two octets are dedicated to host addresses, this means you can have 65,536 hosts on a class A network.
  • We know this because 2^16=65,536 OR 256 x 256=65,536.
  • In class C addresses, the first three octets are the network ID and the last octet is the host.
  • Because the last octet is dedicated to host addresses, this means you can have 256 hosts on a class A network.
  • We know this because 28=256 OR 256.
  • What is Subnetting:
  • Network administrators sometimes need to divide networks, especially large ones, into smaller networks. These smaller divisions are called subnetworks.
  • Each subnetwork is connected to one another by a device known as a router.
  • Larger networks are broken down into subnetworks through the use of a numbering scheme known as the subnet mask.
  • Routers use the “ANDing” process to determine if a destination host is on the same network or not. Basically, you multiply the binary equivalent of the IP address by the binary equivalent of the subnet mask to get the network address.
  • Here are the default subnet masks. Class A uses 255.0.0.0. Class B uses 255.255.0.0. Class C uses 255.255.255.0.
  • Let’s apply the ANDing process and the subnet mask to calculate the network address for the host 200.1.1.5.

Decimal form / Binary form
Host address / 200.1.1.5 / 11001000.00000001.00000001.00000101
Subnet mask / 255.255.255.0 / 11111111.11111111.11111111.00000000
Resulting network address (binary form): / 11001000.00000001.00000001.00000000
Resulting network address (dec form): / 200.1.1.0
  • Creating a Custom Subnet Mask for a Class C Address:
  • Let’s pretend that we want less than 256 hosts on one network with a network address of 200.1.1.0. We want two subnets and to separate them with a router for security reasons and to reduce traffic.
  • The first step to subnetting is to determine how many subnets we need. In this case we need two.
  • The next step is to see how many bits we should borrow from the host portion of the network address, begin to add the bits from the right to left until the total is equal to or greater than the number of subnets we need.

128 / 64 / 32 / 16 / 8 / 4 / 2 / 1

2 + 1 = 3 which is greater than the number of subnets we need.

  • After we know how many bits to borrow, we take them from the left side of the fourth octet of the host address.

128 / 64 / 32 / 16 / 8 / 4 / 2 / 1
Bits we need to borrow / 1 / 1 / 0 / 0 / 0 / 0 / 0 / 0

Our custom subnet mask is going to be 255.255.255.192. The 192 comes from the value of the first two bits from the left. (The 192 comes from 128 + 64).

  • Since we borrow two bits for the network ID. This means we may have 22=4 subnets.
  • Since we borrow two bits for the network ID, this leaves only six bits for the host ID. This means that we may have 26=64 hosts on each subnet.
  • Here’s a chart that demonstrates the four subnets we can create.

Subnet No. / Network Address / Range of Available Addresses
0 / 200.1.1.0 / 200.1.1.0 – 200.1.1.63
1 / 200.1.1.64 / 200.1.1.64 – 200.1.1.127
2 / 200.1.1.128 / 200.1.1.128 – 200.1.1.191
3 / 200.1.1.192 / 200.1.1.192 – 200.1.1.255
  • Based on our example, can a host of 200.1.1.5 send data directly to a host of 200.1.1.70?
  • Based on our example, can a host of 200.1.1.5 send data directly to a host of 200.1.1.60?