IP was created as a way to hide the
complexity of physical addressing by creating
a virtual addressing scheme that is independent
of the underlying network. IP does not ensure
that data is delivered to the
application in the appropriate order; that responsibility
is left to upper-layer protocols such as TCP
and UDP.
An IP address is 32 bits long. The bits can
be broken down into four bytes. Each byte is
expressed in decimal form and separated from
other bytes by a dot (that is, x.x.x.x).
This is called dotted-decimal format. Each bit
within a byte carries a binary weight (starting
from left to right) of 128, 64, 32,
16, 8, 4, 2, 1. If you add up these values,
you get a range of 0-255 for each byte.
For example, one byte can be translated
from binary format to decimal format as follows:
128 |
|
64 |
|
32 |
|
16 |
|
8 |
|
4 |
|
2 |
|
1 |
|
|
0 |
|
1 |
|
1 |
|
1 |
|
0 |
|
0 |
|
0 |
|
1 |
|
|
0 |
+ |
64 |
+ |
32 |
+ |
16 |
+ |
0 |
+ |
0 |
+ |
0 |
+ |
1 |
= |
113 |
IP addressing has been broken down into
five separate classes based on the number of
maximum hosts required by the network.
IP Address
Classes
8 16 24 32
| Class D |
1110 |
Multicast
Address |
You can see from Figure 8.2 that each
address class contains a network portion and
a host portion. The network portion identifies
the data link that is in common with all the
devices attached to that network. The host portion
uniquely identifies an end device connected
to the network.
Table IP Address Classes
Class Decimal Value
Purpose
Max, Hosts
of First Byte
Class A 0-127 Large
organizations 16,777,214
Class B 128-191 Medium-sized Organizations
65,543
Class C 192-223 Small organizations
254
Class D 224-247 Multicast addresses
n/a
Class E 248-255 Experimental n/a
Private IP Addresses
Starting Address Ending Address
10.0.0.0
10.255.255.255
172.16.0.0
172.31.255.255
192.168.0.0
192.168.255.255
Address Masks
The network mask is used in conjunction
with an IP address to delineate the network
portion of an IP address from the host portion.
Each major network address within its designated
class has a standard network mask:
Address Class Network Mask
Class
A
255.0.0.0
Class
B
255.255.0.0
Class
C
255.255.255.0
A major network address can be further
divided into smaller networks by using a technique
called subnetting. When a major network is subnetted,
the address can be broken into three parts:
ü
_ The network portion
ü
_ The subnet portion
ü
_ The host portion
When a network mask is varied into further
subnets like this, it is commonly referred to
as a Variable Length Subnet Mask (VLSM).
Cisco often represents the subnet mask
by identifying the number of bits used as the
mask. For example, 192.174.10.0/30 would represent
network 192.174.10.0 255.255.255.252. The value
of 30 represents the number of bits used for
the network portion of the address; in binary
format, 30 would be
255.255.255.252 = 11111111.11111111.11111111.11111100
= 30
Let's look at another example. Given
the following 170.130.0.0/21, what is the subnet
mask?
21 = 11111111.11111111.11111100.00000000
The network address and mask are
170.130.0.0 255.255.248.0.
Understanding how to derive the network
address and broadcast address when given an
IP address and mask is critical to passing the
CCIE Written Exam. Let's say that we want to
determine the network address, the broadcast
address, and the available addresses that
correspond with the given IP address:
150.34.74.53 255.255.240.0
1. Convert the IP
address and its address mask into binary format.
150.34.74.53
= 10010110
00100010 01001010
00110101
255.255.240.0
= 11111111 11111111 11110000 00000000
2. Perform a logical AND between the IP address and the mask.
A logical AND is a digital math operation
that compares two bits of data to each other.
The result of the operation is as follows:
0 and
0 = 0
0 and
1 = 0
1 and
0 = 0
1 and
1 = 1
So,
Host Address: 10010110 00100010 01001010
00110101
Mask:
11111111 11111111 11110000
00000000
Logical AND Result: 10010110 00100010 01000000
00000000
3. Convert the results of the logical AND back into decimal format; this
is the network address:
10010110
00100010
01000000 00000000
=
150.34.64.0
4. Calculate the broadcast address.
Remember that the network mask is used
to delineate the network portion of an IP address
from the host portion. Mask bits are set to
1 if the corresponding bit in the IP address
should be considered part of the network address
and 0 if part of the host address.
150.34.74.53
= 10010110 00100010 0100
1010
00110101
255.255.240.0
=
11111111 11111111
1111 0000
00000000
Network Bits
Host Bits
To determine the broadcast address,
we need to replace each bit available within
the host portion of the IP address with a value
of 1.
So, the broadcast address of the network
for the host 150.34.74.53 is
150.34.79.255
= 10010110
00100010
0100 1111
11111111
Network Bits
Host Bits
Summary:
Given the IP address and address mask:
150.34.74.53 255.255.240.0, we have determined
the following:
Network Address = 150.34.64.0
Broadcast Address = 150.34.79.255
Available Addresses = 150.34.64.1-150.34.79.254 (for a total of 4,078 hosts)
|