Professional Documents
Culture Documents
IP Addressing
IP Addressing
IP Addressing
Table of contents
Chapter 5 IP Addressing ............................................................................................................ 1
5.1 Introduction ...................................................................................................................... 1
5.2 Types of IP addresses ....................................................................................................... 1
5.2.1 Private IP addresses ................................................................................................... 1
5.2.2 Public IP addresses .................................................................................................... 1
5.3 Working of IP addresses .................................................................................................. 2
5.4 IP Terminology ................................................................................................................ 2
5.5 The Hierarchical IP Addressing Scheme ......................................................................... 2
5.6 Network Addressing ......................................................................................................... 3
5.7 Easy Subnetting ................................................................................................................ 4
5.7.1 How to Create Subnets .............................................................................................. 4
5.7.2 Subnet Masks ............................................................................................................. 5
5.7.3 Classless Inter-Domain Routing (CIDR) ................................................................... 5
5.7.4 Subnetting Class C Addresses ................................................................................... 5
5.8 Subnetting a Class C Address .......................................................................................... 6
5.9 Variable Length Subnet Masks (VLSMs) ........................................................................ 8
5.9.1 VLSM Design ............................................................................................................ 9
5.9.2 Implementing VLSM Networks .............................................................................. 10
i
Chapter 5 IP Addressing
5.1 Introduction
Every individual or business with an internet service plan will have two types of IP
addresses: their private IP addresses and their public IP address. The terms public and
private relate to the network location — that is, a private IP address is used inside a
network, while a public one is used outside a network.
5.2.1 Private IP addresses
Every device that connects to your internet network has a private IP address.
Therefore, your router generates private IP addresses that are unique identifiers for each
device that differentiate them on the network.
5.2.2 Public IP addresses
A public IP address is the primary address associated with your whole network.
Your public IP address is the address that all the devices outside your internet network
will use to recognize your network.
Public IP addresses come in two forms – dynamic and static.
Dynamic IP addresses
Dynamic IP addresses change automatically and regularly.
ISPs buy a large pool of IP addresses and assign them automatically to their customers.
Periodically, they re-assign them and put the older IP addresses back into the pool to be
used for other customers. The rationale for this approach is to generate cost savings for
the ISP.
Automating the regular movement of IP addresses means they don’t have to carry out
specific actions to re-establish a customer's IP address if they move home, for example.
There are security benefits, too, because a changing IP address makes it harder for
criminals to hack into your network interface.
Static IP addresses
In contrast to dynamic IP addresses, static addresses remain consistent. Once the network
assigns an IP address, it remains the same.
Most individuals and businesses do not need a static IP address, but for businesses that
plan to host their own server, it is crucial to have one. This is because a static IP address
1|Page
ensures that websites and email addresses tied to it will have a consistent IP address —
vital if you want other devices to be able to find them consistently on the web.
5.3 Working of IP addresses
The working of IP addresses is similar to other languages. It can also use some set of
rules to send information. Using these protocols we can easily send, and receive data or
files to the connected devices. There are several steps behind the scenes. Let us look at
them
Your device directly requests your Internet Service Provider which then grants your
device access to the web.
And an IP Address is assigned to your device from the given range available.
Your internet activity goes through your service provider, and they route it back to you,
using your IP address.
Your IP address can change. For example, turning your router on or off can change your
IP Address.
When you are out from your home location your home IP address doesn’t accompany
you. It changes as you change the network of your device.
To see the IP address of a device in Windows:
Use the command prompt.
Search for “cmd” (without the quotes) using Windows search
In the resulting pop-up box, type “ipconfig” (no quote marks) to find the information.
5.4 IP Terminology
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
The two- or three-level hierarchical addressing scheme that is structured by network and
host or by network, subnet, and host.
This two- or three-level scheme can also be compared to a telephone number. The first
section, the area code, designates a very large area. The second section, the prefix,
2|Page
narrows the scope to a local calling area. The final segment, the customer number, zooms
in on the specific connection.
IP addresses use the same type of layered structure. Rather than all 32 bits being treated
as a unique identifier, as in flat addressing, a part of the address is designated as the
network address and the other part is designated as either the subnet and host or just the
host address.
5.6 Network Addressing
3|Page
5.7 Easy Subnetting
Having one large network is not a good thing. To solve this problem we have subnetting,
which is a way of breaking up a giant network into a bunch of smaller ones.
B network.network.host.host 255.255.0.0
C network.network.network.host 255.255.255.0
In a Class C address, only 8 bits are available for defining the hosts. Remember that
subnet bits start at the left and move to the right, without skipping bits. This means that
the only Class C subnet masks can be the following:
5|Page
We can’t use a /31 or /32 because we must have at least 2 host bits for assigning IP
addresses to hosts.
5.8 Subnetting a Class C Address
When you’ve chosen a possible subnet mask for your network and need to determine the
number of subnets, valid hosts, and the broadcast addresses of a subnet that mask will
provide, all you need to do is answer five simple questions:
1. How many subnets does the chosen subnet mask produce?
2. How many valid hosts per subnet are available?
3. What are the valid subnets?
4. What’s the broadcast address of each subnet?
5. What are the valid hosts in each subnet?
Here’s how you arrive at the answers to those five big questions:
1. How many subnets?
2x = number of subnets. x is the number of masked bits, or the 1s. For example, in
11000000, the number of 1s gives us 22 subnets. So in this example, there are 4 subnets.
6|Page
Practice Example: 255.255.255.128 (/25)
We’re going to subnet the Class C network address 192.168.10.0.
192.168.10.0 = Network address
255.255.255.128 = Subnet mask
Since 128 is 10000000 in binary, there is only 1 bit for subnetting and 7 bits for hosts.
Now, let’s answer our big five:
Subnet 0 128
Looking at a Class C /25, it’s pretty clear that there are two subnets.
The key to understanding subnetting is to understand the very reason you need to do it,
and I’m going to demonstrate this by going through the process of building a physical
network.
7|Page
Figure 4 Implementing a Class C /25 logical network
Looking at Figure above, you can see that there are two physical networks, so we’re
going to implement a logical addressing scheme that allows for two logical networks.
The figure shows us that both subnets have been assigned to a router interface, which
creates our broadcast domains and assigns our subnets.
Notice that instead of one large broadcast domain, there are now two smaller broadcast
domains, providing for up to 126 hosts in each.
You have successfully subnetted a network and applied it to a network design.
Practice Example: 255.255.255.192 (/26)
192.168.10.0 = Network address
255.255.255.192 = Subnet mask
1. How many subnets does the chosen subnet mask produce?
2. How many valid hosts per subnet are available?
3. What are the valid subnets?
4. What’s the broadcast address of each subnet?
5. What are the valid hosts in each subnet?
5.9 Variable Length Subnet Masks (VLSMs)
VLSM networking is a simple way to create many networks from a large single network
using subnet masks of different lengths
It brings up another important subject of classful and classless networking.
Suppose the following network and mask
192.168.10.0 = Network
255.255.255.240 (/28) = Mask
8|Page
Figure 5 Typical classful network
Our subnets would be 0, 16, 32, 48, 64, 80, etc., which allows us to assign 16 subnets to
our internetwork. But how many hosts would be available on each network?
Well, as you know by now, each subnet provides only 14 hosts, so each LAN has only 14
valid hosts available (don’t forget that the router interface needs an address too and is
included in the amount of needed valid hosts). This means that one LAN doesn’t even
have enough addresses needed for all the hosts, and this network as it is shown would not
work as addressed in the figure!
Since the point-to-point WAN link also has 14 valid hosts, it would be great to be able to
nick a few valid hosts from that WAN link to give to our LANs!
All hosts and router interfaces have the same subnet mask—again, known as classful
routing— and if we want this network to be efficient, we would definitely need to add
different masks to each router interface.
But that’s not our only problem—the link between the two routers will never use more
than two valid hosts! This wastes valuable IP address space, and it’s the big reason you
need to learn about VLSM network design.
5.9.1 VLSM Design
Let’s take Figure above and use a classless design instead, which will become the new
network shown in Figure below
In the previous example, we wasted address space—one LAN didn’t have enough
addresses because every router interface and host used the same subnet mask. A better
solution would be to provide for only the needed number of hosts on each router
interface, and we’re going to use VLSMs to achieve that goal.
9|Page
Figure 6 Classless network design
Now remember that we can use different size masks on each router interface. If we use a
/30 on our WAN links and a /27, /28, and /29 on our LANs, we’ll get 2 hosts per WAN
interface and 30, 14, and 6 hosts per LAN interface (remember to count your router
interface as a host)!
This makes a huge difference—not only can we get just the right amount of hosts on each
LAN, we still have room to add more WANs and LANs using this same network!
5.9.2 Implementing VLSM Networks
To create VLSMs quickly and efficiently, you need to understand how block sizes and
charts work together to create the VLSM masks. Table 5.1 shows you the block sizes
used when creating VLSMs with Class C networks.
Table 5 Block sizes
/26 192 62 64
/27 224 30 32
/28 240 14 16
/29 248 6 8
/30 252 2 4
10 | P a g e
For example, if you need 25 hosts, then you’ll need a block size of 32. If you need 11
hosts, you’ll use a block size of 16. Need 40 hosts? Then you’ll need a block of 64. You
cannot just make up block sizes—they’ve got to be the block sizes shown in that table.
11 | P a g e