[Computer three-level network technology] The third IP address planning technology


Article Directory


insert image description here


1. IP address planning and new technology for dividing addresses

1. Standard Classification of IP Addresses (Phase 1)

The IP address has a total of 32 bits (bits), expressed in dotted decimal notation, and divided into five categories: A, B, C, D, and E. Type A, Type B, and Type C are more commonly used, and their address structure is a two-level hierarchical structure including " network number + host number " (RFC1812).

The length of the class A address network number is 7 bits, and only 126 networks are actually allowed to be allocated.
The length of the class B address network number is 14bit, and only 16384 networks are allowed to be allocated.

2. Three-level address structure for dividing subnets (second stage)

According to the standard classification of IP addresses, if a network with only 4 hosts needs to connect to the Internet, it needs to apply for a Class C IP address, and the effective utilization rate of this Class C IP address is only 4/255=1.57%. Similarly, if there is a network with 260 hosts, it needs to apply for a class B IP address, and the effective utilization rate of this class B IP address is only 260/65535-0.40%. It can be seen that the effective utilization rate of the IP address is very low. It is unreasonable to design Class A and Class B addresses in this way, and IP addresses will be exhausted soon. So in 1991 , the concepts of subnet and mask appeared .

The so-called subnet is to divide a large network into several smaller subnets, thus forming a three-level structure of "network number-subnet number-host number".

3. Classless inter-domain routing technology that constitutes a supernet (the third stage)

Classless inter-domain routing technology needs to strike a balance in the following two aspects:
one is to improve the utilization of IP addresses;
the other is to reduce the load of the backbone routers.
Classless inter-domain routing technology is also called supernet (supernet) technology. The purpose of forming a supernet is to combine existing IP addresses into larger routing domains with more host addresses.

4. Network address translation technology (the fourth stage)

The basic idea of ​​NAT is: assign one or a small number of IP addresses to each unit for the transmission of Internet traffic, and assign a reserved dedicated IP address (RFC 1918) to a single host within the company, but this address cannot be used on the Internet. Private IP addresses are used for internal network communication. If you need to access external Internet hosts, the internal private IP addresses must be converted into global IP addresses by a host or router running NAT.

2. IP address classification

The length of an IPv4 address is 32 bits, each group of 8 bits is expressed in dotted decimal notation, that is, it is expressed in the format of xxxx . For example, 199.213.131.26.

1. Class A, B and C IP addresses

Class A, B and C IP addresses, as shown in the figure below

insert image description here

insert image description here

insert image description here

2. Special address form

Special IP addresses include: limited broadcasting (limited broadcasting) address, direct broadcasting (directed broadcasting) address, host address and loopback address (loopback address).
.
(1) Restricted broadcast address.
Restricted broadcast address is also called limited broadcast address, and the address has a unique form, that is, an IP address (255.255.255.255) whose 32 bits are all 1s.

(2) Direct broadcast address.
The form of the direct broadcast address is a valid network number and a host number with all 1s, the network number remains unchanged, and the host number is set to 1.

(3) Host address
The form of the host address is a network number of all 0s and a definite host number, the network number is set to 0, and the host number remains unchanged.

(4) The loopback address.
127.0.0.0 in the class A IP address is a reserved address, which is the loopback address. Used for network software testing and local interprocess communication.

example:

IP address 125.172.2.7
subnet mask 255.224.0.0
address class ( 1 )
website address ( 2 )
direct broadcast address ( 3 )
host number ( 4 )

(1) Analysis: The range of class A addresses is 1.0.0.0~127.255.255.255, the IP address in the title is in this range, so fill in (1): A

(2) Analysis: According to the form of the network address, it is a certain network number and a host number with all 0s, that is, the network number remains unchanged, and the host number is set to 0. Convert the IP address and subnet mask into binary respectively, and compare them bit by bit:

binary
IP address 125.172.2.7 01111101.10101100.00010100.00000111
subnet mask 255.224.0.0 11111111.11100000.00000000.00000000
website address ( 2 ) 0111101.101 00000.00000000.00000000

Convert the binary number 0111101.10100000.00000000.00000000 into a decimal number to get the network address: 125.160.0.0

(3) Analysis: According to the form of the direct broadcast address, it is a valid network number and a host number with all 1s, the network number remains unchanged, and the host number is set to 1. Convert the IP address and subnet mask into binary respectively, and compare them bit by bit:

