IPv4 Addressing - Classful Addressing

What is Classful addressing?

Classful addressing is an IP addressing method that divides the IP address space into fixed classes (A, B, C, D, and E), each with a predefined range and default subnet mask.

Why is Classful addressing useful?

Classful addressing provided a simple and structured way to allocate IP addresses in the early days of the internet. It helped standardize IP address assignment.

How it works?

IP addresses are divided into five classes based on their first few bits. Each class has a default subnet mask and a predefined range of network and host bits.

Where is Classful addressing used?

Classful addressing was used in early IP networks before the introduction of CIDR. It is now largely obsolete but still appears in legacy systems and educational contexts.

Which OSI layer does this protocol belong to?

Classful addressing operates at the Network Layer (Layer 3), as it deals with IP addressing and routing.

Is Classful addressing Windows specific?

No, Classful addressing is not Windows specific. It is a general IP addressing concept applicable to any system implementing IP.

Is Classful addressing Linux specific?

No, Classful addressing is not Linux specific. It is supported on all operating systems that use the IP protocol, although it is now outdated.

Which Transport Protocol is used by Classful addressing?

Classful addressing is not tied to any transport protocol. It is used with IP and can work with both TCP and UDP.

Which Port is used by Classful addressing?

Classful addressing does not use any specific port. It defines IP address structure, not application-layer communication.

Is Classful addressing using client-server model?

No, Classful addressing is an addressing method and not a communication protocol. It does not follow the client-server model.

What are the different classes in Classful addressing?

The classes are A, B, C, D, and E, each defined by a range of IP addresses and default subnet masks.

What is the default subnet mask for Class A?

The default subnet mask for Class A is 255.0.0.0 or /8.

What is the default subnet mask for Class B?

The default subnet mask for Class B is 255.255.0.0 or /16.

What is the default subnet mask for Class C?

The default subnet mask for Class C is 255.255.255.0 or /24.

What is Class D used for?

Class D addresses are reserved for multicast groups.

What is Class E used for?

Class E addresses are reserved for experimental and future use.

Why is Classful addressing considered inefficient?

It leads to wasted IP addresses because networks must use predefined sizes regardless of actual need.

How does Classful addressing determine network and host portions?

The class of the IP address defines which bits represent the network and which represent hosts.

What is the address range of Class A?

Class A addresses range from 1.0.0.0 to 126.255.255.255.

What is the address range of Class B?

Class B addresses range from 128.0.0.0 to 191.255.255.255.

What is the address range of Class C?

Class C addresses range from 192.0.0.0 to 223.255.255.255.

Are Classful addresses still in use?

They are mostly obsolete but sometimes seen in legacy systems and older networking concepts.

What are the limitations of Classful addressing?

Fixed class sizes limit flexibility and contribute to IP address exhaustion.

How did CIDR improve on Classful addressing?

CIDR introduced variable-length subnet masks allowing more flexible and efficient IP allocation.

What role do network bits play in Classful addressing?

Network bits identify the network segment to which the IP address belongs.

What role do host bits play in Classful addressing?

Host bits identify individual devices within a network.

Can Classful addressing be subnetted?

Yes, subnetting can be applied to classful networks to create smaller network segments.

What tools help analyze Classful addressing?

Tools like IP calculators and subnet calculators help visualize classful IP ranges and subnetting.

  • In this section, you are going to learn

  • Terminology

  • Version Info

  • rfc details

Test Objective

This test confirms the historic division of IPv4 addresses into classes and verifies that the ipcalc utility correctly interprets Class A, B, and C addresses using their fixed-length subnet masks.

IPv4 Address Classes

  • Class A: 1.0.0.0 126.255.255.255 (/8)

  • Class B: 128.0.0.0 191.255.255.255 (/16)

  • Class C: 192.0.0.0 223.255.255.255 (/24)

Note

  • ipcalc should output the Network, Host, and Broadcast addresses based on the classful subnet mask (e.g., /8 for Class A).

  • Two hosts in the same classful network should be able to communicate successfully.

  • Classful addressing is deprecated and replaced by CIDR (Classless Inter-Domain Routing).

  • These tests are for educational/legacy understanding only.

