• IP subnetting is the process of dividing an IP (Internet Protocol) address into smaller subnets. This enables network administrators to allocate IP addresses more efficiently and manage network traffic.
  • By logically grouping IP addresses, subnetting facilitates routing and network segmentation.
  • Subnets are created by borrowing host bits from a Class A, B, or C network to create more networks.
  • When host bits are borrowed, new subnets are created, reducing the number of usable IP addresses in the network.
  • Each subnet has its own range of IP addresses and a subnet mask.
  • The first address of a subnet is the network address, while the last address is the broadcast address. The usable IP range lies between these two.

FLSM and VLSM

FLSM (Fixed Length Subnet Masking)

FLSM involves splitting an IP address space into subnets of equal size. It is simpler and easier to manage but may lead to inefficient use of IP addresses.

Example: To divide the 192.168.1.0/24 network into 4 equal-sized subnets, follow these steps:

1. Determine the Subnet Mask

  • To create 4 equal subnets, borrow 2 bits (2^2 = 4).
    • Before division, the subnet mask for the network:

      • CIDR: /24
      • Binary: 11111111.11111111.11111111.00000000
      • Decimal: 255.255.255.0
    • After borrowing 2 bits for subnetting:

      • CIDR: /26
      • Binary: 11111111.11111111.11111111.11000000
      • Decimal: 255.255.255.192

2. Calculate Network Addresses Using the binary values of the borrowed bits, find the network addresses:

2⁷2⁶2⁵2⁴2⁰Network Start Address
11000000
192.168.1.000000000
192.168.1.0100000064
192.168.1.10000000128
192.168.1.11000000192

Network Addresses:

SubnetsNetwork AddressUsable Host RangeBroadcast Address
1.192.168.1.0/26192.168.1.1 - 192.168.1.62192.168.1.63
2.192.168.1.64/26192.168.1.65 - 192.168.1.126192.168.1.127
3.192.168.1.128/26192.168.1.129 - 192.168.1.190192.168.1.191
4.192.168.1.192/26192.168.1.193 - 192.168.1.254192.168.1.255

VLSM (Variable Length Subnet Masking)

VLSM allows IP address spaces to be divided into subnets of different sizes, making more efficient use of IP addresses by tailoring the subnet size to the specific needs.

Example:

  1. Subnet 1: 50 devices
  2. Subnet 2: 30 devices
  3. Subnet 3: 10 devices
  4. Subnet 4: 2 devices

To divide the 192.168.1.0/24 network into subnets based on the number of devices required:

1. Determine Subnet Masks:

  • Calculate the number of host bits required and determine the subnet mask by subtracting these from the 32-bit total.

  • Use the formula

    2^n - 2

    to calculate the number of usable IP addresses, where n is the number of host bits.

    Subnet 1 - 50 devices

    • 2⁶ - 2 = 62 addresses
    • Host bits: 6
    • Subnet Mask: 255.255.255.192 (/26)

    Subnet 2 - 30 devices

    • 2⁵ - 2 = 32 addresses
    • Host bits: 5
    • Subnet Mask: 255.255.255.224 (/27)

    Subnet 3 - 10 devices

    • 2⁴ - 2 = 14 addresses
    • Host bits: 4
    • Subnet Mask: 255.255.255.240 (/28)

    Subnet 4 - 2 devices

    • 2² - 2 = 2 addresses
    • Host bits: 2
    • Subnet Mask: 255.255.255.252 (/30)

2. Calculate Network Addresses:

In VLSM, subnets are ordered from largest to smallest, and addresses are allocated accordingly. The starting address of each subnet is determined by the previous subnet’s ending address.

Calculation for Subnet 1 (50 devices):

2⁷2⁶2⁵2⁴2⁰Network Address
1st Subnet11XXXXXX192.168.1.0 /26
2nd Subnet111XXXXX192.168.1.64 /27
3rd Subnet1111XXXX192.168.1.96 /28
4th Subnet111111XX192.168.1.112 /30