【Computer Network】 Subnetting

IP address classification

Insert image description here

Learning to convert between decimal and binary can be memorized quickly and regularly.

subnet mask

Also called network mask, address mask, and subnet mask, it means to cover up the subnet from outside prying eyes.

Insert image description here

The binary bitwise AND of the local IP address and the subnet mask can be used to obtain the external IP address of a certain host.

Default subnet masks for classes A, B, and C:

Insert image description here

gateway

Also known as Internet connector, protocol converter. A gateway is a device or software that connects two subnets.

Gateways are IP addresses with routing functions, which means that gateways must have routing functions. The default host numbers are all 0, which is a gateway. For example, 192.18.1.0 or 192.18.2.0.

If you want to determine whether you and others are in the same subnet, use your own IP and subnet mask to bitwise AND to see if they are the same as others.

broadcast address

Used to broadcast to all devices on the network. An IP address with a normal network number part and a host number part all 1 is called a broadcast address.

Wired broadcast address: refers to an IP address with 32 bits all equal to 1 (i.e. 255.255.255.255), which is used for broadcasting on this network.

A normal broadcast address is called a direct broadcast address. Sending direct broadcast address data will send the data to all hosts in the subnet.

Non-default subnet mask

Insert image description here

The number of 1's in the non-default subnet mask must be more than that of the default subnet, and the 1's must be consecutive. These 1's are borrowed from the original host number.

Subnetting FAQs

  1. How many subnets will the selected subnet mask create?

2^x, where x is the number of host bits borrowed for the subnet mask. For example: 192.168.10.32/28, where 28 means the network number. We know that the default subnet mask bit of Class C IP is 255.255.255.0. The network number of Class C IP should be 24 bits, so it borrows 4 bits of the host bit to serve as the network bit, so the number of subnets created is 2^4 =16.

  1. How many hosts can each subnet contain?

2^y-2 units, where y is the number of hosts that have not been borrowed. -2 is because the part with all 0's in the host bits is the gateway of this subnet, and the part with all 1's is the broadcast address of this subnet.

  1. What subnets are there?

To know which subnets there are, first calculate the step size (increment) of the subnet. Example: 256-192=64, that is, when the subnet mask is 192, the step size is 64. It starts from 0 and continues to increase until it reaches the subnet mask value. The intermediate result is the subnet, that is, 0, 64, 128, 192.

Guess you like

Origin blog.csdn.net/jia_03/article/details/132708990