# Simplified IP Addressing

Some years back when I was teaching Novell courses, I noted that many students in my TCP/IP course were having problems understanding IP addressing. Other instructors were seeing the same results. Although I carefully walked the students through the material, many of them still had difficulty grasping the concepts. Furthermore, their problem was exacerbated by having to take the CNE tests, which were closed-book and timed. Hence, they needed a quick and effective way of working with IP addresses.

I fine-tuned an approach to minimize the chances for test errors and to help them memorize and apply the principles at almost any time, even years later. I used to give this one- to two-hour IP presentation toward the end of the course, and it worked great. Very few of my students failed the test.

In the last couple of years, I have been teaching at DeVry and found the need to “dust off” my IP presentation. It has worked equally well at DeVry. This article summarizes that presentation.

The first question concerns what constitutes a Class A, or a Class B, etc. network. Novices have trouble remembering where each class begins and ends. Table 3 shows a schema to help with this. First, let's discuss some basics of binary numbers.

A byte is a grouping of eight binary bits. Since a binary bit is either a 0 or a 1, a byte consists of eight 0s and/or 1s. No mystery here. So 10010101 is one byte and 11100000 is another. How do we convert these to decimal numbers? It turns out that the right-most bit has a weight of 1 (2<+>0<+>). The next bit to its left has a weight of 2 (2<+>1<+>), the next has a weight of 4 (2<+>2<+>), i.e., two raised to the second power and so on:

2

or equivalently:

128 64 32 16 8 4 2 1 : decimal weightsThus, the binary number 10101001 has a decimal equivalent of

1x1 + 1x8 + 1x32 + 1x128 = 169If you assign contiguous 1s starting from the right, the above diagram can be used as a kind of calculator. Let's say you have 00001111 binary bits. To get the decimal equivalent, you could do the calculations the hard way, that is:

1x1 + 1x2 + 1x4 + 1x8 = 15or you could note the following (taking our number):

128 64 32 16 8 4 2 1 :decimal weights 0 0 0 0 1 1 1 1 :binary numberIf you have all ones starting at the right side, you can simply take the weight of the first 0 bit (16 in this case), subtract 1, and you have 15—the decimal equivalent—without having to use a calculator. Thus, if all the bits on the right are 1s, you can determine the decimal value by using the above diagram as a kind of calculator.

Note that the bits go up in powers of 2, so the ninth bit has a decimal weight of 256. So if you have a byte with all ones, i.e., 11111111, then it has a decimal value of 255 (256 -1). 255 appears many times in IP addressing.

Now we need to construct another calculator for handy reference (see Table 1). There is a thing called netmasking, which I will discuss later on. Standard procedure says to start the masking from the left and work down. So, if you make the eighth, or high-order bit, 1 and the rest equal to 0, the decimal equivalent is 128; if you made the first three bits 1 and the rest 0, the decimal equivalent is 224, etc.

This table works fine, but is a bit unwieldy. Table 2 shows a short version. It says that if your byte is 11100000, then the decimal equivalent value is 224. If this bothers you, just use Table 1.

We have set the groundwork for IP addressing, and I will now discuss the standard IPv4 addresses. The IP addresses are sometimes called “dotted quad” numbers. There are five classes of IP addresses, i.e., A, B, C, D and E. Classes D and E are reserved so you can work with classes A, B and C. However, I will show all five here. The class is determined from the first byte. Thus, an IP address of 205.140.187.31 is a class C address, since the first byte is 205. How do I know that? Well, let's look at Table 3.

How did I get Table 3? I had to remember only a couple of pieces of information, then I constructed the rest. I know there are five classes of IP addresses, and the first byte of the IP address tells you to which class it belongs. I also know the schema for the binary starting value of the first byte, i.e., 0, 10, 110, etc. Because of the way it follows a schema, the second column is easy to construct. Now, using Table 2, it was easy to construct the third column.

Next, note that the fourth column (ending point) follows naturally by simply subtracting one from the beginning of the next class. A class C begins at 192, while a class D begins at 224. Hence, a class C must end at 223. Now you have no excuses about forgetting the beginning and ending points of each class; merely remember the binary schema, and take a minute to construct the table. On a side note, you don't have to worry about Classes D and E, except that the beginning of Class D tells you where Class C ends by subtracting 1.

## Geek Guides

Practical (and free!) books for the most technical people on the planet.

- NEW: Get in the Fast Lane with NVMe
- NEW: Take Control of Growing Redis NoSQL Server Clusters
- Linux in the Time of Malware
- Apache Web Servers and SSL Encryption
- Build a Private Cloud for Less Than $10,000!

**Plus many more.**

## Trending Topics

September 2015 Issue of Linux Journal: HOW-TOs | Sep 01, 2015 |

September 2015 Video Preview | Sep 01, 2015 |

Using tshark to Watch and Inspect Network Traffic | Aug 31, 2015 |

Where's That Pesky Hidden Word? | Aug 28, 2015 |

A Project to Guarantee Better Security for Open-Source Projects | Aug 27, 2015 |

Concerning Containers' Connections: on Docker Networking | Aug 26, 2015 |

- Using tshark to Watch and Inspect Network Traffic
- September 2015 Issue of Linux Journal: HOW-TOs
- Concerning Containers' Connections: on Docker Networking
- Problems with Ubuntu's Software Center and How Canonical Plans to Fix Them
- Firefox Security Exploit Targets Linux Users and Web Developers
- A Project to Guarantee Better Security for Open-Source Projects
- Where's That Pesky Hidden Word?
- Build a “Virtual SuperComputer” with Process Virtualization
- My Network Go-Bag
- Doing Astronomy with Python

## Comments

## thanksssssssssss

Sir,

Thanks for ur tutorial on ip addressing. It has never been so easy to grasp.I would appreciate simplified tutorials on all other topics of networking(cisco)from you.

## Re: Linux Apprentice: Simplified IP Addressing

Aclare' muchas de mis dudas con este articulo.

Antes de leer el articulo tenia unas dudas. Despues de la lectura entendi' muchas cosas 'oscuras' del asunto.

Honestamente, considero acertado el metodo que el autor aborda el tema: Las tablas dan una explicacion del 'como y porque'. Sobretodo, la parte de ``subnetting"

Manuel Kobashigawa

(mil disculpas. no escribo en ingles, mas entiendo -regular- la lectura)