Basic knowledge of IP addresses and subnet masks

Source: Internet
Author: User

The IP-based Internet has developed into the world's largest communication network with the largest number of users and the widest range of resources. Therefore, the IP protocol has become a de facto industry standard. The network based on the IP protocol has become the mainstream of communication networks.

Based on the practical experience of the author and the CCNA course teaching experience of Cisco Network Technology College, This article briefly describes the IP address of the IP protocol.

I. Why should I use an IP address?

An IP address is used to identify a communication entity in the network, such as a host or a port of a router. Packets transmitted in an IP-based network must also be identified by IP addresses. For example, if we write a letter to indicate the recipient's communication address and the sender's address, the postal staff uses this address to determine the mail destination.

The same process also occurs in the computer network. Each transmitted packet also includes a source IP address and a destination IP address. When the packet is transmitted over the network, these two addresses must remain unchanged to ensure that network devices can always send data packets from the source communication entity to the specified destination communication entity based on the specified IP address.

Currently, IP addresses are in 32-bit binary address format. For convenience of memory, IP addresses are usually expressed in decimal notation, for example, 202.112.14.1.

An IP address consists of two parts: one is used to identify the network number that the address belongs to, and the other is used to specify the host number of a specific host on the network.

In order to provide the necessary flexibility for networks of different scales, IP address designers divide the IP address space into five different address categories, as shown in the following table. Among them, Class A, B, and class C are the most commonly used:

Class A 0-127 0 8-bit 24-bit

Class B 128-191 10 16-bit 16-bit

Class C 192-223 110 24-bit 8-bit

Class D 224-239 1110 multicast address

Class E 240-255 1111 retention test use

The network number is allocated by the Internet authority to ensure the global uniqueness of the network address. The host address is allocated by the administrator of each network. Therefore, the uniqueness of the network address and the host address in the network ensure the global uniqueness of the IP address.

Ii. Dividing subnets

To improve the efficiency of IP address usage, you can divide a network into subnets: by taking the bits, you can change from the maximum bit of the host to the New subnet bit, the remaining part is still the master location. This divides the IP address structure into three parts: Network bit, subnet bit, and host bit.

After the concept of subnet is introduced, the network bit and subnet bit can uniquely identify a network. All the network bits are identified by 1, and the host bits are identified by 0, and the subnet mask is obtained. As shown in, the subnet mask is converted to decimal, and then is: Too Many Subnet Mask

Subnet addressing makes the IP address have a certain internal hierarchy, which facilitates IP Address Allocation and Management.

The key to its use is to select an appropriate hierarchy-how to adapt to the physical network scale and make full use of the IP address space: where to separate the subnet number and host number ).

Tips -- subnet computing

In the CCNA teaching and examination of Cisco Network Technology College, many students always have a headache in calculating the subnet and mask when planning IP addresses. Now I will give you a tip to solve this problem smoothly.

First, let's take a look at a common question type in the CCNA exam: the IP address of a host is 202.112.14.133, And the mask is 202.112.14.133. The network address and broadcast address of the host must be calculated.

The general method is to convert the host address and subnet mask into binary numbers. The network address can be obtained after the logic and calculation of the two. In fact, you only need to think about it carefully and you can get another method: The Mask of zookeeper contains 256-224 = 32 IP addresses including network addresses and broadcast addresses ), the network address with this mask must be a multiple of 32. The network address is the beginning of the subnet IP address, and the broadcast address is the end. The available host address is within this range. Therefore, it is slightly smaller than 137, and only 128 is the multiple of 32, therefore, the network address is 202.112.14.128. The broadcast address is the network address of the next network minus 1. The next 32 is a multiple of 160. Therefore, the broadcast address is 202.112.14.159. You can refer to this example to understand:

In the CCNA test, you also need to plan the subnet address and calculate the subnet mask based on the number of hosts on each network. This can also be calculated based on the above principles. For example, if a subnet has 10 hosts, 10 + 1 + 1 + 1 = 13 IP addresses are required for this subnet. Note that the first one is the gateway address required for the network connection, and the second two are the network address and broadcast address respectively .) 13 is less than 1616 is equal to the 4 power of 2), so the host space is 4 bits. And 256-16 = 240, so 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 wrong. Because 14 + 1 + 1 + 1 = 17, greater than 16, we can only allocate a subnet with 32 addresses equal to the power of 2. In this case, the subnet mask is too large.

Iii. Limitations of IP addresses

At first, Internet designers did not expect that the network would develop so quickly. Therefore, all the problems faced by the network can be traced back to the early decision-making of the development of the Internet. The allocation of IP addresses can better reflect this.

The currently used IPv4 address uses a 32-bit address, that is, 2324,294,967,296 of IPv4 address spaces, about 4.3 billion) are available. In the early days of the internet, such an address space was almost infinite, so the IP address was assigned to an organization or company by category based on the application, however, we seldom consider whether we really need so many address spaces, not considering that IPv4 address spaces will eventually be exhausted.

Therefore, an IPv4 address is classified by the number of IP addresses used by the network size. Its addressing scheme uses the concept of "class. The definitions of IP addresses A, B, and C are easy to understand and divide. However, in actual network planning, they are not conducive to effectively allocating limited address space. For Class A and Class B addresses, few companies can use such A large scale, and the number of hosts for Class C addresses is relatively small. Therefore, a type of IP address is not conducive to effectively allocating limited address space, and is not applicable to network planning.

In this case, people began to work on the next generation Internet protocol-IPv6. Because the IPv6 protocol is not complete and mature, it requires long-term test and verification. Therefore, the full transition from IPv4 to IPv6 is a long process, during the transition period, we still need to Interconnect Networks on IPv4. In the early 1990s S, systems such as the variable-length subnet mask VLSM and classless Inter-Domain Routing (CIDR) were introduced, as a short-term solution to improve the efficiency of IPv4 address space usage in the current transitional period, it has played a major role.

Related Articles]

  • IP address and subnet mask
  • Easy management of computer networks with active IP addresses
  • IP Network Design Series-IP Address Management

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.