IP & subnet division

Source: Internet
Author: User

IP classification:

    1. A: starts with 1--127--------0 ----- network id8-bit ----- 16777214 host
    2. B: 128--191-----10 ---- Network id16-bit ---- 65534 host
    3. C: starting with 192--223-----110 --- network id24-bit ---- 254 host
    4. D: starting with 224--239-----1110 ------ reserved for Multicasting
    5. E: starting with 240--254-----11110 ----- Reserved

IP--32, 4 8 bits, 8 bits: 00000000-11111111, represented from right to left:, 64, 32, 16

Convert each 8-bit to decimal: Sum of the corresponding values

Convert decimal to binary: add the corresponding binary weights ---- or calculate directly by the Calculator

IP = network ID + host ID

The bit corresponding to the network ID is "1", and the bit corresponding to the host ID is "0"

Subnet division:

    1. Determine the number of subnets, and determine the next multiplied by 2 that is greater than the expected number of subnets. Example:Six subnets are to be divided. The multiplication of the next highest 2 greater than 6 is the power 3 of 2 = 8.
    2. The exponent of Multiplication Side 2 is the number of digits required to divide the subnet. 3
    3. In the order starting from the high position, append the "1" of the required digits to the default subnet. For example, if the index is 3, the corresponding binary mask is 11100000, And the decimal value is 224.

Subnet ID:

    1. Lists all binary combinations of bits added to the default subnet mask.
    2. Calculates the decimal values of these binary combinations
    3. Attaches each value to the originally assigned network ID to form a network ID.

Example:

    • Divide five subnets. The default subnet mask occupies three places.
    • List all three binary combinations: 000,001,011,100,101,110,111
    • Decimal value: 128,160,192,228
    • Each subnet ID is the third eight-digit corresponding to the above values: 0, 32, 64, 96, 128,160,192,228

When the number of subnet digits exceeds 4, it is impractical to use the above method. In this case, you must use the truncation method to determine the subnet ID:

    • For example, the subnet occupies 5 bits, and the binary 8 bits indicate 11111000
    • Convert the minimum value of a single digit to decimal. For example, if the minimum value of the fifth digit in 8 bytes is 8 (11111), the minimum value is the added value of the subnet ID.
    • 0 is used as the first subnet ID, and the next subnet ID is added with the added value of 8 on the basis of 0.

When dividing subnets, the number of valid subnets is determined by the number of digits occupied by the subnet mask, that is, the number of subnets is equal to 2. For example, a subnet is divided by five digits, the number of subnets that can be divided is 2 to the power of 5 = 32 subnets...

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.