The calculation method of IP address

Source: Internet
Author: User

Compute related addresses by IP address and subnet mask and operations

When you know the IP address and subnet mask, you can figure out:

1, network address

2. Broadcast Address

3. Address range

4, the network has several hosts

Example 1: The following example IP address is 192 168 100 5 Subnet mask is 255 255 • 255 0. Calculate the network address, broadcast address, address range, host number.

One) step-by-step calculation

1 The IP address and subnet mask conversion to binary, subnet mask continuous 1 of the network address, followed by the host address. The dotted line is the network address, after the dotted line is the host address

2 IP address and subnet mask and operation, the result is network address

3 The above network address in the network address part of the same, the host address into a total of 1, the result is broadcast address.

4 The address range is included in the network section of all the host

Network Address +1 is the first host address, broadcast address-1 is the last host address, which can be seen

Address range is: Network address + 1 to broadcast address-1

The network scope of this example is: 192 168 100 1 to 192 168 100 254

In other words, the following address is a network segment.

192 168 100 1, 192 168, 100 2 ... 192 168 100 20 ... 192 168 100 111 ... 192 168 100 254

5 Number of hosts

Number of hosts = 22 host digits in binary-2

Minus 2 is because the host does not include the network address and broadcast address. The number of host digits in this example binary is 8 bits.

Number of hosts =28-2=254

II) Overall calculation

We combined the example above to calculate the process as follows:

Example 2:IP address is 128 36 • 199 3 Subnet mask is 255 255 240 0. Calculate the network address, broadcast address, address range, host number.

1 The IP address and subnet mask conversion to binary, subnet mask continuous 1 of the network address, followed by the host address, dotted line before the network address, after the dotted line for the host address

2 IP address and subnet mask and operation, the result is network address

3 The network address in the result of the operation is unchanged, the host address becomes 1, the result is broadcast address.

4 The address range is included in the network section of all the host

Network Address +1 is the first host address, broadcast address-1 is the last host address, which can be seen

Address range is: Network address + 1 to broadcast address-1

The network scope of this example is: 128 36 192 1 to 128 36 207 254

5 Number of hosts

Number of hosts = 22 in the host of the number of digits-2

Number of hosts =212-2=4094

Minus 2 is because the host does not include the network address and broadcast address.

We can see from the above two examples that regardless of whether the subnet mask is standard or special, to compute the network address, broadcast address, address number, as long as the address converted into binary, and then from the subnet mask punishment clearly 1 of the previous network address, then the host address for the corresponding calculation can be.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.