Test 1 — Class A Addressing

  • Objective: Verify ipcalc applies a /8 subnet mask to Class A.

Laptop 1 Setup

test:~$ sudo ip addr add 10.10.10.1/8 dev enp0s8
test:~$ sudo ip link set enp0s8 up
test:~$ ping 10.20.20.2
PING 10.20.20.2 (10.20.20.2) 56(84) bytes of data.
64 bytes from 10.20.20.2: icmp_seq=1 ttl=64 time=0.590 ms
64 bytes from 10.20.20.2: icmp_seq=2 ttl=64 time=0.517 ms
64 bytes from 10.20.20.2: icmp_seq=3 ttl=64 time=1.13 ms
^C
--- 10.20.20.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2047ms

test:~$ ipcalc 10.10.10.1
Address:   10.10.10.1          00001010.00001010.00001010.00000001
Netmask:   255.255.255.0 = 24  11111111.11111111.11111111.00000000
Wildcard:  0.0.0.255           00000000.00000000.00000000.11111111
=>
Network:   10.10.10.0/24       00001010.00001010.00001010.00000000
HostMin:   10.10.10.1          00001010.00001010.00001010.00000001
HostMax:   10.10.10.254        00001010.00001010.00001010.11111110
Broadcast: 10.10.10.255        00001010.00001010.00001010.11111111
Hosts/Net: 254                 Class A, Private Internet

Laptop 2 Setup

test:~$ sudo ip addr add 10.20.20.2/8 dev enp0s8
test:~$ sudo ip link set enp0s8 up
test:~$ ping 10.10.10.1
test:~$ ipcalc 10.20.20.2
Address:   10.20.20.2          00001010.00010100.00010100.00000010
Netmask:   255.255.255.0 = 24  11111111.11111111.11111111.00000000
Wildcard:  0.0.0.255           00000000.00000000.00000000.11111111
=>
Network:   10.20.20.0/24       00001010.00010100.00010100.00000000
HostMin:   10.20.20.1          00001010.00010100.00010100.00000001
HostMax:   10.20.20.254        00001010.00010100.00010100.11111110
Broadcast: 10.20.20.255        00001010.00010100.00010100.11111111
Hosts/Net: 254                 Class A, Private Internet

Capture Analysis

  • ICMP Echo Request and Reply packets are exchanged between 10.10.10.1 and 10.20.20.2.

  • Wireshark shows: - Source: 10.10.10.1 → Destination: 10.20.20.2 - Protocol: ICMP (ping) - TTL: 64

  • Reply packets show reversed addresses (confirming bidirectional communication).

Note

  • In Class A, only the first octet is fixed as the network ID (10.x.x.x).

  • That’s why 10.10.10.1 and 10.20.20.2 still belong to the same network.

Download Wireshark Capture

Test 2 — Class B Addressing

  • Objective: Verify ipcalc applies a /16 subnet mask to Class B.

Laptop 1 Setup

test:~$ sudo ip addr add 172.16.10.1/16 dev enp0s8
test:~$ sudo ip link set enp0s8 up
test:~$ ping 172.16.20.2
PING 172.16.20.2 (172.16.20.2) 56(84) bytes of data.
64 bytes from 172.16.20.2: icmp_seq=1 ttl=64 time=10.9 ms
64 bytes from 172.16.20.2: icmp_seq=2 ttl=64 time=0.799 ms
64 bytes from 172.16.20.2: icmp_seq=3 ttl=64 time=1.05 ms
^C
--- 172.16.20.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2047ms

test:~$ ipcalc 172.16.10.1
Address:   172.16.10.1          10101100.00010000.00001010.00000001
Netmask:   255.255.255.0 = 24  11111111.11111111.11111111.00000000
Wildcard:  0.0.0.255           00000000.00000000.00000000.11111111
=>
Network:   172.16.10.0/24      10101100.00010000.00001010.00000000
HostMin:   172.16.10.1         10101100.00010000.00001010.00000001
HostMax:   172.16.10.254       10101100.00010000.00001010.11111110
Broadcast: 172.16.10.255       10101100.00010000.00001010.11111111
Hosts/Net: 254                 Class B, Private Internet

