IP address, subnet mask, network number, host number, network address, host address, IP address

Source: Internet
Author: User

IP address, subnet mask, network number, host number, network address, host address, IP address

IP Address: 4-segment decimal, 32-bit binary, for example, 192.168.1.1 binary is: 11000000 | 10101000 | 00000001 | 00000001

The subnet mask shows how many bits are the network number and how many bits are the host number.: 255.255.255.0 binary: 11111111 11111111 11111111 00000000

24-bit network number, that is, all are 8-bit host number 1, that is, all are 0

129.168.1.1/24 This, 24 is to tell us that the network number is 24 bits, it is equivalent to telling us that the subnet mask is: 11111111 11111111 11111111 00000000 that: 255.255.255.0

In 172.16.10.33/27/27 that is to say, the subnet mask is too many bytes, that is, 27 full 1, 11111111 11111111 11111111 11100000

1. Calculate the network address and broadcast address based on the IP address and subnet mask:

The IP address of a host is 202.112.14.133, And the mask is 255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.255.

1. Based on the subnet mask, you can know the number of network numbers and the number of host numbers!

Convert bytes into binary: 11111111 11111111 11111111 11100000

There are 27 network numbers and 5 Host numbers

Network Address
That is, convert the IP address to binary and subnet mask for calculation (logical multiplication: 0 & 0 = 0; 0 & 1 = 0; 1 & 0 = 0; 1 & 1 = 1)

11001010 01110000 00001110 10001001

IP address & Subnet Mask

11001010 01110000 00001110 10001001

11111111 11111111 11111111 11100000

------------------------------------------------------

11001010 01110000 00001110 10000000

That is, 202.112.14.128

Broadcast address
: The network address of the host bit all five to 1, 10011111 is 159: 202.112.14.159

Number of hosts: 2 ^ 5-2 = 30

++ ++

2. Plan and calculate the subnet mask based on the number of hosts in each network. This can also be calculated based on the above principles. For example, if a subnet has 10 hosts, the IP address required for this subnet is:
10 + 1 + 1 + 1 = 13
Note: The first 1 in the addition refers to the gateway address required for the network connection, and the second two 1 in the addition refer to the network address and broadcast address respectively. Because 13 is less than 16 (16 is equal to the 4 power of 2), the host space is 4 bits. While
256-16 = 240
Therefore, the subnet mask is 255.255.255.255.255.240.
If a subnet has 14 hosts, many people often make the mistake of allocating a subnet with 16 address spaces instead of allocating addresses to the gateway. This is an error because:
14 + 1 + 1 + 1 = 17
17. If it is greater than 16, we can only allocate subnets with 32 addresses (32 equals to the power 5 of 2. In this case, the subnet mask is: Too Many Subnet Mask

++ ++ ++

3. The IP address is 128 • 36 • 199 • 3. The subnet mask is 255 • 255 • 240 • 0. Calculate the network address, broadcast address, address range, and number of hosts.
1) convert the IP address and subnet mask to binary. The subnet mask is the network address consecutively. The host address is followed by the network address in front of the dotted line and the host address in front of the dotted line.
2) perform and calculate the IP address and subnet mask. The result is the network address.
3) change the network address in the calculation result to 1, and the result is the broadcast address.
4) The address range is all hosts included in this section.
The network address + 1 is the first host address, and the broadcast address-1 is the last host address.
The address range is: network address + 1 to broadcast address-1

128.36.11000111.00000011

& 10000000011110000.00000000

-----------------------------------------------

128.36.11000000.00000000: The network address 128.36.192.0 broadcast address: 128.36.11000000.00000000. Change the host space from 12 to 1:

128.36.11001111.111111: 128.36.207.255
The Network range in this example is: 128 • 36 • 192 • 1 to 128 • 36 • 207 • 254
5) number of hosts
Number of hosts = 2 ^ host with binary digits-2
Number of hosts = 2 ^ 12-2 = 4094
2 is because the host does not include the network address and broadcast address.
From the above two examples, we can see that no matter whether the subnet mask is standard or special, you only need to convert the address into binary when calculating the network address, broadcast address, and address count, then, the subnet mask is used to determine the network address before consecutive 1, and then the host address for calculation.
++

4. 206 110 4 0/18 is divided into 16 subnets, with each subnet mask?

(Divide it into 16 subnets. According to the subnet mask/18, there are 18 1, and four hosts from the IP address must be used as the network bit !)

The subnet mask is 255.255.252.0.

Each subnet can accommodate 1024 hosts.

I will give you a detailed answer below:

206.110.1.0/18 from the last/18, we can know that this IP address has specified that its network bit is 18 bits, its default subnet mask is 11111111.111111.11 | 000000.00000000 (1 indicates the network bit, and 0 indicates the host bit)

We can see that the number of digits we can operate is the last 14 0, that is, we can divide several places on the ground as the subnet's network bit, and then divide the subnet. The requirement is to switch to 16 subnets. We know that the 4 power of 2 is just equal to 16, which means that the number of subnet network bits is 4 bits, then 14-4 = 10 is the host space of the subnet. So the binary string I wrote above can be changed to: 11111111.111111.111111 | 00.00000000 (1 indicates the network bit, and 0 indicates the host bit)

In decimal format: 255.255.252.0, the number of hosts that each subnet can accommodate is the 10th power of 2, that is, 1024.

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.