4. Understanding the IP Addresses
The IPv4 address has two
important components: the network ID and the host ID. The network ID
identifies the subnet the client is on, and the host ID is a unique
address on the subnet. The subnet mask identifies which portion of the
IP address is the network ID and which portion is the host ID.
Subnetting can be more
complex than the description given previously, and instead of dealing
with just 255 or 0 in the subnet mask, you could have different numbers
like 128, 192, and so on. However, for the purpose of the 70-685 exam
and this explanation, we are keeping it simple.
|
|
You should easily be able to
determine the network ID when you see an IP address and a subnet mask.
Moreover, you should be able to determine when these are misconfigured
for clients on a network.
4.1. Determining the Network ID
As an example, consider the following IP address and subnet mask:
192.168.1.10
255.255.255.0
Both the IP address and the
subnet mask use dotted decimal format, with four decimal numbers
separated by dots. To determine the subnet portion of the IP address,
look for the 255s in the subnet mask. Because the first three numbers in
the subnet mask are 255, the first three numbers in the IP address are
the network ID.
192.168.1.x
255.255.255.x
NOTE
Under the hood, each
decimal number is represented by 8 bits. 192 is represented by 1100
0000, 168 is represented by 1010 1000, and 1 is represented by 0000
0001. Because of this, when the numbers are shown in binary, they are
referred to as octets.
The network ID is expressed
with all four numbers, and the trailing numbers are always set as 0. For
example, the previous network ID would be expressed as 192.168.1.0.
Can you identify the network ID for the following IP address and subnet mask?
10.80.1.5
255.0.0.0
Because only the first
number in the subnet mask is a 255, only the first number in the IP
address is in the network ID. The network ID is 10.0.0.0.
4.2. Classful IP Addressing
You may occasionally see
IP addresses identified as classful addresses represented without a
subnet mask. There are three primary classes you may run across: Class
A, Class B, and Class C.
When a classful address is used, you automatically know what the subnet mask is, and you can then identify the network ID.
Class A
The first number in a Class A address is between 1 and 126, and the
subnet mask is 255.0.0.0. For example, an IP address of 10.1.2.3 has a
first number of 10, and since 10 is between 1 and 126, the subnet mask
is 255.0.0.0 and the network ID is 10.0.0.0.
Class B The first number is between 128 and 191 and the subnet mask is 255.255.0.0.
For example, an IP address of
172.1.2.3 has a first number of 172, which is between 128 and 191, so
the subnet mask is 255.255.0.0 and the network ID is 172.1.0.0.
Class C The first number is between 192 and 223 and the subnet mask is 255.255.255.0.
For example, an IP address of
192.1.2.3 has a first number of 192, which is between 192 and 223, so
the subnet mask is 255.255.255.0 and the network ID is 192.1.2.0.
NOTE
Where's 127? You may have
noticed that Class A ends at 126 and Class B starts at 128. Technically,
Class A addresses include the 127.x.y.z range, but this entire range is
used for testing, so it is not used.
The biggest benefit of using
classful IP addresses in documentation is that the subnet mask can be
omitted. However, it's important to realize that the rules of classful
IP addresses can be broken. For example, an administrator can specify an
IP address of 10.1.2.3 with a subnet mask of 255.255.255.0. In this
case, the network ID is 10.1.2.0.
If you see an IP address
that is identified as classful, you can use the first number of the IP
address to determine the subnet mask and the network ID. However, if you
see an IP address with a subnet mask, you would use the subnet mask
regardless of the first number in the IP address.
4.3. Identifying Misconfigured Clients
All assigned IP addresses
within a single subnet must have the same network ID. If not, they will
not be able to communicate with other clients on the subnet. In
addition, each client must be configured with the correct default
gateway or it will not be able to communicate outside the network.
Consider Figure 6.
Each client (numbered 1 through 6) has an assigned IP address (IP),
subnet mask (SM), and default gateway (DG). Can you tell what's wrong
with this picture? (The network interfaces on the router are configured
correctly.)
Client 1
This client is configured correctly. The network ID is 192.168.1.0.
Client 2
This client is configured
with an incorrect IP address. The third decimal is 11 but must be a 1 to
have the same network ID of 192.168.1.0 as other clients in the subnet.
It currently has a network ID of 192.168.11.0. This client will not be
able to communicate with any other clients on the network.
Client 3
This client is configured
with an incorrect default gateway. The near side of the router has an IP
address of 192.168.1.1, so the default gateway should be 192.168.1.1.
This client will be able to communicate with other clients in Subnet A
that have the same network ID (only client 1 in the figure), but it will
not be able to communicate with any clients on Subnet B.
Client 4
This client is configured
with an incorrect default gateway. The near side of the router has an IP
address of 192.168.25.1, so the default gateway should be 192.168.25.1,
not 192.168.1.1. This client will be able to communicate with other
clients in Subnet B that have the same network ID (only client 5 in the
figure), but it will not be able to communicate with any clients on
Subnet A.
Client 5
This client is
configured with an incorrect default gateway. The near side of the
router has an IP address of 192.168.25.1, so the default gateway should
be 192.168.25.1, not 192.168.24.1. This client will be able to
communicate with other clients in Subnet B that have the same network ID
(only client 4 in the figure), but it will not be able to communicate
with any clients on Subnet A.
Client 6
This client is
configured with an incorrect subnet mask. The third decimal is 0 but
should be 255, resulting in a network ID of 192.168.0.0 instead of
192.168.25.0. This client will not be able to communicate with any other
clients on the network.
4.4. Understanding CIDR Notation
You may occasionally see
IP addresses expressed with a slash and a number at the end, like this:
192.168.1.5/24. This is referred to as Classless Inter-Domain Routing
(CIDR) notation, and the number after the slash (/) represents the
number of bits in the subnet mask.
Each IPv4 address and
each subnet mask are represented by 32 bits (32 1s and 0s). However,
when working with Windows interfaces, we normally use the decimal format
of the IP address instead of listing all the 1s and 0s.
When a subnet mask is
represented in dotted decimal format, it has four octets separated by
dots, such as 255.255.255.0. If you look under the hood though, the
subnet mask is represented in binary format and each octet is
represented by 8 bits (such as 1 1 1 1 1 1 1 1 or 0 0 0 0 0 0 0 0).
A subnet mask of 255.255.255.0 is expressed in binary format as
1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 0 0 0 0 0 0 0 0.
Each string of 8 binary 1s
represents the decimal number 255. A subnet mask of 255.255.255.0 has
three strings of 8 binary 1s, with a total of 24 1s (3 * 8 = 24). CIDR
notation uses the number of 1s in the subnet mask to express the value.
Instead of the traditional method of expressing the subnet mask as
255.255.255.0, it can be expressed as /24.
Similarly, an address of
10.80.5.2/8 would have a subnet mask of 255.0.0.0. The /8 indicates only
the first 8 bits of the subnet mask are 1s. In other words, the subnet
mask in binary format is
1 1 1 1 1 1 1 1 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0 . 0 0 0 0 0 0 0 0.
IP addresses are either public
(on the Internet) or private. The Internet Assigned Numbers Authority
(IANA) has designated several IP address ranges as private, and they
will never be used on the Internet. These private IP address ranges are
as follows:
10.0.0.1 through 1.255.255.255.254 (available IP addresses: 16,777,214) 172.16.0.1 through 172.31.255.255 (available IP addresses: 1,048,574) 192.168.0.1 through 192.168.255.254 (available IP addresses: 65,534)
Although the same public IP
address can't be used by more than one host on the Internet, the same
private IP addresses can be used by different private companies. For
example, Acme could use the same IP address in the 192.168.1.0/24 range
as Zycom uses. Since the addresses are private within each company,
there is no conflict.
|
4.5. A Few Words on IPv6
IPv6 has arrived—on the Internet
anyway. While it's spreading rapidly on the Internet, you may not see
it being used as much on internal networks. Still, you should be aware
of some of the basics of IPv6.
NOTE
IPv6 does not support
NetBIOS names. If your network is still using NetBIOS names and WINS
servers, you will not be able to migrate to an IPv6-only network.
However, IPv4 and IPv6 can coexist, so it is possible to support NetBIOS
with IPv4 but use IPv6.
As background, the move to
IPv6 was driven largely because the Internet was running out of
available IP addresses. IPv4 uses 32 bits (232), and it could only
address about 4 billion clients. However, IPv4 wasted a lot of
addresses, so we didn't really have 4 billion IP addresses that could be
used.
IPv6 uses 128 bits (2128),
which is almost incomprehensible. Instead of having a total of 4
billion IP addresses on the entire Internet, it allows for more than 4
billion IP addresses for every person alive today (currently estimated
at about 6.8 billion people).
Both IPv4 and IPv6 can
coexist on the same network, and they are currently doing so on the
Internet. While private networks can also support both IPv4 and IPv6 at
the same time, there doesn't seem to be a quick move to do so. The
servers that interact with the Internet need to use both IPv4 and IPv6,
but most internal networks don't need IPv6 yet.
A simple reason why IPv6
isn't needed is that private networks aren't running out of IP
addresses. The three private IP address ranges can be used to meet the
needs of any organization on the planet.
An IPv6 address is
expressed in hexadecimal. A hexadecimal character can be 0 through 9 and
A through F, and it represents four binary bits. Because the IPv6
address has 128 bits, it is represented by 32 hexadecimal characters
(128/4). These hexadecimal characters are represented in eight groups of
four separated by a colon. As an example, the following is an IPv6
address:
2000 : 0001 : 4137 : 9E50 : 006C : 229E : B43A : 21E5
4.6. IPv6 Prefixes
There's no such thing as a
subnet mask for IPv6. IPv6 uses an implicit 64-bit address prefix for
any addresses assigned to network interfaces. However, there are some
exceptions. IPv6 uses several unique prefixes to identify different
types of addresses.
Global unicast
The address prefix is 2000::/3. A global unicast address is globally
routable over the Internet. It uniquely identifies a single host on the
Internet, and it can be thought of as similar to an IPv4 address.
Link-local unicast The address prefix is FE80::/8. A link-local address
is used within a private network and is not recognized outside the
enterprise. Link-local addresses are assigned using autoconfiguration
similar to IPv4 APIPA addresses. These are used when a DHCP server is
not available.
Unique local unicast
The address prefix is FD00::. A unique local unicast address is an
address assigned within a private network. This has been defined in RFC
4193, and it is intended to be used instead of site-local addresses.
NOTE
Site-local addresses
(with a prefix of FEC0::/7) were deprecated in September 2004 by RFC
3879. Unique local unicast addresses are used instead.