Laptop 2 Setup

test:~$ sudo ip addr add 172.16.20.2/16 dev enp0s8
test:~$ sudo ip link set enp0s8 up
test:~$ ping 172.16.10.1
test:~$ ipcalc 172.16.20.2
Address:   172.16.20.2          10101100.00010000.00010100.00000010
Netmask:   255.255.255.0 = 24  11111111.11111111.11111111.00000000
Wildcard:  0.0.0.255           00000000.00000000.00000000.11111111
=>
Network:   172.16.20.0/24      10101100.00010000.00010100.00000000
HostMin:   172.16.20.1         10101100.00010000.00010100.00000001
HostMax:   172.16.20.254       10101100.00010000.00010100.11111110
Broadcast: 172.16.20.255       10101100.00010000.00010100.11111111
Hosts/Net: 254                 Class B, Private Internet

Capture Analysis

  • Wireshark shows successful ICMP ping between 172.16.10.1 and 172.16.20.2.

  • Important details: - Source: 172.16.10.1 → Destination: 172.16.20.2 - Detected netmask: 255.255.0.0 (/16) - Echo Reply confirms same Class B network.

Note

  • In Class B, the first two octets define the network (172.16.x.x).

  • Both 172.16.10.1 and 172.16.20.2 fall in the same network 172.16.0.0/16.

Download Wireshark Capture

Test 3 — Class C Addressing

  • Objective: Verify Class C uses the first three octets as the Network ID.

Laptop 1 Setup

test:~$ sudo ip addr add 192.168.10.1/24 dev enp0s8
test:~$ sudo ip link set enp0s8 up
test:~$ ping 192.168.10.2
PING 192.168.10.2 (192.168.10.2) 56(84) bytes of data.
64 bytes from 192.168.10.2: icmp_seq=1 ttl=64 time=0.989 ms
64 bytes from 192.168.10.2: icmp_seq=2 ttl=64 time=1.05 ms
64 bytes from 192.168.10.2: icmp_seq=3 ttl=64 time=1.06 ms
^C
--- 192.168.10.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4029ms

test:~$ ipcalc 192.168.10.1
Address:   192.168.10.1        11000000.10101000.00001010.00000001
Netmask:   255.255.255.0 = 24  11111111.11111111.11111111.00000000
Wildcard:  0.0.0.255           00000000.00000000.00000000.11111111
=>
Network:   192.168.10.0/24     11000000.10101000.00001010.00000000
HostMin:   192.168.10.1        11000000.10101000.00001010.00000001
HostMax:   192.168.10.254      11000000.10101000.00001010.11111110
Broadcast: 192.168.10.255      11000000.10101000.00001010.11111111
Hosts/Net: 254                 Class C, Private Internet

Laptop 2 Setup

test:~$ sudo ip addr add 192.168.10.2/24 dev enp0s8
test:~$ sudo ip link set enp0s8 up
test:~$ ping 192.168.10.1
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=0.840 ms
64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.660 ms
64 bytes from 192.168.10.1: icmp_seq=3 ttl=64 time=0.731 ms
^C
--- 192.168.10.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4073ms

test:~$ ipcalc 192.168.10.2
Address:   192.168.10.2        11000000.10101000.00001010.00000010
Netmask:   255.255.255.0 = 24  11111111.11111111.11111111.00000000
Wildcard:  0.0.0.255           00000000.00000000.00000000.11111111
=>
Network:   192.168.10.0/24     11000000.10101000.00001010.00000000
HostMin:   192.168.10.1        11000000.10101000.00001010.00000001
HostMax:   192.168.10.254      11000000.10101000.00001010.11111110
Broadcast: 192.168.10.255      11000000.10101000.00001010.11111111
Hosts/Net: 254                 Class C, Private Internet

Capture Analysis

  • ICMP Echo Requests from 192.168.10.1 to 192.168.10.2 are observed.

  • Wireshark shows: - Protocol: ICMP - Network range: 192.168.10.0/24

  • HostMin/HostMax match ipcalc output.

