IP addressing basics
Feb 1, 2009 12:00 PM, By Brad Gilmer
Maintain critical broadcast networks with IP addressing.
In smaller networks with less than 253 computers, you can assign them all to the same private network, meaning that the first three octets are the same, but the last octet is different for each computer. For example, you might select 10.25.56.xxx for your network. All computers on the network would have IP addresses that begin with 10.25.56, but the last three numbers would vary. Larger organizations may want to arrange the networks by department, assigning all computers within that department to the same network. For example, graphics might be 10.25.56.xxx, but news might be 10.25.66.xxx. This would allow you to have a large number of computers in each department.
Stay away from addresses that end in zero, and 254 to 255 inclusive. These addresses are reserved for special network applications. Also note that gateways — routers that allow you to connect to other networks — usually have a LAN address ending in one. In our example, a gateway router would be assigned the address 10.25.56.1.
The role of a subnet mask
A subnet mask is applied to an IP address to determine which portion of the address refers to the network and which portion refers to a specific computer on the network. On most computers, the network mask is set to 255.255.255.0, which effectively turns the subnet mask off.
When working with an internal network where you can create all the addresses needed, you may never have to worry about setting the subnet mask to anything other than 255.255.255.0. On the other hand, if you ever work with a piece of equipment that is directly connected to the Internet, you will almost always need to set the subnet mask appropriately.
It may be easiest to understand subnet masks by looking at an example. Let's say that you are an engineer at a television station that has a T1 connection to the Internet. Your Internet service provider (ISP) says you have six public IP addresses and that the address range is 66.235.22.8/29. The ISP is giving you a range of IP addresses in Classless Inter-Domain Routing (CIDR) notation. (Read more about CIDR in RFC 1518 and 1519.) The /29 indicates that there are a total of eight IP addresses in this block. As Table 1 (below) shows, the number after the slash indicates the total number of IP addresses available.
Why does Table 1 show that eight addresses were issued, but the ISP says you only have six? The reason is that the first and last addresses are reserved. Given the CIDR of 66.235.22.8/29, you would be free to assign the addresses 66.235.22.9 through 66.235.22.14 to host computers you want to connect directly to the Internet. Note that you would set the subnet mask on these computers to 255.255.255.248.
As you know, 255 is a common number in Internet address notation. What is so magical about 255? It is an easy number to represent in binary.
In binary, the right most digit represents ones, the next digit to the left represents twos, the next digit to the left represents fours, and so on. As you can see in Table 2 (below), a binary value of 11111111, or eight ones, equals 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, which equals 255. A group of eight binary digits is sometimes referred to as an octet. Internet addresses are specified by four octets separated by periods. The reason 255 is a common number in Internet notation is because it is easy for computers to count from zero to 11111111 in binary, and to make decisions based upon values that are all ones or zeros.
Now, let's go back to the number that represents the quantity of public IP addresses at our disposal in this example. Why would the number /29 be chosen to represent eight addresses on the network? To answer this question, it might be useful to look at the network address assigned by the ISP and its corresponding subnet mask in binary. (See Table 3, below.)
There are 29 ones in the binary representation of the subnet mask. Not only that, but if you look at the subnet mask, you will see that only three binary numbers are set to zero — the last three. A binary value of 111 equals seven. So, if you use the subnet mask to strip off all but the last three digits of the assigned IP address, the maximum number of values that can be represented is eight (zero through seven). It is possible to design logic that can quickly strip off the first 29 bits, or the last three bits.
One reason CIDR notation is common is because it is convenient. It is much easier to say 66.235.22.8/29 than it is to say 66.235.22.8 with eight valid IP addresses, or 66.235.22.8 with a subnet mask of 255.255.255.248.
Brad Gilmer is executive director of the Video Services Forum, executive director of the Advanced Media Workflow Association and president of Gilmer & Associates.
| CIDR | Available addresses | Usable | Subnet mask |
|---|---|---|---|
| /32 | 1 | 0 | 255.255.255.255 |
| /31 | 2 | 0 | 255.255.255.254 |
| /30 | 4 | 2 | 255.255.255.252 |
| /29 | 8 | 6 | 255.255.255.248 |
| /28 | 16 | 14 | 255.255.255.240 |
| … | |||
| /25 | 128 | 126 | 255.255.255.128 |
| /24 | 256 | 254 | 255.255.255.0 |
Table 1. An ISP will give you a range of IP addresses in CIDR notation, which defines the available addresses, usable addresses and subnet masks.
| Base-10 value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Binary | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Table 2. An example of binary values
| IP address | 66 | 235 | 22 | 8 |
| Binary | 01000010 | 11101011 | 00010110 | 00001000 |
| Subnet mask | 255 | 255 | 255 | 248 |
| Binary | 11111111 | 11111111 | 11111111 | 11111000 |
Table 3. Network address assigned by the ISP and the corresponding subnet mask in binary
Send questions and comments to: brad.gilmer@penton.com
| Want to use this article? Click here for options! |





























