Summary:
Class A, B, C is actually the concept of address block, the so-called application of a class C address, refers to the application of a Class C address block.
C class Address block of specific IP address of this class C address block, of course, also belong to Class C address classes.
A subnet mask is a subnet, such as a number of 200多万个 address blocks that divide the entire IP address into Class A, class B, and C. Identifies each subnet block.
The subnet masks are divided into standard subnet masks (A, B, C-class subnet masks) and variable-length subnet masks, which can be divided into smaller subnets for large Class A, Class B, and Class C address blocks (VLSM,VLSM). VLSM and CIDR are inherently flexible and can determine the number of network prefix digits based on the number of hosts
CIDR: Classless Inter-Domain Routing (Classless inter-domain Routing, CIDR) is a way to categorize IP addresses that assign IP addresses to users and efficiently route IP packets on the Internet.
Variable eldest subnet mask technology that specifies prefixes of any length. An address that follows a CIDR rule has a suffix that describes the number of digits of the prefix, such as: 192.168.0.0/16. This makes the use of increasingly scarce IPv4 addresses more effective. (Dividing a large address block into a small address block to a molecular network and routing) aggregates multiple consecutive prefixes into a network, and, in the Internet, as long as it is possible to display as an aggregation of networks, it is generally possible to reduce the number of table entries in the routing table. Aggregation makes the routing table of Internet not divided into multi-level, and through VLSM reverse the process of "dividing subnets". (Fast aggregation of continuous small addresses into large address block subnets and routes) manages the allocation of IP addresses based on the actual needs of the organization and the short-term expected needs rather than the large or too small address blocks defined in the classification network. CIDR requires routing protocol support, such as: Ripv2,ospf,eigrp and BGP.
First, IP address classification:
When initially designing the Internet, each IP address consists of two identification codes (IDS), the network ID and the host ID, for easy addressing and hierarchical construction of the network. All hosts on the same physical network use the same network ID, and one host on the network (including workstations on the network, servers, routers, etc.) has a host ID corresponding to it. The Internet Board defines 5 types of IP addresses to fit a network of different capacities, that is, a class ~e class.
where a, B, C3 Class (table below) is distributed globally by Internetnic, D and e are special addresses. Category maximum number of networks IP address range maximum host number private IP address range A 126 (2^7-2) 0.0.0.0-127.255.255.255 16777214 10.0.0.0-10.255.255.255 B 16384 (2^14) 128.0.0 .0-191.255.255.255 65534 172.16.0.0-172.31.255.255 C 2097152 (2^21) 192.0.0.0-223.255.255.255 254 192.168.0.0-192.168.255.255 Class A IP address a class A IP address refers to the IP address of the four paragraph number, the first paragraph number is the network number, the remaining three segment number is the local computer number. If the IP address is represented by a binary, the Class A IP address consists of a 1-byte network address and a 3-byte host address, and the highest bit of the network address must be "0". A class of IP address network identification length of 8 bits, host identification length of 24 bits, a class of network addresses a small number of 126 networks, each network can accommodate the number of hosts up to more than 16 million units. Class A IP address range 1.0.0.0 to 127.255.255.255 [1] (binary representation is: 00000001 00000000 00000000 00000000-01111110 11111111 11111111 11111111). The last one is the broadcast address. The IP address of Class A has a subnet mask of 255.0.0.0, and the maximum number of hosts supported by each network is 256 of 3 -2=16777214. [2] B IP Address a class B IP address refers to the IP address of the four paragraph number, the first two paragraphs of the number is the network number. If the IP address is represented by binary, the Class B IP address consists of 2-byte network address and 2-byte host address, and the highest bit of the network address must be "10". Class B IP Address network identification length of 16 bits, host identification length of 16 bits, B class network address for the medium sized network, there are 16,384 networks, each network can hold more than 60,000 computers. Class B IP Address range 128.0.0.0-191.255.255.255 [3] (binary representation is: 10000000 00000000 00000000 00000000----10111111 11111111 11111111 11111111). The last one is the broadcast address. The subnet mask for Class B IP addresses is 255.255.0.0, and the maximum number of hosts supported by each network is 256 of 2 -2=65534. Class C IP Address a class C IP address refers to the IP address of the four paragraph number, the first three paragraph number is the network number, the remaining part of the number is the local computer number. If the IP address is represented by binary, the class C IP address consists of 3-byte network address and 1-byte host address, and the highest bit of the network address must be "110". Class C IP Address Network identification length of 24 bits, host identification length of 8 bits, Class C network address number of more than 2.09 million network. For small-scale local area networks, each network can contain up to 254 computers. Class C IP address range 192.0.0.0-223.255.255.255 [3] (binary representation is: 11000000 00000000 00000000 00000000-11011111 11111111 11111 111 11111111). The Class C IP address has a subnet mask of 255.255.255.0, and the maximum number of hosts per network supports is 256-2=254 Class D IP address the IP address of Class D is called a multicast address (multicast address) in history, that is, multicast addresses. In Ethernet, a multicast address names a set of sites that should be applied in this network to receive a grouping. The highest bit of a multicast address must be "1110", ranging from 224.0.0.0 to 239.255.255.255. Special URLs Each byte is 0 of the address ("0.0.0.0") corresponds to the current host, each byte in the IP address is 1 IP address ("255. 255. 255. 255 ") is the broadcast address of the current subnet, and the IP address is reserved for future and experimental use with the class E IP address that begins with" 11110 ". The IP address cannot begin with the decimal "127", which is the number 127 in the class address. 0. 0. 1 to 127. 255. 255. 255 for loop testing, such as: 127.0.0.1 can represent the native IP address, with "http://127.0.0.1" can test the configured Web server in this computer. The first 8-bit group of the network ID cannot be completely set to "0", and all "0" represents the local network. Second, private IP address range Private IP address is a reserved IP address. Only used in LAN, not in inteUsed on rnet. is to solve the problem that the IPV4 address is insufficient, this kind of address with NAT can alleviate the problem of IPV4 address tension.
Third, the subnet mask is used to divide the network scope, in the same subnet can not pass through the router to exchange information. Can be used in the local area network private address, to divide the local area network different subnet. can also be used for public IP network A, B, C class address, for a group of IP addresses, the division of different subnets.
The function of the subnet mask is to reach the network address with the IP address and the operation, the subnet mask is also 32bit and is composed of a string of 1 followed by a string of 0, where 1 represents the number of digits corresponding to the network number in the IP address, and 0 represents the number of digits in the IP address that correspond to the host.
1) Standard Subnet mask
Class A network (1-126) default subnet mask: 255 0 0 0
255 0 0 0 conversion into binary system for 11111111 00000000 00000000 00000000
You can clearly see that the top 8 is the network address, the latter 24 is the host address, that is, if you are using a standard subnet mask, look at the first paragraph address can be seen is not the same network. such as 21.0.0.0.1 and 21.240.230.1, the first paragraph 21 belongs to Class A, and if the default subnet mask is used, the two addresses are a network segment.
Class B Network (128-191) default subnet mask: 255 255 0 0
Class C Network (192-223) default subnet mask: 255 255 255 0
Class B, Class C analysis ibid.
2 Special Subnet Mask
The standard subnet mask appears as a combination of 255 and 0, with the following subnet mask in the actual application
255 128 0 0
255 192 0 0
。。。。。。
255 255 192 0
255 255 240 0
。。。。。。
255 255 255 248
255 255 255 252
What do these subnet masks mean? These subnet masks appear to divide a network into multiple networks.
2 Class C Network Division Examples
When the subnet is divided, the number of subnets increases as the subnet address borrows the number of host digits, and the number of available hosts in each subnet is gradually reduced. For example, C-Class network, the original 8-seat, 2 of the 8-time side of 256 host address, the default subnet mask 255.255.255.0. Borrow 1 main seat, produce 2 subnets, each subnet has 126 host address, borrow 2 main seats, produce 4 subnets, each subnet has 62 host address .... Each network, the first IP address (that is, the host part of all 0 IP) and the last IP (that is, the host part of all 1 of the IP) can not be allocated to the host to use, so the number of available IP addresses per subnet is minus 2 for the total number of IP addresses, and the number of host digits borrowed from the subnet ID can be calculated by dividing the subnet numbers, Masks, each subnet host number, the list is as follows: ① number of subnets ② Subnet ③ subnet mask (binary) ④ subnet mask (decimal) ⑤ per subnet host number ①1~2②1③11111111.11111111.11111111.10000000④255.255 .255.128⑤126①3~4②2③11111111.11111111.11111111.11000000④255.255.255.192⑤62①5~8②3③11111111.11111111.111111 11.11100000④255.255.255.224⑤30①9~16②4③11111111.11111111.11111111.11110000④255.255.255.240⑤14①17~32②5③1 1111111.11111111.11111111.11111000④255.255.255.248⑤6①33~64②6③11111111.11111111.11111111.11111100④255.255.255.2 52⑤2