CN112019653B - Access switch, IP address deployment method, device and readable storage medium - Google Patents

Access switch, IP address deployment method, device and readable storage medium Download PDF

Info

Publication number
CN112019653B
CN112019653B CN202010943926.XA CN202010943926A CN112019653B CN 112019653 B CN112019653 B CN 112019653B CN 202010943926 A CN202010943926 A CN 202010943926A CN 112019653 B CN112019653 B CN 112019653B
Authority
CN
China
Prior art keywords
address
target
terminal
access switch
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010943926.XA
Other languages
Chinese (zh)
Other versions
CN112019653A (en
Inventor
舒弋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN202010943926.XA priority Critical patent/CN112019653B/en
Publication of CN112019653A publication Critical patent/CN112019653A/en
Application granted granted Critical
Publication of CN112019653B publication Critical patent/CN112019653B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses

Abstract

The application provides an access switch, an IP address deployment method, an IP address deployment device and a readable storage medium, wherein the method comprises the following steps: when IP communication with a target terminal is required, acquiring an IP address of the target terminal and a gateway address corresponding to the target terminal; generating a target IP address which is positioned in the same network segment with the IP address of the target terminal according to the IP address of the target terminal; and when the IP addresses of all the terminals connected with the access switch are different from the target IP address and the gateway address is different from the target IP address, carrying out IP communication with the target terminal by using the target IP address. Therefore, a unique IP address of a local area network does not need to be deployed for each access switch, and the workload and complexity of IP deployment of the access switches are reduced.

Description

Access switch, IP address deployment method, device and readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to an access switch, an IP address deployment method, an IP address deployment device, and a readable storage medium.
Background
In a lan networking, an IP (Internet Protocol) terminal (e.g., a PC, a network camera, a network printer, etc.) accesses a lan through an access switch, and a convergence device (e.g., a convergence switch or a convergence router) serves as an IP gateway of the IP terminal.
In local area network networking, an IP gateway is deployed on convergence equipment, a plurality of access switches only exist as network connection nodes and do not bear the IP routing forwarding function, and therefore IP addresses do not need to be deployed.
However, with the development of network management, in order to reduce the burden of the aggregation device, the access switch does not assume an IP routing forwarding function, but gradually deploys some IP functions for IP communication with a terminal connected to the access switch. For example: and deploying a network scanning function on the access switch to perform security scanning on the terminal, wherein the access switch needs to deploy an IP address at the moment.
However, the number of lan access switches is large, and a unique lan IP address is deployed for each access switch, which increases the complexity and workload of lan IP address planning.
Disclosure of Invention
Embodiments of the present application provide an access switch, an IP address deployment method, an IP address deployment device, and a readable storage medium, so as to reduce complexity and workload of IP address planning of the access switch.
The embodiment of the application provides an IP address deployment method of an access switch, which is applied to the access switch and comprises the following steps: when IP communication with a target terminal is required, acquiring an IP address of the target terminal and a gateway address corresponding to the target terminal; the target terminal is a terminal in at least one terminal connected with the access switch; generating a target IP address according to the IP address of the target terminal; the target IP address and the IP address of the target terminal are positioned in the same network segment; and when the IP addresses of all terminals connected with the access switch are different from the target IP address and the gateway address is different from the target IP address, using the target IP address to carry out IP communication with the target terminal.
It should be understood that the IP address deployed on the access switch is only used for communication with the terminals connected to the access switch, and therefore does not need to be unique throughout the network, as long as it is ensured that IP addresses of the terminals and gateways connected to the access switch do not conflict. In the implementation process, when the access switch needs to perform IP communication with the target terminal, the IP address of the target terminal and the gateway address corresponding to the target terminal are obtained, and then the target IP address located in the same network segment with the IP address of the target terminal is generated according to the IP address of the target terminal, and when the target IP address does not conflict with the IP addresses of all terminals connected with the access switch and does not conflict with the gateway address corresponding to the target terminal, the target IP address is used for performing IP communication with the target terminal. Therefore, when the access switch needs to perform IP communication with the target terminal, the target IP address which is positioned in the same network segment with the IP address of the target terminal and does not conflict with the IP address of the relevant equipment is dynamically generated to realize the IP communication between the access switch and the target terminal, so that the unique IP address of a local area network does not need to be deployed for each access switch, and the workload and the complexity of IP deployment of the access switch are reduced.
Further, the method further comprises: and updating the target IP address when the IP address same as the target IP address exists in the IP addresses of at least one terminal connected with the access switch or the gateway address is the same as the target IP address.
In the above implementation, when the target IP address conflicts with the IP address of the terminal connected to the access switch or with the gateway address, if IP communication is performed with the target terminal using the target IP address, a network conflict may occur. Therefore, when the target IP address conflicts with the IP address of the terminal connected to the access switch or with the gateway address, the target IP address is updated, whether the IP address of the terminal connected to the access switch conflicts or conflicts with the gateway address is redetermined until no conflict occurs, and the target IP address is used for IP communication with the target terminal. Therefore, the reliability of the scheme of the application can be ensured.
Further, updating the target IP address includes: and keeping the network address of the target IP address unchanged, and updating the target IP address by adopting a new host address.
It should be understood that an IP address is made up of a network address and a host address. In the embodiment of the application, the network address of the target IP address can be kept unchanged to ensure that the updated target IP address is still located in the same network segment with the IP address of the target terminal, and the host address is updated, so that a new target IP address is generated.
Further, the method further comprises: acquiring a mask of the target terminal; generating a target IP address according to the IP address of the target terminal includes: determining the network address of the target terminal according to the IP address and the mask of the target terminal; and generating the target IP address according to the network address.
Further, generating the target IP address according to the network address includes: generating a host address which is 0 after being compared with the mask of the target terminal, and adding the network address and the host address to obtain the target IP address; or, adding n to the network address to obtain a target IP address; and n is an integer greater than or equal to 1.
Further, the method further comprises: and configuring the access switch not to broadcast the gratuitous ARP request of the target IP address in the process of carrying out IP communication with the target terminal by using the target IP address.
In the embodiment of the application, after the target IP address which can be used for performing IP communication with the target terminal is obtained, the target IP address is only the IP address conflict of the terminal which is not connected with the access switch and the gateway, but is not necessarily unique in the whole network, so that the access switch is configured not to broadcast the gratuitous ARP request of the target IP address, thereby avoiding the occurrence of the abnormality of IP address conflict in the local network and avoiding the communication confusion of the local network.
Further, the method further comprises: and configuring the access switch to not respond after receiving a gratuitous ARP request aiming at the target IP address in the process of carrying out IP communication with the target terminal by using the target IP address.
Similarly, since the target IP address may not be unique in the whole network, if a gratuitous ARP request for the target IP address is received and responded, an exception of IP address collision may occur in the local network. Therefore, in the embodiment of the present application, the access switch is configured not to respond after receiving a gratuitous ARP request for the target IP address in the process of performing IP communication with the target terminal by using the target IP address, so that the stability and reliability of the whole local area network can be improved.
Further, the method further comprises: configuring the access switch to send an ARP request only on a terminal connection interface list of a terminal connection VLAN when the ARP request needs to be sent in the process of carrying out IP communication with the target terminal by using the target IP address; wherein: the terminal connection VLAN is the VLAN of the access switch connection terminal, and the terminal connection interface list is the interface set of the access switch connection terminal.
In the practical application process, during the process of using the target IP address to perform IP communication with the target terminal, the access switch may need to send an ARP request. At the moment, the access switch is configured to send the ARP request only on the terminal connection interface list of the terminal connection VLAN, so that the target IP address can not be notified to other devices in the local area network, the abnormity of IP address conflict in the local area network can be avoided, the communication chaos of the local area network is avoided, and the stability and the reliability of the whole local area network are improved.
The embodiment of the present application further provides an IP address deployment device for an access switch, which is applied to the access switch, and includes: the device comprises an acquisition module, a generation module and a communication control module; the acquisition module is used for acquiring the IP address of the target terminal and the gateway address corresponding to the target terminal when the IP communication with the target terminal is required; the target terminal is a terminal in at least one terminal connected with the access switch; the generating module is used for generating a target IP address according to the IP address of the target terminal; the target IP address and the IP address of the target terminal are positioned in the same network segment; and the communication control module is used for using the target IP address and the target terminal to carry out IP communication when the IP addresses of all terminals connected with the access switch are different from the target IP address and the gateway address is different from the target IP address.
The embodiment of the present application further provides an access switch, including: the system comprises a switch interface, a processor, a memory and a communication bus; the communication bus is used for realizing connection communication among the switch interface, the processor and the memory; the switch interface is used for accessing a terminal; the processor is configured to execute one or more programs stored in the memory to implement any of the above-described methods of IP address deployment for an access switch.
An embodiment of the present application further provides a readable storage medium, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement any of the above methods for deploying an IP address of an access switch.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic diagram of a local area network provided in an embodiment of the present application;
fig. 2 is a schematic diagram of another local area network provided in an embodiment of the present application;
fig. 3 is a schematic basic flowchart of an IP address deployment method of an access switch according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an ARP packet according to an embodiment of the present application;
fig. 5 is a schematic diagram of a specific lan networking provided in an embodiment of the present application;
fig. 6 is a schematic diagram of a calculation flow of a target IP address according to an embodiment of the present application;
fig. 7 is a schematic diagram of a specific ARP packet structure provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of an IP address deployment apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an access switch according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The first embodiment is as follows:
in order to solve the problem that the complexity and workload of local area network IP address planning are increased because a unique local area network IP address needs to be deployed for each access switch in the related art, the embodiment of the application provides an IP address deployment method of the access switch.
It should be understood that in a local area network, where the architecture may be as shown in fig. 1, each access switch may be connected to one or more terminals while connecting to one or more aggregation devices. The aggregation devices connected to the access switch act as gateways to the terminals connected to the access switch. The access switch exists only as a network connection node and does not bear the IP route forwarding function.
However, at present, in order to reduce the burden of the convergence device, the access switch does not assume the IP routing forwarding function, but gradually deploys some IP functions for IP communication with the terminal connected to the access switch itself. At this time, the corresponding IP address needs to be deployed for the access switch.
In the embodiment of the present application, for convenience of description, a terminal that an access switch needs to communicate is taken as a target terminal, and the target terminal is a terminal among terminals connected to the access switch.
It should be understood that the IP addresses deployed on the access switch are only used for communication with the terminals connected to themselves, and therefore do not need to be network-wide unique, as long as it is ensured that the IP addresses of different self-connected terminals and gateways collide. For example, referring to the network configuration shown in fig. 2, the IP address (IP-3) of the access switch 1 may be different from the IP-1 (gateway IP address), the IP-2 (gateway IP address), the IP-5 (terminal IP address to which the access switch 1 is connected), and the IP-6 (terminal IP address to which the access switch 1 is connected) as long as they collide.
Therefore, in the embodiment of the present application, IP deployment for the access switch can be realized in a dynamic allocation manner.
Referring to fig. 3, fig. 3 is a method for deploying an IP address of an access switch applied to an access switch according to an embodiment of the present application, where the method includes:
s301: when IP communication with a target terminal is needed, the IP address of the target terminal and the gateway address corresponding to the target terminal are obtained.
It should be noted that the access switch used in the embodiment of the present application is an access switch serving as a network connection node in a local area network.
It should be understood that, in the embodiment of the present application, since the target terminal is a terminal connected to the access switch, the gateway address corresponding to the target terminal refers to a gateway address of each gateway connected to the access switch. When there is only one gateway connected to the access switch, there is only one gateway address corresponding to the target terminal, and when there are a plurality of gateways connected to the access switch, there are a plurality of gateway addresses corresponding to the target terminal. For example, for the structure shown in fig. 2, the access switch 1 is connected to the aggregation device 1 and the aggregation device 2 (i.e., the gateway 1 and the gateway 2), and the access switch 2 is also connected to the aggregation device 1 and the aggregation device 2, so that each of the terminals 1 to 4 corresponds to two gateways (i.e., the aggregation device 1 and the aggregation device 2) and has two corresponding gateway addresses (IP-1 and IP-2).
In this embodiment, when the access switch needs to perform IP communication with the target terminal, an engineer may manually input the IP address of the target terminal and the gateway address corresponding to the target terminal into the access switch.
In addition, in the embodiment of the present application, in order to reduce the investment of human resources and improve the information acquisition efficiency, the IP address of the target terminal and the gateway address corresponding to the target terminal may also be automatically acquired through network management software.
In addition, in the embodiment of the present application, when the local area network is configured, the IP addresses of the terminal and the gateway connected to the access switch may be written into the access switch, so that the IP address of the target terminal and the gateway address corresponding to the target terminal may be determined directly according to the IP addresses of the terminal and the gateway connected to the access switch, which are written in advance.
It should be understood that a target terminal that needs to perform IP communication is specified according to a current task, and the access switch may obtain identification information (such as a MAC address) representing an identity of the target terminal, so that determination of an IP address corresponding to the target terminal may be achieved.
S302: and generating a target IP address according to the IP address of the target terminal.
It should be appreciated that in order for the access switch to be able to IP communicate with the target terminal, the access switch must be on the same network segment as the target terminal.
Therefore, in the embodiment of the application, a target IP address can be generated by obtaining the IP address of the target terminal, so that the target IP address and the IP address of the target terminal are located in the same network segment.
In order to enable the target IP address and the IP address of the target terminal to be located in the same network segment, in the embodiment of the present application, the network address of the target terminal may be determined first, and then the target IP address may be generated according to the network address of the target terminal.
It should be understood that, in order to obtain the network address of the target terminal, in this embodiment of the present application, the access switch may further obtain a mask of the target terminal, so as to perform an and operation on the IP address of the target terminal and the mask, and determine the network address of the target terminal.
It should also be understood that, in the embodiment of the present application, the obtaining manner of the mask for the target terminal may be consistent with the obtaining manner of the IP address of the target terminal and the gateway address corresponding to the target terminal. That is, the configuration may be performed manually on the access switch by an engineer, the automatic acquisition of the mask of the target terminal may be realized by network management software, and the mask of the target terminal may be acquired from the mask of each terminal written in advance by writing the mask of each terminal in the access switch in advance.
For example, in the embodiment of the present application, a network address identical to the IP address of the target terminal may be used, and a host address is generated, so as to obtain the target IP address.
In this example, the generated host should satisfy the mask phase and the back phase of 0 with the target terminal, so as to ensure that the obtained target IP address can be in the same network segment with the IP address of the target terminal.
It should be noted that the IP address is understood to be obtained by adding the network address and the host address. Typically, the first M bits of an IP address are the portion that characterizes the network address, while the last N bits are the portion that characterizes the host address. For example, for an IPV4 address with a network number of 24 bits, the first 24 bits represent the network address and the last 8 bits represent the host address. To this end, for a 32-bit network address of an IPV4, the last 8 bits are 0 and the first 24 bits are 0. For example, for an IPV4 address of 192.168.1.1, if the network number is 24 bits, the mask is 255.255.255.0, and the network address is 192.168.1.0 and the host address is 0.0.0.1.
It should be understood that the values of M and N may be set according to the specification of the relevant IP address, and the values of M and N determine the mask value.
Based on the rule, the host address which is 0 after the mask phase of the target terminal can be quickly generated.
In addition, based on the above rule of the IP address, it can be seen that the last N bits of the obtained network address are 0. Based on this, in a possible implementation manner of the embodiment of the present application, the target IP address may also be obtained by directly adding n to the network address.
N in the previous paragraph may be an integer greater than or equal to n, but the value of n should not exceed the maximum allowed host address. For example, for an IPV4 address with a network number of 24 bits, the value of n cannot be greater than 255.
In the embodiment of the present application, a specific value of n may be set by an engineer according to actual needs, for example, set to any value of 1 to 10.
S303: and when the IP addresses of all the terminals connected with the access switch are different from the target IP address and the gateway address is different from the target IP address, carrying out IP communication with the target terminal by using the target IP address.
In the embodiment of the present application, after the target IP address is determined, the target IP address cannot be directly used for IP communication with the target terminal, and it is also necessary to determine that there is no conflict between the target IP address and IP addresses of terminals and gateways connected to the access switch.
Therefore, in the embodiment of the present application, after the target IP address is determined, collision detection may be performed on the target IP address.
The IP address of the gateway to which the access switch is connected (i.e., the gateway address corresponding to the target terminal) is already acquired in step S301. Therefore, whether the target IP address conflicts with the gateway address corresponding to the target terminal (i.e. whether the target IP address is already taken as the gateway address corresponding to the target terminal) can be directly detected.
And for the IP address of each terminal connected to the access switch:
if the IP addresses of the terminal and the gateway connected to the access switch are written in the access switch in advance, it is possible to directly detect whether the target IP address conflicts with the written IP addresses of the terminals (i.e., detect whether the target IP address is already the IP address of the terminal connected to the access switch).
If the access switch does not write the IP address of the terminal connected to the access switch in advance, a feasible manner is to obtain the IP address of the terminal connected to the access switch by means of manual input of an engineer or automatic acquisition of network management software, and further detect whether the target IP address conflicts with the written IP address of each terminal.
Another feasible method is that, by means of manual input by an engineer or automatic acquisition by Network management software, which interfaces the access switch uses to connect with the terminal (i.e., acquiring an interface set of the access switch connecting the terminal, which is referred to as a terminal connection interface list in this embodiment for convenience of description), and which VLAN (Virtual Local Area Network) the access switch uses to connect with the terminal (i.e., acquiring the VLAN of the access switch connecting the terminal, which is referred to as a terminal connection VLAN in this embodiment for convenience of description), and then detecting whether the target IP Address conflicts with the written IP Address of each terminal by sending an ARP (Address Resolution Protocol) request message on the terminal connection interface list of the terminal connection VLAN.
In the embodiment of the present application, since it is to detect whether the target IP address is already used by the terminal connected to the access switch, the IP address of the request to be written in the ARP request message should be the target IP address, and the IP address of the sender may be constructed as 0.0.0.0, which indicates that there is no IP address. The format of the ARP request message sent can be seen in fig. 4. Fig. 4 is an ARP request message filled in by the access switch in the present application, which is different from the conventional ARP request message in that the IP address of the local device (i.e., the IP address of the sender) is set to 0.0.0.0, and the requested IP address is set to the target IP address.
Thus, if the IP address of the terminal is the target IP address, the response message is sent, so that the access switch can determine that the target IP address is unavailable.
In the embodiment of the present application, the target IP address may be updated when, among the IP addresses of at least one terminal connected to the access switch, there is an IP address identical to the target IP address, or the target gateway address is identical to the target IP address (i.e., when there is a conflict between the target IP address and the IP address of the terminal connected to the access switch, or the gateway address).
In this embodiment of the present application, the manner of updating the target IP address may include: and keeping the network address of the target IP address unchanged, and updating the target IP address by adopting a new host address.
For example, in a possible implementation manner of the embodiment of the present application, the first M bits of the target IP address may be maintained unchanged (the value of M is consistent with the network number), and the last N bits of the target IP address may be regenerated, so as to obtain the updated target IP address.
It should be understood that the last N bits of the target IP address may be generated randomly or according to a certain rule, for example, a positive integer, for example, 1, may be added on the basis of the original last N bits of the target IP address, so as to obtain a new last N bits of the target IP address.
It should be noted, however, that the new last N-bit address cannot exceed the value of the maximum allowed host address. For example, for an IPV4 destination IP address with a network number of 24 bits, where N is 8, the newly generated last N-bit address cannot exceed 255.
In yet another possible implementation manner of the embodiment of the present application, the network address and the host address of the target IP address may also be obtained by restoring, and a host address may be regenerated, so as to obtain an updated target IP address by re-summation.
It should be understood that the regenerated host address may be generated randomly, or generated according to a certain rule, for example, a positive integer, for example, 1, may be added on the basis of the original host address to obtain a new host address.
It should be noted, however, that the newly generated host address cannot exceed the value of the maximum allowed host address. For example, for an IPV4 destination IP address with a network number of 24 bits, the newly generated host address cannot exceed 0.0.0.255.
In yet another possible implementation manner of the embodiment of the present application, m may also be directly added to the target IP address to obtain an updated target IP address.
It should be noted that in this practical embodiment, the value of M should be a non-0 integer, but after adding M to the target IP address, the resulting value cannot cause the first M bits of the target IP address to change (the value of M is consistent with the network number). The value of m can be set by engineers according to actual needs.
It should be understood that, in the embodiment of the present application, after obtaining the updated target IP address, collision detection needs to be performed again, and only when the IP address of each terminal connected to the access switch is different from the target IP address, and the gateway address of each gateway connected to the access switch is also different from the target IP address, the target IP address is used to perform IP communication with the target terminal.
It should be understood that the target IP address obtained in the embodiment of the present application is only used for the access switch to perform IP communication with the target terminal, and it can only ensure that IP addresses of terminals and gateways that are not connected to the access switch conflict, but cannot ensure that no IP address conflict exists in the entire lan. I.e., the target IP address is not guaranteed to be unique throughout the network.
Therefore, in order to avoid communication confusion in the local area network caused by the target IP address, the access switch may be configured so as not to broadcast a gratuitous ARP request for the target IP address during IP communication with the target terminal using the target IP address.
In order to avoid communication confusion in the local area network caused by the target IP address, the access switch may be configured so that, in the process of performing IP communication with the target terminal using the target IP address, no response is made after receiving a gratuitous ARP request for the target IP address.
In addition, in the process of performing IP communication with the target terminal, it may be necessary that some services or functions are involved and the access switch needs to send an ARP request, so it may be configured that, in the process of performing IP communication with the target terminal by using the target IP address, when the ARP request needs to be sent, the access switch only sends the ARP request on the terminal connection interface list of the terminal connection VLAN, so as to ensure that the target IP address is not notified to the rest devices in the local area network.
According to the IP address deployment method of the access switch, when the access switch needs to perform IP communication with a target terminal, the IP address of the target terminal and the gateway address corresponding to the target terminal are obtained, then the target IP address located in the same network segment with the IP address of the target terminal is generated according to the IP address of the target terminal, and when the target IP address does not conflict with the IP addresses of all terminals connected with the access switch and does not conflict with the gateway address corresponding to the target terminal, the target IP address is used for performing IP communication with the target terminal. Therefore, when the access switch needs to perform IP communication with the target terminal, the target IP address which is positioned in the same network segment with the IP address of the target terminal and does not conflict with the IP address of the relevant equipment is dynamically generated to realize the IP communication between the access switch and the target terminal, so that the unique IP address of a local area network does not need to be deployed for each access switch, and the workload and the complexity of IP deployment of the access switch are reduced.
Example two:
the present embodiment further illustrates the scheme of the present application with a specific example on the basis of the first embodiment.
Referring to fig. 5, assume that now an access switch 1 is required to IP communicate with a terminal 2 having an IP of 128.255.16.29.
First, the network administrator sets on the access switch 1:
target terminal address 128.255.16.29
Target terminal mask 255.255.252.0
Target terminal gateway address 128.255.19.254, 128.255.19.253
PORT1, PORT2 as a list of terminal connection interfaces
Terminal connection VLAN (VLAN 10)
It should be noted that, the network administrator described in the embodiment of the present application may be an engineer or network management software. The destination terminal address is an IP address of the destination terminal, and the destination terminal mask is a mask of the destination terminal.
Then, the access switch 1 calculates the target IP address used by the access switch 1 for the current IP communication according to the target terminal address.
The calculation process for the target IP address can be seen in fig. 6, for this example:
(1) the target IP address 128.255.16.29AND 255.255.252.0+1 128.255.16.1 is obtained first.
AND in the formula represents AND operation.
(2) And (3) collision detection: since 128.255.16.1 is different from the target terminal gateway addresses 128.255.19.254 and 128.255.19.253, step (3) is entered.
(3) At PORT1 and PORT2, in VLAN10, an ARP request message is sent, and it is detected 128.255.16.1 whether the terminal is occupied, where the ARP request message is shown in fig. 7.
(4) Since the IP of the terminal connected to PORT1 and PORT2 is not 128.255.16.1, the ARP reply is not replied, so the access switch 1 does not receive the reply message, and the access switch 1 performs IP communication with the terminal 2 having IP address 128.255.16.29 using the target IP address 128.255.16.1.
In the embodiment of the present application, in the process of the access switch 1 using the target IP address 128.255.16.1 to perform IP communication with the terminal 2 having the IP address 128.255.16.29:
(1) the access switch 1 does not broadcast 128.255.16.1 a gratuitous ARP request.
(2) When receiving the ARP request message of the query 128.255.16.1, the access switch 1 does not respond.
(3) When the access switch 1 needs to send the ARP request message, the ARP request message is sent only in VLAN10 on PORT1 and PORT 2.
In a local area network, a large number of access switches as network connection nodes are provided, and these access switches do not deploy IP addresses in the original network planning, and along with the development of the network, in order to reduce the service pressure of the aggregation switch, the access switches also need to deploy IP functions to perform IP communication with their own connected terminals. By using the scheme of the embodiment of the application, network managers do not need to adjust network planning, the unique IP address of the whole network is deployed for each access switch, the access switches can carry out IP communication according to the IP address of the target terminal needing to carry out IP communication, the target IP address used in the communication is automatically calculated, and the IP communication is completed by using the calculated target IP address. Therefore, a unique IP address of a local area network is not required to be deployed for each access switch, and the workload and complexity of IP deployment of the access switches are reduced. In addition, by adopting the scheme of the embodiment of the application, the original network can be taken care of, the resources of the original network can be fully utilized, and a new IP function can be provided on the access switch.
Example three:
based on the same inventive concept, the embodiment of the application also provides an IP address deployment device applied to the access switch. Referring to fig. 8, fig. 8 shows an IP address deploying apparatus 100 corresponding to the method according to the first embodiment. It should be understood that the specific functions of the IP address deploying apparatus 100 of the access switch can be referred to the above description, and the detailed description is appropriately omitted here to avoid redundancy. The IP address deploying apparatus 100 of the access switch includes at least one software functional module that can be stored in a memory in the form of software or firmware or solidified in an operating system of the IP address deploying apparatus 100 of the access switch. Specifically, the method comprises the following steps:
referring to fig. 8, the IP address deploying apparatus 100 is applied to an access switch, and includes: an acquisition module 101, a generation module 102 and a communication control module 103. Wherein:
the acquiring module 101 is configured to acquire an IP address of a target terminal and a gateway address corresponding to the target terminal when IP communication with the target terminal is required; the target terminal is a terminal in at least one terminal connected with the access switch;
the generating module 102 is configured to generate a target IP address according to the IP address of the target terminal; the target IP address and the IP address of the target terminal are positioned in the same network segment;
the communication control module 103 is configured to perform IP communication with the target terminal by using the target IP address when the IP addresses of all terminals connected to the access switch are different from the target IP address, and the gateway address is different from the target IP address.
In this embodiment of the application, the generating module 102 is further configured to update the target IP address when an IP address identical to the target IP address exists in the IP addresses of the at least one terminal connected to the access switch, or when the gateway address is identical to the target IP address.
In this embodiment of the application, the generating module 102 is specifically configured to keep the network address of the target IP address unchanged, and update the target IP address with a new host address.
In this embodiment of the present application, the obtaining module 101 is further configured to obtain a mask of the target terminal; the generating module 102 is specifically configured to, according to the IP address of the target terminal, generate a target IP address, including: determining the network address of the target terminal according to the IP address and the mask of the target terminal; and generating the target IP address according to the network address.
In this embodiment of the present application, the generating module 102 is specifically configured to generate a mask phase of the network address and a host address with a back phase of 0, and add the network address and the host address to obtain the target IP address; or, adding n to the network address to obtain a target IP address; and n is an integer greater than or equal to 1.
In this embodiment, the IP address deployment apparatus 100 further includes a configuration module, configured to configure the access switch not to broadcast a gratuitous ARP request of the target IP address in the process of using the target IP address to perform IP communication with the target terminal.
In this embodiment, the IP address deployment apparatus 100 further includes a configuration module, configured to configure the access switch to not respond after receiving a gratuitous ARP request for the target IP address in a process of using the target IP address to perform IP communication with the target terminal.
In this embodiment, the IP address deployment apparatus 100 further includes a configuration module, configured to configure the access switch to send an ARP request only on a terminal connection interface list of a terminal connection VLAN when the ARP request needs to be sent in a process of performing IP communication with the target terminal by using the target IP address; wherein: the terminal connection VLAN is the VLAN of the access switch connection terminal, and the terminal connection interface list is the interface set of the access switch connection terminal.
It should be understood that, for the sake of brevity, the contents described in some embodiments are not repeated in this embodiment.
Example four:
the embodiment provides an access switch, which can be seen in fig. 9and includes a switch interface 901, a processor 902, a memory 903 and a communication bus 904. Wherein:
the communication bus 904 is used to enable connection communication between the switch interface 901, the processor 902, and the memory 903.
Switch interface 901 is for an access terminal.
The processor 902 is configured to execute one or more programs stored in the memory 903 to implement the IP address deployment method of the access switch in the first/second embodiments.
It is understood that the structure shown in fig. 9 is merely an illustration, and the access switch may further include more or less components than those shown in fig. 9, or have a different configuration from that shown in fig. 9, and is not limited in the embodiment of the present application.
The present embodiment further provides a readable storage medium, such as a floppy disk, an optical disk, a hard disk, a flash Memory, a usb (Secure Digital Card), an MMC (Multimedia Card), etc., where one or more programs for implementing the above steps are stored in the readable storage medium, and the one or more programs may be executed by one or more processors to implement the IP address deployment method of the access switch in the first embodiment or the second embodiment. And will not be described in detail herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
In this context, a plurality means two or more.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (11)

1. An IP address deployment method of an access switch is characterized in that the method is applied to the access switch and comprises the following steps:
when IP communication with a target terminal is required, acquiring an IP address of the target terminal and a gateway address corresponding to the target terminal; the target terminal is a terminal in at least one terminal connected with the access switch; the terminal connected with the access switch is a terminal in a terminal connection VLAN; the terminal connection VLAN is a VLAN of the access switch connection terminal;
generating a target IP address according to the IP address of the target terminal; the target IP address and the IP address of the target terminal are positioned in the same network segment;
and when the IP addresses of all terminals connected with the access switch are different from the target IP address and the gateway address is different from the target IP address, using the target IP address to carry out IP communication with the target terminal.
2. The method of IP address deployment for an access switch of claim 1, the method further comprising:
and updating the target IP address when the IP address same as the target IP address exists in the IP addresses of at least one terminal connected with the access switch or the gateway address is the same as the target IP address.
3. The method of IP address deployment for an access switch of claim 2, wherein updating the target IP address comprises:
and keeping the network address of the target IP address unchanged, and updating the target IP address by adopting a new host address.
4. The method of IP address deployment for an access switch of claim 1, the method further comprising: acquiring a mask of the target terminal;
generating a target IP address according to the IP address of the target terminal includes:
determining the network address of the target terminal according to the IP address and the mask of the target terminal;
and generating the target IP address according to the network address.
5. The method of claim 4, wherein generating the target IP address from the network address comprises:
generating a mask phase of the target terminal and a host address with the back of 0, and adding the network address and the host address to obtain the target IP address;
or, adding n to the network address to obtain a target IP address; and n is an integer greater than or equal to 1.
6. The method of IP address deployment for an access switch of any of claims 1-5, wherein the method further comprises:
and configuring the access switch not to broadcast the gratuitous ARP request of the target IP address in the process of carrying out IP communication with the target terminal by using the target IP address.
7. The method of IP address deployment for an access switch of any of claims 1-5, wherein the method further comprises:
and configuring the access switch to not respond after receiving a gratuitous ARP request aiming at the target IP address in the process of carrying out IP communication with the target terminal by using the target IP address.
8. The method of IP address deployment for an access switch of any of claims 1-5, wherein the method further comprises:
configuring the access switch to send an ARP request only on a terminal connection interface list of a terminal connection VLAN when the ARP request needs to be sent in the process of carrying out IP communication with the target terminal by using the target IP address; wherein:
the terminal connection interface list is an interface set of the access switch connection terminal.
9. An IP address deployment device of an access switch, applied to the access switch, includes: the device comprises an acquisition module, a generation module and a communication control module;
the acquisition module is used for acquiring the IP address of the target terminal and the gateway address corresponding to the target terminal when the IP communication with the target terminal is required; the target terminal is a terminal in at least one terminal connected with the access switch; the terminal connected with the access switch is a terminal in a terminal connection VLAN; the terminal connection VLAN is a VLAN of the access switch connection terminal;
the generating module is used for generating a target IP address according to the IP address of the target terminal; the target IP address and the IP address of the target terminal are positioned in the same network segment;
and the communication control module is used for using the target IP address and the target terminal to carry out IP communication when the IP addresses of all terminals connected with the access switch are different from the target IP address and the gateway address is different from the target IP address.
10. An access switch, comprising: the system comprises a switch interface, a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication among the switch interface, the processor and the memory;
the switch interface is used for accessing a terminal;
the processor is configured to execute one or more programs stored in the memory to implement the method of IP address deployment of an access switch of any of claims 1 to 8.
11. A readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the IP address deploying method of an access switch according to any one of claims 1 to 8.
CN202010943926.XA 2020-09-09 2020-09-09 Access switch, IP address deployment method, device and readable storage medium Active CN112019653B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010943926.XA CN112019653B (en) 2020-09-09 2020-09-09 Access switch, IP address deployment method, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010943926.XA CN112019653B (en) 2020-09-09 2020-09-09 Access switch, IP address deployment method, device and readable storage medium

Publications (2)

Publication Number Publication Date
CN112019653A CN112019653A (en) 2020-12-01
CN112019653B true CN112019653B (en) 2022-08-12

Family

ID=73522215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010943926.XA Active CN112019653B (en) 2020-09-09 2020-09-09 Access switch, IP address deployment method, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN112019653B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112566094B (en) * 2020-12-04 2022-11-04 展讯通信(上海)有限公司 Terminal device, random access method thereof, and computer-readable storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217805A (en) * 2008-01-21 2008-07-09 中兴通讯股份有限公司 A wireless LAN access control method
CN201869221U (en) * 2010-11-17 2011-06-15 山西省电力公司临汾供电分公司 3G multimedia scheduling and command system
CN104052753A (en) * 2014-06-26 2014-09-17 杭州华三通信技术有限公司 Authentication method and device
CN105024949A (en) * 2014-04-28 2015-11-04 国网山西省电力公司电力科学研究院 Port automatically binding method and system
CN105245473A (en) * 2015-09-02 2016-01-13 国家电网公司 Local area network terminal admission control method based on switch double binding
CN105917634A (en) * 2013-12-12 2016-08-31 华为技术有限公司 Method, device and system for dynamically allocating IP address
CN106488525A (en) * 2016-12-13 2017-03-08 国家电网公司信息通信分公司 A kind of wireless network construction method of IP dynamic binding and corresponding network framework
CN106789667A (en) * 2016-11-21 2017-05-31 华为技术有限公司 A kind of data forwarding method, relevant device and system
CN108989232A (en) * 2017-05-31 2018-12-11 中兴通讯股份有限公司 Message interaction method and device in SDN
CN109547267A (en) * 2019-01-02 2019-03-29 京东方科技集团股份有限公司 LAN system and core layer, access-layer switch and its configuration method
CN109587286A (en) * 2018-12-27 2019-04-05 新华三技术有限公司 A kind of equipment connection control method and device
CN110913637A (en) * 2019-11-13 2020-03-24 许昌许继风电科技有限公司 Fan communication cabinet
CN111478983A (en) * 2020-03-12 2020-07-31 苏州浪潮智能科技有限公司 Three-layer switch port IP address configuration method, system, terminal and storage medium

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005347801A (en) * 2004-05-31 2005-12-15 Oki Electric Ind Co Ltd Ip communication system and ip address allocation method
WO2006070311A1 (en) * 2004-12-30 2006-07-06 Koninklijke Philips Electronics N.V. Method of generating a valid address in a local area network
CN101051951A (en) * 2006-05-29 2007-10-10 华为技术有限公司 Method and device for securing server connection reliability
CN101242295A (en) * 2007-02-09 2008-08-13 深圳市新格林耐特通信技术有限公司 A method for managing low-end switch
CN101072239B (en) * 2007-06-25 2010-06-02 中兴通讯股份有限公司 Method and device for realizing IP address filtering
CN101227471A (en) * 2008-02-18 2008-07-23 中兴通讯股份有限公司 Same network segment address analysis protocol agent method and method for communicating among internal processing plates
CN101674232A (en) * 2008-09-10 2010-03-17 北京艾科网信科技有限公司 Server, method and system of access control
CN102025792B (en) * 2009-09-22 2013-12-25 国基电子(上海)有限公司 Router and IP address setting method thereof
CN103326881A (en) * 2013-05-11 2013-09-25 中煤科工集团武汉设计研究院 Computer management network system for long-distance pipeline coal transportation
FR3031425A1 (en) * 2015-01-05 2016-07-08 Orange DEVICE AND METHOD FOR CONTROLLING AN IP NETWORK HEART
CN106534290B (en) * 2016-11-04 2020-04-10 浙江宇视科技有限公司 Self-adaptive maintenance method and device for IP address of maintained equipment
CN107222462A (en) * 2017-05-08 2017-09-29 汕头大学 A kind of LAN internals attack being automatically positioned of source, partition method
CN109962851B (en) * 2017-12-25 2021-08-31 浙江宇视科技有限公司 Method and system for controlling multicast source access in real time
CN109714206A (en) * 2018-12-28 2019-05-03 广州邦讯信息系统有限公司 Electric power monitoring system Generating Network Topology Map, network bus topological diagram
CN111211982B (en) * 2019-12-30 2022-05-17 视联动力信息技术股份有限公司 Data forwarding method and device, electronic equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217805A (en) * 2008-01-21 2008-07-09 中兴通讯股份有限公司 A wireless LAN access control method
CN201869221U (en) * 2010-11-17 2011-06-15 山西省电力公司临汾供电分公司 3G multimedia scheduling and command system
CN105917634A (en) * 2013-12-12 2016-08-31 华为技术有限公司 Method, device and system for dynamically allocating IP address
CN105024949A (en) * 2014-04-28 2015-11-04 国网山西省电力公司电力科学研究院 Port automatically binding method and system
CN104052753A (en) * 2014-06-26 2014-09-17 杭州华三通信技术有限公司 Authentication method and device
CN105245473A (en) * 2015-09-02 2016-01-13 国家电网公司 Local area network terminal admission control method based on switch double binding
CN106789667A (en) * 2016-11-21 2017-05-31 华为技术有限公司 A kind of data forwarding method, relevant device and system
CN106488525A (en) * 2016-12-13 2017-03-08 国家电网公司信息通信分公司 A kind of wireless network construction method of IP dynamic binding and corresponding network framework
CN108989232A (en) * 2017-05-31 2018-12-11 中兴通讯股份有限公司 Message interaction method and device in SDN
CN109587286A (en) * 2018-12-27 2019-04-05 新华三技术有限公司 A kind of equipment connection control method and device
CN109547267A (en) * 2019-01-02 2019-03-29 京东方科技集团股份有限公司 LAN system and core layer, access-layer switch and its configuration method
CN110913637A (en) * 2019-11-13 2020-03-24 许昌许继风电科技有限公司 Fan communication cabinet
CN111478983A (en) * 2020-03-12 2020-07-31 苏州浪潮智能科技有限公司 Three-layer switch port IP address configuration method, system, terminal and storage medium

Also Published As

Publication number Publication date
CN112019653A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN108574616B (en) Method, equipment and system for processing route
CN116057910B (en) Virtual private cloud communication and configuration method and related device
CN108347493B (en) Hybrid cloud management method and device and computing equipment
CN109728962B (en) Method and equipment for sending message
EP3883217A1 (en) Data transmission method and computer system
CN111385374B (en) Method for network allocation, network device and computer-readable storage medium
CN114070723B (en) Virtual network configuration method and system of bare metal server and intelligent network card
CN114143283B (en) Tunnel self-adaptive configuration method and device, central terminal equipment and communication system
CN107547665B (en) Method, equipment and system for allocating DHCP (dynamic host configuration protocol) address
CN107809386B (en) IP address translation method, routing device and communication system
EP3267633B1 (en) Information processing system, proxy server, address duplication prevention method, and computer-readable recording medium
WO2021139304A1 (en) Method and device for multi-cloud interconnection
CN112019653B (en) Access switch, IP address deployment method, device and readable storage medium
CN114978988A (en) Method and device for realizing table entry backup
JP6445408B2 (en) Communication system and setting method
EP2911367B1 (en) Method and system for releasing addresses
CN110830598B (en) Method and network equipment for establishing and transmitting interface address and alias in BGP (Border gateway protocol) session
CN111988446B (en) Message processing method and device, electronic equipment and storage medium
CN113438159B (en) Transmission method and device of segmented routing strategy and network transmission system
CN110636146B (en) User address allocation method and device
CN114765601A (en) Address prefix obtaining method and device
CN110995502A (en) Network configuration management method, device, switching equipment and readable storage medium
EP4184822A1 (en) Method and apparatus for keeping user terminal alive
JP5703848B2 (en) Communication method, communication system, router and server
CN114301865B (en) Table entry management method, apparatus, network device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant