the purpose of an IP address is to handle communication between devices that send and receive information across a network.
The IP address uniquely identifies every device on the network
EX Ping 192.168.1.5 IF This Host is available that means communication can be done
Private Addresses
CLASS-A 10.0.0.0 – 10.255.255.255
CLASS-B 172.16.0.0 – 172.31.255.255
CLASS-C 192.168.0.0 – 192.168.255.255
you can know at which class the address belong to from the first octet
Public Addresses range of IPs ISP can assign to Customer for global communication (internet)
Reserved Addresses
0.0.0.0/0 ( unspecified) 127.0.0.0 ( Loopback Address) 169.254.0.0 ( Automatic Private IP Address )
Multicast Addresses 223.0.0.0 – 239.255.255.255
Experimental 240-255
Network ID / Broadcast ID
128 64 32 16 8 4 2 1
1 0 1 0 1 0 0 0
Convert 168 to binary
Solution :
Is 168 ≥ 128? Yes, enter 1 in 128 position and subtract 128 (168-128=40)
Is 40 ≥ 64?
No, enter 0 in 64 position and move on
Is 40 ≥ 32?Yes, enter 1 in 32 position and subtract 32 (40-32=8)
Is 8 ≥ 16?No, enter 0 in 16 position and move on
Is 8 ≥ 8?Equal. Enter 1 in 8 position and subtract 8 (8-8=0)
No values left. Enter 0 in remaining binary positions
Class C 255.255.255.0 Or CIDR /24
Class B 255.255.0.0 Or CIDR /16
Class A 255.0.0.0 Or CIDR /8
255.255.255.128 /?
255.255.255.224 /?
255.255.255.248 /?
50 what is the binary Number
80 what is the binary Number
180 what is the binary Number
Host Requirement
2^h ≥ required Hosts “h” Number of Required Zero To get required Hosts
Network Requirement
2^n ≥ Required Network “n” Number of Required One To get required Subnets
192.168.10.0/24 Host requirement is—->30 hosts
2 ^h ≥30
2^5≥30 32 ≥ 30
I need 5 bits zero in the new subnet mask
Default mask is 255.255.255.0
New mask is 255.255.255.11100000 /27 Or 255.255.255.224
Block size ————–> last bit one value 2^5 32
1.192.168.10.0 /27
2.192.168.10.32 /27
3.192.168.10.64 /27
4.192.168.10.96 /27
5.192.168.10.128 /27
6.192.168.10.160/27
7.192.168.10.192/27
8.192.168.10.224/27
2 ^h ≥60
2^6≥60 64 ≥ 60
I need 6 bits zero in the new subnet mask
Default mask is 255.255.255.0
New mask is 255.255.255.11000000 /26 Or 255.255.255.192
Block size ————–> last bit one value 2^6 64
1.192.168.10.0 /26
2.192.168.10.64 /26
3.192.168.10.128 /26
4.192.168.10.192 /26
2 ^h ≥ 6
2^3≥ 6 8 ≥ 6
I need 3 bits zero in the new subnet mask
Default mask is 255.255.255.0
New mask is 255.255.255.11111000 /29 Or 255.255.255.248
Block size ————–> last bit one value 2^3 = 8
1.192.168.10.0 /29
2.192.168.10.8 /29
3.192.168.10.16 /29
4.192.168.10.24 /29
5.192.168.10.32 /29
6.192.168.10.40/29
7.192.168.10.48/29
8.192.168.10.56/29
………………………….
2 ^h ≥60
2^6≥30 64 ≥ 60
I need 6 bits zero in the new subnet mask
Default mask is 255.255.255.0
New mask is 255.255.255.11000000 /26 Or 255.255.255.192
Block size ————–> last bit one value 2^6 64
1.192.168.10.0 /26
2.192.168.10.64 /26
3.192.168.10.128 /26
4.192.168.10.192 /26
2 ^n ≥16
2^4≥16 16≥ 16
I need 4 bits ones in the new subnet mask
Default mask is 255.255.255.0
New mask is 255.255.255.11110000 /28 Or 255.255.255.240
Block size ————–> last bit one value 2^4 16
1.192.168.10.0 /28
2.192.168.10.16 /28
3.192.168.10.32 /28
4.192.168.10.48 /28
5.192.168.10.64 /28
6.192.168.10.80/28
7.192.168.10.96/28
8.192.168.10.128/28
……………………………..
2 ^n ≥2
2^1≥2 2 ≥ 2
I need 1 bit one in the new subnet mask
Default mask is 255.255.255.0
New mask is 255.255.255.10000000 /26 Or 255.255.255.128
Block size ————–>last bit one value 2^7 128
1.192.168.10.0 /25
2.192.168.10.128 /25
from the given network 192.168.0.0/24 find the new subnet mask that match 50 hosts requirment
2^h>required host 2^h> 50 2^6> 50 64 > 50 I need 6 bits zero in the new mask
old subnet mask : 255.255.255.0 the new mask is 255.255.255.1100000 = 255.255.255.192
block size 64
subnet 1
192.168.0.0 NID +64
192.168.0.1 First IP for interface G0/0
192.168.0.2 Second IP For Switch LAN-A
192.168.0.62 Last IP for PC-A
192.168.0.63 BID
subnet 2
192.168.0.64 NID +64
192.168.0.65 First IP for interface G0/1
192.168.0.66 Second IP For Switch LAN-B
192.168.0.126 Last IP for PC-B
192.168.0.127 BID
subnet 3 (For future use)
192.168.0.128 NID +64
192.168.0.129 First Valid
192.168.0.130 Second Valid
192.168.0.190 LAST Valid
192.168.0.191 BID
subnet 4 (For Future use)
192.168.0.192 NID
192.168.0.193 First Valid
192.168.0.194 Second Valid
192.168.0.254 Last Valid
192.168.0.255 BID
Router Configuration :
enable
conf t
interface g0/0
no shutdown
ip address 192.168.0.1 255.255.255.192
interface g0/1
no shutdown
ip address 192.168.0.65 255.255.255.192
—————————————————
switch LAN A Configuration:
enable
conf t
interface vlan 1
no shutdown
ip address 192.168.0.2 255.255.255.192
exit
ip default-gateway 192.168.0.1
——————————————————
switch LAN B Configuration :
enable
conf t
interface vlan 1
no shutdown
ip address 192.168.0.66 255.255.255.192
exit
ip default-gateway 192.168.0.65
from the given network 192.168.100.0/24 find the new subnet mask for this requirement [25 hosts]
255.255.255.0 what is the new subnet mask
2^5>required host 2^5>25 32 > 25 I need 5 bits zero in the new subnet mask
255.255.255.11100000 what is the block size? 32
255.255.255.224
subnet 0
192.168.100.0 NID +32
192.168.100.1 first valid
192.168.100.2
192.168.100.30 last valid
192.168.100.31 BID
subnet 1
192.168.100.32 NID +32
192.168.100.33 Fist valid host
192.168.100.34
192.168.100.62 last valid
192.168.100.63 BID
subnet 2
192.168.100.64 NID +32
192.168.100.65 first valid
192.168.100.66
192.168.100.94 LAST valid
192.168.100.95 BID
subnet 3
192.168.100.96 NID +32
192.168.100.97 First Valid
192.168.100.98
192.168.100.126 Last valid
192.168.100.127 BID
R1 Configuration
enable
conf t
interface g0/0
no shutdown
ip address 192.168.100.1 255.255.255.224
interface g0/1
no shutdown
ip address 192.168.100.33 255.255.255.224
————————————————
S3 configuration
enable
conf t
interface vlan 1
no shutdown
ip address 192.168.100.66 255.255.255.224
exit
ip default-gateway 192.168.100.65
————————————————–
PC4 Configuration
192.168.100.126
255.255.255.224
192.168.100.97