When TCP/IP was developed long ago, the creators provided for five classes of IP address, A->E. For common addressing, only Classes A, B, and C are used.
The "Class" of the address is determined by the leading bits of the first octet. For example:
Class A always starts with a 0xxxxxxx,
Class B always starts with a 10xxxxxx,
Class C always starts with a 110xxxxx,
Class D (multicast) starts with 1110xxxx,
Class E (experimental) always starts with a 1111xxx.
(all represented in binary, where "x" represents the remaining bits of the byte/octet)
If you note the positions of the "1" bits, you'll see that the highest you can count with the leading bit as a zero is 127 (the leading bit represents the number "128" in decimal). SO, a Class A address will always be in the range of 1-127.
With the leading bit set to "1" the next bit set to "0" the range of numbers possible are 128-191, which is the address range of a Class B network.
With the first two leading bits set to "1" and the third bit set to "0", the number range possible is 192 - 223, which would make it a Class C address.
(and so on for Class D and E)
Each of these address Classes were assigned a default "Network Mask." The mask is used by routing logic to figure out which part of the address is the "network" and which part is used for "host" addressing (who is a wire, who is a computer).
Class A's default mask is "255.0.0.0"
Class B's default mask is "255.255.0.0"
Class C's default mask is "255.255.255.0"
The number 255 represents an octet / byte with all of its bits set to a "1."
If you put the mask under the address like this:
You'll see that the first three octets are all "masked" by ones. The mask is showing which part of the address is "network," which part is host - any position masked by a one is part of the network portion of the address.
Once networks and the Internet started to grow (much larger than the creators imagined), it became apparent that a shortage of network addresses would occur, and a method was sought to conserve (i.e., not waste) addresses.
For example, in a point-to-point WAN scenario, only two addresses would be used (one at each end). Even if you only use a Class C address (253 possible hosts by today's conventions), you're still throwing away 251 addresses.
It's "against the (classful) rules" to use the same address block in two different places on the network (it can confuse the routers and get data sent to the wrong place).
The answer was to "subnet." Subnetting borrows bits from the "host" portion of the address to create more networks. By extending the network mask into the host address area, you are telling the receiving device where the network address stops, and the host address starts. With subnetting (using the above example), we can extend the mask to 30 bits:
With only two bits of host address, we now have a bunch of networks (subnets), each of which will have exactly two host addresses .... no waste.
Note: even though we have stretched the mask, this would still be a Class C address, because the leading bits are "110xxxxx."
(running out of room and time, see the next reply post for the rest of this)
The concept of subnetting was expanded / enhanced to create "classless" addressing. With classless addressing, any network/host boundry can be arbitrarily chosen, as long as all of the devices can understand "classless."
The only basic rule is that the bits in the mask that represent the network portion of the address "must be" (should be) contiguous (adjacent, next to each other). A network mask of "11001111" would be inefficient a gut-wrenching nightmare to track.
Classless also allows a network designer/implementer to created a hierarchy of addressing, where blocks of addresses are summarized at certain boundries to minimize routing protocol traffic and reduce processor time in the router.
Subnetting can occur anywhere in the host portion of the address. 192.168.X.0 is a Class C. The (Classful) host portion is the fourth octet - you have eight bits to subnet.
With pure Classless addressing, you can subnet anywhere in the third or fourth octet (and still comply with the RFC 1918 "Private" addressing scheme)
"Private" addresses are defined by RFC 1918 and are used to allow any number of networks to use the same addresses - as long as they are not presented to the Internet. Usually the "Private" adresses are used inside the network, with some device (router, firewall, proxy) presenting one or more "Public" addresses to the Internet.
Traffic sent to the "Public" address is translated by the router, frewall, or proxy into one of the "inside" private addresses (this is "Network Address Translation - NAT).
The combination of NAT and classless addressing has bought some time to create and implement a new addressing scheme called IP Version 6 (IPv6), which has addressing space for many, many more hosts.
That's about it for now ... I gotta give my fingers some rest ....
Hopefully this helps you begin to understand how all of this relates ....
Scott has a lot of good information in his explanation. I will try to explain from a slightly different perspective.
An IP address is not classful or classless in itself. It is a question of how addresses are used that determines whether it is classful or classless.
Classful was the older, more simple, traditional way of approaching IP addressing. Classful addressing makes certain assumptions about how addresses will be used. Classless is the newer, more complex, more sophisticated approach to IP addressing and makes different assumptions about how addresses will be used.
Some of the assumptions made by classful addressing include: within a particular classful network you can do subnetting but all subnets of that network must be the same size (no matter how many devices are to be on the segment all subnets within the same network must be the same size and use the same netmask); all subnets within a network must be contiguous; a device that knows some subnets of the network will know all subnets of the network; summarization will occur at the boundary of the network, and summarization will occur only at the boundary of the network.
The assumptions made by classless addressing are pretty much the reverse of the classful assumptions: within a network subnets can have different sizes and use different netmasks (so you can optimize the size of the subnet to the number of devices and reduce wasted addresses); within the network subnets do not necessarily need to be contiguous; a device may know about some subnets of the network but not know about other subnets of the network; summarization may occur at the network boundary but it also may not (it is possible but not required) and summarization may occur at points within the network.
Some of the concepts that we deal with in many networks such as VLSM, and supernets are classless concepts and are not possible in a classful environment.
I hope this helps clarify your understanding of this topic.
The ProblemEnter EVCsHow It Works (Ingress)How It Works
(Egress)Step-by-Step ExampleFinal Thoughts The ProblemOn traditional
switches whenever we have a trunk interface we use the VLAN tag to
demultiplex the VLANs. The switch needs to determine which MAC ...
The ProblemEnter EVCsHow It Works (Ingress)How It Works
(Egress)Step-by-Step ExampleFinal Thoughts Introduction: Netdr is a tool
available on a RSP720, Sup720 or Sup32 that allows one to capture
packets on the RP or SP inband. The netdr command can be use...
IntroductionOSPF, being a link-state protocol, allows for every router
in the network to know of every link and OSPF speaker in the entire
network. From this picture each router independently runs the Shortest
Path First (SPF) algorithm to determine the b...