Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Wednesday, April 5, 2017

IPv4 VLSM

VLSM(Variable length subnet mask)
VLSM is a process of dividing the network into different network having variable length subnet mask is called VLSM.
Ex: we need public IPs to three offices in country one is the main office in KLD and other two are branches of main office in KLP and KLJ. 124 IPs for KLD, 57 IPs for KLJ, 27 IPs for KLP.
Now we perform VLSM in 200.0.0.0/24 255.255.255.0 network.
200.0.0.00000000/25 mask: 255.255.255.128
Total subnets: 21=2. Total host in each subnet: 27-2=126.
Network ID: 200.0.0.0/25 mask: 255.255.255.128 we give it to Kabul.
1st IP: 200.0.0.1 === last IP: 200.0.0.126 === broadcast IP: 200.0.0.127 (end of Kabul IPs).
N/2 ID: 200.0.0.128/25 === 1st IP: 200.0.0.129 === last IP: 200.0.0.254 === broadcast IP: 200.0.0.255.
200.0.0.00000000/26 mask: 255.255.255.192
Total subnets: 22=4. Total host in each subnet: 26-2=62.
Network: 200.0.0.0/26 mask: 255.255.255.192 === 1st IP: 200.0.0.1 === last IP: 200.0.0.62 === broadcast IP: 200.0.0.63 === N/w ID: 200.0.0.64 === 1st IP: 200.0.0.65 === last IP: 200.0.0.126 === broadcast IP: 200.0.0.127 === (we give this network to KLJ office) N/W ID: 200.0.0.128 mask: 255.255.255.192 === 1st IP: 200.0.0.129 === last IP: 200.0.0.190 === broadcast IP: 200.0.0.191 (end of KLJ IPs) === N/W ID: 200.0.0.192 === 1st IP: 200.0.0.193 === last IP: 200.0.0.254 === broadcast IP: 200.0.0.255.
200.0.0.00000000/27 mask: 255.255.255.224
Total subnets: 23=8. Total host in each network: 25-2=30.
Network: 200.0.0.0/27 mask: 255.255.255.224 === 1st IP: 200.0.0.1 === last IP: 200.0.0.30 === broadcast IP: 200.0.0.31 === N/W ID: 200.0.0.32 === 1st IP: 200.0.0.33 === last IP: 200.0.0.62 === broadcast IP: 200.0.0.63 === N/W ID: 200.0.0.64 === 1st IP: 200.0.0.65 === last IP: 200.0.0.94 === broadcast IP: 200.0.0.95 === N/W ID: 200.0.0.96 === 1st IP: 200.0.0.97 === last IP: 200.0.0.126 === broadcast IP: 200.0.0.127 === N/W ID: 200.0.0.128 === 1st IP: 200.0.0.129 === last IP: 200.0.0.158 === broadcast IP: 200.0.0.159 === N/W ID: 200.0.0.160 === 1st IP: 200.0.0.161 === last IP: 200.0.0.190 === broadcast IP: 200.0.0.191 === (we give this network ID to KLP office)N/W ID: 200.0.0.192 mask: 255.255.255.224 === 1st IP: 200.0.0.193 === last IP: 200.0.0.222 === broadcast IP: 200.0.0.223( end of KLP IPs) === N/W ID: 200.0.0.224 === 1st IP: 200.0.0.254 === last IP: 254 === broadcast IP: 255.
KLD Network ID: 200.0.0.0 mask: 255.255.255.128
KLJ Network ID: 200.0.0.128 mask: 255.255.255.192

KLP Network ID: 200.0.0.192 mask: 255.255.255.224

Easy Subnetting

SUBNETTING
Increasing the number of network bits and decreasing the number of host bits is called subnetting.
Class C: In class c we can subnet from 1 to 6.
One bit subnetting: 192.168.0.00000000/25 mask: 255.255.255.128
Total subnets: 21=2. Total host in each subnet: 27-2=126.
We minus last subnet mask value from 256 to find next subnet id. Ex: 256-128=128. Or Network id+ total host= last IP.
Two bits subnetting: 192.168.0.00000000/26 mask: 255.255.255.192
Total subnets: 22=4. Total host in each subnet: 26-2=62.
Three bits subnetting: 192.168.0.00000000/27 mask: 255.255.255.224
Total subnets: 23=8. Total host in each subnet: 25-2=30.
Four bits subnetting: 192.168.0.00000000/28 mask: 255.255.255.240
Total subnets: 24=16. Total host in each subnet: 24-2=14.
Five bits subnetting: 192.168.0.00000000/29 mask: 255.255.255.248
Total subnets: 25=32. Total host in each subnet: 23-2=6.
Six bits subnetting: 192.168.0.00000000/30 mask: 255.255.255.252

