Network Kings


$999 $499 only For All Access Pass Today! USE PROMO CODE : LIMITED

d :
h :

In this lesson, we will learn IP address concept in detail.

What is IP address?

An IP address stands for internet protocol address. IP address is a unique identity of a device.  It means it uniquely identifies a device on the internet. Every device requires an IP address to connect to internet. Without an IP address a device can’t access internet. So, this way you can understand the importance of IP address in computer networking.

IP address is a string of binary numbers in the form of 1 and 0.

Ex- 10101110 11110011 11111000 00101010

This is an example of 32 bit IPv4 address. Similar way in IPv6, we have 128 bits.

In above example we divided 32 bits into 4 pairs. Each pair consist 8 bits. (8bits = 1 octet).

So, in IPv4 we have 4 octets.

Decimal dotted representation of above IP –

Note: In binary number system we have only two bits 1 and 0. So, whenever you read data in binary format or something like that it means it is in the form of 1’s and 0’s.

2 Types of IP Address

IPv4 address (32 bits address)

IPv6 Address (128 bits address)

Note: Here v stands for version. So, we can expand like that IP version 4 and IP version 6.

How I can check IP address of my computer (for windows)?

1st method

  1. Go to the desktop, now type cmd in the window search bar and hit enter button.
  2. After that command prompt screen will be open.
  3. Look carefully, there will be a cursor blinking, now just type ipconfig.

2nd method

  1. Go to the desktop, now type “ncpa.cpl” in the window search bar and hit enter.
  2. Now a dialog box will appear on your screen to shows network connection.
  3. Click on the network from which you are connected, then a dialog box will appear.
  4. In this dialog box, there is a detail option, click on that.
  5. Now you able to see the IP address of your computer.

What are the classes of IPv4 Addresses?

IPv4 Addresses are divided into 5 Classes, These are divided by IANA :- Internet Assigned Number authority.

  1. Class A (1-126)
  2. Class B (128-191)
  3. Class C (192-223)
  4. Class D (224-240)
  5. Class E (241-239)

Class A, Class B and Class C IP address are used to assign IP to hosts (a host can be a router, switch, PC, mobile)

Class D IP address are used for multicasting purpose.

Class E IP address reserved for future use, but these address are not compatible with any device, so now they are wasted.

Now we will discuss some important parameters that are very important:

IPv4 address has 32 bits.

Ex- 10101110 11110011 11111000 00101010

For Class A-

  • First 8 bits are network bits and rest 24 bits are host bits.
  • Subnet mask for Class A:
  • Prefix length: 8 (prefix length represents the no. of network bits.)

For Class B-

  • First 16 bits represent network bits and remaining 16 bits represent host bit.
  • Subnet mask for class B:
  • Prefix length: 16

For Class C-

  • First 24 bits are network bits and remaining 8 bits are host bits.
  • Subnet Mask for class C:
  • Prefix length: 24


Leading bits

 Network bits

Host bits

No. of Networks

Addresses per Network



















How to Calculate Subnet Mask?

It is a very easy process, once you will learn the method then you will calculate for any prefix length.

Replace all the network bits by 1 and all the host bits by 0.

Now we will do 1 problem to understand this in more clear way-

  1. – (Class C address with prefix length 24. As I told you earlier prefix length represents network bits. So, here we have 24 network bits and 8 host bits.)
  2. First perform binary to decimal conversion.

192 .    168       . 1           .   0


  1. Now replace all network bits by 1 and all host bit by 0.


  1. Now again perform binary to decimal conversion and here we have

How we recognize the IP address class?

By looking at the first octet, you can recognize the class of an IP address.

For Class A: first binary octet is 0xxxxxxx. Here, you can see for Class A first bit of first octet is 0. Here x means it could be either 0 or 1.

In decimal notation, first octet always will be lies in the range of 1 – 126. And rest lie in the range of 0-255. First octet decimal range is 1 -126.

For Class B: first binary octet is 10xxxxxx. So, you can see for Class B first 2 bits of first octet always will be 10.

Decimal Octet range: 128-191

For Class C: First binary octet always will be 110xxxxx.

Decimal Octet range is 192-223.

For Class D: First binary octet always will be 1110xxxx.

For Class E: First binary octet always will be 1111xxxx.

Although, Class D and Class E address will not used in configuration.

What is Public IP?

Public IP is provided by Internet service provider (ISP). Public IP is globally unique. A host with private IP can’t go to the internet. So, whenever a host sitting in our LAN network, want to go on internet, first router performs NAT to convert private into public IP then it forwards the request to the internet.

What is Private IP?

Private IP is used in LAN network only. Sometimes, private IP also called LAN addresses. Private IP is uniquely defined in a LAN network. It means inside a LAN network, you can’t assign same IP address to 2 different hosts. Although, you can assign same IP address in 2 different LAN networks.

There are certain addresses in each class of IP address that are reserved for Private Networks.

Class A to

Class B to

Class C to

What is static IP?

Static IP is not a type of IP, it’s kind of terminology. When an IP address is manually configured in a host then it is called as static IP. And the reason is manually configured IP will not change until you change it manually. We mostly configure IP address manually in routers and switches.

What is Dynamic IP?

When an IP address is configured through DHCP then it is called as dynamic IP. Mainly for LAN network we configure DHCP server. DHCP server automatically assigns the IP to the hosts.

What is APIPA address?

APIPA stands for Automatically Private IP Address Assignment. When DHCP server fails, automatically an IP address is generated and this address is called as APIPA address. APIPA assigns a class B address, range from to

Expected Interview questions from IP addressing concept are- (for freshers)

  1. What is a bit? ( I know this is very basic question, but I remember in one of my interview, interviewer asked this question.)

So, I answered bit is the smallest unit of data. In binary we have 2 bits that are 1 and 0.

  1. How many bits in IPv4 address?
  2. How many bits in IPv6 Address?
  3. How many classes in IPv4 Address? Define all classes with their address range.
  4. What are public IP and Private IP?
  5. What are static IP and Dynamic IP?