🌐 What is IPv4?

IPv4 (Internet Protocol Version 4) is a Layer 3 (Network Layer) protocol used to uniquely identify devices on a network.

It provides:

  • Logical addressing
  • Routing between networks
  • Packet delivery

IPv4 address length = 32 bits

 

📌 1. Structure of IPv4 Address

An IPv4 address is divided into:

  • 4 Octets
  • Each octet = 8 bits
  • Total = 8 × 4 = 32 bits

Example:

192.168.1.10

Each number (192, 168, 1, 10) is called an octet.

 

🔢 2. Binary Representation

Each octet ranges from:

00000000  →  0
11111111  →  255

Example:

IP Address:

192.168.1.10

Binary form:

192  = 11000000
168  = 10101000
1    = 00000001
10   = 00001010

Full binary:

11000000.10101000.00000001.00001010

 

🧩 3. Network Portion & Host Portion

An IPv4 address has two main parts:

  1. Network ID → Identifies the network
  2. Host ID → Identifies the device inside the network

Example:

192.168.1.10/24

  • /24 means first 24 bits = Network
  • Remaining 8 bits = Host

So:

  • Network: 192.168.1.0
  • Host: 10

 

🎯 4. Why IPv4 is 32-bit?

When IPv4 was designed in the early Internet era:

  • 32 bits allow:
    2³² = 4,294,967,296 addresses

IPv4 was introduced in 1981 under:
👉 Internet Engineering Task Force (IETF)

Documented in:
👉 RFC 791

 

🧠 5. Address Format Types

IPv4 uses Dotted Decimal Notation:

Decimal format → 192.168.1.1
Binary format  → 11000000.10101000.00000001.00000001

Each octet value range:

BitsDecimal Range
8 bits0 – 255

 

📊 Visual Structure

 

🌐 Types of IPv4 Addresses (Public, Private, Loopback, APIPA)

Here we classify IPv4 addresses based on their usage and scope.

The main types are:

  1. Public IP Address
  2. Private IP Address
  3. Loopback Address
  4. APIPA (Automatic Private IP Addressing) / Link-Local Address

 

1️⃣ Public IP Address

📌 Definition

A Public IP address is an IP address that is:

  • Globally unique
  • Routable on the Internet
  • Assigned by ISP
  • Used for communication over the Internet

It allows devices to communicate outside their local network.

Public IPs are managed by:

👉 Internet Assigned Numbers Authority (IANA)

And distributed by ISPs.

 

🌍 Example

8.8.8.8
142.250.183.14

(Example: 8.8.8.8 belongs to Google DNS)

 

📦 Characteristics

  • Must be unique globally
  • Assigned by ISP
  • Internet routable
  • Can be static or dynamic
  • Used by web servers, mail servers, etc.

 

🔁 There are 5 classes in Public IPv4 address :-

  • Class A (Unicast) - 1.0.0.0 to 126.255.255.255 
  • Class B (Unicast) - 128.0.0.0 to 191.255.255.255
  • Class C (Unicast) - 192.0.0.0 to 223.255.255.255
  •  Class D (Multicast) - 224.0.0.0 to 239.255.255.255
  •  Class E (Experimental) - 240.0.0.0 to 255.255.255.255

 

🔁 Types of Public IP

  1. Static Public IP → Does not change
  2. Dynamic Public IP → Changes periodically

 

2️⃣ Private IP Address

📌 Definition

A Private IP address is:

  • Used inside local networks (LAN)
  • Not routable on the Internet
  • Free to use
  • Reusable in different networks

Private IP ranges are defined in:

👉 RFC 1918

📌 Private IP Ranges

ClassRange
Class A10.0.0.0 – 10.255.255.255
Class B172.16.0.0 – 172.31.255.255
Class C192.168.0.0 – 192.168.255.255

📦 Why Private IP?

Because IPv4 addresses are limited (2³² ≈ 4.3 Billion).

To save public IPs, private IPs are used internally and converted using:

👉 NAT (Network Address Translation)

 

🎯 Example

Your home network:

192.168.1.10
192.168.1.20

These are private IPs.

Router converts them into one public IP to access Internet.

 

3️⃣ Loopback Address

📌 Definition

A Loopback IP address is used:

  • To test TCP/IP stack
  • To test local machine
  • For troubleshooting

It sends traffic back to the same device.

 

📌 Range

127.0.0.0 – 127.255.255.255

Most common:

127.0.0.1

Called:

👉 Localhost

 

📦 Purpose

  • Testing network services
  • Checking if IP stack is working
  • Used internally by OS

Example:

ping 127.0.0.1

If reply comes → TCP/IP stack working

 

4️⃣ APIPA / Link-Local Address

📌 Definition

APIPA stands for:

Automatic Private IP Addressing

Also called:

Link-Local Address

It is automatically assigned when:

  • DHCP server is not available
  • Device cannot get IP from DHCP

 

📌 Range

169.254.0.0 – 169.254.255.255

 

📦 How It Works

  1. Device requests IP from DHCP
  2. No response received
  3. System assigns IP from 169.254.x.x
  4. Device can communicate only within same network

It cannot access Internet.

 

📌 Used In

  • Small peer-to-peer networks
  • Temporary communication
  • Troubleshooting

 

1️⃣ What is a Subnet Mask?

📌 Definition

A Subnet Mask is a 32-bit number used to:

Separate the Network portion and Host portion of an IP address.

It tells us:

  • Which part identifies the network
  • Which part identifies the host

 

📌 Example

IP Address:

192.168.1.10

Subnet Mask:

255.255.255.0

Here:

  • 192.168.1 → Network
  • 10 → Host

 

🔹 Why 255?

Because:

255 = 11111111 (in binary)

Binary rule:

  • 1 = Network bit
  • 0 = Host bit

Example:

255.255.255.0
11111111.11111111.11111111.00000000

So:

  • First 24 bits = Network
  • Last 8 bits = Host

 

📌 Common Default Subnet Masks

ClassDefault Mask
A255.0.0.0
B255.255.0.0
C255.255.255.0

 

2️⃣ What is CIDR?

CIDR = Classless Inter-Domain Routing

It was introduced to:

  • Replace classful addressing
  • Use IP addresses efficiently
  • Reduce IP wastage

 

📌 CIDR Notation Format

Instead of writing subnet mask like:

255.255.255.0

We write:

/24

This means:

24 bits are network bits.

 

📌 Example

192.168.1.10/24

Means:

  • 24 bits network
  • 8 bits host

Because:

/24 = 255.255.255.0

 

3️⃣ CIDR to Subnet Mask Table

CIDRSubnet Mask
/8255.0.0.0
/16255.255.0.0
/24255.255.255.0

 

🔹 4️⃣ Why CIDR is Important?

Before CIDR:

  • Only Class A, B, C fixed sizes
  • Many IPs wasted

After CIDR:

  • Flexible network size
  • Better IP utilization
  • Used in modern networking

 

🔹 5️⃣ Simple Example

If we write:

192.168.1.0/26

/26 means:

26 bits network
6 bits host

Hosts available:

2⁶ - 2 = 62 host

👉 Start your IT journey with our 45 Days Job-Oriented Internship – Learn Networking, Subnetting & Real IT Skills!

https://www.evisiontechnoserve.com/internships/it/45-days-job-internship-program-live