Lecture Slides - IP Addressing Part 2
Lecture Slides - IP Addressing Part 2
Ip addressing concept
Routing IP Addresses
When you build a network, you need to
figure out how many network Ids your
network requires.
To do so, you must account for every
WAN connection & subnet on the
Network.
Every node & router interface requires
a Host address, or ID.
Peter Smith
43
Routing IP Addresses (Cont.)
There’s no hard & fast rule on how you
should dole out your allotted IP
addresses.
Commonly, though, the lowest numbers
(1 through 10) are assigned to routers &
servers but how you assign addresses is
strictly up to you & your network
policies & guidelines.
Peter Smith
44
Limitations of Classful IP Addressing
• Running out of address space soon
232 = 4,294,967,296 addresses
Library
Add another level of hierarchy to the IP addressing structure this is also called Subnetting.
Basic Idea of Subnetting
Split the host number portion of an IP address into a subnet number and a (smaller) host
number.
Result is a 3-layer hierarchy
Then:
◦ Subnets can be freely assigned within the organization
◦ Internally, subnets are treated as separate networks
◦ Subnet structure is not visible outside the organization
Advantages of subnetting
With subnetting, IP addresses use a 3-layer hierarchy:
◦ Network
◦ Subnet
◦ Host
Improves efficiency of IP addresses by not consuming an entire address space for each
physical network.
Reduces router complexity. Since external routers do not know about subnetting, the
complexity of routing tables at external routers is reduced.
Note: Length of the subnet mask need not be identical at all sub networks.
Subnet Mask
•Class A : N.H.H.H
11111111.00000000.00000000.00000000
Default Subnet Mask for Class A is 255.0.0.0
•Class B : N.N.H.H
11111111.11111111.00000000.00000000
Default Subnet Mask for Class B is 255.255.0.0
•Class C : N.N.N.H
11111111.11111111.11111111.00000000
Default Subnet Mask for Class C is 255.255.255.0
Subnet Mask
An IP address has 2 parts:
The Network identification.
The Host identification.
Frequently, the Network & Host portions of
the address need to be separately extracted.
In most cases, if you know the address class,
it’s easy to separate the 2 portions.
Peter Smith
30
Subnet Mask (Cont.)
With the rapid growth of the internet &
the ever-increasing demand for new
addresses, the standard address class
structure has been expanded by borrowing
bits from the Host portion to allow for
more Networks.
Under this addressing scheme, called
Subnetting, separating the Network &
Host requires a special process called
Subnet Masking.
Peter Smith
31
Subnet Mask (Cont.)
The subnet masking process was
developed to identify & extract the
Network part of the address.
A subnet mask, which contains a binary
bit pattern of ones & zeros, is applied to
an address to determine whether the
address is on the local Network.
If it is not, the process of routing it to an
outside network begins.
Peter Smith
32
Subnet Mask (Cont.)
The function of a subnet mask is to
determine whether an IP address exists on
the local network or whether it must be
routed outside the local network.
It is applied to a message’s destination
address to extract the network address.
If the extracted network address matches
the local network ID, the destination is
located on the local network.
Peter Smith
33
Subnet Mask (Cont.)
However, if they don’t match, the
message must be routed outside the
local network.
The process used to apply the subnet
mask involves Boolean Algebra to filter
out non-matching bits to identify the
network address.
Peter Smith
34
Boolean Algebra
Boolean Algebra is a process that applies
binary logic to yield binary results.
Working with subnet masks, you need
only 4 basic principles of Boolean
Algebra:
1 and 1 = 1
1 and 0 = 0
0 and 1 = 0
0 and 0 = 0
Peter Smith
35
Boolean Algebra (Cont.)
In another words, the only way you can
get a result of a 1 is to combine 1 & 1.
Everything else will end up as a 0.
The process of combining binary values
with Boolean Algebra is called Anding.
Peter Smith
36
Default Standard Subnet
Masks
There are default standard subnet masks
for Class A, B and C addresses:
Peter Smith
37
A Trial Separation
Subnet masks apply only to Class A, B
or C IP addresses.
The subnet mask is like a filter that is
applied to a message’s destination IP
address.
Its objective is to determine if the local
network is the destination network.
Peter Smith
38
A Trial Separation (Cont.)
The subnet mask goes like this:
1. If a destination IP address is
206.175.162.21, we know that it is a
Class C address & that its binary
equivalent is:
11001110.10101111.10100010.00010101
Peter Smith
39
A Trial Separation (Cont.)
2. We also know that the default
standard Class C subnet mask is:
255.255.255.0 and that its binary
equivalent is:
11111111.11111111.11111111.00000000
Peter Smith
40
A Trial Separation (Cont.)
3. When these two binary numbers (the IP
address & the subnet mask) are combined
using Boolean Algebra, the Network ID
of the destination network is the result:
Peter Smith
41
A Trial Separation (Cont.)
4. The result is the IP address of the
network which in this case is the same
as the local network & means that the
message is for a node on the local
network.
Peter Smith
42
Classless IP Addressing
The Process of give the classless IP is also called “CIDR ”
It is announced in 1996, allows an ISP to assign as few or as many IP addresses as requested.
Two terms often used in classless addressing
◦ Prefix – another name for the common part of the address range (netid)
◦ Prefix length – the length of the prefix
In classless addressing, the last address in the block does not necessarily end in 255.
In CIDR (Classless Inter Domain Routing) notation, the block granted is defined by the first
address and the prefix length.
When an organization is granted a block of addresses, it can create subnets to meet its needs.
The prefix length increases to define the subnet prefix length.
In fixed-length subnetting, the number of subnets is a power of 2.
Subnet Mask Table
The addresses in color are the default masks for classes A, B, and C.
Thus, classful addressing is a special case of classless addressing.
How classless IP Addressing helps??
Consider a network that contains 9 hosts
Only 4 bits of host suffix are needed to represent all possible host values.
However, a class C address has names for 256 hosts.
Classless addressing solves this problem by allowing an ISP to assign a prefix that is 28 bits
long and the suffix then is 4 bits long.
With 4 bits for the suffix, there are 16-2 = 14 host numbers
CIDR Block Example
If an ISP has two computers each with only 12 computers each, the ISP can use CIDR to
partition a class B IP address into three parts: two for each of the customers and the
remainder available for future use.
One customer can be assigned: 128.211.0.16/28
The other customer can be assigned: 128.211.0.32/28