A network transmission method, device, electronic device and storage medium
By dynamically detecting the number of requests for cache address resolution protocols and generating free messages to determine the interoperability between devices, enabling the target proxy mode, the problem of not being able to dynamically enable the appropriate proxy mode in the prior art is solved, and network transmission performance and flexibility are improved.
Patent Information
- Application Number
- CN202411845897.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The proper address resolution protocol proxy mode cannot be enabled dynamically in the prior art, resulting in performance bottlenecks, waste of resources and poor flexibility.
By obtaining the interoperability cache entry to the interoperability cache table in the host interoperability cache table to be detected, determining the number of cache address resolution protocol requests, and generating free address resolution protocol messages when the number is greater than the preset threshold, determining whether the interoperability between devices can be performed through proxy, and enabling the target proxy mode.
Dynamically perceive network topology, start and stop proxying according to needs, improve forwarding performance, alleviate network transmission pressure, avoid resource waste, and improve flexibility.
Smart Images

Figure CN119316479B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic communications, and in particular to a network transmission method, device, electronic device and storage medium. Background Art
[0002] With the development of computer technology, more and more devices are connected to the network to communicate with each other. In the network, devices usually use the Address Resolution Protocol (ARP) to obtain the physical (MAC) addresses of other devices in the same network. However, when a host on a network sends to another host on the same network segment but not on the same physical network, they cannot communicate directly because their Internet Protocol (IP) addresses are routable, but the physical addresses are not.
[0003] In the case where the above host devices cannot communicate directly, proxy ARP can play a role. Traditional related technologies require users to plan the ARP proxy mode in advance in a specific network planning scenario, and require that all hosts on the same physical network can only configure one ARP proxy mode, so that the hosts on the same network can communicate with each other even if they are not on the same physical network. However, in related technologies, data forwarding between each host requires the participation of a proxy device, which can easily cause performance bottlenecks, low forwarding performance, waste resources, and cannot adapt to different network scenarios, and has poor flexibility.
[0004] Currently, no effective solution has been proposed for the problem of how to dynamically enable a suitable ARP proxy mode in the related art. Summary of the invention
[0005] The embodiments of the present application provide a network transmission method, device, electronic device and storage medium to at least solve the problem of how to dynamically enable a suitable address resolution protocol proxy mode in the related art.
[0006] In a first aspect, an embodiment of the present application provides a network transmission method.
[0007] In some embodiments, the network transmission method includes:
[0008] Obtaining a cache entry for intercommunication to be detected in the cache table of intercommunication between hosts to be detected;
[0009] Determine the number of cache address resolution protocol requests corresponding to each of the intercommunication cache entries to be detected within the intercommunication detection cycle time;
[0010] In the case where the number of cached address resolution protocol requests is greater than a preset number threshold, a free address resolution protocol message corresponding to the intercommunication cache entry to be detected is generated, and whether multiple devices to be detected can be intercommunication through a proxy is determined according to the free address resolution protocol message;
[0011] In the case that the multiple devices to be detected can communicate with each other through a proxy, the target proxy mode is enabled.
[0012] In some embodiments, when the number of cached address resolution protocol requests is greater than a preset number threshold, generating a free address resolution protocol message, and determining whether multiple devices to be detected can communicate with each other through a proxy according to the free address resolution protocol message includes:
[0013] In the case where the number of cached address resolution protocol requests is greater than a preset number threshold, generating a first free address resolution protocol message and a second free address resolution protocol message;
[0014] Sending the first free address resolution protocol message to the first device to be detected to determine whether a first address resolution protocol response message sent by the first device to be detected is received;
[0015] Sending the second free address resolution protocol message to the second device to be detected to determine whether a second address resolution protocol response message sent by the second device to be detected is received;
[0016] When the first address resolution protocol response message and the second address resolution protocol response message are received, it is determined that the first device to be detected and the second device to be detected can communicate with each other through the proxy.
[0017] In some embodiments, obtaining the to-be-detected intercommunication cache entry in the to-be-detected host intercommunication cache table includes:
[0018] Obtain a first intercommunication cache table entry in the intercommunication cache table of the host to be detected, and determine a cache table entry duration corresponding to each of the first intercommunication cache table entries;
[0019] Determine the first intercommunication cache entry whose corresponding cache entry duration is less than a preset aging duration as a second intercommunication cache entry;
[0020] The entry state information corresponding to the second intercommunication cache entry is obtained, and the second intercommunication cache entry corresponding to the entry state information of which is in a to-be-detected state is determined as the to-be-detected intercommunication cache entry.
[0021] In some embodiments, after obtaining the first intercommunication cache entry in the host intercommunication cache table to be detected and determining the cache entry duration corresponding to each of the first intercommunication cache entries, the method further includes:
[0022] The first intercommunication cache entry corresponding to the cache entry whose duration is greater than or equal to the preset aging duration is deleted.
[0023] In some embodiments, when the plurality of devices to be detected can communicate with each other through a proxy, enabling the target proxy mode includes:
[0024] When the Internet Protocol addresses of the plurality of devices to be detected are in the same network segment, enabling the local proxy mode;
[0025] When the Internet Protocol addresses of the multiple devices to be detected are not in the same network segment, the common proxy mode is enabled.
[0026] In some embodiments, the network transmission method further includes:
[0027] Acquire a listening address resolution protocol message and an initial host intercommunication cache table, and update the initial host intercommunication cache table according to the listening address resolution protocol message;
[0028] The updated initial host intercommunication cache table is determined as the host intercommunication cache table to be detected.
[0029] In some embodiments, obtaining the listening address resolution protocol message and the initial host intercommunication cache table, and updating the initial host intercommunication cache table according to the listening address resolution protocol message includes:
[0030] In the case where the listening address resolution protocol message is a request address resolution protocol message, determining whether the initial host intercommunication cache table contains a target listening table entry according to a source Internet Protocol address and a destination Internet Protocol address corresponding to the listening address resolution protocol message;
[0031] In a case where the target monitoring entry is included in the initial host intercommunication cache table, determining the entry state information corresponding to the target monitoring entry as a to-be-detected state;
[0032] In the case that the initial host intercommunication cache table does not include the target monitoring table entry, the target monitoring table entry is generated in the initial host intercommunication cache table, and the table entry state information corresponding to the target monitoring table entry is determined as a pending detection state.
[0033] In a second aspect, an embodiment of the present application provides a network transmission device.
[0034] In some embodiments, the network transmission device includes a detection target acquisition module, a request quantity determination module, a device intercommunication determination module and a proxy mode activation module:
[0035] The detection target acquisition module is used to obtain the intercommunication cache table entry to be detected in the intercommunication cache table of the host to be detected;
[0036] The request quantity determination module is used to determine the number of cache address resolution protocol requests corresponding to each of the intercommunication cache entries to be detected within the intercommunication detection cycle time;
[0037] The device intercommunication judgment module is used to generate a free address resolution protocol message corresponding to the intercommunication cache table entry to be detected when the number of cached address resolution protocol requests is greater than a preset number threshold, and determine whether multiple devices to be detected can communicate with each other through a proxy according to the free address resolution protocol message;
[0038] The proxy mode enabling module is used to enable the target proxy mode when the multiple devices to be detected can communicate with each other through the proxy.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the network transmission method as described in the first aspect above is implemented.
[0040] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the network transmission method described in the first aspect above is implemented.
[0041] Compared with the related art, the network transmission method, device, electronic device and storage medium provided in the embodiments of the present application obtain the intercommunication cache table items to be detected in the intercommunication cache table of the host to be detected, determine the number of cache address resolution protocol requests corresponding to each intercommunication cache table item to be detected within the intercommunication detection cycle time, and generate a free address resolution protocol message corresponding to the intercommunication cache table item to be detected when the number of cache address resolution protocol requests is greater than a preset number threshold, determine whether multiple devices to be detected can communicate with each other through a proxy based on the free address resolution protocol message, and enable the target proxy mode when the multiple devices to be detected can communicate with each other through a proxy, thereby solving the problem of how to dynamically enable a suitable address resolution protocol proxy mode in the related art, and does not require advance planning of network scenarios. It can dynamically perceive the network topology, start and stop the proxy according to demand, improve forwarding performance, alleviate network transmission pressure, avoid waste of resources, and has high flexibility.
[0042] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0044] Figure 1 is a hardware structure block diagram of a terminal according to a network transmission method of an embodiment of the present application;
[0045] Figure 2 is a flow chart of a network transmission method according to an embodiment of the present application;
[0046] Figure 3 is a flow chart of another network transmission method according to an embodiment of the present application;
[0047] Figure 4 is a flow chart of a network transmission method according to a preferred embodiment of the present application;
[0048] Figure 5 It is a structural block diagram of a network transmission device according to an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0050] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0051] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application means greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0052] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the network transmission method according to an embodiment of the present invention. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0053] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the network transmission method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0054] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0055] This embodiment provides a network transmission method. Figure 2 is a flow chart of a network transmission method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0056] Step S201, obtaining a cache entry of the intercommunication to be detected in the cache table of the intercommunication between hosts to be detected.
[0057] Read the intercommunication cache entry to be detected in the host intercommunication cache table, and obtain the target information corresponding to the entry. The target information may include the corresponding source device address information, destination device address information, entry status information, proxy mode information, the number of ARP requests received during the intercommunication detection cycle, cache entry duration information, and preset aging duration information.
[0058] Step S202: Determine the number of cache address resolution protocol requests corresponding to each intercommunication cache entry to be detected within the intercommunication detection cycle time.
[0059] The address resolution protocol request received by the intercommunication cache entry to be detected is determined as a cached address resolution protocol request (cached ARP request). The number of cached ARP requests received by each intercommunication cache entry to be detected within the intercommunication detection cycle is determined.
[0060] Step S203, when the number of cached ARP requests is greater than a preset number threshold, a free ARP message corresponding to the intercommunication cache entry to be detected is generated, and whether multiple devices to be detected can intercommunicate through a proxy is determined based on the free ARP message.
[0061] When the number of cached ARP requests exceeds the preset number threshold, it means that the multiple devices to be detected corresponding to the table entry cannot communicate directly, and it is necessary to trigger the reachability detection process between the proxy device and the device to be detected to determine whether the multiple devices to be detected can communicate with each other indirectly through the proxy device. If so, the table item status information of the table item corresponding to the device to be detected is indirectly reachable. Specifically, a free address resolution protocol message corresponding to the intercommunication cache table item to be detected can be generated, and whether the multiple devices to be detected can communicate with each other through the proxy can be determined based on the free address resolution protocol message. In addition, when the number of cached ARP requests does not exceed the preset number threshold, it means that the multiple devices to be detected are already intercommunication, and there is no need to start the proxy. The table item status information of the intercommunication cache table item to be detected can be updated to a directly reachable state.
[0062] Step S204: when multiple devices to be detected can communicate with each other through a proxy, enable the target proxy mode.
[0063] Based on the reachability detection process between the proxy device and the device to be detected, when it is determined that multiple devices to be detected can communicate with each other through the proxy, the target proxy mode is enabled to ensure the communication and transmission requirements between the multiple devices to be detected.
[0064] Through the above steps, the embodiment of the present application obtains the intercommunication cache table items to be detected in the intercommunication cache table of the host to be detected, and determines the number of cache address resolution protocol requests corresponding to each intercommunication cache table item to be detected within the intercommunication detection cycle time. When the number of cache address resolution protocol requests is greater than the preset number threshold, it indicates that the devices to be detected cannot communicate directly with each other, and it is necessary to further detect whether they can communicate indirectly through the proxy, thereby generating a free address resolution protocol message corresponding to the intercommunication cache table item to be detected, and determining whether multiple devices to be detected can communicate indirectly based on the free address resolution protocol message. When multiple devices to be detected can communicate indirectly with each other, the target proxy mode is enabled to avoid starting the proxy for all forwardings, reduce forwarding pressure, solve the problem of how to dynamically enable a suitable address resolution protocol proxy mode in the related technology, do not need to plan the network scenario in advance, can dynamically perceive the network topology, start and stop the proxy according to demand, improve forwarding performance, alleviate network transmission pressure, avoid waste of resources, and have high flexibility.
[0065] In some embodiments, step S203 includes:
[0066] Step S2031: When the number of cached ARP requests is greater than a preset number threshold, a first free ARP message and a second free ARP message are generated.
[0067] When the number of cached address resolution protocol requests is greater than a preset number threshold, a first free address resolution protocol message (first free ARP message) and a second free address resolution protocol message (second free ARP message) are generated and sent to detect whether an ARP response from the device to be detected can be received.
[0068] Step S2032: Send a first free address resolution protocol message to the first device to be detected to determine whether a first address resolution protocol response message sent by the first device to be detected is received.
[0069] The multiple devices to be detected include a first device to be detected, and a first free ARP message is sent to the first device to be detected to determine whether a first address resolution protocol reply message (first ARP reply message) sent by the first device to be detected is received. If the first ARP reply message can be received, it means that the first device to be detected and the proxy device can communicate with each other.
[0070] Step S2033: Send a second free address resolution protocol message to the second device to be detected to determine whether a second address resolution protocol response message sent by the second device to be detected is received.
[0071] The plurality of devices to be detected include a second device to be detected, and a second free ARP message is sent to the second device to be detected to determine whether a second address resolution protocol reply message (second ARP reply message) sent by the second device to be detected is received. If the second ARP reply message can be received, it means that the second device to be detected and the proxy device can communicate with each other.
[0072] Step S2034: upon receiving the first address resolution protocol response message and the second address resolution protocol response message, determining that the first device to be detected and the second device to be detected can communicate with each other through the proxy.
[0073] When the first address resolution protocol response message and the second address resolution protocol response message are received, it indicates that the first device to be detected, the second device to be detected and the proxy device can communicate with each other. Therefore, it is determined that the first device to be detected and the second device to be detected can forward data through the proxy device, that is, they can communicate with each other, and the table status information of the corresponding table entry is indirectly reachable.
[0074] Through the above steps, when the devices to be detected cannot communicate directly with each other, the embodiment of the present application triggers the proxy device to perform reachability detection and constructs a free ARP message to determine whether the device to be detected and the proxy device are interoperable, thereby further confirming whether the devices to be detected can communicate with each other indirectly, which has high feasibility.
[0075] In some embodiments, step S201 includes:
[0076] Step S2011, obtaining the first intercommunication cache table entry in the host intercommunication cache table to be detected, and determining the cache table entry duration corresponding to each first intercommunication cache table entry.
[0077] The first intercommunication cache entries are all entries in the intercommunication cache table of the host to be detected, and the cache entry duration corresponding to each first intercommunication cache entry is determined.
[0078] Step S2012: determine the first intercommunication cache entry whose corresponding cache entry duration is less than the preset aging duration as the second intercommunication cache entry.
[0079] When the cache entry duration corresponding to the first intercommunication cache entry is less than the preset aging duration, it indicates that the entry was established relatively recently and has not yet aged, so it is determined as the second intercommunication cache entry and is retained.
[0080] Step S2013: Acquire entry state information corresponding to the second intercommunication cache entry, and determine the second intercommunication cache entry whose corresponding entry state information is in a to-be-detected state as the to-be-detected intercommunication cache entry.
[0081] The entry state information corresponding to the second intercommunication cache entry is obtained. When the entry state information is in a to-be-detected state, it indicates that the intercommunication state of the host device corresponding to the second intercommunication cache entry is unknown and further detection is required. Therefore, the second intercommunication cache entry is determined as an to-be-detected intercommunication cache entry.
[0082] Through the above steps, the embodiment of the present application introduces an aging mechanism and filters out entries whose entry status information is not in the state to be detected, so that intercommunication detection between corresponding devices is performed only on the intercommunication cache entries to be detected, making the detection more targeted, efficient and feasible.
[0083] In some embodiments, after step S2011, the method further includes:
[0084] Step S2111: Delete the first intercommunication cache entry whose corresponding cache entry duration is greater than or equal to the preset aging duration.
[0085] When the cache entry duration of the first intercommunication cache entry is greater than or equal to the preset aging duration, it indicates that the entry was established for a long time and the preset aging time has been reached, and the first intercommunication cache entry is deleted.
[0086] Through the above steps, the embodiment of the present application deletes the intercommunication cache entries whose cache entries have lasted longer than the preset aging time, thereby further saving resources and improving efficiency.
[0087] In some embodiments, step S204 includes:
[0088] Step S2041: when the Internet Protocol addresses of multiple devices to be detected are in the same network segment, enable the local proxy mode.
[0089] Step S2042: when the Internet Protocol addresses of the multiple devices to be detected are not in the same network segment, enable the common proxy mode.
[0090] When it is determined that multiple devices to be detected can communicate with each other through a proxy device, it is further determined whether the IP addresses of the intercommunication devices to be detected are in the same network segment. If they are in the same network segment, the ARP local proxy mode is enabled, otherwise the ARP normal proxy mode is enabled. In addition, if no ARP reply message is received, it means that multiple devices to be detected cannot forward data through the proxy device and cannot communicate with each other through the proxy. At this time, the corresponding cache entry for intercommunication to be detected is deleted. It is worth mentioning that in the communication process of the embodiment of the present application, the corresponding table entry status information can also be obtained according to the received ARP request message, and the host intercommunication cache table is matched. If it cannot be obtained, no processing is performed, otherwise, different processing is performed according to different information. When the table entry status information is in a directly reachable state, the proxy device does not need to do any processing; when the table entry status information is in an indirectly reachable state, corresponding processing is performed according to the ARP proxy mode.
[0091] Through the above steps, the embodiment of the present application verifies whether multiple devices to be detected belong to the same network segment to confirm whether the corresponding ARP general proxy mode or ARP local proxy mode is turned on, which is accurate and feasible, and improves forwarding robustness.
[0092] This embodiment also provides a network transmission method. Figure 3 is a flow chart of another network transmission method according to an embodiment of the present application. Figure 3 As shown, the process further includes the following steps based on the steps in the above embodiment:
[0093] Step S301: acquiring a listening address resolution protocol message and an initial host intercommunication cache table, and updating the initial host intercommunication cache table according to the listening address resolution protocol message.
[0094] In the embodiment of the present application, the ARP messages in the network link can also be monitored in real time, and the received different types of monitored ARP messages can be processed accordingly to update the initial host intercommunication cache table.
[0095] Step S302: determine the updated initial host intercommunication cache table as the host intercommunication cache table to be detected.
[0096] The initial host intercommunication cache table is dynamically updated in real time, and the updated initial host intercommunication cache table is determined as the host intercommunication cache table to be detected.
[0097] Through the above steps, the embodiment of the present application monitors the ARP interaction information between the devices to be detected in the network in real time, thereby updating the initial host intercommunication cache table to determine the host intercommunication cache table to be detected, and can dynamically perceive the network topology with strong real-time performance.
[0098] In some embodiments, step S301 includes:
[0099] Step S3011, when the monitored ARP message is a request ARP message, determine whether the initial host intercommunication cache table contains a target monitoring table entry according to the source Internet Protocol address and the destination Internet Protocol address corresponding to the monitored ARP message.
[0100] In the case where the monitored ARP message is a request ARP message, the corresponding target monitoring table entry is determined according to the source Internet Protocol address (source IP address) and the destination Internet Protocol address (destination IP address) corresponding to the monitored ARP message. Among them, the source device address information of the target monitoring table entry is the source IP address corresponding to the monitored ARP message, and the destination device address information of the target monitoring table entry is the destination IP address corresponding to the monitored ARP message. Further, it is checked whether the target monitoring table entry is included in the initial host intercommunication cache table.
[0101] Step S3012: when the initial host intercommunication cache table includes the target monitoring entry, the entry state information corresponding to the target monitoring entry is determined as a to-be-detected state.
[0102] The state to be detected may be an update state. When the initial host intercommunication cache table includes a target monitoring entry, the entry state information corresponding to the target monitoring entry is determined as an update state.
[0103] Step S3013: if the initial host intercommunication cache table does not contain the target monitoring entry, a target monitoring entry is generated in the initial host intercommunication cache table, and the entry state information corresponding to the target monitoring entry is determined as a pending detection state.
[0104] The state to be detected may be an unknown state. When the initial host intercommunication cache table does not contain a target monitoring entry, a target monitoring entry is generated in the initial host intercommunication cache table, and the entry state information corresponding to the target monitoring entry is determined to be an unknown state.
[0105] In addition, when the listening address resolution protocol message is a reply address resolution protocol message, it is determined whether the initial host intercommunication cache table contains a corresponding reachable listening table entry according to the source Internet Protocol address and the destination Internet Protocol address corresponding to the listening address resolution protocol message. If not, a reachable listening table entry is pre-built and its table entry state information is determined to be a directly reachable state; if it exists, the table entry state information of the corresponding reachable listening table entry is directly updated to be a directly reachable state.
[0106] Through the above steps, the embodiment of the present application further enhances the dynamic perception capability and real-time performance of the solution by pre-building table entries between the devices to be detected while monitoring, and parsing ARP packets to perceive in advance whether the devices to be detected are directly reachable.
[0107] The embodiments of the present application are described and illustrated below through preferred embodiments.
[0108] Figure 4 1 is a flow chart of a network transmission method according to a preferred embodiment of the present application. Figure 4 As shown, the network transmission method includes the following steps:
[0109] Step S401: obtaining a cache entry of the intercommunication cache to be detected in the host intercommunication cache table to be detected.
[0110] Step S402: Determine the number of cache address resolution protocol requests corresponding to each intercommunication cache entry to be detected within the intercommunication detection cycle.
[0111] Step S403, when the number of cached ARP requests is greater than a preset number threshold, a free ARP message corresponding to the intercommunication cache entry to be detected is generated, and whether multiple devices to be detected can intercommunicate through a proxy is determined based on the free ARP message.
[0112] Step S404: when multiple devices to be detected can communicate with each other through a proxy and the Internet Protocol addresses of the multiple devices to be detected are in the same network segment, enable the local proxy mode.
[0113] Step S405 , when multiple devices to be detected can communicate with each other through the proxy and the Internet Protocol addresses of the multiple devices to be detected are not in the same network segment, enable the common proxy mode.
[0114] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0115] This embodiment also provides a network transmission device, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "module", "unit", "subunit" and the like can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0116] Figure 5 is a structural block diagram of a network transmission device according to an embodiment of the present application, such as Figure 5 As shown, the device includes: a detection target acquisition module 10, a request quantity determination module 20, a device intercommunication judgment module 30 and a proxy mode activation module 40:
[0117] The detection target acquisition module 10 is used to obtain the intercommunication cache table entry to be detected in the intercommunication cache table of the host to be detected;
[0118] The request quantity determination module 20 is used to determine the number of cache address resolution protocol requests corresponding to each intercommunication cache entry to be detected within the intercommunication detection cycle time;
[0119] The device intercommunication determination module 30 is used to generate a free address resolution protocol message corresponding to the intercommunication cache table entry to be detected when the number of cached address resolution protocol requests is greater than a preset number threshold, and determine whether multiple devices to be detected can be intercommunication through the proxy according to the free address resolution protocol message;
[0120] The proxy mode enabling module 40 is used to enable the target proxy mode when multiple devices to be detected can communicate with each other through a proxy.
[0121] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0122] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0123] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0124] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0125] Obtaining a cache entry for intercommunication to be detected in the cache table of intercommunication between hosts to be detected;
[0126] Determine the number of cache address resolution protocol requests corresponding to each intercommunication cache entry to be detected within the intercommunication detection cycle time;
[0127] When the number of cached address resolution protocol requests is greater than a preset number threshold, a free address resolution protocol message corresponding to the intercommunication cache entry to be detected is generated, and whether multiple devices to be detected can communicate with each other through a proxy is determined according to the free address resolution protocol message;
[0128] When multiple devices to be detected can communicate with each other through proxies, enable target proxy mode.
[0129] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0130] In addition, in combination with the network transmission method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the network transmission methods in the above embodiment is implemented.
[0131] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0133] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A network transmission method, characterized in that: The method is applied to a proxy device and comprises the following steps: Obtaining a cache entry for intercommunication to be detected in the cache table of intercommunication between hosts to be detected; Determine the number of cache address resolution protocol requests corresponding to each of the intercommunication cache entries to be detected within the intercommunication detection cycle time; In the case where the number of cached address resolution protocol requests is greater than a preset number threshold, generating a first free address resolution protocol message and a second free address resolution protocol message; Sending the first free address resolution protocol message to the first device to be detected to determine whether a first address resolution protocol response message sent by the first device to be detected is received; Sending the second free address resolution protocol message to the second device to be detected to determine whether a second address resolution protocol response message sent by the second device to be detected is received; Upon receiving the first address resolution protocol response message and the second address resolution protocol response message, determining that the first device to be detected and the second device to be detected can communicate with each other through a proxy; In the case that the multiple devices to be detected can communicate with each other through a proxy, the target proxy mode is enabled.
2. The network transmission method according to claim 1, characterized in that: The step of obtaining the cache entry of the intercommunication to be detected in the cache table of the host intercommunication to be detected comprises: Obtain a first intercommunication cache table entry in the intercommunication cache table of the host to be detected, and determine a cache table entry duration corresponding to each of the first intercommunication cache table entries; Determine the first intercommunication cache entry whose corresponding cache entry duration is less than a preset aging duration as a second intercommunication cache entry; The entry state information corresponding to the second intercommunication cache entry is obtained, and the second intercommunication cache entry corresponding to the entry state information of which is in a to-be-detected state is determined as the to-be-detected intercommunication cache entry.
3. The network transmission method according to claim 2, characterized in that: After obtaining the first intercommunication cache table entry in the host intercommunication cache table to be detected and determining the cache table entry duration corresponding to each of the first intercommunication cache table entries, the method further includes: The first intercommunication cache entry corresponding to the cache entry whose duration is greater than or equal to the preset aging duration is deleted.
4. The network transmission method according to any one of claims 1 to 3, characterized in that: In the case where the plurality of devices to be detected can communicate with each other through a proxy, enabling the target proxy mode includes: When the Internet Protocol addresses of the plurality of devices to be detected are in the same network segment, enabling the local proxy mode; When the Internet Protocol addresses of the multiple devices to be detected are not in the same network segment, the common proxy mode is enabled.
5. The network transmission method according to claim 4, characterized in that: The method further comprises: Acquire a listening address resolution protocol message and an initial host intercommunication cache table, and update the initial host intercommunication cache table according to the listening address resolution protocol message; The updated initial host intercommunication cache table is determined as the host intercommunication cache table to be detected.
6. The network transmission method according to claim 5, characterized in that: The acquiring of the listening address resolution protocol message and the initial host intercommunication cache table, and updating the initial host intercommunication cache table according to the listening address resolution protocol message comprises: In the case where the listening address resolution protocol message is a request address resolution protocol message, determining whether the initial host intercommunication cache table contains a target listening table entry according to a source Internet Protocol address and a destination Internet Protocol address corresponding to the listening address resolution protocol message; In a case where the target monitoring entry is included in the initial host intercommunication cache table, determining the entry state information corresponding to the target monitoring entry as a to-be-detected state; In the case that the initial host intercommunication cache table does not include the target monitoring table entry, the target monitoring table entry is generated in the initial host intercommunication cache table, and the table entry state information corresponding to the target monitoring table entry is determined as a pending detection state.
7. A network transmission device, characterized in that: It includes a detection target acquisition module, a request quantity determination module, a message generation module, a first detection module, a second detection module, an intercommunication judgment module and a proxy mode activation module: The detection target acquisition module is used to obtain the intercommunication cache table entry to be detected in the intercommunication cache table of the host to be detected; The request quantity determination module is used to determine the number of cache address resolution protocol requests corresponding to each of the intercommunication cache entries to be detected within the intercommunication detection cycle time; The message generation module is used to generate a first free address resolution protocol message and a second free address resolution protocol message when the number of cached address resolution protocol requests is greater than a preset number threshold; The first detection module is used to send the first free address resolution protocol message to the first device to be detected to determine whether the first address resolution protocol response message sent by the first device to be detected is received; The second detection module is used to send the second free address resolution protocol message to the second device to be detected to determine whether the second address resolution protocol response message sent by the second device to be detected is received; The intercommunication determination module is used to determine that the first device to be detected and the second device to be detected can communicate with each other through a proxy when the first address resolution protocol response message and the second address resolution protocol response message are received; The proxy mode enabling module is used to enable the target proxy mode when the multiple devices to be detected can communicate with each other through the proxy.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the network transmission method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the network transmission method according to any one of claims 1 to 6 when running.
Citation Information
Patent Citations
ARP agent method and ARP agent device
CN101594375A
Method and system for realizing proxy address resolution protocol (ARP) based on gratuitous ARP
CN102572013A