Sei sulla pagina 1di 5

2-1 IP Addresses – Composition, Types and Classes

Before heading deeper into IP addresses, you should be aware of the following terms

 Bit – A bit is a single digit with a value of 0 or 1.


 Byte – A byte is composed of 8 bits.
 Octet – An octet is also made up of 8 bits. Throughout this chapter the terms byte and octet are
interchangeable.
 Network Address – This refers to a remote network in terms of routing. All hosts in the remote
network fall within this address. For example, 10.0.0.0, 172.16.0.0 and 192.168.1.0
 Broadcast Address – This is the address used to send data to all hosts in a network. The
broadcast address 255.255.255.255 refers to all hosts in all networks while an address such as
192.168.1.255 refers to all hosts in a particular network.

The Hierarchical IP Addressing Scheme


An IP address consists of 32 bits of information. These bits are divided into four sections, referred to
as octets or bytes, with each containing 1 byte (8 bits). You can depict an IP address using one of
three methods:

Dotted-decimal, as in 172.16.30.56
Binary, as in 10101100.00010000.00011110.00111000
Hexadecimal, as in AC.10.1E.38

All these examples represent the same IP address. To further make it easier to read and remember, the
binary numbers are converted to decimal. For example, an IP address such as
11000000100000000000110000000001 is divided to make it
11000000.10000000.00001100.00000001.

When this address is converted to decimal, it will become 192.128.12.1. This format of IP address is
called the dotted decimal format. Some applications also covert the address to hexadecimal format
instead of decimal format.

Topics in this chapter require binary to decimal conversions. Table 2-1 shows the decimal value of each
bit location in a byte. To easily convert from binary to decimal, add up the decimal value corresponding
to the bit place that is “on” (1). For example, a binary value of 10110000 can be easily converted to
decimal by adding the decimal value of each bit that is 1. That gives us 128+32+16 = 176.

Table 2-2 shows the decimal value for the most common binary numbers you will encounter in this
chapter.

Table 2-1 Decimal Value for each bit place in a byte

128 64 32 16 8 4 2 1
Table 2-2 Decimal Values for common binary numbers
Binary Decimal
Value Value

10000000 128
11000000 192
11100000 224
11110000 240
11111000 248
11111100 252
11111110 254
11111111 255

An IP address does not only represent the host address. In fact it represents the network where the host
resides and the host itself. In effect, the IP address consists of two parts:

1. 1. The Network component – Defines network (or subnet), in an internetwork, the host
resides in.
2. 2. The Host component – Defines the host itself in the network.

Each combination of the network component and the host component should be unique in the entire
Internetwork. To make it easy to identify which portion of the address is network component and which
one is the host component, addresses are broken down into 5 classes discussed below:

 Class A – The first byte (8 bits) is the network component and the remaining three bytes (24 bits)
are host component (network.host.host.host). This class is for an internetwork with small number
of networks and large number of hosts per network. Class A network addresses are 1 byte long,
with the first bit of that byte reserved and the 7 remaining bits available for manipulation
(addressing). As a result, the maximum number of Class A networks that can be created is
27=128. The actual maximum usable number of nodes for a Class A network is 2 24 minus 2,
which equals 16,777,214
 Class A Valid Host IDs
Here’s an example of how to figure out the valid host IDs in a Class A network address:

o All host bits off is the network address: 10.0.0.0.


o All host bits on is the broadcast address: 10.255.255.255.
o The valid hosts are the numbers in between the network address and the broadcast
address: 10.0.0.1 through 10.255.255.254.

 Class B – The first two bytes (16 bits) are the network component and the remaining three bytes
are host components (network.network.host.host). This class bridges the gap between Class A and
Class C by providing for medium number of networks with medium number of hosts. Class B
network addresses should start with the binary digit 1, then 0. This leaves 14 bit positions to
manipulate, therefore 16,384, or 214 unique Class B network addresses. This is 216 minus the two
reserved patterns of all 0s and all 1s for a total of 65,534 possible node addresses for each Class B
network.
 Class B Valid Host IDs
Here’s an example of how to find the valid hosts in a Class B network:
o All host bits turned off is the network address: 172.16.0.0.
o All host bits turned on is the broadcast address: 172.16.255.255
o The valid hosts would be the numbers in between the network address and the broadcast
address: 172.16.0.1 through 172.16.255.254.

 Class C – The first three bytes (24 bits) are the network component and the last byte (8 bits) is
