the process of dividing a network into sub networks hence the name. makes it more manageable and efficient

read IP before getting into this and terminology to know beforehand:

  • modern networks use CIDR Notation
  • network bits stay unaffected
  • subnet range
  • network address (not assigned to any hosts)
  • broadcast address
    • the last address in the subnet, used to send messages to all devices on the subnet at once
  • usable hosts
    • 2 are removed coz yk network and broadcast address

creating a subnet:

yea:

192.168.72.0

192.168.72.255

1100 0000 . 1010 1000 . 0011 1010 . 0000 0000

  • unique network address
  • hosts
  • broadcast ID
  • each IPv4 has four octets
    • octets are divided into network and host portions
    • classes:
      • class A: 8 bit network ID, 24 bit host IDs
        • the first bit of the first octet is always 0 and the remaining 7 are used to determine the network ID
        • default subnet mask: 255.x.x.x
        • 2^[24] - 2 host addresses
      • class B: 16 bit IDs
        • the first two bits of the first octet are always 10 and the remaining 14 bits are used to determine the network IDs
        • default subnet mask on this one: 255.255.x.x
      • class C: 24 bit network ID, 8 bit host IDs
        • the first three bits on this are always 110 and the rest of the 21 bits are used to get the network IDs
        • default subnet mask: 255.255.255.x
      • class D: multicast address
        • multi-casting
        • the first 4 bits are always 1110
        • doesnt have a subnet mask
        • the IP range is 224.0.0.0 <–> 239.255.255.255
      • class E: reserved
        • reserved for experimental and research purposes
        • IP range is 240.0.0.0 <–> 255.255.255.255
        • doesn’t have a subnet mask either
        • the first 4 bits are always 1111
      • classful addressing structure

examples:

  • class C example:
    • the first 3 octets remain the same cuz class C after all
network bitsbits borrowed
()
subnets
()
subnet maskhost bits
()
hosts per subnet
(2^m$$- 2)
subnetblock size
2401255.255.255.08254255
2512255.255.255.1287126
2624255.255.255.192662
2738255.255.255.224530
28416255.255.255.240414
29532255.255.255.24836
30664255.255.255.25222
- /31 is used for point to point links like router connections. but its unusable for hosts since theres only 2 IPs
- /32 is used to identify a single device
  • class B example:
    • the first 2 octets stay the same
network bitsbits borrowed
()
subnets
()
subnet maskhost bits
()
hosts per subnet
(2^m$$- 2)
subnetblock size
1601255.255.0.01665534
1712255.255.128.01532766
1824255.255.192.01416382
1938255.255.224.0138190
20416255.255.240.0124094
21532255.255.248.0112046
22664255.255.252.0101022
237128255.255.254.09510
248256255.255.255.08254
259512255.255.255.128
7126
26101024255.255.255.192662
27112048255.255.255.224530
28124096255.255.255.240414
29138192255.255.255.24836
301416384255.255.255.25222
  • class A example:
    • only the first octet stays the same
network bitsbits borrowed
()
subnets ()subnet maskhost bits
()
hosts per subnet
(2^m$$- 2)
subnetblock size
801225.0.0.024
912225.128.0.023
1024225.192.0.022
1138225.224.0.021
12416225.240.0.020
13532225.248.0.019
14664225.252.0.018
157128225.254.0.017
168256255.255.0.01665534
179512255.255.128.01532766
18101024255.255.192.01416382
19112048255.255.224.0138190
20124096255.255.240.0124094
21138192255.255.248.0112046
221416384255.255.252.0101022
2315255.255.254.09510
2416255.255.255.08254
2517255.255.255.128
7126
2618255.255.255.192662
2719255.255.255.224530
2820255.255.255.240414
2921255.255.255.24836
3022255.255.255.25222
  • 194.10.20.0/19

    • 11111111:11111111:11100000:00000000
    • 255.255.224.0
    • 00000000:00000000:00100000:00000000
    • 0.0.32.0
    • block size calculation:
      • 256 - 224 = 32
    • network/subnet number calculation:
      • 2^3 = 8 (3 cuz 11100000)
      • 32-19 = 13
      • 2^13 = 8192 (host)
        • subnet host calculation:
          • 194.10.0.0-194.10.31.255
          • 194.10.32.0-194.10.63.255
          • 194.10.64.0-194.10.95.255
          • 194.10.96.0-194.10.127.255
          • 194.10.96.0-194.10.127.255
          • 194.10.96.0-194.10.127.255
          • 194.10.96.0-194.10.123.255
          • 194.10.224.0-194.10.255.255
        • network: 194.10.20.0
        • broadcast : 194.10.20.
        • usable: 194.10.20.1 > 194.10.20.6
  • 192.168.10.0/30

    • network bits: 30
      • borrowed bits = 30-24 = 6
      • subnets: = 64
    • host bits: 2
      • hosts per subnet:
    • subnet mask:
      • 255.255.255.252
      • subnet: 0.0.8.0
      • block size: 256 - 252 = 4
      • subnets:
        • subnet-1: 192.168.10.0/30
          • network: 192.168.10.0
          • hosts: 192.168.10.1 - 192.168.10.2
          • broadcast: 192.168.10.3
        • subnet-2: 192.168.10.4/30
          • network: 192.168.10.4
          • hosts: 192.168.10.5 - 192.168.10.6
          • broadcast: 192.168.10.7
        • and so on until the 64th subnet
  • 10.0.2.3/12

    • network bits: 12
      • borrowed bits: 12 - 8 = 4
      • subnets: $2^{4} = 16
  • example network: 10.0.0.0/24 and we wanna make 4 subnets out of it

    • /24 is a CIDR notation meaning 24 bits out of the 32 bits of an ip is fixed and the rest of the 8 bits are free for hosts so the total number of IP addresses on the subnet is 2^8 = 64
    • need 4 subnets so i need to borrow 2 bits (2^2)
    • original mask: /24
    • new mask: /26
    • first subnet:
      • network: 10.0.0.0
      • usable: 10.0.0.1 > 10.0.0.62
      • broadcast: 10.0.0.63
    • second subnet:
      • network: 10.0.0.64
      • usable: 10.0.0.65 > 10.0.0.62
      • broadcast: 10.0.0.63

GET BITS FROM CIDR NOTATION

IDENTIFY WHICH OCTATE YOU’RE WORKING WITH

GET SUBNET MASK

GET BLOCK SIZE (256 - OCTATE VALUE)

GET VALID HOST AMOUNT (BLOCK SIZE - 2)

IDENTIFY SUBNETS

10.0.0.0

10.255.255.255

10.0.2.3/12

1111 1111 . 1111 0000 . 0000 0000 . 0000 0000

SUBNET MASK - 255.240.0.0

block size 256 - 240 = 16

Borrowed Bits - 4

subnet amount : = 16 subnets

possible host amount per subnet : = = 16

valid host amount = possible amount - 2 = 14

first subnet:

network ID 10.0.0.0

valid host range: 10.0.0.1 - 10.15.255.254

broadcast ID 10.15.255.255

2nd subnet:

network ID: 10.16.0.0

valid host range: 10.16.0.1 - 10.31.255.254

broadcast ID: 10.31.255.255

3rd subnet:

network ID: 10.32.0.0

valid host range: 10.32.0.1 - 10.47.255.254

broadcast ID: 10.47.255.255