Total subnets: 26=64. Total host in each subnet: 22-2=2.
Class B: In class b we can subnet from 1 to 14.
One bit subnetting: 172.16.00000000.0/17 mask: 255.255.128.0
Total subnets: 21=2. Total host in each subnet: 215-2=32766.
Two bits subnetting: 172.16.00000000.0/18 mask: 255.255.192.0
Total subnets: 22=4. Total host in each subnet: 214-2=16382.
Three bits subnetting: 172.16.00000000.0/19 mask: 255.255.224.0
Total subnets: 23=8. Total host in each subnet: 213-2=8190.
Four bits subnetting: 172.16.00000000.0/20 mask: 255.255.240.0
Total subnets: 24=16. Total host in each subnet: 212-2=4094.
Five bits subnetting: 172.16.00000000.0/21 mask: 255.255.248.0
Total subnets: 25=32. Total host in each subnet: 211-2=2046.
Six bits subnetting: 172.16.00000000.0/22 mask: 255.255.252.0
Total subnets: 26=64. Total host in each subnet: 210-2=1022.
Seven bits subnetting: 172.16.00000000.0/23 mask: 255.255.254.0
Total subnets: 27=128. Total host in each subnet: 29-2=510.
Eight bits subnetting: 172.16.00000000.0/24 mask: 255.255.255.0
Total subnets: 28=256. Total host in each subnet: 28-2=254.
Nine bits subnetting: 172.16.0.00000000/25 mask: 255.255.255.128
Total subnets: 29=512. Total host in each subnet: 27-2=126.
Ten bits subnetting: 172.16.0.00000000/26 mask: 255.255.255.192
Total subnets: 210=1024. Total host in each subnet: 26-2=62.
Eleven bits subnetting: 172.16.0.00000000/27 mask: 255.255.255.224
Total subnets: 211=2048. Total host in each subnet: 25-2=30.
Twelve bits subnetting: 172.16.0.00000000/28 mask: 255.255.255.240
Total subnets: 212=4094. Total host in each subnet: 24-2=14.
Thirteen bits subnetting:172.16.0.00000000/29 mask: 255.255.255.248
Total subnets: 213=8192. Total host in each subnet: 23-2=6.
Fourteen bits subnetting:172.16.0.00000000/30 mask: 255.255.255.252
Total subnets: 214=16384. Total host in each subnet: 22-2=2.
Class A: In class A we can subnet from 1 to 22.
One bit subnetting: 10.00000000.0.0/9 mask: 255.128.0.0
Total subnets: 21=2. Total host in each subnet: 223-2=8388606.
Two bits subnetting: 10.00000000.0.0/10 mask: 255.192.0.0
Total subnets: 22=4. Total host in each subnet: 222-2=4194302.
Three bits subnetting: 10.00000000.0.0/11 mask: 255.224.0.0
Total subnets: 23=8. Total host in each subnet: 221-2=2097150.
Four bits subnetting: 10.00000000.0.0/12 mask: 255.240.0.0
Total subnets: 24=16. Total host in each subnet: 220-2=1048574.
Five bits subnetting: 10.00000000.0.0/13 mask: 255.248.0.0
Total subnets: 25=32. Total host in each subnet: 219-2=524286.
Six bits subnetting: 10.00000000.0.0/14 mask: 255.252.0.0
Total subnets: 26=64. Total host in each subnet: 218-2=262142.
Seven bits subnetting: 10.00000000.0.0/15 mask: 255.254.0.0
Total subnets: 27=128. Total host in each subnet: 217-2=131070.
Eight bits subnetting: 10.00000000.0.0/16 mask: 255.255.0.0
Total subnets: 28=256. Total host in each subnet: 216-2=65534.
Nine bits subnetting: 10.0.00000000.0/17 mask: 255.255.128.0
Total subnets: 29=512. Total host in each subnet: 215-2=32766.
Ten bits subnetting: 10.0.00000000.0/18 mask: 255.255.192.0
Total subnets: 210=1024. Total host in each subnet: 214-2=16382.
Eleven bits subnetting: 10.0.00000000.0/19 mask: 255.255.224.0
Total subnets: 211=2048. Total host in each subnet: 213-2=8190.
Twelve bits subnetting: 10.0.00000000.0/20 mask: 255.255.240.0
Total subnets: 212=4096. Total host in each subnet: 212-2=4094.
Thirteen bits subnetting:10.0.00000000.0/21 mask: 255.255.248.0
Total subnets: 213=8192. Total host in each subnet: 211-2=2046.
Fourteen bits subnetting:10.0.00000000.0/22 mask: 255.255.252.0
Total subnets: 214=16384. Total host in each subnet: 210-2=1022.
Fifteen bits subnetting:10.0.00000000.0/23 mask: 255.255.254.0
Total subnets: 215=32768. Total host in each subnet: 29-2=510.
Sixteen bits subnetting:10.0.00000000.0/24 mask: 255.255.255.0
Total subnets: 216=65536. Total host in each subnet: 28-2=254.
Seventeen bits subnetting:10.0.0.00000000/25 mask: 255.255.255.128
Total subnets: 217=131072. Total host in each subnet: 27-2=126.
Eighteen bits subnetting:10.0.0.00000000/26 mask: 255.255.255.192
Total subnets: 218=262144. Total host in each subnet: 26-2=62.
Nineteen bits subnetting:10.0.0.00000000/27 mask: 255.255.255.224
Total subnets: 219=524288. Total host in each subnet: 25-2=30.
Twenty bits subnetting: 10.0.0.00000000/28 mask: 255.255.255.240
Total subnets: 220=1048576. Total host in each subnet: 24-2=14.
Twenty one bits subnetting:10.0.0.00000000/29 mask: 255.255.255.248
Total subnets: 221=2097152. Total host in each subnet: 23-2=6.
Twenty two bits subnetting:10.0.0.00000000/30 mask: 255.255.255.252
Total subnets: 222=4194304. Total host in each subnet: 22-2=2.

