Professional Documents
Culture Documents
IP v4 Addressing
IP v4 Addressing
IP v4 Addressing
Internet address or IP address
146.102.32.255 - 146.102.29.0
0.0.3.255 in base 256
1. When at least one of the numbers is 0 or 255, the AND operation selects the smaller byte (or one of them if
equal).
2. When none of the two bytes is either 0 or 255, take each byte as the sum of eight terms, where each term is a
power of 2. We then select the smaller
12-Sep-23
term in each pair (or one of them if equal) and add them to getIPthe
CSE 3152 Computer Networks 2023
result.
V4 Addressing
IP
Some operations
Bitwise OR Operation
Shortcut
1. When at least one of the two bytes is 0 or 255, the OR operation selects the larger byte (or one of them if equal).
2. When none of the two bytes is 0 or 255, we can write each byte as the sum of eight terms, where each term is a
power of 2. We then select the larger term in each pair (or one of them if equal) and add them to get the result of
OR operation.
12-Sep-23 CSE 3152 Computer Networks 2023 IP V4 Addressing
IP
CLASSFUL ADDRESSING
Classes
Blocks in Class B
Blocks in Class C
A network using class B addresses, just one network with almost 216 hosts (before
subnetting)
A subnetwork has
subnetid and hostid
First, second, and fourth bytes are calculated using first shortcut of AND operation
Third byte, using second shortcut of AND operation.
So, In classless addressing, the prefix length cannot be found if we are given only an
address in the block. The given address can belong to a block with any prefix length.
AND operation
a. Since 1000 is not a power of 2, 1024 addresses are granted (1024 = 210).
b. The prefix length for the block is calculated as n = 32 − log21024 = 22.
c. The beginning address is chosen as 18.14.12.0 (which is divisible by 1024).
The granted block is 18.14.12.0/22. The first address is 18.14.12.0/22 and the last
address is 18.14.15.255/22.
1. We can give 16 addresses for each subnetwork to meet the first requirement
(64/16 is a power of 2).
So, We can give 16 addresses to each subnet starting from the first available address.
Note that the starting address in each subnetwork is divisible by the number of addresses in that subnetwork.
12-Sep-23 CSE 3152 Computer Networks 2023 IP V4 Addressing
IP
CLASSLESS ADDRESSING
Designing Subnets
An organization is granted a block of addresses with the beginning address
14.24.74.0/24. The organization needs to have 3 sub blocks of addresses to use in its
three subnets as shown below:
One subblock of 120 addresses.
One subblock of 60 addresses.
One subblock of 10 addresses.
So,
N = 232 − 24 = 28 = 256 addresses in the block
The first address in the network is 14.24.74.0/24
The last address is 14.24.74.255/24
1. We can allocate 128 addresses for the first subblock. (requirement is 120)
The subnet mask is 24 + log2(256/128) = 25.
The first address is 14.24.74.0/25
12-Sep-23
The last address is 14.24.74.127/25
CSE 3152 Computer Networks 2023 IP V4 Addressing
IP
CLASSLESS ADDRESSING
Designing Subnets
2. In the second subblock, we can allocate 64 addresses. (requirement is 60)
The subnet mask is 26.
The first address in this block is 14.24.74.128/26;
The last address is 14.24.74.191/26.
3. In the third subblock, we can allocate 16 addresses. (requirement is 10)
The subnet mask is 28.
The first address in this block is 14.24.74.192/28;
The last address is 14.24.74.207/28.
So, the total addresses used are 208, which means 48 addresses are left in reserve.
The first address in this range is 14.24.74.209.
The last address is 14.24.74.255.
• Each ISP in turn divides its assigned block into smaller subblocks and grants the
subblocks to its customers; many blocks of addresses are aggregated in one block
and granted to one ISP.
Source: 0.0.0.0
Destination: 255.255.255.255
Packet
Network
221.45.71.64/24 221.45.71.126/24
221.45.71.20/24 221.45.71.178/24
Transport layer
Destination address:127.x.y.z
ping 127.0.0.0
Multicast Addresses
The block 224.0.0.0/4 is reserved for multicast communication.
Network Address
The first address (with the suffix set all to 0s) in a block defines the
network address. It actually defines the network itself and not any host
in the network..
221.45.71.20/24 221.45.71.178/24
Packet