Ipv4 Addressing
Ipv4 Addressing
Chapter 5
Network Layer Design Issues
• An IP address:
- is a 32 bit long identifier
- encodes a network number
(network prefix)
and a host number
Network prefix and Host number
• The network prefix identifies a network and the host
number identifies a specific host (actually, interface
on the network).
network prefix host number
• How do we know how long the network prefix is?
– The network prefix used to be implicitly defined (class-
based addressing, A,B,C,D…)
– The network prefix now is flexible and is indicated by a
prefix/netmask (classless).
Note
Solution
We replace each group of 8 bits with its equivalent
decimal number (see Appendix B) and add dots for
separation.
Example 19.2
Solution
We replace each decimal number with its binary
equivalent (see Appendix B).
Example 19.3
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
Note
19.14
The old way: Internet Address
Classes
19.15
Problems with Classful IP Addresses
The original classful address scheme had a number of
problems
19.16
Problems with Classful IP
Addresses
Problem 3. Inflexible. Assume a company requires 2,000 addresses
Class A and B addresses are overkill
addresses)
19.17
Problems with Classful IP
Addresses
19.18
Finding the classes in binary and dotted-decimal notation
Example 19.4
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.
Note
Solution
The class is A because the first byte is between
0 and 127. The block has a netid of 17.
The addresses range from 17.0.0.0 to
17.255.255.255.
Example 10
Solution
The class is B because the first byte is between
128 and 191. The block has a netid of
132.21. The addresses range from
132.21.0.0 to 132.21.255.255.
Example 11
Solution
Solution
The default mask is 255.0.0.0, which means
that only the first byte is preserved and the
other 3 bytes are set to 0s. The network
address is 23.0.0.0.
Example 13
Solution
The default mask is 255.255.0.0, which
Means that the first 2 bytes are preserved
and the other 2 bytes are set to 0s. The
network address is 132.6.0.0.
Example 14
Solution
The default mask is 255.255.255.0,
which means that the first 3 bytes are
preserved and the last byte is set to 0.
The network address is 201.180.56.0.
We must not
apply the default mask
of one class to
an address belonging
to another class.
Loop back address
• IP address with first byte as 127[127.X.Y.Z]
• Used to test the s/w on a machine [ Here the
packet simply returns to the protocol s/w on
the same machine]
• Eg. Ping appln to test if the process is able to
receive and process a packet.
• Eg. Client process sending msg to server
process on the same machine.
Special Addresses
Special Address Netid Hostid Source or
Destination
Network address Specific All 0s None
Direct broadcast address Specific All 1s Destination
Solution
The number of 1s in the default
mask is 24 (class C).
Solution (Continued)
Solution
The number of 1s in the default mask is 16
(class B).
Solution (Continued)
The mask is
11111111 11111111 11111111 11000000
or
255.255.255.192.
The number of subnets is 1024.
The number of addresses in each subnet is 26
(6 is the number of 0s) or 64.
A network with three levels of
hierarchy (subnetted)
Note: