Skip to main content

IPv4 Address Calculation for beginners

Internet Protocol version 4 (IPv4)

  • 32 bit address
    • Example : 11000000 10101000 01100100 00000001
  • Divided into 4 groups
  • So each group contains 8 bits.
  • To separate groups we use PERIODS
    • Example : 11000000 . 10101000 . 01100100 . 00000001
  • The format of IP address is dotted decimals
    • We have to convert those binary bits in numbers (decimals).
    • Example : 192 . 168 . 100 . 1
Starting number of each group must be 00000000 (0)
Ending number of each group must be 11111111 (255).

1

Classes of IP Address



How to Find Class of an IP Address?

2
Class Range Size Hosts
A 1 – 126 Large 16,777,214
B 128 – 191 Medium 65,534
C 192 – 223 Small 254
D 224 – 239 Reserved
E 240 – 254 Reserved
The Class D IP address is reserved for Multicast.

The IP address starting 0, 127, 255 are also reserved. The IP address starting with 127 is reserved for loopback address.

Parts of IP Address

The IP address does contain 2 parts. One is Network Part and another is Host Part.

3

But Network part and Host part will be vary with each class.

4

Class A has 8 bits of Network Part and 24 bits of Host Part.
Class B has 16 bits of Network Part and 16 bits of Host Part.
Class C has 24 bits of Network Part and 8 bits of Host Part.

When a design a network, The Network part of all IP address must be command and host part must be unique.

7

What is Subnet Mask?



Subnet Mask is used by networking devices to find out the network and host bits of IP address.
The Subnet Mask is contiguous. First Network bits and then Host bits.
For Subnet Mask: Network bits are 1’s and Host bits are 0’s

Example:

5 

Number of hosts:



We have a formula to find out the number of hosts in each class. And the formula is  2n – 2.
And the value of n is  number of hosts bits.
Class A 224 – 2 16,777,214
Class B 216 – 2 65,534
Class C 28 – 2 254


Reserved Address is Every Network.

In Every Network there are 2 address are reserved and that’s why we minus 2 from finding number of host addresses. One is used for Routing and we call it as Network Address and another one is used for local broadcast and we call it as Broadcast Address.

For Network Address, the network part are same as the network part IP address but the host bits of IP were 0.

8
For Broadcast Address, the network part are same as the network part IP address but the host bits of IP were 1.

9

Exercise 1

In this exercise we can find out subnet mask, network broadcast address, valid ip range of the network, and number of host on the network of Class C IP address.

IP Address – 192.168.100.14

The Above IP address belong to Class C.

Then the subnet mask is 255.255.255.0.

Ok. The first 3 groups of this IP address (not subnet mask) is host bits and the last group is host part.

Then Network Address must be : 192.168.100.0
Because all bits in the last group were 0’s : 192.168.100. 00000000
The Broadcast Address must be : 192.168.100.255
Because all bits in the last group were 1’s : 192.168.100. 11111111

The Network IP range must be from 192.168.100.1 to 192.168.100.254
Number of Host : 28 – 2 = 254.
Exercise 2

In this second exercise we can find out subnet mask, network broadcast address, valid ip range of the network, and number of host on the network of class B address.

IP Address – 172.16.100.55

The Above IP address belong to Class B.

Then the subnet mask is 255.255.0.0.

Ok. The first 3 groups of this IP address (not subnet mask) is host bits and the last group is host part.

Then Network Address must be : 172.16.0.0
Because all bits in the last group were 0’s : 172.16. 00000000 . 00000000
The Broadcast Address must be : 172.16.255.255
Because all bits in the last group were 1’s : 172.16. 11111111 . 11111111

The Network IP range must be from 172.16.0.1 to 172.16.255.254
Number of Host : 216 – 2 = 65534.

Exercise 2

In this second exercise we can find out subnet mask, network broadcast address, valid ip range of the network, and number of host on the network of class A address.

IP Address – 10.56.42.5

The Above IP address belong to Class A.

Then the subnet mask is 255.0.0.0.

Ok. The first 3 groups of this IP address (not subnet mask) is host bits and the last group is host part.

Then Network Address must be : 10.0.0.0
Because all bits in the last group were 0’s : 10. 00000000 . 00000000 . 00000000
The Broadcast Address must be : 10.255.255.255
Because all bits in the last group were 1’s : 10. 11111111 . 11111111 . 11111111

The Network IP range must be from 10.0.0.1 to 10.255.255.254
Number of Host : 28 – 2 = 16,777,254.
The End

Comments

  1. There is an error in last excercise.

    "Number of Host : 28 – 2 = 16,777,254. "

    Anyways thanks for nice tutorial it helped me a lot. :)

    ReplyDelete
  2. A very enlightening and descriptive guide for the beginners, it surely was a little bit hard but I really understood a lot from this post.

    ReplyDelete

Post a Comment

Popular posts from this blog

New Questions in CCNA 200-120 (HSRP, VRRP, NetFlow, SNMP)

The below are mock questions that were about to appear in exam CCNA 200-120. Updated : 14 th October 2013 Download the Latest 200-120 dumps : Click Here This file requires Visual Cert Exam Suite: Click Here Download the latest 200-120 dumps in DOCX format : Chapter 1 , Chapter 2 , Chapter 3 , Chapter 4 , Chapter 5, Chapter 6, Chapter 7, Chapter 8 , Chapter 9, Chapter 10, Chapter 11, Chapter 12 CCNA EIGRP Simulation CCNA ACL2 Simulation Question 1 Which three are the components of SNMP? (Choose three) A. MIB B. SNMP Manager C. SysLog Server D. SNMP Agent E. Set Answer : A, B, D Question 2 What are the Popular destinations for syslog messages to be saved? A. Flash B. The logging buffer .RAM C. The console terminal D. Other terminals E. Syslog server Answer: B, C, E Question 3 Syslog was configured with a level 3 trap. Which 3 types of logs would...

Cisco Packet Tracer Multi User Connection

Multiuser communication allows multiple point-to-point (peer) connections between multiple instances of Packet Tracer. By allowing communication between Packet Tracer instances, a new door has been opened to a fun, interactive, social, collaborative, and competitive learning environment. Instructors will now be able to create a variety of activities for students to learn in groups that will facilitate greater social interaction between students. Students will benefit from this environment by working together to solve problems and share ideas. Both students and teachers should take full advantage that Multiuser will offer in their learning environment. Technical Information Communicates between instances using PTMP. PTMP is TCP based. By default, uses TCP port 38000, is customizable, and each new instances on the same PC will use the next available port. On by default. UPnP will attempt to establish port forwarding to facilitate home networks. All network co...

CCNA RIPv2 Simulation

Central Florida Widgets recently installed a new router in their Apopka office. Complete the network installation by performing the initial router configurations and configuring RIPv2 routing using the router command line interface (CLI) on the Apopka router. To configure the router (Apopka) click on the console host icon that is connected to a router by a serial console cable (shown in the diagram as a dashed black line). Each of the windows can be minimized by clicking on the [-]. You can also reposition a window by dragging it by the title bar. The “Tab” key and most commands that use the “Control” or “Esc” keys are not supported and are not necessary to complete this simulation. The help command does not display all commands of the help system. Configure the router per the following requirements: Name of the router is Apopka Enable-secret password is ish555ana The password to access user EXEC mode using the console is New2Rtr The password to allow te...