Address detection method and device, storage medium and electronic equipment
By optimizing address mode conversion between the control plane and the data plane of the programmable switch, and directly generating detection data packets, the problem of low IPv6 address detection efficiency in the prior art is solved, and faster address detection is achieved.
Patent Information
- Application Number
- CN202410914743.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-08
AI Technical Summary
The existing IPv6 address detection method based on semantic information is costly to calculate during model training, resulting in a long detection process time and low efficiency.
By obtaining the address list of seed sets, calling the control plane of the programmable switch to generate an address mode, and converting it into a detection address in the data plane, generating a detection data packet for detection, directly determining the target detection address, reducing the process of sending the control plane to the data plane. .
It improves the efficiency of IPv6 address detection, shortens detection time, and reduces calculation costs.
Smart Images

Figure CN118921353A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to an address detection method, device, storage medium and electronic device. Background Art
[0002] Address detection for Internet Protocol Version 6 (IPv6) networks can determine the active status of the detected host. Discovering active IPv6 addresses is crucial for multiple applications such as topology discovery, vulnerability scanning, and address management.
[0003] At present, the relevant technology adopts a method based on semantic information, uses model training to extract the text information of the IPv6 address, and regards each byte of the IPv6 address as a text with certain information for detection.
[0004] However, the semantic information-based methods in the related art require significant computational costs when training the model, resulting in a long address detection process for IPv6 addresses and low address detection efficiency. Summary of the invention
[0005] In view of this, the present application provides an address detection method, device, storage medium and electronic device, the main purpose of which is to improve the technical problem that the current method based on semantic information requires significant computing costs during model training, resulting in a long address detection process for IPv6 addresses and low address detection efficiency.
[0006] In a first aspect, the present application provides an address detection method, comprising:
[0007] Get the address list corresponding to the seed set;
[0008] According to the address list, calling the control plane of the programmable switch to generate an address pattern corresponding to the seed set;
[0009] Calling the data plane of the programmable switch to convert the address mode into a detection address, and generating a detection data packet corresponding to the detection address;
[0010] The detection address is detected using the detection data packet, and a target detection address is determined from the detection addresses.
[0011] In a second aspect, the present application provides an address detection device, comprising:
[0012] An acquisition module is configured to acquire an address list corresponding to the seed set;
[0013] A generating module is configured to call a control plane of a programmable switch to generate an address pattern corresponding to the seed set according to the address list;
[0014] A generating module, configured to call the data plane of the programmable switch to convert the address mode into a detection address, and generate a detection data packet corresponding to the detection address;
[0015] The determination module is configured to detect the detection address using the detection data packet and determine a target detection address from the detection addresses.
[0016] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the address detection method described in the first aspect.
[0017] In a fourth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the address detection method described in the first aspect when executing the computer program.
[0018] In a fifth aspect, the present application provides a computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the address detection method described in the first aspect.
[0019] By means of the above technical scheme, the present application provides an address detection method, device, storage medium and electronic device, firstly obtaining an address list corresponding to a seed set; then, according to the address list, calling the control plane of a programmable switch to generate an address pattern corresponding to the seed set; then calling the data plane of the programmable switch to convert the address pattern into a detection address, and generating a detection data packet corresponding to the detection address; finally, using the detection data packet to detect the detection address, and determining the target detection address result from the detection address. Compared with the current prior art, the present application can call the control plane of a programmable switch to generate an address pattern corresponding to a seed set, then call the data plane to convert the address pattern into a detection address, and generate a detection data packet corresponding to the detection address, and use the detection data packet to detect the detection address, and determine the target detection address result, without the need for the control plane to convert the address pattern to the detection address, thereby reducing the process of the control plane sending the detection address to the data plane and improving the address detection efficiency.
[0020] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0023] Figure 1 A schematic diagram of a flow chart of an address detection method provided in an embodiment of the present application is shown;
[0024] Figure 2 A schematic diagram of a flow chart of an address detection method provided in an embodiment of the present application is shown;
[0025] Figure 3 A schematic diagram of an example process provided by an embodiment of the present application is shown;
[0026] Figure 4 A schematic diagram of an example process provided by an embodiment of the present application is shown;
[0027] Figure 5 A schematic diagram of an example process provided by an embodiment of the present application is shown;
[0028] Figure 6 A schematic structural diagram of an address detection device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0029] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0030] In order to improve the current semantic information-based method, a significant computational cost is required during model training, resulting in a long time for address detection of IPv6 addresses and a low address detection efficiency. This embodiment provides an address detection method, such as Figure 1 As shown, the method includes:
[0031] Step 101: Get the address list corresponding to the seed set.
[0032] The seed set may include but is not limited to known active IPv6 addresses, and the address list may be obtained after the seed set is sorted, and may be sorted in lexicographic order to improve the processing efficiency of the seed set. Exemplarily, the IPv6 address scanning space may be optimized to discover as many active IPv6 addresses as possible as quickly as possible. This process may be called IPv6 target generation, that is, through the seed set, by mining the information of known addresses, candidate addresses with a higher probability of being active are generated, so as to narrow the detection range, speed up the scan, and improve the detection efficiency of active IPv6 addresses.
[0033] In this embodiment, the execution subject may be a programmable switch, and the programmable switch may be used to obtain an address list corresponding to the seed set, and then the address list is processed to detect and obtain active IPv6 addresses.
[0034] Step 102: According to the address list, call the control plane of the programmable switch to generate an address pattern corresponding to the seed set.
[0035] The address pattern may include an address field with a wildcard, which is used to mine the information of known addresses to classify the seed set, simplify the generation process of the detection address, and further simplify the search and matching operations of the detection address, thereby improving the efficiency of address detection. Correspondingly, the wildcard can be a custom special symbol, such as: *,?,\, etc., which can be used to mark some digits in the address.
[0036] In a specific application scenario, the control plane of the programmable switch can be called to obtain the numerical relationship between adjacent addresses in the address list through bit operations, cluster the addresses in the address list based on the numerical relationship, and finally determine the address pattern corresponding to the seed set according to the clustering results.
[0037] Step 103: Call the data plane of the programmable switch to convert the address mode into a detection address, and generate a detection data packet corresponding to the detection address.
[0038] Among them, the detection address may include but is not limited to the IPv6 address that needs to be detected, that is, the active IPv6 address with a high probability, so as to narrow the detection range. Exemplarily, an address pattern may correspond to multiple addresses, and the data plane of the programmable switch may be called to convert the wildcard in the address pattern into specific data to form an actually available detection address, and then generate a detection data packet (detection packet) corresponding to the detection address to detect the detection address and determine the active address in the detection address. In this way, the data processing process of the control plane of the programmable switch can be reduced, and the control plane does not need to convert the address mode to the detection address, which reduces the process of the control plane sending the detection address to the data plane, and improves the address detection efficiency.
[0039] For example, the address mode may be expressed as 2001:41d0:0700:659*:0000:0000:0000:00*0. The detection addresses after conversion of the address mode may include 2001:41d0:0700:6592:0000:0000:0000:0080 and 2001:41d0:0700:6598:0000:0000:0000:0090.
[0040] Step 104: Use the detection data packet to detect the detection address, and determine the target detection address from the detection address.
[0041] The target detection address may include but is not limited to active IPv6 addresses. The standards for determining whether an IPv6 address is active vary at various levels of the network architecture. For example, at the network layer, activity means that the scanned IPv6 address can respond to the detection packet via an IP packet; at the transport layer, activity means that the scanned IPv6 address can send a TCP packet from at least one port, whether it is a SYN-ACK or a RST.
[0042] Exemplarily, the programmable switch is regarded as a general scanner for discovering active IPv6 addresses. Specifically, the programmable switch sends several detection packets to the detection address and monitors the response of the host corresponding to the detection address. If the host corresponding to the detection address responds to these detection packets, the host corresponding to the detection address can be regarded as active, and the IPv6 address of the active host is used as the target detection address.
[0043] Compared with the current existing technology, this embodiment can call the control plane of the programmable switch to generate an address pattern corresponding to the seed set, and then call the data plane to convert the address pattern into a detection address, and generate a detection data packet corresponding to the detection address, and use the detection data packet to detect the detection address to determine the target detection address result. There is no need for the control plane to convert the address pattern to the detection address, which reduces the process of the control plane sending the detection address to the data plane and improves the address detection efficiency.
[0044] In order to further illustrate the specific implementation process of the method of this embodiment, this embodiment provides the following Figure 2 The specific method shown includes:
[0045] Step 201: Obtain the address list corresponding to the seed set.
[0046] In this embodiment, if Figure 3As shown, an example diagram of 6Map, a fast active IPv6 address detection system based on a programmable switch, is provided. The core idea of 6Map is to quickly extract address patterns on the control plane and directly generate scanning targets on the data plane for high-speed scanning, aiming to discover active IPv6 addresses as quickly as possible. 6Map has achieved comprehensive optimization in both the target generation algorithm and the scanning tool. Specifically, a lightweight target generation algorithm is used to guide the scanning direction as quickly as possible, and a well-customized scanning tool uses the switch ASIC to improve the efficiency of discovering active addresses. In addition, the programmable switch is used for in-band network telemetry (INT) to control the detection speed. Through comprehensive optimization, 6Map achieves the goal of discovering as many active IPv6 addresses as possible within a given time period.
[0047] Among them, the programmable switch may include a control plane and a data plane, and the control plane may include a target generation module to convert the seed set to the address mode, and receive the network information sent by the data plane, use the rate adjustment module to adjust the parameters of the fuzzy PID model, determine the detection rate, and send the detection rate to the address detection module of the data plane to control the sending rate of the detection data packet; accordingly, the data plane can receive the address mode that needs to be detected sent by the control plane, and convert the address mode into an actually available detection address, and receive the template data packet sent by the control plane, and convert the template data packet into a detection data packet according to the address mode, which is used to detect the detection address and determine the active target detection address therefrom.
[0048] Step 202: Call the control plane to cluster the address list according to a preset clustering threshold, and generate a clustering result of the address list.
[0049] Optionally, step 202 may specifically include: calling the control plane to obtain a binary representation of the first address and a binary representation of the second address, the first address and the second address being adjacent addresses in the address list; calculating the number of bits of different numerical values in the binary representation of the first address and the binary representation of the second address, and an XOR result of the binary representation of the first address and the binary representation of the second address; generating a clustering result of the first address and the second address based on the number of bits and the XOR result.
[0050] In this embodiment, the target generation module in the control plane can be used to run the target generation algorithm. The target generation algorithm may include primitives such as calc_addr_diff, calc_addr_xor, and calc_a□□r_or. Among them, calc_addr_diff can be used to calculate the number of bits with different values in the same bit of two IPv6 addresses. The return value of this primitive can intuitively represent the difference between the two IPv6 addresses. The calc_addr_xor and calc_addr_or primitives calculate the results of bitwise AND and bitwise OR of two IPv6 addresses. These three functions can all be implemented through bit operations, and the operation is very efficient. The time complexity is O(1), which reduces the time of target generation and thereby improves the efficiency of address detection.
[0051] The preset clustering threshold may include the clustering threshold T of the target generation algorithm. Specifically, the seed set may be sorted to obtain an address list, and then the given IPv6 address list may be traversed to compare the first address Addr of two adjacent addresses. curr and the second address Addr next During the comparison process, the calc_addr_diff primitive is first called to calculate the number of different bits in the binary representation of the two addresses, Δ n , and call the calc_addr_xor primitive to get their XOR results δ m If the number of different bits Δ n If Addr is less than the given clustering threshold T, further judgment is made. curr If it is not in the clustering result, then Addr curr andAddr next Join a new cluster together and update the mask M of this cluster l is δ m Otherwise, call the calc_addr_or primitive to calculate Addr curr The mask M of the cluster l and δ m The result of the OR operation is as follows: next The cluster mask M added to this cluster c If M c and M l Exactly the same, indicating that Addr next Join Addr curr The number of different bits in the class will not increase, and no additional detection budget is required, so Addr next Join Addr curr Otherwise, the growth of the current cluster ends and the next cluster begins to be considered.
[0052] For example, Figure 4As shown, the address list may include address 1, address 2, address 3, and address 1. The preset clustering threshold T may be set to 4. For the first pair of addresses (address 1 and address 2), calc_addr_diff is called to calculate Δ n If it is 2, which is less than the preset clustering threshold, calc_addr_xor is called to calculate δ m , since address 1 has not been clustered, address 1 and address 2 can be added to a new cluster and the mask M of this cluster can be updated. l is δ m . Continue traversing, for the second pair of addresses (address 2 and address 3), call calc_addr_diff to calculate Δ n is 1, which is less than the preset clustering threshold. Calculate δ by calling calc_addr_xor m Since the current address (address 2) is already in cluster 0, the calc_addr_or primitive is called to calculate M c , M c and M i If they are exactly the same, the address to be clustered is added to the class of the current address. For the third pair of addresses (address 3 and address 4), calc_addr_diff is called to calculate Δ n If it is 10, which is greater than the preset clustering threshold, the expansion of cluster 0 can be terminated.
[0053] Step 203: Determine the address pattern corresponding to the seed set according to the clustering result, where the address pattern includes an address field with a wildcard.
[0054] In this embodiment, the clustering result can be obtained by traversing the seed set once, and the address list can be analyzed and classified according to the judgment of the numerical relationship of each bit. Then, the address mode is determined according to the clustering result to reduce the detection budget. The time complexity of the algorithm is only O(nlogn), and it only takes a few minutes to run on a programmable switch with limited computing resources, thereby quickly guiding the scanning direction to discover as many active IPv6 addresses as possible within a certain period of time.
[0055] Step 204: Obtain a template data packet generated by the control plane.
[0056] In this embodiment, the programmability of the switch ASIC can be expanded by using the switch CPU, and the address mode processing method can be implemented on the switch ASIC, and the address mode obtained by the target generation algorithm can be directly input into the switch ASIC to quickly generate addresses for scanning. Exemplarily, a template data packet (which can be called a template packet or a template group) can be generated by the switch CPU and injected into the switch ASIC through a PCIe channel, and an accelerator, a replicator, and an editor can be used in the data plane to generate a detection data packet.
[0057] Step 205: According to the template data packet and the wildcard, the data plane is called to convert the address pattern into a detection address.
[0058] For example, Figure 5 As shown, three types of indicators can be defined in the custom metadata: iteration can indicate the number of addresses that the replicator has generated for a certain pattern, threshold can indicate the total number of addresses converted into a pattern, and pos is an array indicating the wildcard position starting from the least significant bit (LSB). The pattern and indicator with the wildcard position set to 0 are stored in the register of the data plane.
[0059] Specifically, for each copied template packet in the editor, first obtain a pattern and its indicator, and modify the position of each wildcard through a series of matching operation tables. These tables accurately match iteration and the position pos of the corresponding wildcard. Then, these tables adjust the destination IP address of the data packet. For example, for iteration range in (16*k, 16*k+15], k=0,1,2,…, the value at the position of the first wildcard will increase by 1; for iteration equal to 16*k, k=0,1,2,…, the value at the position of the second wildcard will increase by 1, and the value at the position of the first wildcard will be carried to 0; for the remaining iterations, and so on. After the header is adjusted, if iteration is greater than threshold, it means that the address mode conversion is completed, and the message is discarded. Otherwise, it will be mirrored to the egress deparser. One of the two packets is sent as a probe packet, and the other will be recycled to the editor for further address mode conversion.
[0060] As a possible implementation, the address mode conversion mechanism of the data plane may support three wildcards, and additional wildcards may be converted by the control plane, thereby improving the mode conversion efficiency and reducing the overhead of the data plane mode conversion.
[0061] Step 206: Convert the template data packet into a detection data packet corresponding to the detection address.
[0062] Optionally, converting the template data packet into a detection data packet corresponding to the detection address may specifically include: calling an accelerator in the data plane to send the template data packet to a replicator in the data plane; based on the number of detection addresses, using the replicator to copy the template data packet to obtain a target template data packet, the number of target template data packets being greater than the number of detection addresses; based on the address pattern, using an editor in the data plane to convert the target template data packet into a detection data packet.
[0063] Among them, the accelerator can utilize the recycling function of the programmable switch. After the data packet leaves the egress port, the template data packet will be immediately sent back to the ingress pipeline, achieving constant acceleration and obtaining a constant acceleration cycle and a full-speed stable packet source for the replicator; the replicator can obtain the template packet as input and use multicast to perform replication. After a set of ports are configured, multicast can copy and forward data packets in parallel to these ports. The original template data packet from the accelerator will continue to recirculate to ensure that the replicator can consistently obtain template data packets from the accelerator, and the multicast copies will be further processed by the editor.
[0064] Accordingly, the editor may be responsible for modifying the copied template packet into the required detection packet. The editor obtains information in the register about the destination address generated and written by the control plane, and then modifies the packet header. For example, since the programmable switch only supports a maximum of 32-bit register access, the 128-bit IPv6 address may be modified into four 32-bit fields in the P4 code.
[0065] Step 207: Use the detection data packet to detect the detection address, and determine the target detection address from the detection address.
[0066] Optionally, before step 207, the method of this embodiment may also include: calling the data plane to collect real-time information of the detection data packet; calling the control plane to calculate the idle link bandwidth of the data plane based on the real-time information; and using the fuzzy PID model to fuzzy process the idle link bandwidth to determine the target detection rate.
[0067] Among them, the idle link bandwidth can represent the unoccupied link bandwidth, which can be used to directly indicate the congestion level and the upper limit of the scanning rate, so as to facilitate the adjustment of the detection rate. The real-time information may include but is not limited to the length of the data packet, the time interval for sending data packets, etc. For example, the INT-based passive network measurement technology can be used to estimate the idle link bandwidth on the data plane. The programmable switch records the timestamps of the arrival of the first and last packets at a certain time interval, and sums the lengths of all packets. The time interval and the lengths of all packets are sent to the control plane, and then the control plane divides the sum of the lengths of all packets by the time interval to obtain the idle link bandwidth of the link. In this way, the switch ASIC can provide nanosecond timestamps for each incoming packet and collected data at a granularity rather than sampling, thereby improving the accuracy of the algorithm.
[0068] Specifically, the control plane is first called to calculate the idle link bandwidth based on the precise real-time information collected by the data plane, and then fuzzy logic processing is performed on it, converted into a fuzzy set, and reasoned by the fuzzy rule base. The reasoning result of the fuzzy logic is then combined with the output of the fuzzy PID controller, and the error and its rate of change are used to calculate the control quantity. Finally, the fuzzy PID controller outputs the target detection rate. In this way, the fuzzy PID controller can dynamically adjust the detection rate according to the current available bandwidth of the network, thereby effectively preventing adverse effects on the detection link and improving the network robustness during the detection process.
[0069] Optionally, step 207 may specifically include: sending a detection data packet to a corresponding detection address according to a target detection rate; and determining the detection address as a target detection address in response to receiving a response message sent by the detection address.
[0070] In this embodiment, a stateless connection mechanism similar to SYN cookies can be used to calculate a hash value based on the content of the packet and store it in a field of the detection packet. For the selection of hash functions, SipHash can be selected. SipHash is designed for short inputs (e.g., header fields) and has been proven to be as secure as existing encryption methods and requires fewer operations. The SipHash algorithm can be divided into three steps: an initialization phase, a compression loop, and an end loop. The initialization phase obtains four internal state words and is executed by the CPU before starting the detection. Compression and end rounds are performed in the data plane to encrypt the header fields. Variable fields such as the source port number and sequence number are used to store hash tokens.
[0071] Specifically, in the case of TCP scanning, when sending a probe message in the egress pipeline, the editor can set SrcPort to Siphash(Proto, SrcIP, DstIP), and when a probe reply packet is received, the same Siphash is executed to check DstPort to determine whether the received packet is a valid response to the probe packet. Correspondingly, UDP scanning and ICMP scanning are similar to TCP scanning, but differ in the selection of packet fields. After identifying and checking the response packets, the ASIC will send them to the storage server for offline analysis.
[0072] In specific application scenarios, address detection can be used to discover potential network security threats. For example, SYN scans can be performed on high-risk ports of 223,000 active IPv6 addresses discovered by 6Map. Experimental results show that 6Map discovered the opening of tens of thousands of high-end ports in less than 20 minutes, proving the usefulness and advancement of 6Map in security applications. When new or abnormal IPv6 addresses are discovered, an alarm can be issued to prompt administrators to implement necessary security measures and reduce potential damage.
[0073] Compared with the current existing technology, this embodiment can call the control plane to cluster the address list according to a preset clustering threshold, and determine the address pattern corresponding to the seed set based on the clustering result. The clustering result can be obtained by traversing the seed set only once, which reduces the time complexity of generating the address pattern and quickly guides the scanning direction to discover as many active IPv6 addresses as possible within a given time, thereby improving the address detection efficiency.
[0074] Further, as Figure 1 and Figure 2 The specific implementation of the method shown in the embodiment provides an address detection device, such as Figure 6 As shown, the device includes: an acquisition module 31, a generation module 32, and a determination module 33.
[0075] An acquisition module 31 is configured to acquire an address list corresponding to the seed set;
[0076] A generating module 32 is configured to call a control plane of the programmable switch to generate an address pattern corresponding to the seed set according to the address list;
[0077] The generating module 32 is configured to call the data plane of the programmable switch to convert the address mode into a detection address, and generate a detection data packet corresponding to the detection address;
[0078] The determination module 33 is configured to detect the detection address using the detection data packet and determine the target detection address from the detection address.
[0079] In some examples of this embodiment, the generation module 32 is specifically configured to call the control plane to cluster the address list according to a preset clustering threshold to generate a clustering result of the address list; determine the address pattern corresponding to the seed set based on the clustering result, and the address pattern includes an address field with a wildcard.
[0080] In some examples of this embodiment, the generation module 32 is specifically configured to call the control plane to obtain the binary representation of the first address and the binary representation of the second address, the first address and the second address being adjacent addresses in the address list; calculate the number of bits of different numerical values in the binary representation of the first address and the binary representation of the second address, and the XOR result of the binary representation of the first address and the binary representation of the second address; generate a clustering result of the first address and the second address based on the number of bits and the XOR result.
[0081] In some examples of this embodiment, the generation module 32 is specifically configured to obtain a template data packet generated by the control plane; based on the template data packet and the wildcard, call the data plane to convert the address pattern into a detection address; and convert the template data packet into a detection data packet corresponding to the detection address.
[0082] In some examples of this embodiment, the generation module 32 is specifically configured to call an accelerator in the data plane to send a template data packet to a replicator in the data plane; based on the number of detection addresses, the template data packet is copied by the replicator to obtain a target template data packet, and the number of target template data packets is greater than the number of detection addresses; based on the address pattern, the target template data packet is converted into a detection data packet by an editor in the data plane.
[0083] In some examples of this embodiment, the determination module 33 is specifically configured to call the data plane to collect real-time information of the detection data packet; based on the real-time information, call the control plane to calculate the idle link bandwidth of the data plane; use the fuzzy PID model to fuzzy process the idle link bandwidth to determine the target detection rate.
[0084] In some examples of this embodiment, the determination module 33 is specifically configured to send a detection data packet to a corresponding detection address at a target detection rate; in response to receiving a response message sent by the detection address, determine the detection address as a target detection address.
[0085] It should be noted that for other corresponding descriptions of the functional units involved in the address detection device provided in this embodiment, reference can be made to Figure 1 and Figure 2 The corresponding description in will not be repeated here.
[0086] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.
[0087] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a computer program product, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.
[0088] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the method of the implementation scenario of the present application.
[0089] Based on the above Figure 1 and Figure 2 The method shown, and Figure 6 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, such as a personal computer, a server, a laptop computer, a smart phone, an intelligent robot or other intelligent terminal, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The method shown.
[0090] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0091] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0092] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0093] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware. By applying the technical solution of this embodiment, the control plane can be called to cluster the address list according to a preset clustering threshold, and the address pattern corresponding to the seed set can be determined based on the clustering result. The clustering result can be obtained by traversing the seed set only once, which reduces the time complexity of generating the address pattern, quickly guides the scanning direction, and finds as many active IPv6 addresses as possible within a given time, thereby improving the efficiency of address detection.
[0094] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0095] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
Claims
1. An address detection method, It is characterized in that include: Get the address list corresponding to the seed set; According to the address list, calling the control plane of the programmable switch to generate an address pattern corresponding to the seed set; Calling the data plane of the programmable switch to convert the address mode into a detection address, and generating a detection data packet corresponding to the detection address; The detection address is detected using the detection data packet, and a target detection address is determined from the detection addresses.
2. The method according to claim 1, It is characterized in that The step of calling the control plane of the programmable switch to generate the address mode corresponding to the seed set according to the address list includes: Calling the control plane to cluster the address list according to a preset clustering threshold to generate a clustering result of the address list; An address pattern corresponding to the seed set is determined according to the clustering result, wherein the address pattern includes an address field with a wildcard.
3. The method according to claim 2, It is characterized in that The calling the control plane to cluster the address list according to a preset clustering threshold to generate a clustering result of the address list includes: Calling the control plane to obtain a binary representation of a first address and a binary representation of a second address, wherein the first address and the second address are adjacent addresses in the address list; Calculate the number of bits of different values in the binary representation of the first address and the binary representation of the second address, and the XOR result of the binary representation of the first address and the binary representation of the second address; A clustering result of the first address and the second address is generated according to the number of bits and the XOR result.
4. The method according to claim 2, It is characterized in that The calling of the data plane of the programmable switch to convert the address mode into a detection address and generate a detection data packet corresponding to the detection address includes: Obtaining a template data packet generated by the control plane; Invoke the data plane to convert the address mode into the detection address according to the template data packet and the wildcard; The template data packet is converted into a detection data packet corresponding to the detection address.
5. The method according to claim 4, It is characterized in that The converting the template data packet into a detection data packet corresponding to the detection address includes: Invoking an accelerator in the data plane to send the template data packet to a replicator in the data plane; According to the number of the detection addresses, the template data packet is copied by the replicator to obtain a target template data packet, and the number of the target template data packet is greater than the number of the detection addresses; According to the address mode, the target template data packet is converted into the detection data packet using an editor in the data plane.
6. The method according to claim 1, It is characterized in that Before detecting the detection address using the detection data packet and determining the target detection address from the detection address, the method further includes: Calling the data plane to collect real-time information of the detection data packet; Invoke the control plane to calculate the idle link bandwidth of the data plane according to the real-time information; The idle link bandwidth is fuzzily processed using a fuzzy PID model to determine a target detection rate.
7. The method according to claim 6, It is characterized in that The detecting the detection address by using the detection data packet and determining the target detection address from the detection address includes: According to the target detection rate, the detection data packet is sent to the corresponding detection address; In response to receiving the response information sent by the detection address, the detection address is determined as the target detection address.
8. An address detection device, It is characterized in that include: An acquisition module is configured to acquire an address list corresponding to the seed set; A generating module is configured to call a control plane of a programmable switch to generate an address pattern corresponding to the seed set according to the address list; A generating module, configured to call the data plane of the programmable switch to convert the address mode into a detection address, and generate a detection data packet corresponding to the detection address; The determination module is configured to detect the detection address using the detection data packet and determine a target detection address from the detection addresses.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product having a computer program stored thereon, It is characterized in that When the computer program product is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
