# The method of S series switches divide subnet

84

By further dividing the IP part of the IP address into several subnets, it solves the problem that the IP address space is low and the two-level IP address is not flexible enough.
When a unit of the host a lot, in order to facilitate management, the unit can be inside the host number and then further divided into multiple subnets. Through the subnetting, the entire network address can be divided into more small networks.
Subnet division is the behavior of the network, from the outside, this unit has only one network number. Only when the external message into the scope of the unit, the unit of the routing equipment according to the subnet number and then routing, find the destination host.
In the case of a subnet with a Class B IP address, the subnet mask consists of a series of consecutive "1" and a string of consecutive "0". "1" corresponds to the network number and subnet number field, and "0" corresponds to the host number field.
Class B address of the Host-id high 5bits used to divide the subnet, Subnet-id range from 00000 ~ 11111, a total of 32 (2 5 times) subnet. Subnet corresponding to the subnet mask will be a corresponding change, such as Subnet-id 11111 subnet mask is 255.255.248.0. The result of the execution and operation of the IP address and its corresponding mask bit is the network address.
To divide a subnet number field is to pay the price. For example, a Class B IP address can hold 65534 (2 16-party-2) host numbers. But the division of the 5bits long subnet field, up to 32 subnets, each subnet has 11bit host number, that is, each subnet can have up to 2046 (2 of 11 times - 2, remove all 1 and all 0 Host number) host number. So the total number of host numbers is (32 x 2046 = 65472), less than 62 when the subnet is not divided.

###### Other related questions:
Subnet-based VLAN assignment on S series switch
Example of configuring IP subnet-based VLAN assignment for S series switches (except S1700 switches): 1. Configuration roadmap 1) Create VLANs, and add an interface to the VLANs so that the interface allows packets of IP subnet-based VLANs to pass through. 2) Enable IP subnet-based VLAN assignment on the interface, and associate IP subnets with the VLANs, so that the switch can determine the VLANs to which received packets belong according to the source IP addresses or specified subnets in the packets. 2. Configuration procedure 1) Create VLANs. [HUAWEI] vlan batch 100 200 //Create VLAN100 and VLAN 200. 2) Configure an interface. [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] port link-type hybrid //Set the interface type to hybrid. [HUAWEI-GigabitEthernet0/0/1] port hybrid untagged vlan 100 200 //Add the interface to VLAN 100 and VLAN 200 in untagged mode. [HUAWEI-GigabitEthernet0/0/1] ip-subnet-vlan enable //Enable IP subnet-based VLAN assignment on the interface. [HUAWEI-GigabitEthernet0/0/1] quit 3) Associate IP subnets with VLANs. [HUAWEI] vlan 100 [HUAWEI-vlan100] ip-subnet-vlan 1 ip 192.168.1.2 24 priority 2 //Associate IP subnet 192.168.1.2/24 with VLAN 100 and set the 802.1p priority of VLAN 100 to 2. [HUAWEI-vlan100] quit [HUAWEI] vlan 200 [HUAWEI-vlan200] ip-subnet-vlan 1 ip 192.168.2.2 24 priority 3 [HUAWEI-vlan200] quit

Subnetting on an S series switches
A network can be divided into multiple subnets to conserve IP address space and support flexible IP addressing. When many hosts exist on an internal network, the internal host IDs can be divided into multiple subnets to facilitate management. Then the entire network contains multiple small networks. Subnetting is implemented within an internal network. The internal network has only one network ID for the external network. When packets are transmitted from the external network to the internal network, the routing device on the internal network selects a route for the packets based on the subnet ID and find the destination host. Take subnet division of an IP address in Class B as an example. The subnet mask consists of a string of continuous 1s and 0s. 1s correspond to the network ID field and the subnet ID field while 0s correspond to the host ID field. The first 5 bits of the host ID is used as the subnet ID. The subnet ID ranges from 00000 to 11111, allowing for a maximum of 32 (2 to the power of 5) subnets. Each subnet ID has a subnet mask. For example, the subnet mask of the subnet ID 11111 is 255.255.248.0. After performing an AND operation on the IP address and the subnet mask, you can obtain the network address. Subnetting reduces the available IP addresses. For example, normally an IP address of Class B can contain 65534 (216 �?2) host IDs. After 5 bits in the host ID are used as the subnet ID, there can be a maximum of 32 subnets, each with an 11-bit host ID. That is, each subnet has a maximum of 2046 host IDs (211 �?2, excluding the host IDs with all 1s and all 0s). Therefore, the IP address has a maximum of 65472 (32 x 2046) host IDs, 62 less than the maximum number of host IDs before subnetting.

###### If you have more questions, you can seek help from following ways:
To iKnow To Live Chat