0% found this document useful (0 votes)
5 views44 pages

Understanding IPv4 Addressing Basics

It talks about the IP addresses ipv4 and ipv5

Uploaded by

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

Understanding IPv4 Addressing Basics

It talks about the IP addresses ipv4 and ipv5

Uploaded by

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

IPv4 ADDRESSES

An IPv4 address is a 32-bit address that uniquely and


universally defines the connection of a device (for
example, a computer or a router) to the Internet.
An IPv4 address is 32 bits long.
The IPv4 addresses are unique
and universal.
The address space of IPv4 is
232 or 4,294,967,296.
Dotted-decimal notation and binary notation for an IPv4 address

•Binary notation (base 2),


•Dotted-decimal notation (base 256),

•Hexadecimal notation (base 16).


10000001 00001011 00001011 11101111
0X810B0BEF or 810B0BEF16
Example 1

Change the following IPv4 addresses from binary notation


to dotted-decimal notation.

Solution
We replace each group of 8 bits with its equivalent decimal
number (see Appendix B) and add dots for separation.
In Classful addressing, the address space is divided into five classes:
A, B, C, D, and E.
Finding the classes in binary and dotted-decimal notation
Finding the address class using continuous
checking
Example 2

Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. [Link]
d. [Link]

Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
Netid and hostid
In classful addressing, an IP address in classes A, B, and C
is divided into netid and hostid
Classes and Blocks
•Millions of class A addresses are wasted.
•Many class B addresses are wasted.
•Not so many organizations are so small to
have a class C block.
•Class D addresses are made of one block,
used for multicasting.
•The only block of class E addresses was
reserved for future purposes.
Number of blocks and block size in classful IPv4 addressing
In classful addressing, a large part of the
available addresses were wasted.
Default masks for classful addressing
Network address
Default mask

A network mask or a default mask in


classful addressing is a 32-bit number
with n leftmost bits all set to 1s and
(32 − n) rightmost bits all set to 0s.
Information extraction in classful
addressing
Example : An address in a block is given as
[Link]. Find the number of addresses in
the block, the first address, and the last address.
[Link] number of addresses in this block is
N = 232−n = 232−8 = 224 = 16,777,216.
[Link] find the first address, we keep the
leftmost 8 bits and set the rightmost 24 bits all
to 0s.
The first address is [Link]/8 in which 8 is the
value of n.
[Link] find the last address, we keep the
leftmost 8 bits and set the rightmost 24 bits all
Finding a network address using the default
mask
Example 2: An address in a block is
given as [Link]. Find the number
of addresses in the block, the first
address, and the last address.
Example3:An address in a block is
given as [Link]. Find the
number of addresses in the block, the
first address, and the last address.
The number of addresses in this block is N = 232−n = 216 =
65,536.
Classful addressing, which is almost obsolete, is
replaced with classless addressing.
Classless Addressing

In IPv4 addressing, a block of


addresses can be defined as
x.y.z.t /n
in which x.y.z.t defines one of the addresses
and the /n defines the mask.
Slash notation (CIDR)

The number of addresses in the block is found as N =


2(32−n) .
To find the first address, we keep the n leftmost bits and
set the (32 − n) rightmost bits all to 0s.
To find the last address, we keep the n leftmost bits and
set the (32 − n) rightmost bits all to 1s.
A classless address is given as [Link]/27. We can
find the above three pieces of information
The number of addresses in the network is 2(32 − n) = 2(5)
= 32 addresses.
The first address in the block can be found by
setting the rightmost
32 − n bits to 0s.
Example

A block of addresses is granted to a small organization. We


know that one of the addresses is [Link]/28. What is
the first address in the block?

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
[Link].
The last address in the block can be
found by setting the rightmost
32 − n bits to 1s.
Example

Find the last address for the block .

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
[Link]
The number of addresses in the block can be
found by using the formula
232−n.
Example

Find the number of addresses

Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Example

Another way to find the first address, the last address, and
the number of addresses is to represent the mask as a 32-bit
binary (or 8-digit hexadecimal) number. This is
particularly useful when we are writing a program to find
these pieces of information. In [Link]/28 the /28 can
be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).

Find
a. The first address
b. The last address
c. The number of addresses.
Example (continued)

Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by
bit. The result of ANDing 2 bits is 1 if both bits are 1s;
the result is 0 otherwise.
Example

b. The last address can be found by ORing the given


addresses with the complement of the mask. ORing
here is done bit by bit. The result of ORing 2 bits is 0 if
both bits are 0s; the result is 1 otherwise. The
complement of a number is found by changing each 1
to 0 and each 0 to 1.
A network configuration for the block [Link]/28
The first address in a block is
normally not assigned to any device;
it is used as the network address that
represents the organization
to the rest of the world.
Each address in the block can be considered as
a two-level
hierarchical structure:
the leftmost n bits (prefix) define
the network;
the rightmost 32 − n bits define
the host.

You might also like