Lecture 6 on basic network knowledge: Implementing subnets (including IPv6)

Source: Internet
Author: User

A frequently asked question in the network class is, "Why don't we place all the devices in the same subnet? This eliminates the need to worry about routing issues ." The reason is simple. Each time a system needs to communicate, whether it is a host or another router, they need to send an ARP request. In addition, there are some non-ARP broadcast packets that can be received by all people in the message network. When there are only 255 devices in a 24-seat network, these broadcast packets are relatively limited. A very important problem in the network is to keep this number in a low state, because when any host receives a message or broadcast information sent to it, the host must process this packet. This requires creating a hard interrupt, and the operating system kernel must read enough data so that the data packet can be further processed.

Broadcast storms occur from time to time. The main cause of this situation is the layer-2 topological loop. We have encountered some layer-2 topology problems in the previous article. When thousands of data packets flow to your computer at the same time, your machine will run very slowly. The operating system kernel needs to spend a lot of time dealing with interruptions and no longer have time to process other processes. Therefore, this is why the subnet is very important. A subnet is also called a broadcast domain. It can limit the broadcast range that you can receive.

So what are the key points for creating a subnet? How do I remember these strange subnet masks? How does this work with IPv6 addresses? This lecture will expand the previous tutorials on subnets and CIDR to give you a more comprehensive understanding of subnet-related concepts.

The next question is how to view the broadcast address and subnet mask from the perspective of a host. We can understand what computers a host has on the same subnetwork. These IP addresses can be directly spoken without a router. When the subnet mask or broadcast address is incorrectly configured, you will soon find that some hosts cannot be accessed.

The most common setting error often occurs when an IP address is set when the subnet mask and broadcast address are not specified at the same time. For some reason, you can use one of these values to calculate the other, however, most operating systems are not responsible for updating them. For example, when you run "ifconfig eth0 130.211.0.1 netmask 255.255.255.0", you may think everything will run as expected. Unfortunately, your broadcast address may be set to 255.255.0.0. This mainly depends on the vro settings. However, this result usually results in the loss of all broadcast data packets. On the contrary, if a subnet mask is incorrectly set, the computer does not know the start and end addresses of the subnet. If one computer considers another host to be in the same subnet but not in fact, the computer will directly send an ARP request to the network instead of requesting the router when it needs to communicate with it. Of course, you can also set a vro to handle this situation and let the vro Replace the target host to make an ARP response (called "ARP proxy"). However, in most cases, the host cannot be accessed.

Understanding the subnet mask setting principle can avoid the problems mentioned above. When you remember that the subnet mask means "mask some binary bits", it is not very difficult to calculate the network address and broadcast address. Deciphering the meanings of some subnet masks can deepen your understanding of the principle of subnet masks. The subnet mask of a 24-bit network address is 255.255.255.0. This is simple. What does 255.255.255.240.0 mean? The best way to crack this address is to start with mask masking. Compare this address with a standard 24-bit network address. The standard 24-bit network address has three bytes hidden. We can see that 255.255.255.240.0 has two bytes hidden, and the other 8-bit bytes hidden. We know that this is between a 16-bit network address and a 24-bit network address. We must understand binary and calculate how many digits are masked. The first 16 bytes are clearly part of the network segment. The third 8-bit byte 240 allows the 16-bit network address to expand the subnet mask, by analyzing this number, you can find that four binary bits in this byte are not masked (256-240 = 16, 16 is equal to the 4 power of 2 ). The remaining four binary digits plus 16 binary digits in the first two bytes mean that we are processing a 20-bit network address.

1.0.0.0/255.255.255.255.248? We are indeed in a network with a subnet smaller than 24 bits. If we check the remaining eight bytes in the last eight bytes, we can see eight available IP addresses. Remember, only the 3rd power of 2 can be equal to 8. Therefore, we use all three binary bits except the last byte as the network address. This is a 29-bit network. Of course, the simple address is very clear: Compared with the 24-bit network, the number of host addresses allowed by zookeeper 255.128 is half of the last 8-bit bytes. Therefore, this is a 25-bit network.

IPv6 addresses certainly have a place in the topic of confusing subnet masks. This subnet mask is actually not a problem because the same principle applies here. You only need to remember more numbers. The real problem in the address is the expression of the address itself, and IETF (Internet Engineering Task Force) seems proud of creating chaos. IPv6 addresses are generally expressed in hexadecimal notation. Our old friend IPv4 can also express an IP address in hexadecimal notation. For example, B. B. B. B represents the network address 11.11.11.11. Unfortunately, IPv6 addresses are more confusing. To express a 128-bit address, IPv6 generally divides the address into eight 16-bit fields.

An IPv6 address looks like this: 2013: 4567: 0000: CDEF: 0000: 0000: 00AD: 0000. This address is indeed easier. For example, the preceding zero does not need to be written. The four consecutive zeros can be abbreviated ::. However, the following zeros must be displayed. This is a bit confusing. However, this rule applies to a non-Ambiguous IP address. The first zero in every four zeros can be deleted, but each address can be abbreviated as a zero continuous field only once. After the preceding address is abbreviated as "0: 2013: 4567: 0000: CDEF: AD: 0000. The number of IPv6 addresses is 128 to the power of 2, which is enough for the earth to use about 1000 IP addresses per square meter.

If you remember the binary rules, IPv6 indicates the address rules and some simple subnet references, you will become a subnet master. Friends will ask for help.

Summary

• Subnets are important to minimize broadcast traffic.

• The binary bit masked by the count is the easiest way to guess the unfamiliar subnet mask.

• IPv6 addresses are the same as IPv4 addresses when they are divided into subnets. As long as you remember the rules for expressing addresses, You can minimize confusion.

Lecture 5: Learning Spanning Tree Protocol
Lecture 4: understanding the data link layer
Network basics Lecture 3: Understanding OSI network layering
Network basics Lecture 2: Understanding subnet and CIDR
One of the basic network knowledge lectures: understanding the meaning of IPv4 addresses

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.