Professional Documents
Culture Documents
Binary is a numbering system that uses only the digits 1 and 0. We are
accustomed to using the decimal number system, which uses the digits 0
through 9.
Binary is the numbering system that network devices use to process all data.
Without binary, computers and networks would not function. All data sent
across a network is in binary.
Just like we use the decimal numbering system (numbers 0 through 9) for all
counting, money, and financial transactions, computers use binary for storage
of all data, all data transmissions, and all numerical calculations. You can
think of this as a language. For example, all people in Russia use Russian for
all communication. If someone in Russia talked to someone in the United
States, they would probably talk in English so that we could understand and
communicate. That person would be bilingual because they understand two
languages. In that sense, you could compare the computer to them because
the computer understands two numbering systems, binary and decimal.
Humans don't want to have to think or do calculations in binary. We want to
convert those binary numbers to decimal. Converting from binary to decimal is
not difficult. The numbers 0 and 1 in binary are converted to 0 and 1 in
decimal. After that, it gets a little more complicated.
Decimal Binary
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000
9 1001
10 1010
27 26 25 24 23 22 21 20
12864 32 16 8 4 2 1
Let's discuss how to use this chart. First, always start by looking at the chart
from right to left, not from left to right. Second, all the numbers on the chart
stay where they are -- you don't change these. These numbers are used to tell
you the values of the binary digits you will enter in the blanks.
Finally, the top line of 2x numbers tells you what each column represents. The
column on the far right is worth 20. The second line, with the decimal numbers,
tells you what the answer is to the 20 line. So, if you look at the column on the
far right, second line, it tells you that 20 is equal to 1 IF there is a 1 in the blank
below it. If you had a one in the fourth column from the right, 23, you would
have a value of 8 turned ON. Anywhere that you do not have a 1 in the bottom
line, you will fill in with a zero. Think of each of these columns being able to be
turned ON and OFF by using a 1 or a 0, respectively.
When you are done filling in your 1's and 0's on the bottom line of the chart,
you can add all the values that you turned ON, in decimal, from left to right
(using the second line of the chart). Thus, if you had put a 1 in the 23 column
(8) and a 1 in the 20 column (1), you would add 8 + 1 = 9. That 9 is
represented by 1001.
27 26 25 24 23 22 21 20
1286432168 4 2 1 = 9
0 0 0 0 1 0 0 1 = 1001
Let's look at another example... If you look at the number 3, it was calculated
by having a 1 in the 20 place and a 2 in the 21 place (starting on the right-hand
side of the table). If you add the 1 that you get from the 20 place and the 2 that
you get from the 21 place, you get 3. In other words, 1 + 2 = 3.
Let's look at another one. The 1000 in binary represents 8 in decimal because
you have a 1 in the 23 place and that gives you 8. You have 0's in all the other
places.
The three critical pieces of information that you, the network administrator,
provide or a DHCP server provides to network devices (computer, server,
router, switch, etc.) are:
• IP Address
• Subnet mask
• Default Gateway
The network device immediately converts this information into binary. So, let's
pretend that we are that network device and we are given the following
information:
• IP Address = 1.1.1.1
• Subnet Mask = 255.255.255.0
• Default Gateway = 1.1.1.254
The computer converts this information into binary and calculates the Network
ID. Before we can calculate the Network ID, we first have to convert from
decimal to binary.
1 decimal = 1 binary
1 decimal = 1 binary
1 decimal = 1 binary
1 decimal = 1 binary
That was easy! To convert the subnet mask of 255.255.255.0, take each octet
one at a time, using the table:
27 26 25 24 23 22 21 20
12864 32 16 8 4 2 1
To do this, I looked at the bottom row of numbers that each binary space
represents. I started with 27, which equals 128. So, how many 128's are in
255? The answer is 1. So I write:
256 – 128 = 127
Now, how many 64's (the next binary space) are in 127? The answer is 1, so I
write: 127 – 64 = 63
So, I used all 8 binary spaces to calculate the 255 in decimal, to be 11111111
in binary. The last octet is a 0, so 0 in binary is 0 but we write 00000000. As
you get more experience you will already know that eight 1's in binary equals
255 in decimal.
To calculate the Network ID, start off with the IP address and subnet mask in
binary, from above:
Perform a logical AND on these. A logical AND is a math function where you
look at each row and calculate an answer based on the following rules:
• 0 and 0 = 0
• 0 and 1 = 0
• 1 and 1 = 1
Using the AND rules, I look at the first 0 in the IP address and the first 1 in the
subnet mask. I see that, according to the rules, a 0 and a 1 = 0. That is how I
calculated the first 0 in the network ID. To continue, I go from left to right,
calculating each row.
Notice that the only difference between the IP address and network ID is in
the last number of the last octet. Now, to get the Network ID in decimal, we
convert this back. This is a simple example, so converting it back is easy. The
00000001 in binary is converted to 1 in decimal. In the last octet, the
00000000 is converted to 0. This makes our network ID:
1.1.1.0
So, when the network device wants to communicate with a host that has the
IP address of 1.1.1.200, it compares this with its network ID and finds that this
host is on the local network. The network device can then communicate
directly with it because it is on the 1.1.1.0 network. If the network device
wants to communicate with host 1.1.2.1, however, it finds that this is NOT on
its local network (the 1.1.1.0 network) and it sends this traffic to the default
gateway.
These examples are, of course, very simplified, since this topic can get very
complex when you begin subnetting networks and using variable-length
subnet masks.
Article Summary
binary
- Binary describes a numbering scheme in which there are only two
possible values for each digit: 0 and 1.� The term also refers to any digital
encoding/decoding system in which there are exactly two possible states.� In
digital data memory, storage, processing, and communications, the 0 and 1
values are sometimes called "low" and "high," respectively.
Binary numbers look strange when they are written out directly.� This is
because the digits' weight increases by powers of 2, rather than by powers of
10.� In a digital numeral, the digit furthest to the right is the "ones" digit; the
next digit to the left is the "twos" digit; next comes the "fours" digit, then the
"eights" digit, then the "16s" digit, then the "32s" digit, and so on.� The
decimal equivalent of a binary number can be found by summing all the
digits.� For example, the binary 10101 is equivalent to the decimal 1 + 4 + 16
= 21:
DECIMAL = 21
64
32
16
BINARY = 10101
DECIMAL
1. What do you need to know about addresses?
You probably know what an IP address is: a number that identifies that device
on the network. But what else do you need to know? IP addresses are made
up of 32 bits (IPv4 addresses, that is). We normally think of an IP address as
something like 1.1.1.1, but really this can be translated into eight binary bits
(see Binary-to-Decimal Conversion for more information). Each set of binary
bits can represent only the numbers zero through 255. That is why your IP
addresses can range only from 0.0.0.0 to 255.255.255.255.
By the way, the IP address 255.255.255.255 is called the "all ones" network
because in binary it is represented by 32 numeral ones (1s). The all ones
address is used to send a packet to all devices on all networks (as long as it
isn't stopped by a router first).
A subnet mask is what tells your computer (or other network device) what
portion of the IP address is used to represent your network and what part is
used to represent hosts (other computers) on your network. For example, if
you have an IP address of 1.1.1.1 and a subnet mask of 255.255.255.0, the
255s mask off the first three 1s. If you did the logical "AND" (the calculation
your computer does -- see Binary-to-Decimal Conversion for more
information), you would find out that the network ID for this network is 1.1.1.0.
Where the 0 is located, you could fill in hosts numbered 1 to 254. For
example, the first host on your network is 1.1.1.1 and the last host is
1.1.1.254.
Of special note when looking at the number of hosts in a network is this: The
first IP address in a network is the network address and the last IP address is
always the broadcast address. That's why I couldn't use IP address 1.1.1.0
and IP address 1.1.1.255. These are special, reserved addresses, but some
computers will allow you to use the network address as a real computer
address.
When the concept of IP addressing was first thought up, it was decided that IP
addresses would be put into classes. These classes are:
Today, these default subnet masks aren't much used except as a point of
reference and trivia. For example, if I said that your IP address was
192.168.1.1 but didn't tell you the subnet mask, it would be safe to assume
that your subnet mask is 255.255.255.0 because that IP address falls into the
Class C range. This is also important when you take some certification tests.
In real life, an IP address today could have any legal subnet mask. For
example, you may have an IP address of 1.1.1.1 with a subnet mask of
255.255.255.240. Or you may have an IP address of 192.192.192.192 with a
subnet mask of 255.0.0.0. Sometimes, people will say things like "I need an
entire Class C block of addresses." This just means that they want 254
contiguous and usable IP addresses.
The term "classful" means that the IP address or software is assuming that IP
addresses fall into these classes and uses the default subnet mask shown. If
a routing protocol, like RIP, is classful, it has trouble with the IP addresses that
don't use the default subnet masks.
On the other hand, a "classless" routing protocol, like RIP version 2, doesn't
assume that IP addresses have their default subnet masks. Today, you should
assume that all network devices are classless unless you find that they are
not (like routing protocols RIP or IGRP, or a very old computer operating
system).
The private IP address space is defined by RFC1918. In this RFC, it says that
no public (take that as "no Internet") devices will use or recognize the
following IP addresses:
Your IP address may be the same on your PC as someone else's if you have
a private IP address. These ranges of IP addresses are available for anyone
to use on their own internal (private) network. There is no need to keep them
unique. I can have IP address 192.168.1.1 on my home network and so can
everyone else in the world! When I go to make a request to the Internet,
however, that private IP address must be converted into a public IP address or
else the Internet router I make the request to will just throw my request away
(because I have a private IP address). Network Address Translation (NAT) is
what performs this public-to-private translation (see RFC1631 and RFC2663
for more information on NAT).
Private IP addresses are there to reduce the need for more public IP
addresses. An unintentional consequence is that they provide a tiny bit of
security.
So, if I am trying to FTP to your computer on the Internet and you tell me that
your IP address is 192.168.3.3, I will tell you "No, I need your public IP
address, not your private IP address."
subnet
The IP Address
130.5.5.25
Each of the decimal numbers represents a string of eight binary digits. Thus,
the above IP address really is this string of 0s and 1s:
10000010.00000101.00000101.00011001
As you can see, we inserted periods between each eight-digit sequence just
as we did for the decimal version of the IP address. Obviously, the decimal
version of the IP address is easier to read and that's the form most commonly
used.
Some portion of the IP address represents the network number or address and
some portion represents the local machine address (also known as the host
number or address). IP addresses can be one of several classes, each
determining how many bits represent the network number and how many
represent the host number. The most common class used by large
organizations (Class B) allows 16 bits for the network number and 16 for the
host number. Using the above example, here's how the IP address is divided:
130.5 . 5.25
If you wanted to add subnetting to this address, then some portion (in this
example, eight bits) of the host address could be used for a subnet address.
Thus:
130.5 . 5 . 25
To simplify this explanation, we've divided the subnet into a neat eight bits but
an organization could choose some other scheme using only part of the third
quad or even part of the fourth quad.
Using the previous example (which is a very typical case), the combined
network number and subnet number occupy 24 bits or three of the quads. The
appropriate subnet mask carried along with the packet would be:
255.255.255.0
Or a string of all 1's for the first three quads (telling the router to look at these)
and 0's for the host number (which the router doesn't need to look at). Subnet
masking allows routers to move the packets on more quickly.
If you have the job of creating subnets for an organization (an activity called
subnetting) and specifying subnet masks, your job may be simple or
complicated depending on the size and complexity of your organization and
other factors.