Tuesday, April 4, 2017

IPV4 Addresses

IPv4 Addresses
IP addresses develop by IETF (Internet Engineering Task Force).

IP is network layer routed protocol, which are use for numeric identification of a device on TCP/IP network.
  • Binary numeric system: represent data in bits 0 or 1
  • Decimal numeric system: represent data in digits, 0-9
  • Hexa decimal numeric system: represent data in 0-9 and A-F

Mac address is a hexa decimal format, which consist of 12 hexa (48 bits). 1 Hexa=4bits. Authorized by IEEE (Institute of Electrical Electronic Engineering).
  • First 6 hexa of Mac address called OUI (Organization Unique Identifier), we can’t change it
  • Second 6 hexa of Mac address called vender assign numbers

We have five classes of IP addresses: A, B, C, D, E

Class A: Range (0-127). Rule: first bit of first byte must be off, at least one bit from the remaining must be on. Ex: 01000000.
Total network and host in class A: 2n-1, where n=number of network bits. 28-1 -2=27-2=126 (networks).
2P-2, where p=number of host bits. 224 -2=16777214 (hosts).
Class B: Range (128-191). Rule: first bit of first byte must be on second bit of first byte must be off, remaining bits may be on or off. Ex: 10111001.
Total network and host in class B: 2n-2, where n=number of network bits. 216-2=214 =16384  (networks).
2P-2, where p=number of host bits. 216-2=65534 (hosts).
Class C: Range (192-223). Rule: first bit of first byte must be on second bit of first byte must be on third bit of first byte must be off, at least the remaining bits may be on or off. Ex: 11010000.
Total network and host in class C: 2n-3, where n=number of network bits. 224-3=221=2097152 (networks).
2P-2, where p=number of host bits. 28-2=254 (hosts).
Class D: Range (224-239). Use for multicasting, no network and host portion.
Class E: Range (240-255). Reserved for IETF, use for research purposes. No network and no host portion.
Subnet mask: Define the network and host portion, in subnet mask on bits are called network portion and off bits are called host portion.
Ex: 192.168.1.0 255.255.255.0/24
CIDR: (Classless inter domain routing) or Prefix, /24.
Private and Public IPs
Private IPs: 192.168.0.0-192.168.255.255, 172.16.0.0-172.31.255.255, 10.0.0.0-10.255.255.255. Except these IPs all IPs are called Public IPs.
Understanding the power of 2: Power of 2 is important to understand and memorize for use with IP subnetting.
21=2, 22=4, 23=8, 24=16, 25=32, 26=64, 27=128, 28=256, 29=512, 210=1024, 211=2048, 212=4096, 213=8192, 214=16384 etc.