IP Address
IP Address
19.3
Note
The IPv4 addresses are unique
and universal.
19.4
Note
The address space of IPv4 is
232
or 4,294,967,296.
19.5
IPv4 address is divided into two parts
Network ID
Host ID
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4
address
19.8
Example 19.1
Solution
We replace each group of 8 bits with its equivalent decimal
number (see Appendix B) and add dots for separation.
a. ????
b. ????
19.9
Example 19.2
19.10
Solution
We replace each decimal number with its binary
equivalent (see Appendix B).
Example 19.3
19.12
Note
In classful addressing, the address space is divided into five classes:
A, B, C, D, and E.
19.13
Figure 19.2 Finding the classes in binary and dotted-decimal
notation
19.14
Example 19.4
19.15
Table 19.1 Number of blocks and block size in classful IPv4
addressing
19.16
Note
In classful addressing, a large part of the available addresses were wasted.
19.17
CIDR
(Classless Inter-Domain Routing) -- also known as supernetting --
is a method of assigning Internet Protocol (IP) addresses that
improves the efficiency of address distribution and replaces the
previous system based on Class A, Class B and Class C networks.
19.20
CIDR addresses are made up of two sets of numbers: a prefix,
which is the binary representation of the network address --
similar to what would be seen in a normal IP address -- and a
suffix, which declares the total number of bits in the entire
address.
For example, CIDR notation may look like: 192.168.129.23/17 --
with 17 being the number of bits in the address. IPv4 addresses
allow a maximum of 32 bits.
Computer networks can be broken into many networks or
small networks can be combined to form large networks
depending upon our needs.
• IP subnetting
• Supernetting
Why subnetting?
19.25
Figure 19.3 A block of 16 addresses granted to a small
organization
19.26
Note
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.
19.27
Note
The first address in the block can be found by setting the rightmost
32 − n bits to 0s.
19.28
Which of the subnet masks we can use for a corporate
network with 300 sub-networks and a maximum of 50
host addresses per subnet and working with only Class
B address.
ANS:] /25 = 255.255.255.128 and /26 = 255.255.255.192
Explanation:] Given that we need to subnet class “B” network.
Required Number of Subnets: 300
And, Maximum of Host address per subnet is: 50
To fulfill these requirements, we can use two combinations of NW bits and Host bits
i.e. we can use 2 different Subnet Masks.
Class “B”: Default Subnet Mask /16 = 255.255.0.0
1.For 300 Subnets we need to Borrow 9 bits such as, 29 = 512 > 300.
Hence, Network bits = 16 + 9 = 25
Therefore, Host Bits = 32 – 25 = 7
Maximum of Host address available = 27 – 2 = 126 > 50
Means, both of the requirements are fulfil. So we can use CIDR /25 i.e. Subnet
mask 255.255.255.128.
2.For 300 Subnets we need to Borrow 10 bits such as, 210 = 1024 > 300.
Hence, Network bits = 16 + 10 = 26
Therefore, Host Bits = 32 – 26 = 6
Maximum of Host address available = 26 – 2 = 64 > 50
Means, both of the requirements are fulfil. So we can use CIDR /26 i.e. Subnet
mask 255.255.255.192.
An organization requires a range of IP addresses to assign one to each
of its 1500 computers. The organization has approached an Internet
Service Provider (ISP) for this task. The ISP uses CIDR and serves the
requests from the available IP address space 202.61.0.0/17. The ISP
wants to assign address space to the organization which will minimize
the number of routing entries in the ISP’s router using route
aggregation. To calculate the address spaces are potential candidates
from which the ISP can allow any one of the organizations?
Subnet Mask for the given IP address:
202.61.0.0/17
⇒ 11111111 11111111 10000000 00000000
⇒ 255.255.128.0
Now, since we need 1500 hosts, so, bits for host address,
= ceiling (log (1500))
2
= ceiling (10.55)
= 11 bits for host address
So, the last 11 bits will be for host addresses:
00000000.00000000 → 00000111.11111111 (0.0 → 7.255)
00001000.00000000 → 00010000.00000000 (8.0 - 15.255)
00001111.11111111 → 00010111.11111111 (16.0 - 23.255)
Sequences are 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 96, 104, 112, 120.
Hence, 64 and 104 are present in the sequence, so 202.61.104.0 / 21 and
202.61.64.0 / 21 are the possible IP addresses.
Your router has the following IP address on Ethernet0: 172.16.2.1/23.
Which of the following can be valid host IDs on the LAN interface
attached to the router?
1.172.16.1.100
2.172.16.1.198
3.172.16.2.255
4.172.16.3.0
A. 1 Only
B. 2 and 3 Only
C. 3 and 4 Only
D. None of the above
What is the maximum number of IP addresses that
can be assigned to hosts on a local subnet that uses
the 255.255.255.224 subnet mask?
A. 14
B. 15
C. 16
D. 30
You need to subnet a network that has 5 subnets, each with at
least 16 hosts. Which classful subnet mask would you use?
A. 255.255.255.192
B. 255.255.255.224
C. 255.255.255.240
D. 255.255.255.248
Why supernetting?
The routing table contains the entry of a subnet mask for every
network. If there are lots of small networks then the size of the
routing table increases. When the router has a big routing table then
it takes a lot of time for the router to process the routing table.
Supernetting is used to reduce the size of the IP routing table to
improve network routing efficiency.
192.168.4.0/24 10.7.0.0/16
We will apply the rules to each list and if any one of the rules is broken, then
we cannot create one supernet for all those networks without causing some
issues.
Rule #1: Contiguous networks
•The networks in List 1 are contiguous because the next subnet after
192.168.0.0/24 is 192.168.1.0/24. Qualifies for next round.
•The networks in List 2 are contiguous because the next subnet after
192.168.1.0/24 is 192.168.2.0/24. Qualifies for next round.
•The networks in List 3 are contiguous because the next subnet after
192.168.0.0/24 is 192.168.1.0/24 and after that is
192.168.2.0/24. Qualifies for next round.
•The networks in List 4 are not contiguous because the next subnet
after 192.168.2.0/24 is 192.168.3.0/24, not 192.168.4.0/24. Does not
qualify for next round.
•The networks in List 5 are contiguous. Qualifies for next round.
Rule #2: Number of networks order of 2
•The first non-common octet in List 1 is the 3rd octet i.e. 0 vs. 1. The first
(lowest) IP address block is 192.168.0.0/24. The decimal value of the 3rd
octet in this address block is 0. Qualifies to be aggregated.
•The first non-common octet in List 2 is the 3rd octet i.e. 1 vs. 2. The first
(lowest) IP address block is 192.168.1.0/24. The decimal value of the 3rd
octet in this address block is 1. This value is not zero or a multiple of the
number of networks to aggregated (2). Does not qualify to be aggregated.
•The first non-common octet in List 5 is the 2nd octet i.e. 4 vs. 5 vs. 6 vs. 7.
The first (lowest) IP address block is 10.4.0.0/16. The decimal value of the
2nd octet in this address block is 4. This value is a multiple of the number of
networks to aggregated (4). Qualifies to be aggregated.
Therefore, only Lists 1 and 5 can be aggregated into one supernet without
causing any issues.