binary
IP address 125.172.2.7 0111101.10101100.00010100.00000111
subnet mask 255.224.0.0 11111111.11100000.00000000.00000000
direct broadcast address ( 3 ) 0111101.101 11111.11111111.11111111

Convert the binary number 0111101.10111111.11111111.11111111 into a decimal number to get the direct broadcast address: 125.191.255.255.

(4) Analysis: According to the form of the host address is a network number of all 0s and a definite host number, the network number is set to 0, and the host number remains unchanged. Convert the IP address and subnet mask into binary respectively, and compare them bit by bit:

binary
IP address 125.172.2.7 0111101.10101100.00010100.00000111
subnet mask 255.224.0.0 11111111.11100000.00000000.00000000
host number ( 4 ) 00000000.00001100.00010100.00000111

Convert the binary number 00000000.00001100.00010100.00000111 into a decimal number to get the host number: 0.12.20.7

3. Subnetting

1. The basic concept of subnet

The basic idea of ​​subnetting is: by dividing subnets, a network can be divided into several small networks to meet the needs of different internal departments, but it still looks like a network from the outside. Dividing subnets not only optimizes network performance but also improves network management efficiency.

2. The address structure of the subnet

The IP addresses after subnetting are still in a hierarchical structure. The standard class A, B and C IP addresses all have a two-level hierarchical structure of network number and host number. The technical points of subnetting are as follows.

  • A subnet is also called an IP network or a network.
  • The division of subnets is carried out within the unit, and there is no need to apply to ICANN or change external databases.
  • Subnets must be close together.
  • The concept of subnet can be applied to IP addresses of Class A, Class B, or Class C.
  • All hosts in the same subnet have the same subnet number.
  • Three-level IP address: Use the host number of the original IP address to divide the subnet, forming a three-layer structure of "network number + subnet number + host number", as shown in the figure.

insert image description here

insert image description here

insert image description here

3. The concept of subnet mask

In order to divide the subnet, people put forward the concept of subnet mask (subnet mask) or simply mask (mask). The subnet mask is also sometimes called the subnet mask. Subnet division is actually the process of designing a subnet mask. The subnet mask is mainly used to distinguish the network number (network number + subnet number) and the host number in the IP address.
insert image description here

Tip: The structure and form of the subnet mask are the same as the IP address, and it is also composed of 32-bit binary numbers, expressed in dotted decimal notation. The corresponding relationship between the subnet mask and the IP address is that the corresponding bit in the subnet mask corresponding to the bit of the network number in the IP address is 1, and the corresponding bit in the subnet mask corresponding to the bit of the host number in the IP address is 0.

Example
Take the IP address as 145.13.3.10 and the subnet mask as 255.255.255.0 as an example:

insert image description here
It can be seen from this example that after the "AND" operation is performed on the third-level IP address and the subnet mask, the address of the network where the IP address is located is 145.13.3.0

4. Classless Inter-Domain Routing (CIDR) Technology

Classless inter-domain routing technology has the following two characteristics.

  • Classless inter-domain routing uses "network prefix (network-prefix)" to form a new non-classified secondary address structure, namely: <network prefix>, <host number>.
  • Classless inter-domain routing combines consecutive IP addresses with the same network prefix into a "CIDR address block". The block start address and the number of block addresses can represent a CIDR address block. The block start address refers to the address with the smallest value in the address block.

Example 1: 201.113.22.0/21
When 201.113.22.0/21 represents an address block,
its starting address is 201.113.22.0
and the number of addresses in the address block is 2 11.
The minimum address is
201.113.22.0 and the maximum address is 201.113.23.255 (the network bit remains unchanged, and the host position is 1) .
The host number is all 0 and all 1 The address is generally not used.
In this example, the network prefix indicates that the corresponding 21-bit network number is determined, so the number of host addresses that can be allocated by the organization that obtains this address block is 2 (32-21) = 2 11 .

Example 2: Can the subnet mask of the IP address block 59.67.159.125/11 be written as?
Solution: According to the slash notation, the network digits of the IP address are the first 11 digits, and the host digits are the last 21 digits. It is also defined by the subnet mask: the network bit is represented by 1, and the host bit is represented by 0.

That is, 11111111.11100000.00000000.00000000 is represented as 255.224.0.0 in dotted decimal.

Example 3: What is the number of addresses available after aggregation of IP address blocks 202.113.79.128/27 , 202.113.79.160/27 , and 202.113.79.192/27?
insert image description here

During address aggregation, the IP address obtained by searching for the last identical bit is the aggregated network address. Get the network number 202.223.79.10000000, that is, 202.223.79.128/26
2 6 -2=62
2 5 -2=30
The maximum number of available addresses is 62+30=92.

Example 4: Please answer the question according to the network structure shown in the figure below, and fill in the relevant routing table items in the routing Rg.

本题考查的是路由汇聚的知识,计算方法和地址汇聚相同。
insert image description here
Fill in the relevant routing table entries in the router RG:

Destination network (note: select the maximum available mask length) output port
【1】 s0 (direct connection)
【2】 S1 (direct connection)
【3】 S0
【4】 S1
【5】 S0
【6】 S1

[1] Analysis: The SO port of the router RG is a micro-network composed of IP addresses 172.16.0.33 and 172.16.0.34. The way to find the network number is to convert the two IP addresses into binary, and then find the same bit. The IP address composed of different bits with 0 and the same bits is the network number.

Convert 172.16.0.33 into binary: 172.16.0.00100001
172.16.0.34 into binary: 172.16.0.00100010
to get the network number: 172.16.0.00100000
into decimal: 172.16.0.32, the same digit has 30 digits. So the subnet mask is /30

Therefore, [1] should be filled in: 172.16.0.32/30

【2】Analysis: The S1 port of the router RG is a micro-network composed of IP addresses 172.16.0.65 and 172.16.0.66. The way to find the network number is to convert the two IP addresses into binary, and then find the same bit. The IP address composed of different bits with 0 and the same bits is the network number.

Convert 172.16.0.65 into binary: 172.16.0.01000001
172.16.0.66 into binary: 172.16.0.01000010
to get the network number: 172.16.0.01000000
into decimal: 172.16.0.64, the same bit has 30 bits. Therefore, the subnet mask is /30.
Therefore, [2] should be filled in: 172.16.0.64/30.

[3] Analysis: The S0 port in line 3 is a micro-network composed of three IP addresses: 172.16.0.56, 172.16.0.57 and 172.16.0.58.
According to [1] method:
Convert 172.16.0.56 into binary: 172.16.0.00111000
172.16.0.57 into binary: 172.16.0.00111001
172.16.0.58 into binary: 172.16.0.00111010
Get network number: 172.16.0.00
Convert 111000 into decimal: 172.16.0.32, there are 30 identical digits. The network already has 3 IP addresses, and the IP address that can be allocated must be 2 n 2-2>=3, and the minimum value of n is 3, that is, the subnet mask must be at least 29 bits to meet the allocation requirements, but 172.16.
Therefore, [3] should be filled in: 172.16.0.48/28

[4] Analysis: The S1 port in line 4 is a micro-network composed of three IP addresses: 172.16.0.42, 172.16.0.43, and 172.16.0.44. According to [1]:
Convert 172.16.0.42 to binary: 172.16.0.00101010
172.16.0.43 to binary: 172.16.0.00101011
172.16.0.44 to binary: 172.16.0.00101100
Network number: 172.16.0.001
Convert 01000 to decimal: 172.16.0.40, the same digit has 29 digits. So the network prefix is ​​/29. This IP is not occupied.
Therefore, [4] should be filled in: 172.16.0.40/29

[5] Analysis: The network of S0 in line 5 should consist of IP addresses 172.16.0.56, 172.16.0.57 and 172.16.0.58. According to [1]:
Convert 172.16.32.0 to binary: 172.16.00100000.00000000
172.16.33.0 to binary: 172.16.00100001.00000000
172.16.34.0 to
binary: 172.16.00100010.000 Convert 00000 172.16.35.0 into binary: 172.16.00100011.00000000
to get the network number: 172.16.00100000.00000000
into decimal: 172.16.32.0, the same bit has 22 bits. So the network prefix is ​​/22.
Therefore, [5] should be filled in: 172.16.32.0/22.

[6] Analysis: The S1 port in line 6 is a micro-network composed of four IP addresses: 172.16.16.0, 172.16.17.0, 172.16.18.0, and 172.16.19.0. According to [1] method:
Convert 172.16.16.0 into binary: 172.16.00010000.00000000
172.16.17.0 into binary: 172.16.00010001.00000000
172.16.18.0 into binary: 172.16.00010010. Convert 00000000 172.16.19.0 into binary: 172.16.00010011.00000000
to
get the network number: 172.16.00010000.00000000
into decimal: 172.16.16.0, the same bit has 22 bits. So the network prefix is ​​/22.
Therefore, [6] should be filled in: 172.16.16.0/22

The Method of Using Subnet to Divide Network Address

Example 1: If 172.0.35.128/25 is divided into 3 subnets, the first subnet can accommodate 55 hosts, and the other two subnets can accommodate 25 hosts respectively, and the network addresses are required to be assigned to the 3 subnets in ascending order. What are the masks of these three subnets? What are the available IP address segments?

Solution: (1) Since the first subnet needs to accommodate 55 hosts, 2 n -2>=25, and n=6, so the host bits are the last 6 bits, then the network bits are 32-6=26 bits.
That is, the subnet mask of the first subnet is: 255.255.255.192 or /26
Network address: 172.0.35.128 (given in the title)
Direct broadcast address: 172.0.35.191 (the network bit of the network address remains unchanged, and the host position is 1)
Available IP address: 172.0.35.129-172.0.35.190
(available IP address segment range: network address + 1—— Direct broadcast address - 1)

Solution: (2) Since the second subnet needs to accommodate 25 hosts, 2 n -2>=25, and n=5, so the host bits are the last 5 bits, then the network bits are 32-5=27 bits.
That is, the subnet mask of the second subnet is: 255.255.255.224 or /27
Network address: 172.0.35.192 (由第一个子网直接广播地址+1得到)
Direct broadcast address: 172.0.35.223 (网络地址网络位不变,主机位置为1)
Available IP address: 172.0.35.193—172.0.35.222
(可用IP地址段范围:网络地址+1——直接广播地址-1)

Solution: (3) Since the third subnet needs to accommodate 25 hosts, so 2 n -2>=25, and n=5, so the host bits are the last 5 bits, then the network bits are 32-5=27 bits.
That is, the subnet mask of the third subnet is 255.255.255.224 or /27
Network address: 172.0.35.224 (由第二个子网直接广播地址+1得到)
Direct broadcast address: 172.0.35.255 (网络地址网络位不变,主机位置为1)
Available IP address: 172.0.35.225—172.0.35.254
(可用IP地址段范围:网络地址+1——直接广播地址-1)

5. Dedicated IP address and internal network address planning method

1. Dedicated IP address vs global IP address

address class address range
Class A address 1 address block 10.0.0.0-10. 255. 255. 255
Class B address 16 address blocks 172. 16.0. 0-172. 31. 255. 255
Class C address 256 address blocks 192. 168.0.0-192. 168. 255. 255

Class A, Class B, and Class C reserved private IP addresses

(1) The network using IP addresses is mainly divided into two situations, one is that the network is directly connected to the Internet; the other is the internal network.

The dedicated IP address cannot be used for the Internet, it can only be used for the internal network of a school or unit, when a group uses a dedicated IP address, the router connected to the Internet in the network will not forward the group to the Internet.

(2) Unlike the use of the global IP address, which requires application, the dedicated IP address can be used without application. The global IP address must be guaranteed to be unique on the entire network, and the network connected to the Internet needs to apply for a public IP address according to its own structure and scale.

Different from the global IP address, the dedicated IP address is reserved by the management agency in advance, so any unit does not need to apply to the Internet management agency when using it.

(3) Different from the private IP address which can not be unique on the Internet but only needs to be unique within a certain network, the global IP address must be guaranteed to be unique on the Internet.

2. Limitations of the NAT method

(1) NAT violates the design principles of the network layered structure model. In the traditional network hierarchical structure model, layer N cannot modify the header content of layer N+1. NAT violates the principle of independence of each layer.

(2) NAT violates the design principles of the IP address structure model. The basis of the IP address structure model is that each IP address identifies a network, and the software design for connecting to the Internet is based on this premise, and NAT makes it possible for many hosts to use the same address (such as 192.168.0.25).

(3) NAT also affects high-level protocols and their security. Opponents believe that NAT, a temporary solution to the shortage of IP addresses, cannot substantially solve deep-seated problems, but delays the progress of 1Pv6.

(4) NAT makes the IP protocol change from connection-oriented to connection-oriented. In the TCP/IP protocol system, if a router fails, it will not affect the entire network transmission, and the sending process can enter the timeout retransmission process. However, NAT must maintain the mapping relationship between private IP addresses and public IP addresses and port numbers, and the Internet may become very vulnerable.

(5) FTP protocol and IP telephony protocol H.323 and other protocols, some applications insert the IP address into the content of the text. If NAT works with such protocols, the NAT protocol itself must be modified; if the transport layer uses other protocols than TCP and UDP protocols, the NAT protocol must respond and modify in time; in addition, because P2P file sharing and voice sharing are based on the IP protocol, the emergence of NAT makes it difficult to implement P2P applications.

6. Planning IP address

1. Basic steps to plan IP address

Generally, plan the network address according to the following steps.
(1) Determine the number of networks and hosts required by the customer.
(2) Configure the basic network address structure that meets the requirements.
(3) Configure the address mask.
(4) Configure the network address.
(5) Configure the network broadcast address.
(6) Configure the host address of the network.

2. The basic method of address planning

(1) Determine the number of networks and hosts required by the customer: first determine the maximum number of subnets Nnet that may be used in the network ; then determine the number of hosts Nhost that exists and may be expanded to the largest network segment in the network .

(2) Configure the basic network address structure that meets the requirements.
①Select the length value x of the subnet ID field, and require Nner<=2 x .
②Select the length value Y of the host ID field, and require Nhost<= 2 Y.
③ According to the value of X+Y, the type of IP address to be applied for can be determined.
In subnetting, the value of X+Y is the sum of the lengths of subnet ID and host ID.

(3) Configure the address mask: the address mask of the class c network without subnetting is 255.255.255.0. The address mask after subnetting is to set the high bit of the standard 32-bit IP address higher than the host ID (above the Y bit) to 1.

(4) Configuring network addresses: In the original RFC document describing subnetting, it is stipulated that the first and last network addresses are not used.

(5) Configure the network broadcast address: the directional broadcast address of a subnet is an address that is 1 less than the address number of the next subnet.

(6) Configure the host address of the network: All network addresses except the network address and broadcast address can be assigned to the host.

7. Planning the subnet address

1. The basic method and specific steps of subnet address planning

(1) Steps to create a subnet.
① Determine the required number of net IDs.

  • Each subnet requires a net ID.
  • Each WAN connection requires a net ID.

② Determine the number of host IDs required.

  • Each host requires a host ID.
  • Each connection to the router requires a host ID.

③ Based on the above requirements, the content that needs to be created is as follows.

  • Set a subnet mask for the entire network.
  • Set a different subnet ID for each physical network segment.
  • Determine the legal address space for hosts for each subnet.

(2) Basic problems to be solved in subnet address planning.
① How many subnets can be divided by the selected subnet mask.
② How many host IDs can be allocated within each subnet.
③What are the addresses of these legitimate hosts?
④ What is the broadcast address of each subnet.
⑤ What is the legal net ID inside each subnet.

2. Actual case of subnet address planning

In the following case, we will introduce the subnet planning and address space division method in detail.

(1) User needs.
① A campus network obtains a class B IP address (145.116.0.0), and subnetting is required.
②The campus network will roughly contain 200 subnets.
③ It is required to divide and manage subnets according to the existing situation.

(2) Determine the length of the subnet number subnet ID.
①Because the number of subnets in the campus network is 200<=2 8 -2=254, the length of the subnet number should be 8 digits, that is, the subnet mask is 255.255.255.0
.

(3) Determine the subnet address. According to the above subnetting scheme, the available IP addresses of the campus network are as follows. Subnet 1: 145.116.1.1~145.116.1.254
Subnet 2: 145.116.2.1-145.116.2.254
Subnet 3: 145.116.3.1-145.116.3.254
...
Subnet 254: 145.116.254.1-145.116.25 4.254

8. Planning a variable-length subnet mask address

1. Basic principles of variable-length subnet mask address planning

The IP protocol allows the division of variable-length subnets (RFC1009). In some cases, a variable-length subnet mask (VLSM) can be used to divide subnets according to needs, and design subnet numbers of different lengths.

2. Case of variable length subnet mask address planning

(1) User needs.
① A company has applied for a class C 213.140.41.0 IP address space.
②The company has 100 employees in the marketing department, 50 employees in the administrative department, and 30 employees in the logistics department.
③ The network administrator needs to set up subnets for the marketing department, administration department, and logistics department respectively.

(2) Select the variable-length subnet mask.
① In this case, the class C IP address can be divided into three parts through the variable-length subnet mask technology. According to the number of employees, the address space of subnet 1 should be twice that of subnet 2 and subnet 3.
② Calculate the subnet 1 address space. First, you can use a subnet mask of 255.255.255.128 to divide the Class C IP address into two halves. In binary calculation, the operation process is as follows. Host IP address: 11010101.10001100.00101001.00000000 (213.140.41.0) Subnet mask: 11111111.1111111111.10000000 (255.255.255.128) and operation result: 11010101.1 The calculation result of 0001100.00101001.00000000 (213.140.41.0) shows that: 213.140.41.1-213.140.41.126 can be used as the IP address of subnet 1, and then the remaining part is divided into two. Since the fourth byte of 213.140.41.127 is all 1s, it is reserved as a broadcast address and cannot be used; the address space junction point of subnet 1, subnet 2, and subnet 3 is at 213.140.41.128; subnet 1 uses a subnet mask of 255.255.255.128.
③ Calculate the address space of subnet 2 and subnet 3. The calculation process of the address space of subnet 2 and subnet 3 is as follows.
Host IP address: 11010101.10001100.00101001.00000000 (213.140.41.0) Subnet mask: 11111111.11111111.11111111.10000000 (255.255.255.128) and operation result: 110 10101.10001100.00101001.00000000 (213.140.41.0)

Subnet 2 and subnet 3 can use the two smaller address spaces divided equally. For subnet 2, the first available address is 213.140.41.129, and the last available address is 213.140.41.190, that is, the address space of the host or router of subnet 2 is 213.140.41.129~213.140.41.190.
The next address 213.140.41.191 of the last IP address of subnet 2 is an address with all 1s in the host number, which needs to be reserved as a broadcast address, and 255.255.255.192 should be used as a subnet mask, so the first available address of subnet 3 is 213.140.41.193, so it can be judged that the address space of the host or router of subnet 3 is 213.140.41.193-213.1 40.41.254

(3) Determine the IP address space of the three subnets
From the above calculations, we can see that the IP addresses of the three subnets divided by variable-length subnets are as follows.
① The address space of subnet 1 is: 213.140.41.1~213.140.41.126
The subnet mask is: 255.255.255.128

②The address space of subnet 2 is: 213.140.41.129~213.140.41.190
The subnet mask is: 255.255.255.192

③The address space of subnet 3 is: 213.140.41.193~213.140.41.254
The subnet mask is: 255.255.255.192

It can be seen from this that subnet 1, subnet 2, and subnet 3 allow 126, 62, and 62 host numbers, respectively. After adopting variable-length subnet mask technology, the company's network structure is shown in the figure.

Structure of variable-length subnetting
insert image description here

9. Planning CIDR address

1. Example of CIDR address planning method

(1) User needs.
A campus network management center obtains the address block of 213.61.16.0/20 and hopes to divide it into 8 smaller address blocks of equal length.

(2) Determine the length of the borrowed host number in the CIDR address.
By borrowing the first 3 digits (23=8) of the 12-digit host number in the CIDR address, it can be further divided into 8 smaller address blocks of equal length.

(3) Division of address blocks.
Table 3-8 gives examples of partitions.
insert image description here
insert image description here

2. Analysis of partition structure

(1) As can be seen from the above example, for the School of Information Engineering, it is assigned the address block of 213.61.16.0/23. The network prefix of its address is "11010101 001111010001000" of 23 digits; the minimum starting address of the address block is 213.61.16.0; the number of addresses that can be allocated in the address block is 29 . For the Faculty of Economics and Management, it is assigned the address block 213.61.18.0/23. The network prefix of its address is "11010101 001111 010001001" of 23 bits; the minimum starting address of the address block is 1213.61.18.0; the number of addresses that can be allocated in the address block is also 29 . Other situations are similar, and the number of allocatable addresses obtained is 29 .

(2) Analyze the network prefixes of the School of Information Engineering and the School of Economics and Management. The network prefix of the School of Information Engineering: 11010101 00111101 0001000 The network prefix of the School of Economics and Management: 11010101 00111101 0001001 It is found that the first 20 digits of the network prefixes of the address blocks allocated by the two colleges are the same, and it can be seen from Table 3-8 that the first 20 digits of the network prefixes of the address blocks of the eight colleges are the same. This conclusion illustrates an important feature of the CIDR address: it has the capabilities of address aggregation and route aggregation.

(3) Campus network structure after dividing CIDR address blocks.
CIDR technology is usually used to combine multiple Class C IP addresses into a single network, and use a single entry in the routing table to represent these Class C IP addresses. For example, the campus network structure after dividing CIDR address blocks in this example is shown in Figure 3-6. In this structure, the main router connected to the Internet sends an announcement to the external network, indicating that it will receive all packets whose destination addresses match 213.61.16.0/20 in the first 20 bits. Therefore, the external network does not need to know that there are 8 college-level networks inside the campus network of the 213.61.16.0/20 address block.

insert image description here

10. Internal network private IP address and network address translation

NAT (Network Address Translation) technology is a good way to effectively and quickly alleviate the shortage of IP addresses in a short period of time. NAT technology is suitable for the following four types of application fields.

  • Address assignment for mobile radio access.
  • Address allocation of ISP, ADSL and cable TV.
  • Combined with a firewall.
  • Address allocation for internal network systems that require strict control over Internet access, such as the e-government intranet.

The figure shows the working principle of NAT. If the host with the internal network address of 10.0.1.2 wants to access the Web server with the address of 153.3.11.1 on the Internet, a group will be generated ①, the source address S=10.0.1.2, the port number is 2322; the destination address D=153.3.11.1, the port number is 80.

When the packet ① arrives at the router that implements the network address translation function, the source address of the packet ① is converted from the internal private address to the global IP address that can be routed on the external Internet through the NAT translation table. At this time, the conversion result constitutes the packet ②, which is recorded as "S=213.0.11.1,2002, D=153.3.11.1,80".

Note here that the port number of the transport layer client process also needs to be converted at the same time.

The working principle of NAT
insert image description here
The NAT mechanism can be divided into two categories: "one-to-one NTA" and "many-to-many NAT". The method of realizing "one-to-one" translation of addresses belongs to static NAT, that is, configuring an internal private IP address to correspond to a public IP address, the access between internal network hosts uses a dedicated IP address, and access to the external network requires a global IP address.

Tip: According to the working principle of NAT, when converting the host IP address and the global IP address, the source address and destination address of ① and ④ in the figure are opposite, and the source address and destination address of ② and ③ in the figure are opposite.

11. Planning IPv6 address

1. Main features of IPv6 addresses

New protocol format, huge address space, automatic address configuration, built-in security mechanism, effective hierarchical addressing and routing structure, and better support for Qos services. The IPv6 address length is 128 bits, so it can provide an astonishingly more than 3.4×1038 IP addresses, and this address space is 296 times that of IPv4.

2. IPv6 address classification

RFC 2373 divides IPv6 addresses into four categories: unicast addresses, multicast addresses, multicast addresses, and special addresses.

3. IPv6 address representation method

The 128-bit address of IPv6 is divided into a bit segment by every 16 bits, divided into 8 bit segments, each bit segment is converted into a 4-digit hexadecimal number, and separated by a colon ":", this notation is called colon hexadecimal (colon hexadecimal) notation.

(1) If there are multiple consecutive binary numbers 0 in an IPv6 address, the representation of the IPv6 address can be simplified by compressing the leading 0 in a bit segment. For example, "002F" can be abbreviated as "2F".
(2) If an IPv6 address contains a long string of 0s, when expressed in colon hexadecimal notation, the place where the consecutive bit field values ​​are all 0 can be abbreviated as ": :", which is called double colon notation (double colon).

4. Problems needing attention in IPv6 address notation

