0% found this document useful (0 votes)
10 views11 pages

Understanding IP Addressing Basics

Uploaded by

allanaukao
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views11 pages

Understanding IP Addressing Basics

Uploaded by

allanaukao
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

LESSON 3: IP ADDRESSING

3.1 INTRODUCTION
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, [Link], [Link] and [Link]
 Broadcast Address – This is the address used to send data to all hosts in a network. The
broadcast address [Link] refers to all hosts in all networks while an address such as
[Link] refers to all hosts in a particular network.
An IP address is 32 bits in length. To make the address easier to read, it is divided into four sections of
8 bits each divided by a period. Each section is therefore, 1 byte (also called octet) long. 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
[Link]. This format of IP address is called the dotted decimal format. Some applications also
covert the address to hexadecimal format instead of decimal format. However this is not commonly
seen and as far as the CCNA exam is concerned, you need to only work with the dotted decimal format.
Topics in this chapter require binary to decimal conversions. Table 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 shows the decimal value for the most common binary numbers you will encounter in this
chapter.

Table 1 Decimal Value for each bit place in a byte


128 64 32 16 8 4 2 1

Table 2 Decimal Values for common binary numbers


Binary Value Decimal 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 it self. In effect, the IP address consists of two parts:

1. The Network component – Defines network (or subnet), in an internetwork, the host resides
in.
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 ([Link]). This class is for an internetwork with small
number of networks and large number of hosts per network.
 Class B – The first two bytes (16 bits) are the network component and the remaining three bytes
are host components ([Link]). This class bridges the gap between Class A
and Class C by providing for medium number of networks with medium number of hosts.
 Class C – The first three bytes (24 bits) are the network component and the last byte (8 bits) is
the host components ([Link]). This class provides for large number of
networks with fewer hosts per network.
 Class D – Used for multicasting.
 Class E – Reserved addresses
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 3 shows the first 5 bits and the first octet range of each class of address.
Table 3 Address range for different classes of address
First 5 bits in
Class binary First Octet range
0-127 (actually 1-126 because 0 and 127 are
A 0xxxx 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 [Link] is reserved to mean
“any network” and [Link] is reserved as a loopback address which refers to the host itself. So the
class A network is restricted to the 1-126 range.

Some IP address such as [Link] have a special meaning. Table 4 lists such addresses and what they
represent.

Table 4 Reserved IP addresses


Address What it represents Where can it be used
Represents “this network”. For For sending broadcast
Network address of all 0s example [Link] messages to the network.
For sending broadcast
Network address of all 1s Represents “all networks”. messages to all networks.
Represents a network address or
all hosts in the network. Routers route traffic based on
Node address of all 0s Example [Link] or [Link] network address.
Represents all hosts in a
network. Also called the
broadcast address. Example
[Link] or Used to send broadcasts to all
Node address of all 1s [Link] hosts in a network.
Used by routers to designate
Entire address of 0s Represents “any network”. the default route.
Used to send broadcast
Entire IP set to all 1s. Represents all hosts in network. messages
To send traffic from the host
to itself. If you want to
connect to a webserver
Represents the loopback running on the host itself, you
address which is essentially the will use this address in the
[Link] host itself browser.
3.2 DYNAMIC AND STATIC IP’S
3.3 IPv4

3.4 IPv6
3.5 SUBNETTING
In case of class A and B IP addresses, each of them provides for a large number of hosts. For class A,
the total numbers of hosts available are 224-2 or 16,777,216 hosts (class A has 24 bits available for host
component and each bit can have two values – 0 and 1. Out of the total value one address is for network
address and the other for broadcast. So two addresses are deducted). Similarly a Class B addresses
provides for 216-2 or 65,534 hosts. In the first chapter you learned about disadvantages of large
networks and why it becomes necessary to divide them into smaller networks joined by routers. So
creating a network with total number of hosts allowed for class A or B addresses will cause a lot of
problems. Meanwhile creating small networks with class A or B addresses will waste a lot of addresses.

To overcome this problem with class based addressing, subnetting was introduced. Subnetting allows
you to borrow some host bits and use them to create more networks. These networks are commonly
called subnets and are smaller in size. But since each network has a network address and a broadcast
address, some addresses get wasted.

To further understand how subnetting is useful consider a Class C address. Each class C address has
28-2 or 254 host addresses available. If you wanted 2 networks with 100 addresses and used 2 class C
networks, you would waste 308 addresses. Instead of using two class C networks, you can subnet one
to provide you two networks of 126 addresses each. This way lesser number of addresses would be
wasted.
While some of the benefits of subnetting are discussed above, the following list discusses all the
benefits associated with it:

 Reduced broadcasts – While broadcasts are necessary, too many of them can bring down
a network and the number of broadcasts is proportionate to the size of the network. So
subnetting a network to smaller subnetworks, helps reduce broadcasts since routers do not
forward broadcasts.
 Increased Network Performance – The direct result of reduced broadcasts is a network
that has more bandwidth available to the hosts. More bandwidth and lesser hosts result in a
better performance of the network.
 Easier Management – Managing and troubleshooting a large network is cumbersome and
difficult. Subnetting breaks a network into smaller subnetworks, making it easier to manage
each of them.
 Scalability – A single large network spanning a large geographical location will be more
difficult and costlier to manage. WAN links connecting different locations are costly and
having broadcasts choking the network can result is wasted money. Hence breaking down
a large network makes is easier to scale a network across geographical locations.
In case of class based subnetting, the first octet of the dotted decimal address tells which part of the
address is the network component and which one is the host component. But when host bits are
borrowed for subnetting, the class based boundaries do not apply and it is not possible to say which
bits are network bits. To overcome this, a third component of IP addresses were added. These are called
the subnet masks.
Subnets masks, like IP addresses, are 32 bit long. The value of subnet mask represents which bits of
the IP address are network components and which are host component. A value of 1 in a subnet mask
shows that the corresponding bit in the IP address is a network component while a value of 0 shows
that the corresponding bit is a host component. The following examples will help clarify this further:

1. An IP address of [Link] with a subnet mask of [Link]


(11111111.11111111.11111111.00000000) shows that the first three octets of the IP
address are the network component while the last octet is the host component.

2. An IP address of [Link] with a subnet mask of [Link]


(11111111.1111111.100000000.00000000) shows that one bit from the third octet has
been borrowed from the host component. Hence the network component is now 17 bits
long instead of the default 16 bit in a class B address.

3. An IP address of [Link].1 with a subnet mask of [Link]


(11111111.11111111.00000000.0000000) shows that the entire second octet has been
borrowed from the host component and now the network component is 16 bits long
instead of the default 8 bit of a class A address.

One restriction that applies to subnet masks is that all network bits (1) and all host bits (0) should be
contiguous. So a subnet mask of 11001100.11110000.11110000.00001111 is not valid because the
network and host bits are not contiguous. Table 5 shows the valid subnet mask values is an octet.

Table 5 Valid subnet mask values in an octet


Binary Value Decimal Value
00000000 0
10000000 128
11000000 192
11100000 224
11110000 240
11111000 248
11111100 252
11111110 254
11111111 255
Subnets masks are commonly represented in two ways:

 Dotted Decimal – [Link] [Link]


 Classless Inter-Domain Routing (CIDR) notation – [Link]/16
By now you may have figured out that the default subnet mask of class A is [Link] or /8, the default
mask of class B is [Link] or /16 and the default mask of class C is [Link] or /24. Table 6
shows the default masks of each class. These default masks cannot be changed. For example, you
cannot use a mask of [Link] for a class C address. If you try to use an invalid mask such as this,
every device will produce an error. For each class, the minimum mask is the default mask and it cannot
be reduced. Class A has to have a minimum mask of [Link], class B has to have a minimum mask
of [Link] and class C has to have a minimum mask of [Link].

Table 6 Default Subnet masks

Class Format Default Subnet Mask


A [Link] [Link]
B [Link] [Link]
C [Link] [Link]
Remember that an IP address without mask or a mask without IP address does not mean anything. A
mask of /24 does not mean that the address is a class C address. Even a class A or class B address can
have a mask of /24 after subnetting. Table 7 provides a list of dotted decimal subnet mask value and
the corresponding CIDR value.

Table 7 Subnet Mask values

Dotted Decimal Value CIDR notation


[Link] /8
[Link] /9
[Link] /10
[Link] /11
[Link] /12
[Link] /13
[Link] /14
[Link] /15
[Link] /16
[Link] /17
[Link] /18
[Link] /19
[Link] /20
[Link] /21
[Link] /22
[Link] /23
[Link] /24
[Link] /25
[Link] /26
[Link] /27
[Link] /28
[Link] /29
[Link] /30
Before moving to actual subnetting, you need to remember the powers of 2 i.e. the value of 2 multiplied
as many times as the given exponent. For example 24 = 2 x 2 x 2 x 2 = 16. Table 2-8 lists the first 14
values. It is not necessary to remember them all, but do remember that each value is twice the previous
one
Table 8 Powers of Two

Exponent Value
21 2
22 4
23 8
24 16
25 32
26 64
27 128
28 256
29 512
210 1024
211 2048
212 4096
213 8192
214 16384
When planning to subnet, you need to know three things:

 Total number of subnets that you need


 Total number of hosts per subnet that you need
 Available network and subnet mask (which will be subnetted)

Armed with answers to this, you need to find the following:


 Subnet Mask to be used across the network
 Valid subnets
 Network address for each subnet
 Broadcast address for each subnet
 Valid host addresses in each subnet.

Subnetting Class C Addresses


Subnetting technique remains the same irrespective of the class of address. The difference that the class
makes is the number of bits available for subnetting. Class C starts with a mask of /24 and can have a
maximum mask of /30. We cannot use /31 or /32 because at least 2 hosts bits are required for the
network and broadcast addresses and /31 and /32 give us 1 and zero host bits respectively. In the
examples below, you get to practice subnetting class C addresses.

Subnetting Class C Address – Example #1


Problem: Is [Link]/26 a host address?

Solution:
1. Converting /26 to dotted decimal format gives [Link]. The fourth octet is the interesting
octet.
2. Deducting 192 from 256 gives us 64. So the subnet addresses are 0,64,128 and 192
3. The network address and broadcast address are:
Network Address Broadcast Address
[Link] [Link]
[Link] [Link]
[Link] [Link]
[Link] [Link]

4. The host addresses for each of the subnets are:


Network Address Host Addresses Broadcast Address
[Link] [Link]-62 [Link]
[Link] [Link]-126 [Link]
[Link] [Link]-190 [Link]
[Link] [Link]-254 [Link]

5. The given address, [Link] is a host address in the last subnet.

You might also like