the host components (network.network.network.host). This class provides for large number of
networks with fewer hosts per network. In a Class C network address, the first three bit positions
are always the binary 110. Hence, there are 221, or 2,097,152, possible Class C networks.

 Class D – (224–239) is used for multicast addresses.

 Class E – (240–255) for scientific purposes.

In a binary address the first 5 bits of the address and the first octet in a dotted decimal address shows the
class of address. Table 2-3 shows the first 5 bits and the first octet range of each class of address.

Table 2-3 Address range for different classes of address

Class First 5 bits in First Octet range


binary
A 0xxxx 0-127 (actually 1-126 because 0 and 127 are
reserved
B 10xxx 128-191
C 110xx 192-223
D 1110x 224-239
E 1111x 240-254

Notice that first few bits in each class have a fixed value. For example a class A address should have the
first bit set to 0. Similarly class C should have first 2 bits set to 1 and the third bit set to 0. Another point
to note is that though the class A range is from 0 to 127, the address 0.0.0.0 is reserved to mean “any
network” and 127.0.0.1 is reserved as a loopback address which refers to the host itself. So the class A
network is restricted to the 1-126 range.

Exam Alert: Class of addresses and their address range is a very important topic. You will have to remember the
range associated with each class.
Before moving ahead, spend some time to figure out the class of some addresses given below. Also try to
figure out which portion is the network and which portion is the host part:

1. 1. 9.140.2.87 – This is a Class A address because the first octet lies in 1-126 range. 9 is the
network part while 140.2.87 is the host part because class A addresses have a
network.host.host.host format.

1. 2. 172.30.4.190 – This is a Class B address because the first octet lies in 128-191 range. 172.30
is the network part while 4.190 is the host part because class B addresses have a
network.network.host.host format.

1. 3. 194.144.5.10 – This is a Class C address because the first octet lies in the 192-223 range.
194.144.5 is the network part while 10 is the host part because class C addresses have a
network.network.network.host format.

1. 4. 45.22.187.1 – This is again a class A address with 45 being the network part and 22.187.1
being the host part.

Some IP address such as 127.0.0.1 have a special meaning. Table 2-4 lists such addresses and what they
represent.

Table 2-4 Reserved IP addresses

Address What it represents Where can it be used


Network address of all 0s Represents “this network”. For For sending broadcast
example 0.0.0.120 messages to the network.
Network address of all 1s Represents “all networks”. For sending broadcast
messages to all networks.
Node address of all 0s Represents a network address Routers route traffic based on
or all hosts in the network. network address.
Example 10.0.0.0 or 172.16.0.0
Node address of all 1s Represents all hosts in a Used to send broadcasts to all
network. Also called the hosts in a network.
broadcast address. Example
172.16.255.255 or
192.168.10.255
Entire address of 0s Represents “any network”. Used by routers to designate
the default route.
Entire IP set to all 1s. Represents all hosts in network. Used to send broadcast
messages
127.0.0.1 Represents the loopback To send traffic from the host to
address which is essentially the itself. If you want to connect to
host itself a webserver running on the
host itself, you will use this
address in the browser.
Exam Alert: It is important to remember that if all host bits in an address are set to 0 then it is a network address.
On the other hand if all host bits are set to 1 then it is a broadcast address. These addresses cannot be assigned to a
host.
As you know already, every host on a network requires a unique IP address. This is easily manageable in
a small network but not a network as large as the Internet. The Internet Assigned Numbers Authority
(IANA) is responsible for managing and distributing IP addresses. The IANA has created 5 address
registrars in five locations of the world. ISPs and large organizations purchase the addresses from these
registrars. The end user in turn gets the IP address from the ISP. These purchasable IP addresses are
called public addresses and are routable on the Internet. Every host on the Internet has one of these
addresses, in theory.

The IANA also designated a range of addresses in class A, B and C for use in private networks. These
addresses can be used by anyone within their network without any required permission but these
addresses are not routable on the Internet. You ISP or your organization usually assigns you one of these
addresses and later translates it to a public address when you want to get out to the Internet. The
designated ranges for private IP addresses are:

Class A – 10.0.0.0 to 10.255.255.255 (1 network)


Class B – 172.16.0.0 to 172.31.255.255 (16 networks)
Class C – 192.168.0.0 to 192.168.255.255 (256 networks)

Exam Alert: It is very important to remember the range of private IP addresses as you will more than likely see a
question about them on your CCNA exam.

Potrebbero piacerti anche