Classful vs Classless Addressing

All IP addresses are composed of two parts :

Network (or prefix)

Host (or Node)

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 255.255.255.0).  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

Class C — NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn

 

Class Starting 

Bits

(fixed to m bits)

Decimal Range of First Byte Network 

Bits

n bits

Host
Bits
p bits
Max 

Networks

2n-m

Max 

Hosts

2p-2

A 0  (m-1) 1 to 126 8 24 28-1 = 126 224-2= 16,777,214
B 10  (m=2) 128 to 191 16 16 216-2 = 16,384 216-2=65,534
C 110 (m=3) 192 to 223 24 8 224-3 = 2,097,152 28-2=254
D 1110 224 to 239
E 1111 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:

  • Class A  0  (00000000)  – no 0.x.x.x – can’t have all 0’s
  • Class A 10 (00001010) – no 10.x.x.x – the Class A “10” network is reserved for private use
  • Class A 127 – no 127.x.x.x – reserved for loopback.
  • Class B (1st octet = 172 OK – but the 2nd octet has an exception) – no 172.16.x.x
  • Class B (1st octet = 192 OK – but the 2nd octet has an exception) – no 192.168.x.x
  • Class E 255 (11111111) – can’t have all 1’s

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   127.0.0.0)

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.

 

Prefix aggregation

IPv4 CIDR
IP/CIDR Δ to last IP addr Mask Hosts (*) Class Notes
a.b.c.d/32 +0.0.0.0 255.255.255.255 1 1/256 C
a.b.c.d/31 +0.0.0.1 255.255.255.254 2 1/128 C d = 0 … (2n) … 254
a.b.c.d/30 +0.0.0.3 255.255.255.252 4 1/64 C d = 0 … (4n) … 252
a.b.c.d/29 +0.0.0.7 255.255.255.248 8 1/32 C d = 0 … (8n) … 248
a.b.c.d/28 +0.0.0.15 255.255.255.240 16 1/16 C d = 0 … (16n) … 240
a.b.c.d/27 +0.0.0.31 255.255.255.224 32 1/8 C d = 0 … (32n) … 224
a.b.c.d/26 +0.0.0.63 255.255.255.192 64 1/4 C d = 0, 64, 128, 192
a.b.c.d/25 +0.0.0.127 255.255.255.128 128 1/2 C d = 0, 128
a.b.c.0/24 +0.0.0.255 255.255.255.000 256 1 C
a.b.c.0/23 +0.0.1.255 255.255.254.000 512 2 C c = 0 … (2n) … 254
a.b.c.0/22 +0.0.3.255 255.255.252.000 1,024 4 C c = 0 … (4n) … 252
a.b.c.0/21 +0.0.7.255 255.255.248.000 2,048 8 C c = 0 … (8n) … 248
a.b.c.0/20 +0.0.15.255 255.255.240.000 4,096 16 C c = 0 … (16n) … 240
a.b.c.0/19 +0.0.31.255 255.255.224.000 8,192 32 C c = 0 … (32n) … 224
a.b.c.0/18 +0.0.63.255 255.255.192.000 16,384 64 C c = 0, 64, 128, 192
a.b.c.0/17 +0.0.127.255 255.255.128.000 32,768 128 C c = 0, 128
a.b.0.0/16 +0.0.255.255 255.255.000.000 65,536 256 C = 1 B
a.b.0.0/15 +0.1.255.255 255.254.000.000 131,072 2 B b = 0 … (2n) … 254
a.b.0.0/14 +0.3.255.255 255.252.000.000 262,144 4 B b = 0 … (4n) … 252
a.b.0.0/13 +0.7.255.255 255.248.000.000 524,288 8 B b = 0 … (8n) … 248
a.b.0.0/12 +0.15.255.255 255.240.000.000 1,048,576 16 B b = 0 … (16n) … 240
a.b.0.0/11 +0.31.255.255 255.224.000.000 2,097,152 32 B b = 0 … (32n) … 224
a.b.0.0/10 +0.63.255.255 255.192.000.000 4,194,304 64 B b = 0, 64, 128, 192
a.b.0.0/9 +0.127.255.255 255.128.000.000 8,388,608 128 B b = 0, 128
a.0.0.0/8 +0.255.255.255 255.000.000.000 16,777,216 256 B = 1 A
a.0.0.0/7 +1.255.255.255 254.000.000.000 33,554,432 2 A a = 0 … (2n) … 254
a.0.0.0/6 +3.255.255.255 252.000.000.000 67,108,864 4 A a = 0 … (4n) … 252
a.0.0.0/5 +7.255.255.255 248.000.000.000 134,217,728 8 A a = 0 … (8n) … 248
a.0.0.0/4 +15.255.255.255 240.000.000.000 268,435,456 16 A a = 0 … (16n) … 240
a.0.0.0/3 +31.255.255.255 224.000.000.000 536,870,912 32 A a = 0 … (32n) … 224
a.0.0.0/2 +63.255.255.255 192.000.000.000 1,073,741,824 64 A a = 0, 64, 128, 192
a.0.0.0/1 +127.255.255.255 128.000.000.000 2,147,483,648 128 A a = 0, 128
0.0.0.0/0 +255.255.255.255 000.000.000.000 4,294,967,296 256 A

 

About Admin

30,living in Houston
This entry was posted in CCNA and tagged . Bookmark the permalink.

6 Responses to Classful vs Classless Addressing

  1. Classful vs Classless Addressing | Network Tutorial Wonderful goods from you, man. I’ve understand your stuff previous to and you are just too wonderful. I actually like what you’ve acquired here, certainly like what you’re stating and the way in which you say it. You make it entertaining and you still care for to keep it wise. I can not wait to read much more Classful vs Classless Addressing | Network Tutorial again from you. Thanks For Share.

  2. Classful vs Classless Addressing | Network Tutorial Fantastic goods from you, man. I have understand your stuff previous to and you’re just extremely fantastic. I actually like what you have acquired here, certainly like what you’re stating and the way in which you say it. You make it enjoyable and you still care for to keep it wise. I can’t wait to read far more Classful vs Classless Addressing | Network Tutorial again from you. Thanks For Share.

  3. I wanted to get the rss FEED but it showing me some XML errors..

  4. Very interesting entry, I look forward to the next! Thx for share

  5. Very interesting entry, I look forward to the next! Thx for share

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>