Classful vs Classless Addressing

All IP addresses are compsed of two parts :

Originally, all IP addresses were classful – they belonged to Class A, B, C or D.  Class D is for Multicast and is rarely used.  Class E is reserved and is not currently used.

The fixed boundaries of classful addressing greatly limited the flexibility and number of addresses that can be assigned.  Therefore, these boundaries were made to be fluid, and instead of Classes, the Network address was allowed to take any number of bits in the 32-bit address space.  They call this the “prefix” and it is denoted with a slash ( / ) followed by the length in bits.  For example, a Class C address has 24 bits for the network address, which in the classless world would be called a /24 address.

Today routers route both classful and classless protocols.  For example, RIP is classful, and both BGP4 and IS-IS is classless.  In reality, Class addresses are converted to Classless for routing through the Internet, since BGP4 is used across the Internet backbone.

However, when you get to the end routers where subnets exist – unless it is a private network – it uses classful addressing.  Even though the subnet numbers add bits to the prefix (extended prefix) and this does not fall on the Classful borders (8, 16, 24 bits) – the prefix stays on Classful borders.  ALWAYS ASSUME CLASSFUL PREFIXES FOR SUBNETS !!!  When you see prefixes mentioned such as /27, it merely means that subnetting is being used (since it is not /8,  /16,  or /24).  In this case, a Class C ( /24 ) block has subnetted the 8-bit host address space, moving the prefix 3 bits to the right.

Is Classful Dead ?

A IP far as the Internet backbone is concerned – yes.  For local networks connected to the Internet – no.

Even with the backbone, Classful addressing is so imbedded into the IP culture, that almost everyone still refers to addresses as Class A, Class B, and Class C.  In addition, since the mathematics and understanding of IP is greatly simplified throught the Class concept of 8-byte boundaries, the vast majority of networks are configured and designed using Classful addressing.

Over 90% of ISP customers order one or more “Class C” blocks of addresses, and few subnet these 254-host blocks.  Their technicians speak “Class A,B,C” addressing, as do most novices.  Furthermore, they are not wrong !!  The advent of classless addressing was backward-compatible with classful adressing.  Therefore, you can design a network using Classful addressing, connect it into the Internet, and it will work flawlessly.

Routers don’t care.  They simply view Classful addresses as classless, and assign a prefix that equates to that particular class.  They even use a “subnet mask” for all classful addresses (for example, a Class C IP address stack on a host is configured with a subnet mask of  Subnets were designed to break down the Class barriers, allowing the Network/Host boundary to fall almost anywhere through the use of extended-prefixes. 

For example Internet routers look at IP addresses along with their prefix.

Classful Addressing  RFC 791

There are 5 different address classes, where A, B, and C are the “primary” address classes, and they are the only ones you are likely to encounter. You can determine which class any IP address is in by examining the first 4 bits of the IP address.

     Class A -- NNNNNNNN.nnnnnnnn.nnnnnnn.nnnnnnn

     Class B -- NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnn





(fixed to m bits)

Decimal Range of First Byte



n bits

p bits








0  (m-1)

1 to 126

8 24

28-1 = 126

224-2= 16,777,214


10  (m=2)

128 to 191

16 16

216-2 = 16,384



110 (m=3)

192 to 223

24 8

224-3  = 2,097,152




224 to 239






240 to 254




Memorization tip to figure out all the ranges - just memorize the starting bits and calculate the numbers from them:

A         0

B          10

C         110

D         1110

E          1111   

Then, add all 0’s to the right to find the lowest range number.  Then calculate the lowest range number of the next highest class and subtract 1 to find the highest range number.  The six exceptions are:

NOTE:  1’s – all zero’s reserved for “this interface or this network, and all 1’s reserved for all interfaces and all networks (broadcast)

Class B exceptions – although the first byte can be 172 and 192, there are two Class B network addresses that are reserved:  172.16  and  192.168

The first bits and value of the first byte

Class A ( /8 )  -  begins with bit 0, and the first byte decimal value is 1 to 127

            Max Networks = 126 (27 – 2)              Max nodes =  16,777,214

            NOTE:  max networks uses 27 because the first bit is set to 0, and only the last 7 bits can vary. 

            NOTE:  entire network 10 and 127 are reserved  (10.x.x.x   and

Class B (/16) -  begins with bits 10, and the first byte decimal value is 128 to 191

            Max Networks = 16,384 (216-2)  Max Nodes = 65,534

            NOTE:  max networks uses 214 because the first 2 bits are set to 10, and only the last 14 bits can vary. 

            NOTE:  172.16  and  192.168 are reserved  (172.16.x.x   and   192.168.x.x)

Class C (/24) -   begins with bits 110, and the first byte decimal value is 192 to 223

            Max Networks = 2,097,152 (224-3)         Max Nodes = 254 

            NOTE:  max networks uses 221 because the first 3 bits are set to 110, and only the last 21 bits can vary. 

Class D – begins with bits 1110,  and the first byte decimal value is 224 to 239

Class E – begins with bits 1111, and the first byte decimal value is 240 to 254

            NOTE:  255 is reserved for broadcasts

*** Class D addresses are reserved for multicasting and Class E addresses are reserved for future use.