Day#5&6 IPV4 Addressing Lecture Notes
Day#5&6 IPV4 Addressing Lecture Notes
Day#5&6 IPV4 Addressing Lecture Notes
IPv4 Addressing
IPv4 – Internet protocol Version 4 addressing
- Network layer 🡺 3rd layer
o Purpose : addressing (logical addressing)🡺 ipv4
& ipv6
- IPv4 🡺 32 bits ( bits are 0 &1)
o Divided into 4 octets ( 4 possible digits with
equal length)
o Dotted decimal
o 32/4 🡺 8 bits equal length
o X1.x2.x3.x4
o X1= 8 bits
o X1= 00000000-11111111
▪ 0-255
o X1.x2.x3.x4
o 0.0.0.0 – 255.255.255.255
o Which of the following is/are valid ipv4
addresses
▪ 10.192.200.129
▪ 192.176.89.256
▪ 209.209.255.255
- IPv4 addressing
o 5 classes of address
▪ Class A
▪ Class B
▪ Class C
▪ Class D
▪ Class E
o Division of classes are based on the first octet
(Left most significant octet)
▪ X1.x2.x3.x4
● 0.0.0.0-127.255.255.255
● 00000000.0.0.0 - 01111111.255.255.255
▪ Class B 🡺 x1=128-191
● 128.0.0.0 – 191.255.255.255
● 10000000.0.0.0-10111111.255.255.255
▪ Class C 🡺x1=192-223
● 192.0.0.0 -223.255.255.255
● 11000000.0.0.0-11011111.255.255.255
● 224.0.0.0-239.255.255.255
● 11100000.0.0.0 – 11101111.255.255.255
● 11110000-11111111
▪ Example 192.168.19.250/24
● …
▪ Example: 192.168.19.250/24
● 255.255.255.0 = >/24
▪
Example: calculate
1.#VHA
2.NA
3.BA
4.Subnet mask
For the following addresses
A>192.168.250.15/24
a. #VHA = (2^8)-2 = 254
i. 192.168.250.1 – 192.168.250.254
b. NA = 192.168.250.0/24 – NA
c. BA= 192.168.250.255/24
d. SM= 255.255.255.0
2^0= 1
2^1 =2
2^2 = 4
2^3= 8
2^4= 16
2^5 =32
2^6 =64
2^7= 128
2^8 =256
2^9 = 512
2^10= 1024
2^11= 2048
2^12= 4096
2^13= 8192
2^14= 16384
2^15 – 32768..
▪ 10kg/10kg/20kg/20kg
▪ 5kg/5kg/20kg/20kg
▪ Next max. need p4= 1kg
▪ 1kg/1kg/1kg/1kg/1kg/20kg/20kg
o We called it Classless addressing or variable length
subnet mask or Modern Subnetting
Classful Addressing
▪ 5= 2#Borrowed-bits(BB)
▪ #BB= 3
▪ 172.17.0.0/16 -/19
▪ 172.17.bbbhhhhh.H
● 172.17.0.0/19 –D1
● 172.17.32.0/19 –D2
● 172.17.64.0/19-D3
● 172.17.96.0/19-d4
● 172.17.128.0/19 –D5
● 172.17.192.0/19
● 172.17.224.0/19
● #VHA = (2^#HB)-2
● 1000=(2^#HB)-2
● 32-10 = 22
● 172.17.0.0/16 -/22
● 172.17.bbbbbb00.0
● 172.17.00001000.0 = 172.17.8.0/22-d3
● 172.17.00001100.0 = 172.17.12.0/22-d3
●…
● 172.17.11111100.0 = 172.17.252.0/22-d3
Day#6
Variable Length Subnet Mask (VLSM)
- Modern subnetting approach
- Allocating ip addresses based on need
- The principle is first allocate the maximum need
- Next maximum need
- … next max. need
Example:
⇨ #VHA = (2#HB)-2
⇨ 1000= 2#HB
⇨ #HB = 10
o 32- 10 = 22
▪ 172.17.0.0/16 --/22
▪ 2^6 = 64 (/22)
o 172.17.bbbbbbhh.H
o 172.17.000000 00.0 == 172.17.0.0/22 – subnet 0
o 172.17.000001 00.0 == 172.17.4.0/22 – subnet 1
o 172.17.000010 00.0 ==172.17.8.0/22--- subnet 2
o 172.17.000011 00.0 == 172.17.12.0/22 – subnet 3
o 172.17.000100 00.0 == 172.17.16.0/22 --- subnet 4
o 172.17.000101 00.0 ===
o 172.17.000110 00.0
o 172.17.000111 00.0
o 172.17.001000 00.0
o 172.17.001001 00.0
o ---
o 172.17.111111 00.0 === 172.17.252.0/22--- subnet 63
o Subnet mask= 255.255.252.0
⇨…
⇨ 510 = (2#HB)-2
⇨ 🡺 #NB = 32-9 = 23
⇨ /23
o 172.17.000001 00.0 == 172.17.4.0/22 – subnet 1 –
further subneting considering next max. need
o 172.17.4.0/22 --/23
o 172.17.00000100.0/22 --/23
o 172.17.000001b0.0/22 --/23
o #Subnets = 2#BB 🡺 2^1 = 2
▪ 172.17.000001 0 0.0 🡺 172.17.4.0/23
▪
⇨ D3= 510, can be 172.17.4.0/23
▪ 172.17.0000 0100.0
▪ 172.17.0000 010 0.0000 0000=> 172.17.4.0/23 – NA
▪
Next max. need = d2= 200 hosts
#VHA = 2#HB-2
202= 2#HB
#HB = 8
⇨172.17.0000 0110.0/23 🡪
⇨172.17.0000 011b.0
D2= 172.17.6.0/24
⇨ 172.17.6.hhhh hhhh
⇨ ---
⇨
Consider next max. need 🡺 D4= 64
#VHA = (2^#HB)-2
66 = 2^#HB
#HB= 7 🡺 #NB= 25 --/25
172.17.7.0/24 ===/25
172.17.7.b 0000000/25
D4= 172.17.7.0/25
⇨ 172.17.7.0 hhhhhhh/25
⇨…
⇨ Last 🡺 D5 = 5 hosts
⇨ 5= (2#HB)-2
⇨ 7= 2^#HB 🡺 #HB= 3
⇨ =🡺 32-3 == 29
⇨ /29
⇨ 172.17.7.128/25 --/29
⇨ #BB= 4, #subnets = 16
⇨…
⇨
D5= 172.17.7.128/29
172.17.7.10000 hhh/29 == >
172.17.7.10000 000/29 == NA (172.17.7.128/29)
.. 172.17.7.10000 001/29 == 172.17.7.129/29 – 1 st VHA
…
172.17.7.10000 110/29 == 172.17.7.134/29 –2nd VHA
172.17.7.10000 111/29 ---172.17.7.135/29 -- BA
● 172.16.10000000.0 🡪 NA
●…
● 172.16.10111111.00000000🡺 172.16.191.0/18
●…
● 172.16.10111111.11111110🡺 172.16.191.254/18- Last VHA
● 172.16.10111111.111111111🡺 172.16.191.255/18—BA
● 255.255.192.0
o 172.16.11000000.0/18- subnet 1
▪ 17.16.192.0/18
o
o
o 172.16.128.0/17 (172.16.128.0/18, 172.16.192.0/18)
● ..
● …
● …
● 172.16.110 11111.11111110 –
● 172.16.223.255 – BA
▪ ..
▪
o 172.16.11110000.0/20 -- subnet1(Subnet1)(Subnet1)
▪ 172.16.240.0/20 -- subnet1(Subnet1)(Subnet1)
o
✔ 4th – BR1- 2,000 Hosts - #HB = 11 - /21
▪ 172.16.240.0/20 -- subnet1(Subnet1)(Subnet1)
▪ 172.16.11110000.0/20
▪ 172.16.1111B000.0/21
▪ 172.16.11110000.0/21
▪ Br1-2000 hosts
● 172.16.11110000.00000000 /21—NA
●
● ..
● BA = 172.16.247.255/21
● SM= 255.255.248.0
▪ 172.16.11111000.0/21
o 172.16.11111000.0/21
o 172.16.11111B00.0/22
o 172.16.11111000.0/22
● 172.16.248.0/22 --- Br2- 1,000 hosts
● subnet1(Subnet1)(Subnet1) (Subnet1) (SUBnet0)
● BA= 172.16.251.255/22
●
o 172.16.11111100.0/22
● 172.16.252.0/22 subnet1(Subnet1)(Subnet1) (Subnet1)
(SUBnet1)
●
o
o
✔ 6th – Br2 – 500 hosts -- #HB= 9 --/23
● 172.16.252.0/22 subnet1(Subnet1)(Subnet1) (Subnet1)
(SUBnet1)
o 172.16.252.0/22
o 172.16.11111100.0/22
o 172.16.111111B0.0/23
o 172.16.11111100.0/23
● 172.16.252.0/23 -- subnet1(Subnet1)(Subnet1) (Subnet1)
(SUBnet1) (Subnet 0)
● Br2 – 500 hosts
● 172.16.252.0/23—NA
172.16.11111100.0/23
● 172.16.11111100.0000 0001/23 --- 172.16.252.1/23---1st vha
● ---
●…
● 172.16.11111101.11111110/23
o 172.16.253.254/23 --- last Vha
● BA= 172.16.253.255/23
o 172.16.11111110.0/23
● 172.16.254.0/23 --- subnet1(Subnet1)(Subnet1) (Subnet1)
(SUBnet1) (Subnet 1)
o
o
✔ HQ-br1– 2 hosts --#HB = 2 --/30
o 172.16.254.0/23 --- subnet1(Subnet1)(Subnet1) (Subnet1)
(SUBnet1) (Subnet 1)
o 172.16.11111110.0000 0000/23
o 172.16.1111111b.bbbbbb00/30
o 172.16.11111110.000000 00/30
o 172.16.254.0/30 -- subnet1(Subnet1)(Subnet1) (Subnet1)
(SUBnet1) (Subnet 0) --- HQ-BR1
▪
o 172.16.11111110.000001 00/30
▪ 172.16.254.4/30 --- HQ-BR2
▪ 172.16.254.4 --NA
▪
o
o
o
✔ HQ-Br2- 2 hosts= #HB=2--/30