In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
IP address and VLSM
Let's start with why we use the IP address.
They are uniquely identifiable for each device in the IP network. Without a logo, it cannot be identified. To put it bluntly, it is impossible to surf the Internet.
Because whether it is a wireless or wired connection, it is through the acquisition of IP address, and through the IP address of the information source to access the Internet.
Each host (computer, network device, peripheral) must have a unique address.
ID of the host:
-identify a single host
-assigned to each device by the organization
The composition of IP addresses: 32-bit binary system, but usually presented in 4-bit decimal (dotted decimal)
192.168.10.1 (4-bit decimal, dotted presentation)
192 168 10 1
0000 0000.0000 0000.0000 0000.0000 0000
0000 0001o1
0000 0010002
0000 01004
0000 1000008
0001 00000016
0010 00000032
0100 00000064
1000 000000128
192 '128' 64 168 '128' 40 '128' 32'8
1100 0000.1010 1000.0000 1010.0000 0001 (32-bit binary)
172.100.20.1
172 '128' 32'8'4
1010 1100.0110 0100.0001 0100.0000 0001
Classification of IP addresses:
Class A. The binary of the first octet is converted to a decimal value: 1-126
Class B. The binary of the first octet is converted to a decimal value: 128-191
Class C. The binary of the first octet is converted to a decimal value: 192-223
Class D. Multicasting
Class E. Scientific research
The first set of addresses that convert unknown binary to decimal values of 127 cannot be assigned to the network for loopback testing.
The IP address is divided into two parts: network bits and host bits.
Network bit: is the scope of the network to which the IP address belongs-is a range-- is the identity of the network
Host bit: is a specific IP address-a specific point-- host identification in the network
Difference:
Network bit represents a range, is a network logo, such as the Internet, metropolitan area network, local area network; for example, we log on to the educational administration system to the campus network, other networks can not be accessed because the network logo is different.
The host bit is a specific device in the network.
Let's take a look at the network bits and host bits in the example, such as:
Class A: 10.100.100.100 its network bits are the values corresponding to the first set of octets, and the rest are host bits. 100.100.100 is its host bit.
Class B: 172.16.1.1 its network bits are the values corresponding to the first two octets, and the rest are host bits. 1.1 is its host bit.
Class C: 192.168.10.1 its network bits are the values corresponding to the first three octets, and the rest are host bits. 1 is its host bit.
So is it all right to have an IP address?
Each IP address cannot appear separately and carries a subnet mask.
So what is the subnet mask for?
The subnet mask is also 32-bit, and the subnet mask is only 0 and 1, 1, 1 for matching, and 0 for mismatch; for example
192.168.1.1
1100 0000.1010 1000.0000 1010. 0000 0001 (matching means that the first 24 bits are the same, so only the last 8 bits can be changed, so the role of the subnet mask is to define the network bits)
1111 1111.1111 1111.1111 1111. 0000 0000 (8 1s is 255.255.255.0)
255.255.255.0
Subnet mask: appears in pairs with IP address
Default subnet mask for Class An addresses: 255.0.0.0
Default subnet mask for class B addresses: 255.255.0.0
Default subnet mask for class C addresses: 255.255.255.0
Network number: the result obtained by doing a sum operation between the IP address and the subnet mask to identify a network range
The number of host bits in real life is based on the subnet mask.
The number of hosts for each of the three types of IP addresses under the default subnet mask.
Class C: 192.168.10.1 255.255.255.0 Network number: 192.168.10.0 number of hosts: 254
Class B: 172.16.1.1 255.255.0.0 Network number: 172.16.0.0 number of hosts: 254 ^ 2
Class A: 10.1.1.1 255.0.0.0 Network number: 10.0.0.0 number of hosts: 254 ^ 3
The reserved address is referred to here:
Reserved address: network address and broadcast address
Network address:: within the range of IP addresses in the network, an address is reserved as the network address, and each host bit of the host portion of this address is 0. (the first address of a network)
Broadcast address: a special address used to send data to all hosts in the network. The broadcast address uses the largest IP address in the range of the network, that is, each host bit in the host part is 1. (the last address of a network)
Note: in the network, broadcast address and network address cannot be configured into the device.
Private address: can not be connected to the Internet, can only exist in the local area network (intranet). Free of charge
Public address: can be connected to the Internet, exists in the external network, but requires an application. Asking for money
VLSM--- variable length subnet mask
Principle: the network bit borrows from the host bit, which can divide a large network into many small networks. -make the host 1 bit less
192.168.10.1 / 24 255.255.255.0-which means you have 254 host bits, which is easy to waste resources.
1111 1111.1111 1111.1111 1111.0000 0000 Subnet Mask
At this time, we have to think about how to reduce the host bits, so that the resources will not be wasted excessively. Then a VLSM will make the subnet mask longer, so that the network bits can borrow bits from the host bits to reduce the host bits.
This way.
192.168.10.50 Compact 27-Class C / 24
1111 1111.1111 1111.1111 1111.1110 0000
How many subnets can the address be divided into via VLSM? -2 ^ 3
How many hosts are there in the network to which the IP address belongs? 2 ^ 5 = 32
How many addresses are available in the network to which the IP address belongs? 2 ^ 5-2: 30
What is the network address in the network to which the IP address belongs? 192.168.10.32
What is the broadcast address in the network to which the IP address belongs? 192.168.10.63
192.168.10.0-31 32-63 64-95 is divided into 8 subnets, each with 32 host bits, so the subnet in 192.168.10.50 is 32-63, the network address is the first address, and the broadcast address is the last address.
192.100.120.120/28
1111 1111.1111 1111.1111 1111.1111 0000
255.255.255.240
How many subnets can the address be divided into via VLSM? sixteen
How many hosts are there in the network to which the IP address belongs? sixteen
How many addresses are available in the network to which the IP address belongs? 16-2
What is the network address in the network to which the IP address belongs? 192.100.120.112
What is the broadcast address in the network to which the IP address belongs? 192.100.120.127
0-15 16-31 32-47 48-63 64-79 80-95 96-111 112-127
One last question:
What is the largest subnet mask in the network?
255.255.255.252 / 30 1111 1111.1111 1111.1111 1111.1111 1100lap30 Why should you want / 30, because at least one available address should be saved. Plus the network address and broadcast address, so there are at least three addresses.
Big ace!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.