background image
OSI Layer 3: Routed and Routing Protocols
47
F I G U R E 2 . 1 0
Hierarchical IP address structure
Longer network prefixes reside near the bottom of the network tree. The
network length is depicted by a /24 or /25 suffixed to an IP address, which
specifies the number of bits (beginning from the left) that define the network
portion. In this figure, the address 172.16.20.0/24 is equivalent to a Class
C address, however it is a Class B address with a /24 mask. You can tell that
because the first 24 bits are used to define the network portion, leaving 256
host addresses available. The first 24 binary bits are equal to the first three
octets in the dotted decimal format of an IP address.
In the beginning (referencing RFC 760), IP addresses weren't assigned
classes. Instead, the network portion of the address was assigned to the first
octet. This allowed for only 254 IP networks. To resolve this dilemma, RFC
791 was defined and written. This RFC converted a previously classless IP
address structure into specific classes--five classes, to be exact. The three
most common ones are Classes A, B, and C. Prefix lengths were defined as
eight bits, 16 bits, and 24 bits, corresponding to Classes A, B, and C, respec-
tively. The first three bits in the first octet were used to determine the IP
address class. Table 2.3 shows how the classes were defined.
16 bits network portion
16 bits
20 bits network portion
12 bits
24 bits network portion
8 bits
25 bits network portion
7 bits host
portion
30 bits network portion
2
bits
172.16.20.0
/16
1 Class B
/20
16 Class C
/24
1 Class C
/25
1/2 Class C
/30
1/64 Class C
Copyright ©2000 SYBEX , Inc., Alameda, CA
www.sybex.com