6697 views|2 replies

1

Posts

0

Resources
The OP
 

What you need to know about network engineering (Part 1) [Copy link]

The setting of IP address and subnet mask is the basic network knowledge that every network administrator must have. Only by understanding the true meaning of IP address and subnet mask can we manage a network handily. If we want to understand the real application of IP address and subnet mask, we must first understand the common sense of IP address and subnet mask.

Since the basic principle of computer is binary, IP address and subnet mask are no exception. If you want to learn how to calculate subnet mask, you must also learn the conversion between decimal and binary. The easiest way is to use Windows calculator. In scientific type, select decimal, enter a number, and then click binary, and the number will be converted to binary.

1. Common sense of IP address:

1. The role of IP address: IP address is used to identify the address of the host. A network is composed of several hosts. Each host must have a globally unique IP address, just like the telephone number in our lives. Each phone can only have a globally unique telephone number. In a broad sense, hosts can be workstations, servers, and routers working in the network. IP addresses are generally expressed in decimal, consisting of four digital segments separated by commas. For example, 192.168.1.5 is an IP address.





1. Composition of IP address: IP address consists of two parts, as shown in Figure 1: the first part is the network number, and the second part is the host number. The network number determines the location of the host, which is equivalent to the area code of our phone number. The host number is the address of the machine. The IP address plus the subnet mask is the real address of the host on the network. This is the same as our phone number, which is also composed of the area code and the phone number. The principle of IP address is based on binary form, but when we use it, we convert it into decimal. Only when calculating the subnet mask, it is expressed in binary form.

2. Classification of IP address: IP addresses are generally divided into three categories: A, B, and C. Let's take the IP address wxyz as an example to explain the division of the three categories of IP addresses: When the value of W is between 1 and 126, the IP address is Class A, and the default subnet mask is 255.0.0.0. When the value of W is between 128 and 191, the IP address is Class B, and the default subnet mask is 255.255.0.0. When the value of W is between 192 and 223, the IP address is Class C, and the default subnet mask is 255.255.255.0.

3. Several regulations of the International NIC Organization:
127.0.0.1 is the IP address reserved for loopback testing of this machine.
192.XXX and 10.XXX are reserved addresses for local area networks.
The address with all host bits as 1 is the broadcast address of the network.
The IP address with all host bits as 0 refers to the network itself.

4. Reasonable choice of IP address: Which type of IP address is used directly determines the number of machines that can be accommodated in this subnet. Therefore, we can choose a reasonable IP address according to the scale of our network. We need to take a look at the IP address of Class C, 192.168.1.X. For the last value, we should not analyze it in decimal. Convert it to binary. There are 8 binary digits, which means we need to use 0 and 1 to make an eight-digit non-repeating number. After the combination and arrangement, 28 different numbers can be generated. Since the combination of all 0s is the network itself and cannot be used, and the combination of all 1s is the broadcast address, there will be 28-2 different values, that is, 254 different values, which determines that the Class C subnet can accommodate a maximum of 254 hosts. In the same way, you can study how many hosts can be accommodated in an IP address segment of Class A and Class B. After analysis, we can draw a conclusion that the number of hosts that can be accommodated in a Class B IP address is 216-2 hosts, and the number of hosts that can be accommodated in a Class A address is 224-2 hosts. Based on the above, we can summarize a formula, the number of hosts = 2n-2, where the value of N is the number of host bits.

2. Common knowledge about subnet masks

1. The function of subnet masks: The function of subnet masks is to determine whether two hosts that need to communicate need to be forwarded through the network. If the two hosts that need to communicate are in the same subnet, they can communicate directly. If the two hosts that need to communicate are not in the same subnet, they need to find a path to communicate. In layman's terms, my own phone number is 021-55554444, and my friend's phone number is 010-666688888. If the two of us want to communicate, I must first check whether our two phones are in the same interval (equivalent to the subnet in the subnet mask). As a result, if they are not in the same interval, I must add the area code to call him, that is, forwarding.

2. Composition of subnet masks: The subnet mask is actually an IP address. The three types of IP addresses, ABC, have default subnet masks. Please do not change them at will when using them. We can convert the subnet mask 255.255.255.0 into binary as follows: 11111111. 11111111. 11111111.00000000. In the subnet mask, the network bit is represented by 1 and the host bit is represented by 0. As long as the network bits are the same, the two subnets can communicate. This is the basis for judging whether the two hosts that need to communicate are in the same subnet.

3. Advanced application of subnet mask - reasonable selection of IP address and subnet mask

The category of IP address determines the number of hosts that can be accommodated in this subnet. By modifying the subnet mask, you can change the number of machines that can be accommodated in a subnet and optimize the communication performance of your own network.

On the surface, it seems that there is no relationship between which type of IP address and subnet mask are used in a network. In fact, if the subnet mask is not selected properly, it may cause broadcast storms and reduce network performance. Let's take an example to analyze: our machine IP address is 192.168.0.X network segment, we did not use the default subnet mask 255.255.255.0, but chose 255.255.0.0 as the subnet mask. After we convert the subnet mask into binary, it is:

11111111.11111111.00000000.00000000. When communicating on the network, because the host bit occupies 16 bits, the range of data broadcast will be expanded, so a large amount of broadcast information may be generated, reducing the communication performance of the network. How to choose an IP address segment and a matching subnet mask for your network to improve our network communication performance is an issue we are concerned about. Therefore, we can create a subnet mask network belonging to our own network according to the number of machines in our network.

In general, if the number of machines does not exceed 250, there is no need to modify the default subnet mask yourself. When the number of machines exceeds 250, it is necessary to modify the subnet mask yourself. Let's take a network of 450 machines as an example to talk about how to choose the right IP address and subnet mask. A network of 450 machines is definitely not possible because the Class C IP address only supports 254 hosts. We can only choose the Class B IP address, such as choosing to use 188.188.XX, and the default subnet mask is 255.255.0.0. We can see from the formula number of hosts = 2n-2 that the number of machines that can be accommodated in the Class B IP address is 65536 hosts, which is a bit too large. Can we modify it? We use the formula to calculate 450 = 2n-2. After calculation, we know that the most appropriate value of N is 9. We convert the subnet mask to binary:

11111111.11111111.00000000.00000000. The current host bit of the subnet mask is 16. After we change it to 9, the subnet mask becomes: 11111111.11111111.11111110.00000000, which is converted to decimal: 255.255.254.0. Success. Use it to test whether communication is possible in the network, and everything is OK.

When calculating the subnet mask yourself, you must correctly understand where the host bits are and where the network bits are after the subnet mask is converted to binary.
This post is from RF/Wirelessly

Latest reply

Well, the host has told us something that is very simple and should be known but many people still don’t know. Keep going!  Details Published on 2007-2-1 21:48
 

1564

Posts

0

Resources
2
 
Oh, very basic computer network knowledge. There is still the next section. Please continue. Everyone is looking forward to it. Thank you for your hard work.
This post is from RF/Wirelessly
 
 

1

Posts

0

Resources
3
 
Well, the host has told us something that is very simple and should be known but many people still don’t know. Keep going!
This post is from RF/Wirelessly
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

快速回复 返回顶部 Return list