Subnetting

Done

CIDR (Classless Inter-Domain Routing)

IANA (Internet Addressing Numbers Authority) assigns ip address to companys according to their size

CIDR and FLSM (Fixed-Length Subnet Masks)

Introduced in 1993 by the IETF (Internet Engineering Task Force) in order to reduce the waste of ipv4 addresses.

How to calculate usable adresses?

2nāˆ’2=adresses2^n-2 = adresses
šŸ’”
n is the number of host bits

Subnets from class C

MaskCIDR NotationHost BitsUsable Addresses
255.255.255.128/257126
255.255.255.192/26662
255.255.255.224/27530
255.255.255.240/28414
255.255.255.248/2936
255.255.255.252/3022
255.255.255.254/3110(2)*
255.255.255.255/3200(1)**
šŸ’”
* If we disregard the reserved addresses we can say that we have 2 addresses, making it perfect for Point-to-Point connections.
šŸ’”
**Similarly as the /31 mask, we can think of the /32 as a single address, making it perfect for solutions targeting only one address. For example, a static route to a single pc (host).

How to calculate how many subnets are in a mask?

2y=subnets2^y=subnets
šŸ’”
y is the number of borrowed bits from the network portion

Subnets from class C

CIDR NotationN° subnetsN° Addresses
/252126
/26462
/27830
/281614
/29326
/30642
/311280(2)
/322560(1)

How to know the network address of a subnet from an IP Address?

  1. Convert the number to binary
    1. 172.25.217.192
    1. X.X.11011001.1100000
  1. Separate the Borrowed Network Portion from Host Portion
    1. X.X.11011|001.11000000
  1. Turn the Host Portion to 0
    1. X.X.11011|000.00000000
  1. Convert from binary to decimal
    1. X.X.216.0
  1. Answer
    1. X.X.216.0/21

How to know the broadcast address of a subnet from an IP Address?

  1. Convert the number to binary
    1. 172.25.217.192
    1. X.X.11011001.1100000
  1. Separate the Borrowed Network Portion from Host Portion
    1. X.X.11011|001.11000000
  1. Turn the Host Portion to 1
    1. X.X.11011|111.11111111
  1. Convert from binary to decimal
    1. X.X.223.255
  1. Answer
    1. X.X.223.255/21

VLSM (Variable-Length Subnet Masks)

It is more efficient, since it allow different prefix-lengths

  1. Assign the first subnet to the largest one starting from the address space
  1. Address the second biggest subnet
  1. Repeat

Practice

www.subnettingquestions.com

www.subnetting.org

www.subnettingpractice.com