Note

  • Class C networks are commonly used in LANs.

  • Since the first three octets form the network ID, both IPs must be identical up to 192.168.10.

Download Wireshark Capture

  • packet details

  • usecases

Classful Addressing (Legacy) - Testcases

Classful Addressing (Legacy) - Test Cases

#

Test Case

Description

Expected Result

1

Class A Address Assignment

Assign 10.0.0.1

Recognized as Class A

2

Class B Address Assignment

Assign 172.16.0.1

Recognized as Class B

3

Class C Address Assignment

Assign 192.168.1.1

Recognized as Class C

4

Class D Address Assignment

Assign 224.0.0.1

Recognized as multicast

5

Class E Address Assignment

Assign 240.0.0.1

Reserved, not routable

6

Class A Default Subnet Mask

255.0.0.0

Applied automatically

7

Class B Default Subnet Mask

255.255.0.0

Applied automatically

8

Class C Default Subnet Mask

255.255.255.0

Applied automatically

9

Class A Network Range

1.0.0.0 to 126.255.255.255

Valid Class A range

10

Class B Network Range

128.0.0.0 to 191.255.255.255

Valid Class B range

11

Class C Network Range

192.0.0.0 to 223.255.255.255

Valid Class C range

12

Class D Network Range

224.0.0.0 to 239.255.255.255

Multicast only

13

Class E Network Range

240.0.0.0 to 255.255.255.254

Reserved

14

Loopback Address

127.0.0.1

Not part of any class

15

Broadcast Address

255.255.255.255

Not class-specific

16

Class A with Custom Subnet

10.0.0.1/16

Subnetting applied

17

Class B with Custom Subnet

172.16.0.1/20

Subnetting applied

18

Class C with Custom Subnet

192.168.1.1/28

Subnetting applied

19

Invalid Class A Address

0.0.0.1

Reserved, not valid

20

Invalid Class B Address

127.0.0.1

Loopback, not Class B

21

Invalid Class C Address

223.255.255.256

Invalid octet

22

Class A with Host Bits All 0

10.0.0.0

Network address

23

Class A with Host Bits All 1

10.255.255.255

Broadcast address

24

Class B with Host Bits All 0

172.16.0.0

Network address

25

Class B with Host Bits All 1

172.16.255.255

Broadcast address

26

Class C with Host Bits All 0

192.168.1.0

Network address

27

Class C with Host Bits All 1

192.168.1.255

Broadcast address

28

Class D with TTL = 1

224.0.0.1

Local multicast only

29

Class D with TTL > 1

224.0.1.1

Multicast routed

30

Class E with Routing Attempt

240.0.0.1

Packet dropped

31

Class A with ARP Request

10.0.0.1

ARP resolves MAC

32

Class B with DHCP

172.16.0.1

DHCP assigns IP

33

Class C with NAT

192.168.1.1

NAT translates IP

34

Class A with ACL

10.0.0.1

ACL filters traffic

35

Class B with Firewall

172.16.0.1

Firewall rules applied

36

Class C with VPN

192.168.1.1

Routed through VPN

37

Class A with Routing Table

10.0.0.0/8

Route added

38

Class B with Static Route

172.16.0.0/16

Route configured

39

Class C with Dynamic Routing

192.168.1.0/24

Route learned

40

Class D with IGMP

224.0.0.1

Group membership managed

41

Class A with DNS

10.0.0.1

Resolves to hostname

42

Class B with SNMP

172.16.0.1

Device monitored

43

Class C with Syslog

192.168.1.1

Logs sent

44

Class A with ICMP

10.0.0.1

Ping successful

45

Class B with Traceroute

172.16.0.1

TTL decremented

46

Class C with Packet Capture

192.168.1.1

Traffic visible

47

Class D with Multicast App

224.0.0.1

App receives stream

48

Class A with Subnet Overlap

10.0.0.0/8 and 10.1.0.0/16

Conflict detected

49

Class B with Subnetting Violation

172.16.0.0/15

Not aligned with class

50

Class C with CIDR

192.168.1.0/26

CIDR overrides classful mask

  • Reference links