Calculating the Range of Addresses on Your Network
2009-11-28 00:51
441 查看
If someone gives you an IP address of 97.158.253.28 and a subnet
mask of 255.255.255.248, how do you determine the network address and
the broadcast address, in other words the boundaries, of your network?
The following section outlines the steps to do this using both a manual
and programmed methodology.
Manual Calculation
Take out your pencil and paper, manual calculation can be tricky. Here we go!
Subtract the last octet of the subnet mask from 256 to give the number of IP addresses in the subnet. (256 - 248) = 8
Divide the last octet of the IP address by the result of step
1; don't bother with the remainder (for example 28 / 8 = 3). This gives
you the theoretical number of subnets of the same size that are below
this IP address.
Multiply this result by the result of step 1 to get the
network address (8 x 3 = 24). Think of it as the third subnet with 8
addresses in it. The network address is therefore 97.158.253.24
The broadcast address is the result of step 3 plus the result
of step 1 minus 1. (24 + 8 -1 = 31). Think of it as the broadcast
address being the network address plus the number of IP addresses in
the subnet minus 1". The broadcast address is 97.158.253.31
Let's do this for 192.168.3.56 with a mask of 255.255.255.224:
256 - 224 = 32
56/32 = 1
32 x 1 = 32. Therefore the network base address is 192.168.3.32
32 + 32 - 1 = 63. Therefore the broadcast address is 192.168.3.63
Let's do this for 10.0.0.75 with a mask of 255.255.255.240
256 - 240 = 16
75/16 = 4
16 x 4 = 64. Therefore the network base address is 10.0.0.64
64 + 16 -1 = 79. Therefore the broadcast address is 10.0.0.79
Note:
As a rule of thumb, the last octet of your network base
address must be divisible by the "256 minus the last octet of your
subnet mask" and leave no remainder. If you are sub-netting a large
chunk of IP addresses it's always a good idea to lay it out on a
spreadsheet to make sure there are no overlapping subnets. Once again,
this calculation exercise only works with subnet masks that start with
"255.255.255".
mask of 255.255.255.248, how do you determine the network address and
the broadcast address, in other words the boundaries, of your network?
The following section outlines the steps to do this using both a manual
and programmed methodology.
Manual Calculation
Take out your pencil and paper, manual calculation can be tricky. Here we go!Subtract the last octet of the subnet mask from 256 to give the number of IP addresses in the subnet. (256 - 248) = 8
Divide the last octet of the IP address by the result of step
1; don't bother with the remainder (for example 28 / 8 = 3). This gives
you the theoretical number of subnets of the same size that are below
this IP address.
Multiply this result by the result of step 1 to get the
network address (8 x 3 = 24). Think of it as the third subnet with 8
addresses in it. The network address is therefore 97.158.253.24
The broadcast address is the result of step 3 plus the result
of step 1 minus 1. (24 + 8 -1 = 31). Think of it as the broadcast
address being the network address plus the number of IP addresses in
the subnet minus 1". The broadcast address is 97.158.253.31
Let's do this for 192.168.3.56 with a mask of 255.255.255.224:
256 - 224 = 32
56/32 = 1
32 x 1 = 32. Therefore the network base address is 192.168.3.32
32 + 32 - 1 = 63. Therefore the broadcast address is 192.168.3.63
Let's do this for 10.0.0.75 with a mask of 255.255.255.240
256 - 240 = 16
75/16 = 4
16 x 4 = 64. Therefore the network base address is 10.0.0.64
64 + 16 -1 = 79. Therefore the broadcast address is 10.0.0.79
Note:
As a rule of thumb, the last octet of your network base
address must be divisible by the "256 minus the last octet of your
subnet mask" and leave no remainder. If you are sub-netting a large
chunk of IP addresses it's always a good idea to lay it out on a
spreadsheet to make sure there are no overlapping subnets. Once again,
this calculation exercise only works with subnet masks that start with
"255.255.255".
相关文章推荐
- The lesser known pitfalls of allowing file uploads on your website
- VMware安装Ubuntu17.04的VMware-tools提示:what is the location of the "ifconfig" program on your machin问题解决
- The pitfalls of allowing file uploads on your web
- How To Focus On The Positive Qualities Of Your Relationship
- Pre-compile (pre-JIT) your assembly on the fly, or trigger JIT compilation ahead-of-time
- Get to the Top on Google: Tips and Techniques to Get Your Site to the Top of the Search Engine Ranki
- what is the location of the gcc program on your machine
- Dynamics CRM2016 The value of field on record of type entity is outside the valid range问题的解决方法
- Update your app to take advantage of the larger aspect ratio on new Android flagship devices
- Dynamics CRM2016 The value of field on record of type entity is outside the valid range问题的解决方法
- linux安装问题:what is the location of the gcc program on your machine
- [Graphics] UIColor created with component values far outside the expected range, Set a breakpoint on UIColorBreakForOutOfRangeColorComponents to debug. This message will only be logged once.
- 安装vmware-tools出现"what is the location of the "ifconfig"program on your machine?"
- Dynamics CRM2016 The value of field on record of type entity is outside the valid range问题的解决方法
- linux安装问题:what is the location of the gcc program on your machine
- How to Have Two Versions of the Same App on Your Device
- Dynamics CRM2016 The value of field on record of type entity is outside the valid range问题的解决方法
- Choosing App Localization For Your App Based On the Target Audience Of the Project
- 奇葩问题:This file could not be checked in because the original version of the file on the server was moved or deleted. A new version of this file has been saved to the server, but your check-in comments were not saved
- “The execution of scripts is disabled on this system” … How to run your own PowerShell scripts