This article will cover important topics like IP Address classes, Network classes, private IP, Broadcasting, etc.
One of the most important topics in any discussion of TCP/IP is IP addressing. An IP address is a numeric identifier assigned to each machine on an IP network. It designates the specific location of a device on the network.
An IP address is a software address, not a hardware address the latter is hard-coded on a Network interface card (NIC) and used for finding hosts on a local network. IP addressing was designed to allow hosts on one network to communicate with a host on a different network regardless of the type of LANs the hosts are participating in.
Before we get into the more complicated aspects of IP addressing, you need to understand some of the basics. First we are going to explain some of the fundamentals of IP addressing and its terminology. Then you’ll learn about the hierarchical IP addressing scheme and Private IP addresses.
Throughout this article you’ll learn several important terms vital to your understanding of the Internet Protocol. Here are a few to get you started:
Bit: A bit is one digit, either a 1 or a 0.
Byte: A byte is 7 or 8 bits, depending on whether parity is used. For the rest of the article, always assume a byte is 8 bits.
Octet: An octet, made up of 8 bits, is just an ordinary 8-bit binary number. In this chapter, the terms byte and octet are completely interchangeable.
Network Address: This is the designation used in routing to send packets to a remote network, for example, 10.0.0.0, 172.16.0.0, and 192.168.10.0.
Broadcast Address: The address used by applications and hosts to send information to all nodes on a network is called the broadcast address. Examples include 255.255.255.255, which is all networks, all nodes: 172.16.255.255, which is all subnets and hosts on network 172.16.0.0; and 10.255.255.255, which broadcasts to all subnets and hosts on network 10.0.0.0.
The hierarchical IP Addressing Scheme
An IP address consists of 32 bits of information. These bits are divided into four sections, referred to as octets or bytes, each containing 1 bytes (8 bits). You can depict an IP address using one of the three methods:
- Dotted-decimal, as in 172.16.30.56
- Binary, as in 100101100.00010000.00011110.00111000
- Hexadecimal, as in AC.10.1E.38
All these examples truly represent the same IP address. Hexadecimal isn’t used as often as dotted-decimal or binary when IP addressing is discussed, but you still might find an IP address stored in hexadecimal in some programs. The windows Registry is a good example of a program that stores a machine’s IP address in hex.
The 32-bit IP address is a structured or hierarchical address, as opposed to a flat or nonhierarchical address. Although either type of addressing scheme could have been used, hierarchical addressing was chosen for a good reason. The advantage of this scheme is that it can handle a large number of addresses, namely 4.3 billion (a 32-bit address space with two possible values for each position either 0 or 1 gives you 232, or 4,294,967,296). The disadvantage of the flat addressing scheme and the reason it’s not used for IP addressing relates to routing. If every address were unique, all routers on the Internet would need to store the address of each and every machine on the internet. This would make efficient routing impossible, even if only a fraction of the possible addresses were used.
The solution to this problem is to use a two or three-level hierarchical addressing scheme that is structured by network and host or by network, subnet, and host.
This two or three-level scheme is comparable to a telephone number. The first section, the area code, designates a very large area. The second section, the prefix, narrows the scope to a local calling area. The final segment, the customer number, zooms in on the specific connection. IP addresses use the same type of layered structure. Rather than all 32 bits being treated as a unique identifier, as in flat addressing, a part of the address is designated as the network address and the other part is designated as either the subnet and host or just the node address.
In the following section, we are going to discuss IP network addressing and the different classes of address we can use to address our networks.
The network address (which can also be called the network number) uniquely identifies each network. Every machine on the same network shares that network address as part of its IP address. In the IP address 172.16.30.56, for example, 172.16 is the network address.
The node address is assigned to and uniquely identifies, each machine on a network. This part of the address must be unique because it identifies a particular machine as an individual as opposed to a network, which is a group. This number can also be referred to as a host address. In the sample IP address 172.16.30.56, the 30.56 is the node address.
The designers of the Internet decided to create classes of networks based on network size. For the small number of networks possessing a very large number of nodes, they created the rank Class A network. At the other extreme is Class C Network, which is reserved for the numerous networks with a small number of nodes. The class distinction for networks between very large and very small is predictably called the Class B Network.
Subdividing an IP address into a network and node address is determined by the class designation of one’s network. The following figure summarizes the three classes of networks.
To ensure efficient routing, internet designers defined a mandate for the leading bits section of the address for each different network class. For example, since a router knows that a Class A network address always starts with a 0, the router might be able to speed a packet on its way after reading only the first bit of its address. This is where the address scheme defines the difference between a Class A, a Class B, and a Class C address. In the next sections, we’ll discuss the differences between these three classes, followed by a discussion of Class D and Class E addresses (Classes A, B, and C are the only ranges that are used to address hosts in our networks).
Network Address Range: Class A
The designers of the IP address scheme said that the first bit of the first byte in a Class A network address must always be off, or 0. This means a Class A address must be between 0 and 127 in the first byte, inclusive.
Consider the following network address:
If we turn the other 7 bits all off and then turn them all on, we’ll find the Class A range of network addresses:
00000000 = 0
01111111 = 127
So, a Class A network is defined in the first octet between 0 and 127, and it can’t be less or more. (Yes, I know 0 and 127 are not valid in a Class A network. I’ll talk about reserved addresses in a minute.)
Network Address Range: Class B
In a Class B network, the RFCs state that the first bit of the first byte must always be turned on but the second bit must always be turned off. If you turn the other 6 bits all off and then all on, you will find the range for a Class B network:
10000000 = 128
10111111 = 191
As you can see, a Class B is defined when the first byte is configured from 128 to 191.
Network Address Range: Class C
For Class C network, the RFCs define the first 2 bits of the first octet as always turned on, but the third bit can never be on. Following the same process as the previous classes, convert from binary to decimal to find the range. Here’s the range for a Class C network:
11000000 = 192
11011111 = 223
So, if you see an IP address that starts at 192 and goes to 223, you’ll know it is a Class C IP address.
Network Address Ranges: Class D and E
The address between 224 to 225 are reserved for Class D and E networks. Class D (224239) is used for multicast addresses and Class E (240255) for scientific purposes and we’ll talk about it in other articles.
Network Address Range: Special Purpose
Some IP addresses are reserved for special purposes, so network administrators can’t ever assign these addresses to nodes. The following table lists the members of this exclusive little club and the reasons why they’re included in it.
|Network address of all 0s||Interpreted to mean “this network or segment”|
|Network address of all 1s||Interpreted to mean “all networks”|
|Network 127.0.0.1||Reserved for loopback tests. Designates the local node and allows that node to send a test packet to itself without generating network traffic.|
|Node address of all 0s||Interpreted to mean “network address” or any host on a specific network.|
|Node address of all 1s||Interpreted to mean “all nodes” on the specified network; for example, 22.214.171.124 means “all nodes” on network 128.2 (Class B)|
|Entire IP address set to all 0s||Used by Cisco routers to designate the default route. Could also mean “any network”|
|Entire IP address set to all 1s (same as 255.255.255.255)||Broadcast to all nodes on the current network; sometimes called an “all 1s broadcast” or limited broadcast.|
Class A Addresses
In a Class A network address, the first byte is assigned to the network address and the three bytes are used for the node addresses. The Class A format is as follows:
For example, in the IP address 126.96.36.199, the 49 is the network address and 22.102.70 is the node address. Every machine on this particular network would have the distinctive network address of 49.
Class A network addresses are 1 byte long, with the first bit of that byte reserved and the 7 remaining bits available for manipulation (addressing). As a result, the maximum number of Class A networks that can be created is 128. Why? Because each of the 7-bit positions can be either a 0 or a 1, thus, 127 or 128.
To complicate matter further, the network address of all 0s (0000 0000) is reserved to designate the default route. Additionally, the address 127, which is reserved for diagnostics, can’t be used either, which means that you can really only use the numbers 1 to 126 to designate Class A network addresses. This means the actual number of usable Class A network addresses is 128 minus 2, or 126.
Each Class A has 3 bytes (24-bit positions) for the node address of a machine. This means there are 224 or 16,777,21 unique combinations and, therefore, precisely that many possible unique nodes addresses for each Class A network. Because node addresses with the two patterns of all 0s and all 1s are reserved, the actual maximum usable number of nodes for a Class A network is 224 minus 2, which equals 16,777,214. Either way, that’s a huge amount of hosts on a network segment.
Class A Valid Host IDs
Here’s an example of how to figure out the valid host IDs in a Class A network address:
All host bits off is the network address: 10.0.0.0
All host bits on is the broadcast address: 10.255.255.255
The valid hosts are the numbers in between the network address and the broadcast address.
10.0.0.1 through 10.255.255.254. notice that 0s and 255s can be valid host IDs. All you need is to remember when trying to find valid host addresses is that the host bits can’t all be turned off or all be on at the same time.
Class B Addresses
In a Class B network address, the first 2 bytes are assigned to the network address and the remaining 2 bytes are used for node addresses. The format is as follows:
For example, in the IP address 172.16.30.56, the network address is 172.16 and the node address is 30.56.
With a network address being 2 bytes (8 bits each), there would be 216 unique combinations. But the internet designers decided that all Class B network addresses should start with the binary digit 1, then 0. This leaves 14-bit positions to manipulate, therefore 16384 (i.e. 214) unique Class B network addresses.
A Class B address uses 2 bytes for node addresses. This is 216 minus the two reserved patterns (all 0s and all 1s), for a total of 65,534 possible node addresses for each Class B network.
Class B Valid Host IDs
Here’s an example of how to find the valid hosts in a Class B network.
All host bits turned off is the network address: 172.16.0.0
All host bits turned on is the broadcast address: 172.16.255.255
The valid hosts would be the numbers in between the network address and the broadcast address: 172.16.0.1 through 172.16.255.254.
Class C Addresses
The first 3 bytes of Class C network is dedicated to the network portion of the address, with only 1 measly byte remaining for the node address. Here’s the format:
Using the example IP address 192.168.100.102, the network address is 192.168.100 and the node address is 102.
In a Class C network address, the first three bit positions are always the binary 110. The calculation is as follows:
3 bytes, or 24 bits, minus 3 reserved positions leaves 21 positions. Hence there are 221, or 2,097,152 possible Class C networks.
Each unique Class C network has 1 byte to use for node addresses. This leads to 28 or 256, minus the two reserved patterns of all 0s and all 1s, for a total of 254 node addresses for each Class C network.
Class C Valid Host IDs
Here’s an example of how to find a valid host ID in a Class C network:
All host bits turned off is the network ID: 192.168.100.0
All host bits turned on is the broadcast address: 192.168.100.255
The valid hosts would be the numbers in between the network address and the broadcast address: 192.168.100.1 through 192.168.100.254.
Private IP Address
The people who created the IP addressing scheme also created what we call private IP addresses. These addresses can be used on a private network, but they are not routable through the internet. This is designed for the purpose of creating a measure of well-needed security, but it also conveniently saves valuable IP address space.
If every host on every network had to have a real routable IP addresses, we would have run out of IP addresses to hand out years ago. But by using private IP addresses, ISPs, corporations, and home users only need a relatively tiny group of bona fide IP addresses to connect their networks to the internet. This is economical because they can use private IP address on their inside networks and get along just fine.
To accomplish this task, the ISP and the corporation the end user, no matter who they are need to use something called Network Address Translation (NAT), which basically takes a private IP address and converts it for use on the Internet. Many people can use the same real IP address to transmit out onto the internet. Doing things this way saves megatons of address space good for us all.
|Address Class||Reserved Address Space|
|Class A||10.0.0.0 through 10.255.255.255|
|Class B||172.16.0.0 through 172.31.255.255|
|Class C||192.168.0.0 through 192.168.255.255|
Most people use the term broadcast as a generic term, and most of the time, we understand what they mean, but not always. For example, you might say, “the host broadcast through a router to a DHCP server” but, well it’s pretty unlikely that this would ever really happened.
What you probably mean using the correct technical jargon is, ‘the host broadcast for an IP address; a router then forwarded this as a unicast packet to the DHCP server.’ Oh, and remember that with IPv4, broadcasts are pretty important, but with IPv6, there aren’t any broadcasts sent at all.
Okay, I have referred to broadcast addresses throughout previous articles, and even showed you some examples. But I really haven’t gone into the different terms and uses associated with them yet, and it’s about time I did. So here are the four different broadcast (generic term broadcast) types that I’d like to define for you.
Layer 2 broadcasts are sent to all nodes on a LAN. Broadcasts layer 3 are sent to all nodes on the network and Unicast are sent to a single destination host.
Multicast is packets sent from a single source and transmitted to many devices on different networks.
First, understand that layer 2 broadcasts are also known as hardware broadcast they only go out on a LAN, and they can’t go past the LAN boundary (router). The typical hardware address is 6 bytes (48 bits) and looks something like 0c.43.a4.f3.12.c2. The broadcast would be all 1s in binary, which would be all Fs in hexadecimal, as in FF.FF.FF.FF.FF.FF.FF.FF.
Then there are the plain old broadcast addresses at layer 3. Broadcast messages are meant to reach all hosts on a broadcast domain. These are the network broadcasts that have all host bits on. Here’s an example that you’re already familiar with: the network address of 172.16.0.0 255.255.0.0 would have a broadcast address of 172.16.255.255 all host bits on. Broadcasts can also be “all networks and all hosts” as indicated by 255.255.255.255. A good example of a broadcast message is an Address Resolution Protocol (ARP) request. When a host has a packet, it knows the logical address (IP) of the destination. To get the packet to the destination, the host needs to forward the packet to a default gateway if the destination resides on a different IP network. If the destination is on the local network, the source will forward the packet directly to the destination. Because the source doesn’t have the MAC address to which it needs to forward the frame, it sends out a broadcast, something that every device in the local broadcast domain will listen to. This broadcast says, in essence, “if you are the owner of IP address 192.168.2.3, please forward your MAC address to me” with the source giving the appropriate information.
A unicast is different because it’s a broadcast packet that goes from 255.255.255.255 to an actual destination IP address in other words, it’s directed to a specific host. A DHCP client request is a good example of how unicast works.
Here’s an example: your host on a LAN sends out an FF.FF.FF.FF.FF.FF.FF.FF layer 2 broadcast and 255.255.255.255 layer 3 destination broadcast looking for a DHCP server on the LAN. The router will see that this is a broadcast meant for the DHCP server because it has a destination port number of 67 (BootP server) and will forward the request to the IP address of the DHCP server on another LAN.
So basically, if your DHCP server IP address is 172.16.0.1, you host just sends out a 255.255.255.255 DHCP client broadcast request, and the router changes that broadcast to the specific destination address of 172.16.0.1. (In order for the router to provide this service, you need to configure the interfaces with the IP helper addresses command this is not a default service).
Multicast is a different beast entirely. At first glance, it appears to be a hybrid of unicast and broadcast communication, but that isn’t quite the case. Multicast does allow point to multipoint communication, which is similar to broadcasts, but it happens in a different manner. The crux of multicast is that it enables multiple recipients to receive messages without flooding the messages to all hosts on a broadcast domain.
Multicast works by sending messages or data to IP multicast group addresses. Routers then forward copies (unlike broadcasts, which are not forwarded) of the packet out every interface that has hosts subscribed to that group address. This is where multicast differs from broadcast messages with multicast communication, copies of packets, in theory, are sent only to subscribed hosts. When I say in theory, this means that the hosts will receive, for example, a multicast packet destined for 188.8.131.52 (this is an EIGRP packet and only a router running the EIGRP protocol will read these). All hosts on the broadcast LAN (Ethernet is a broadcast multi-access LAN technology) will pick up the frame, read the destination address, and immediately discard the frame unless they are in the multicast group. This saves PC processing, not LAN bandwidth.
Multicasting can cause severe LAN congestion, in some instances, if not implemented carefully.
There are several different groups that users or applications can subscribe to. The range of multicast addresses starts with 184.108.40.206 and goes through 220.127.116.11. as you can see, this range of addresses falls within IP Class D address space based on class full IP assignment.