(1) When using the zero compression method, only the leading 0 can be compressed. Valid 0s within a bit field cannot be compressed. For example, AC04: A0: 0: 0: 0: 0: 0: 5 cannot be abbreviated as AC4: A: : 5.
(2) The double colon "::" can only appear once in an address. For example, address 0:0:0:5BC:79:0:0:0, a simplified notation is: : 5BC: 79: 0: 0: 0, another notation is 0: 0: 0: 5BC: 79: :, but it cannot be written as: : 5BC: 79: :.
(3) To determine how many 0 bits are compressed between ": : ", you can use 8 to subtract the number of remaining bit segments in the address, and then multiply the result by 16.
For example, there are 4 bit segments (ABC6, 2F, 9 and 7) in the address ABC6: 2F: : 9: 7, which can be calculated according to the formula: (8-4)x16-64, then the 64-bit binary number 0 is compressed between the double colons.
(4) IPv6 prefix (format prefix) problem.
IPv6 does not support subnet masks, only prefix length notation. A prefix is ​​a part of an IPv6 address that is used for IPv6 routing or subnet identification. The representation method of the prefix is ​​basically similar to the CIDR representation method in IPv4. The IPv6 prefix can be represented by "address/prefix length". For example, FABC: : 27: 0: 8/48, 3CFA: 2B: 0: 91: 43: : /64.

12. Planning variable-length subnet mask addresses

1. Basic principles of variable-length subnet mask address planning

The IP protocol allows the division of variable-length subnets (RFC1009). In some cases, a variable-length subnet mask (VLSM) can be used to divide subnets according to needs, and design subnet numbers of different lengths.

2. Case of variable length subnet mask address planning

(1) User needs.
① A certain company has applied for a class C 213.140.41.0 IP address space.
②The company has 100 employees in the marketing department, 50 employees in the administrative department, and 30 employees in the logistics department.
③ The network administrator needs to set up subnets for the marketing department, administration department, and logistics department respectively.

(2) Choose a variable-length subnet mask.
① In this case, the class C IP address can be divided into three parts through the variable-length subnet mask technology. According to the number of employees, the address space of subnet 1 should be twice that of subnet 2 and subnet 3.
② Calculate the subnet 1 address space. First, you can use a subnet mask of 255.255.255.128 to divide the Class C IP address into two halves. In binary calculation, the operation process is as follows. Host IP address: 11010101.10001100.00101001.00000000(213.140.41.0) Subnet mask: 11111111.11111111.11111111.10000000(255.255.255.128) and operation result: 110 The calculation result of 10101.10001100.00101001.00000000(213.140.41.0) shows that: 213.140.41.1~213.140.41.126 can be used as the IP address of subnet 1, and then the remaining part can be divided into two. Since the fourth byte of 213.140.41.127 is all 1s, it is reserved as a broadcast address and cannot be used; the address space junction point of subnet 1, subnet 2, and subnet 3 is at 213.140.41.128; subnet 1 uses a subnet mask of 255.255.255.128.
③ Calculate the address space of subnet 2 and subnet 3. The calculation process of the address space of subnet 2 and subnet 3 is as follows.
Host IP address: 11010101.10001100.00101001.00000000(213.140.41.0) Subnet mask: 11111111.11111111.11111111.10000000(255.255.255.128) and operation result: 110 10101.10001100.00101001.00000000 (213.140.41.0)

Net 2 and subnet 3 can use the two smaller address spaces that are equally divided. For subnet 2, the first available address is 213.140.41.129, and the last available address is 213.140.41.190, that is, the address space of the host or router of subnet 2 is 213.140.41.129~213.140.41.190. The next address 213.140.41.191 of the last IP address of subnet 2 is the address with all 1s of the host number, which needs to be reserved as a broadcast address, and 255.255.255.192 should be used as a subnet mask, so the first available address of subnet 3 is 213.140.41.193, so it can be judged that the address space of the host or router of subnet 3 is 213.140.41.193-213.1 40.41.254.

(3) Determine the IP address space of three subnets.
From the above calculation, it can be seen that the IP addresses of the three subnets divided by variable-length subnets are as follows.
①Subnet 1 address space: 213.140.41.1~213.140.41.126
Subnet mask: 255.255.255.128
②Subnet 2 address space: 213.140.41.129~213.140.41.190 Subnet mask : 255.255.255.192 ③Subnet 3 The address space is: 213.140.41.193-213.140.41.254
The subnet mask is: 255.255.255.192 It can be seen that the host numbers allowed for subnet 1, subnet 2, and subnet 3 are 126, 62, and 62 respectively. After adopting variable-length subnet mask technology, the company's network structure is shown in the figure.

Structure of variable-length subnetting
insert image description here


Guess you like

Origin blog.csdn.net/guanguan12319/article/details/129215810