IPv4
IPv4 Address Formats
Addressing IPv4
• IPv4 Notation
– Binary Notation
– Dotted Decimal Notation
• IPv4 Addressing
– Classful Addressing
– Classless Addressing
5
Note:
An IP address is a 32-bit
address.
The IP addresses are unique
and universal defines the
connection to the Internet
6
Note:
The address space of IPv4 is 232
or 4,294,967,296
Four billion two hundred ninety-four million
nine hundred sixty-seven thousand two
hundred ninety-six
7
IPv4 Notations
• Binary Notation
- displayed in 32 bits
- each octet is often referred to as a byte
- e.g. 01110101 10010101 00011101 00000010
• Dotted-Decimal Notation
- usually written in decimal form with a decimal point
(dot) separating the byte
- e.g. 117.149.29.2
8
Figure. Dotted-decimal notation
9
Example 1
Change the following IP addresses from binary notation to dotted-decimal
notation.
a. 10000001 00001011 00001011 11101111
b. 11111001 10011011 11111011 00001111
Solution
We replace each group of 8 bits with its equivalent decimal number and
add dots for separation:
a. 129.11.11.239
b. 249.155.251.15
10
Example 2
Change the following IP addresses from dotted-decimal notation to binary
notation.
a. 111.56.45.78
b. 75.45.34.78
Solution
We replace each decimal number with its binary equivalent
a. 01101111 00111000 00101101 01001110
b. 01001011 00101101 00100010 01001110
11
In classful addressing, the
address space is divided into five
classes: A, B, C, D, and E.
12
Finding the classes in binary and dotted-decimal notation
13
Example 3
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
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.
14
d. The first byte is 252; the class is E.
Classless
Interdomain
Routing
Table. Default masks for classful addressing
15
How to do transformation from /24 to /25 network?
Classful addressing, which is almost
obsolete, is replaced with classless
addressing.
24
Classless Addressing
• To overcome the address depletion
• No classes
• Addresses are granted in blocks (range)
• Size of block varies based on the nature &
size of entity
25
Restriction
To simplify the handling addresses, the Internet
authorities impose three restrictions:
1. The addresses in a block must be contiguous
2. The number of addresses in a block must be
a power of 2 (1, 2, 4, 8, 16 …)
3. The first address must be evenly divisible by
the number of addresses
26
Example
The next figure shows a block of addresses, in
both binary and dotted-decimal notation,
granted to a small business that needs 16
addresses.
We can see that the restrictions are applied to
this block. The addresses are contiguous. The
number of addresses is a power of 2 (16 = 24),
and the first address is divisible by 16. The
first address, when converted to a decimal
number, is 3,440,387,360, which when divided
by 16 results in 215,024,210.
27
Figure. A block of 16 addresses granted to a small organization
28
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.
29
The first address in the block can be
found by setting the rightmost
32 − n bits to 0s.
30
Example 4
A block of addresses is granted to a small organization.
We know that one of the addresses is 205.16.37.39/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 00100000
or
205.16.37.32.
This is actually the block shown in Figure slide 28
31
The last address in the block can be
found by setting the rightmost
32 − n bits to 1s.
32
Example 5
Find the last address for the block in Example 4
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
205.16.37.47
This is actually the block shown in Figure slide 28
33
The number of addresses in the block
can be found by using the formula
232−n.
34
Example 6
Find the number of addresses in Example 4
Solution
The value of n is 28, which means that
Number of addresses is 2 32−28 or 16.
35
Exercise
1) In a block of addresses, we know the IP address of one
host is 25.34.12.56/16. What are the first address
(network address) and the last address (limited
broadcast address) in this block?
: 2008/2009
Idawaty Ahmad : Semester 2
1) Write the following masks in slash notation (/n)
a. 255.255.255.0
b. 255.0.0.0
c. 255.255.224.0
d. 255.255.240.0
3) Find the range of addresses in the following blocks
a. 123.56.77.32/29 b. 17.34.16.0/23 36
IPv6
IPv6
Despite all short-term solutions, address depletion is still
a long-term problem for the Internet. This and other
problems in the IP protocol itself have been the
motivation for IPv6.
IPv6 address in binary and hexadecimal colon notation
An IPv6 address is 128 bits long.
Why Change IP?
• Address space exhaustion
– two level addressing (network and host) wastes
space
– network addresses used even if not connected
– growth of networks and the Internet
– extended use of TCP/IP
– Multiple addresses per host
• requirements for new types of service
Abbreviated IPv6 addresses
Expand the address 0:15::1:12:1213 to its
original.
Solution
We first need to align the left side of the double colon to the left
of the original pattern and the right side of the double colon to
the right of the original pattern to find how many 0s we need to
replace the double colon.
This means that the original address is.
Transition Strategies (from IPv4
to IPv6)
• Because of the huge number of systems on
the Internet, the transition from IPv4 to IPv6
cannot happen suddenly. It takes a
considerable amount of time before every
system in the Internet can move from IPv4 to
IPv6. The transition must be smooth to prevent
any problems between IPv4 and IPv6 systems
Three Transition Strategies
Dual stack
Dual stack of protocols.
A host run IPv4 and IPv6 simultaneously until all the Internet uses IPv6
Tunneling strategy
Encapsulate IPv6 packet into IPv4 packet
Tunneling is a strategy used when two computers using IPv6 want to
communicate with each other and the packet must pass through a region that
uses IPv4
Header translation strategy
Header Translation is necessary when the majority of the Internet has moved to
IPv6, but some systems still use IPv4
Address Resolution
Protocol - ARP
• The delivery of a packet to a host or a router requires
two levels of addressing: logical and physical.
• We need to be able to map a logical address to its
corresponding physical address and vice versa.
• This can be done by using either static or dynamic
mapping.
An ARP request is broadcast;
an ARP reply is unicast.
21.53
ARP operation
Four cases using ARP
Example
A host with IP address 130.23.43.20 and physical
address B2:34:55:10:22:10 has a packet to send to
another host with IP address 130.23.43.25 and
physical address A4:6E:F4:59:83:AB. The two hosts
are on the same Ethernet network. Show the ARP
request and reply packets encapsulated in Ethernet
frames.
Example: An ARP request and reply
Step-by-Step ARP Processes
Step-by-Step ARP Processes
Step-by-Step ARP Processes
Step-by-Step ARP Processes
Step-by-Step ARP Processes