Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Subnetting Example

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Subnetting example

Assume that an ISP has given you a block of IPv4 addresses that includes the
following address:
136.50.40.100/22
Create five contiguous subnets from the given block beginning with the first address
of the block, as follows:
1. The first subnet with 512 addresses
2. A second subnet with 256 addresses
3. A third subnet with 128 addresses
4. Two subnets with 64 addresses each
For each subnet, show its prefix in CIDR format, its subnet network address, and its
direct broadcast address.
First Step
• The given address may not be the first address, so we first find the first address (network
address) of the given block
136.50.40.100 = 136. 50. 0010 1000. 0110 0100
Mask: /22 = 255.255. 1111 1100. 0000 0000 (green part: net ID)
Bitwise And: 136. 50. 0010 1000. 0000 0000 = 136.50.40.0
This is the first address of this block.

If we set the host ID part to 1s, we will get


136. 50. 0010 1011. 1111 1111 = 136. 50. 43. 255
This is the last address of this block

Together we have 2^10 = 1024 addresses.


2 Get first subnet of 512 addresses
• Because 2^9 = 512, we only need 9 bits for host ID, and 23 bits for net ID and the
mask is Mask: /23 = 255.255. 1111 1110. 0000 0000
• We use the first address of the original block as the first address: 136.50.40.0 which
is
136.50. 0010 1000. 0000 0000 (green: net id, red: host ID)

The last address will be


136. 50. 0010 1001. 1111 1111 (green: net id, red: host ID)
Which is 136.50.41.255

Subnet 512: 136.50.40.0/23 - 136.50.41.255/23


3 Get next subnet of 256 addresses
• Because 2^8 = 256, we only need 8 bits for host ID, and 24 bits for net ID and the
mask is Mask: /24 = 255.255. 1111 1111. 0000 0000
• We use the last address of the first block plus 1 as the first address
• 136.50.41.255+1 = 136.50.42.0 which is
136. 50. 0010 1010. 0000 0000 (green: net id, red: host ID)

The last address will be


136. 50. 0010 1010. 1111 1111 (green: net id, red: host ID)
Which is 136.50.42.255

Subnet 256: 136.50.42.0/24 - 136.50.42.255/24


4 Get next subnet of 128 addresses
• Because 2^7 = 128, we only need 7 bits for host ID, and 25 bits for net ID and the
mask is Mask: /25 = 255.255. 1111 1111. 1000 0000
• We use the last address of the second block plus 1 as the first address
• 136.50.42.255+1 = 136.50.43.0 which is
136. 50. 0010 1011. 0000 0000 (green: net id, red: host ID)

The last address will be


136. 50. 0010 1011. 0111 1111 (green: net id, red: host ID)
Which is 136.50.43.127

Subnet 128: 136.50.43.0/25 - 136.50.43.127/25


5 Get next subnet of 64 addresses
• Because 2^6 = 64, we only need 6 bits for host ID, and 26 bits for net ID and the
mask is Mask: /26 = 255.255. 1111 1111. 1100 0000
• We use the last address of the second block plus 1 as the first address
• 136.50.43.127+1 = 136.50.43.128 which is
136. 50. 0010 1011. 1000 0000 (green: net id, red: host ID)

The last address will be


136. 50. 0010 1011. 1011 1111 (green: net id, red: host ID)
Which is 136.50.43.191

Subnet 64: 136.50.43.128/26 - 136.50.43.191/26


6 Get next subnet of 64 addresses
• Because 2^6 = 64, we only need 6 bits for host ID, and 26 bits for net ID and the
mask is Mask: /26 = 255.255. 1111 1111. 1100 0000
• We use the last address of the second block plus 1 as the first address
• 136.50.43.191+1 = 136.50.43.192 which is
136. 50. 0010 1011. 1100 0000 (green: net id, red: host ID)

The last address will be


136. 50. 0010 1011. 1111 1111 (green: net id, red: host ID)
Which is 136.50.43.255

Subnet 64: 136.50.43.192/26 - 136.50.43.255/26


Answer

Subnet Prefix Subnet network address Direct broadcast address


Addresses
512 /23 136.50.40.0 136.50.41.255
256 /24 136.50.42.0 136.50.42.255
128 /25 136.50.43.0 136.50.43.127
64 /26 136.50.43.128 136.50.43.191
64 /26 136.50.43.192 136.50.43.255

You might also like