A routing information generation method, device and electronic equipment
By generating a static routing table in the CPE to record the association between source IP and MAC address, the problem of data transmission failure of devices connected to routers with NAT function disabled or unsupported is solved, and normal data services and user experience are improved under static IP addresses.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-08
- Publication Date
- 2026-04-10
AI Technical Summary
In home or workgroup network scenarios, devices connected to a router that has Network Address Translation (NAT) disabled or does not support NAT cannot perform data services normally, resulting in data transmission failure.
Automatically generate static routing information by creating a static routing table in the CPE to record the association between the source IP address and the MAC address of the downstream device, ensuring that downlink packets can be correctly routed to the target device.
When the source IP address is a static IP address, the CPE can perform data services normally, improve user experience, reduce maintenance costs, and enhance the convenience of network setup and internet access experience.
Smart Images

Figure CN116614434B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method, apparatus and electronic device for generating routing information. Background Technology
[0002] With the rapid development of communication technology, network devices such as routers are commonly configured in homes and workplaces. When static Internet Protocol (IP) services are used in the network setup, data transmission failures often occur. For example, ... Figure 1 As shown, devices connected to router 1 with Network Address Translation (NAT) enabled can perform data services normally, such as dynamic IP services and static IP services. Router 1 can also perform data services with its connected customer premise equipment (CPE). However, for router 2 with NAT disabled or not supported, devices connected to it cannot perform data services normally. The main reason is that when the CPE responds to the downlink packets, it does not know which device to pass the packets to, ultimately causing users to be unable to perform services normally. Summary of the Invention
[0003] This application provides a routing information generation method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can automatically generate routing information related to the source IP address when the source IP address in the uplink packet is a static IP address. This allows the CPE to route the downlink packet to the corresponding device based on the routing information when it receives the downlink packet, ensuring that the CPE can still perform business normally when the source IP address is a static IP address, thus improving the user experience.
[0004] Firstly, this application provides a routing information generation method, which includes: acquiring an uplink packet sent by a downstream device; determining whether the source IP address in the uplink packet is a static IP address; and when the source IP address is a static IP address, generating first routing information, which includes the association between the source IP address and the MAC address of the downstream device, wherein the first routing information is recorded in a static routing table. In this way, when the source IP address in the uplink packet is a static IP address, routing information related to that source IP address can be automatically generated, enabling the CPE to route the downlink packet to the corresponding device based on the routing information when it acquires the downlink packet. This ensures that the CPE can still perform services normally even when the source IP address is a static IP address, improving the user experience. For example, the downstream device can be, but is not limited to, a switch.
[0005] In a possible implementation, the hanging device does not support a network address translation (NAT) function, or the hanging device supports the NAT function but has turned off the NAT function.
[0006] In a possible implementation, the method further includes: obtaining a downlink packet sent by a server; determining whether a destination IP address in the downlink packet exists in the static routing table; and routing the downlink packet to a target hanging device when the destination IP address does not exist in the static routing table, where the MAC address of the target hanging device is a MAC address associated with the target IP address in the static routing table.
[0007] In a possible implementation, before the static IP judging module generates the first routing information, the method further includes: determining that the source IP address does not exist in the static routing table.
[0008] In a possible implementation, the determining whether the source IP address in the uplink packet is a static IP address specifically includes: determining whether the source IP address is a static IP address according to a first indication identifier in the uplink packet, where the first indication identifier is used to indicate whether the source IP address is a static IP address.
[0009] In a second aspect, the present application provides a routing information generation device, which includes: a static IP judging module, configured to obtain an uplink packet sent by a hanging device; the static IP judging module is further configured to determine whether a source IP address in the uplink packet is a static IP address; and a static routing generation module, configured to generate first routing information when the static IP judging module determines that the source IP address is a static IP address, where the first routing information includes an association relationship between the source IP address and a MAC address of the hanging device, and the first routing information is recorded in a static routing table.
[0010] In a possible implementation, the hanging device does not support a network address translation (NAT) function, or the hanging device supports the NAT function but has turned off the NAT function.
[0011] In a possible implementation, the device further includes: a downlink packet static routing module, configured to obtain a downlink packet sent by a server; the downlink packet static routing module is further configured to determine whether a destination IP address in the downlink packet exists in the static routing table; and the downlink packet static routing module is further configured to route the downlink packet to a target hanging device when the destination IP address does not exist in the static routing table, where the MAC address of the target hanging device is a MAC address associated with the target IP address in the static routing table.
[0012] In a possible implementation, before the static routing generation module generates the first routing information, the static IP judging module is further configured to determine that the source IP address does not exist in the static routing table.
[0013] In a possible implementation, the static IP judging module is specifically configured to determine whether the source IP address is a static IP address according to the first indication identifier in the uplink packet, where the first indication identifier is used to indicate whether the source IP address is a static IP address.
[0014] In a third aspect, the present application provides an electronic device, comprising at least one memory for storing a program; at least one processor for executing the program stored in the memory; wherein when the program stored in the memory is executed, the processor is configured to execute the method provided in the first aspect. Exemplarily, the electronic device can be the CPE 100 shown in the first aspect. Figure 3 In a third aspect, the present application provides an electronic device, comprising at least one memory for storing a program; at least one processor for executing the program stored in the memory; wherein when the program stored in the memory is executed, the processor is configured to execute the method provided in the first aspect. Exemplarily, the electronic device can be the CPE 100 shown in the first aspect.
[0015] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and when the computer program runs on an electronic device, the electronic device executes the method provided in the first aspect.
[0016] In a fifth aspect, the present application provides a computer program product, which is characterized in that when the computer program product runs on an electronic device, the electronic device executes the method provided in the first aspect.
[0017] It can be understood that the beneficial effects of the above-mentioned second aspect to the fifth aspect can be referred to the related description in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 is a schematic diagram of a networking scenario provided by an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of a hardware structure of a customer premises equipment CPE provided by an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of a software architecture of a customer premises equipment CPE provided by an embodiment of the present application;
[0022] Figure 5 is a process schematic diagram of an adaptive routing method provided by an embodiment of the present application;
[0023] Figure 6 is a process schematic diagram of a customer premises equipment CPE processing a packet provided by an embodiment of the present application;
[0024] Figure 7This is a schematic diagram of the transmission process when host A sends a message to host B, as provided in an embodiment of this application.
[0025] Figure 8 This is a flowchart illustrating a routing information generation method provided in an embodiment of this application;
[0026] Figure 9 This is a schematic diagram of the structure of a routing information generation device provided in an embodiment of this application. Detailed Implementation
[0027] In this article, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The symbol " / " in this article indicates that the related objects are in an "or" relationship; for example, A / B means A or B.
[0028] The terms "first" and "second," etc., used in the specification and claims herein are used to distinguish different objects, not to describe a specific order of objects. For example, "first response message" and "second response message," etc., are used to distinguish different response messages, not to describe a specific order of response messages.
[0029] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0030] In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, for example, multiple processing units means two or more processing units, multiple elements means two or more elements, etc.
[0031] For example, Figure 2 This illustrates an application scenario. For example... Figure 2 As shown, the user front-end device CPE100 is connected to the switch 200, and the switch 200 is connected to the terminal device 300.
[0032] CPE100 is a device that directly connects to the operator's network, including but not limited to telephones, wireless routers, firewalls, computers, optical modems, 4G to WiFi wireless routers, etc.
[0033] Switch 200 is a network device for electric (optical) signal forwarding, which can connect multiple Ethernet physical segments, isolate conflict domains, perform high-speed and transparent switching forwarding on Ethernet frames, and learn and maintain media access control address (MAC address) information automatically, etc. The switch 200 does not support network address translation (NAT), or it supports NAT but has closed the NAT function. Exemplarily, the switch 200 can be a layer 3 switch. Exemplarily, the switch 200 can also be referred to as a lower hanging device of the CPE 100.
[0034] The terminal device 300 can be, but is not limited to, a device used by a user, such as a computer, a printer, etc., and can also be other network devices, which are not limited here. The IP address of the terminal device 300 can be a static IP address. In some embodiments, the static IP address (also referred to as a fixed IP address) is an IP address that is permanently assigned to a computer or network device.
[0035] Continuing to refer to Figure 2 Since the IP address of the terminal device 300 is a static IP address, and the switch 200 does not support the NAT function or has closed the NAT function, the CPE 100 is not clear about which device to deliver the message to when responding to the routing message, resulting in interruption of data services.
[0036] To solve the problem that the CPE 100 cannot perform data services in the scenario shown in Figure 2 Embodiments of the present application provide a self-adaptive routing method. In this method, the CPE can generate a static routing table when it is determined that the source IP address is a static IP address during transmission of the uplink message of the terminal device. The static routing table can include the association between the source IP address and the MAC address of the lower hanging device of the CPE. Then, the CPE can find the MAC address of the next hop device based on the destination IP address in the downlink message related to the uplink message, so as to automatically route the downlink message to the device corresponding to the destination IP address and the found MAC address, and then transmit the downlink message to the terminal device. Thus, when the IP address of the terminal device is a static IP address, the CPE device can also normally perform data service transmission.
[0037] Exemplarily, Figure 3 A hardware structure of a user front-end device CPE is shown. As Figure 3As shown, the CPE 100 can include a processor 110, a memory 120, and a communication interface 130. The processor 110, the memory 120, and the communication interface 130 can be connected through a communication bus, but are not limited thereto. For example, the communication bus can be an address bus, a data bus, a control bus, or the like.
[0038] The processor 110 can include one or more processing units. For example, the processor 110 can include one or more of an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, a neural-network processing unit (NPU), or the like. In some embodiments, the CPE 100 can include one or more processors 110. Different processing units can be independent devices or integrated in one or more processors. For example, the processor 110 can be configured to generate a static routing table.
[0039] The memory 120 can store programs that can be executed by the processor 110, so that the processor 110 performs the method provided by the present application. The memory 120 can also store data. The processor 110 can read the data stored in the memory 120 (for example, a static routing table generated by the CPE, etc.). The memory 120 and the processor 110 can be separately arranged. Alternatively, the memory 120 can also be integrated in the processor 110.
[0040] The communication interface 130 can be a transceiver or the like, which is configured to enable the CPE 100 to communicate with other devices or communication networks. For example, the communication interface 130 can include a wired communication interface and a wireless communication interface. The wired communication interface can be a wireless local area network interface, a cellular network communication interface, or a combination thereof. For example, the communication interface 130 can be configured to transmit uplink / downlink packets.
[0041] It can be understood that the embodiments Figure 3 The illustrated results do not constitute a specific limitation on the CPE 100. In other embodiments, the CPE 100 can include more or fewer components than those shown, or combine certain components, or split certain components, etc. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
[0042] For example,Figure 4 A software architecture of a user-premises equipment (CPE) is shown. As Figure 4 shown, the software architecture of the CPE 100 mainly includes an IP address judging module 41, a static route table generating module 42, and a downlink message static route module 43. The IP address judging module 41 is mainly used to judge whether a source IP address used in an uplink message transmission process is a static IP address. When the CPE 100 is working, the IP address judging module 41 can judge whether a source IP of a current uplink transmission message is a static IP address. The static route table generating module 42 is mainly used to automatically generate a static route table for a message with a static IP address. The downlink message static route module 43 is mainly used to, after sending out an uplink message, search a static route table generated by the static route table generating module 42, and automatically route a downlink message to a terminal device with a corresponding IP and MAC address.
[0043] Next, based on the above description, an adaptive routing method provided in the embodiments of the present application is introduced.
[0044] Exemplarily, Figure 5 An adaptive routing method is shown. As Figure 5 shown, the adaptive routing method can include the following steps:
[0045] S501, the IP address judging module 41 in the CPE 100 acquires an uplink message.
[0046] Specifically, a message transmitted by a device hung below the CPE 100 to the CPE 100 can be first transmitted to the IP address judging module 41 in the CPE 100. Exemplarily, the uplink message can be understood as a message in an uplink. Exemplarily, continuing to refer to Figure 2 , an uplink message transmitted by the terminal device 300 can be transmitted to the CPE 100 through the switch 200, so that the CPE 100 can acquire the uplink message. In some embodiments, the uplink message can include a source IP address and a destination IP address, wherein the source IP address can be understood as an IP address of a device generating the uplink message, such as an IP address of the terminal device 300, and the destination IP address is an IP address of a device to which data sent by the terminal device 300 needs to finally arrive.
[0047] S502, the IP address judging module 41 judges whether the source IP address in the uplink message is a static IP.
[0048] Specifically, after acquiring the uplink message, the IP address judging module 41 can judge whether the source IP address in the uplink message is a static IP. When it is a static IP address, S503 is executed, otherwise, S506 is executed.
[0049] In some embodiments, the IP address judging module 41 can judge whether the source IP in the uplink message is assigned by the CPE 100. When the source IP is not assigned by the CPE 100, it can be judged that the source IP is a static IP. In addition, when the uplink message contains an indication identifier indicating whether the source IP is a static IP, the IP address judging module 41 can also determine whether the source IP is a static IP according to the indication identifier.
[0050] S503, the IP address judging module 41 informs the static route generating module 42 that the source IP is a static IP.
[0051] Specifically, when it is judged that the source IP is a static IP, the IP address judging module 41 informs the static route generating module 42 that the source IP is a static IP.
[0052] S504, the static route generating module 42 generates a static route table by combining the source IP and the MAC address of the device connected to the CPE 100.
[0053] Specifically, after the static route generating module 42 receives the message sent by the IP address judging module 41, it can associate the source IP and the MAC address of the device connected to the CPE 100 to generate a static route table. In this way, the static route table is generated.
[0054] S505, the static route generating module 42 sends the uplink message to the server.
[0055] Specifically, after the static route generating module 42 generates the static route table, it can send the uplink message to the server. Exemplarily, the server can be understood as a server corresponding to the service associated with the uplink message.
[0056] S506, the IP address judging module 41 sends the uplink message to the server.
[0057] Specifically, when it is judged that the source IP is not a static IP, the IP address judging module 41 directly sends the uplink message to the server.
[0058] S507, the server sends a downlink message to the downlink message static route module 43 in the CPE 100 in response to the uplink message.
[0059] Specifically, after the server receives the uplink message, it can send a downlink message to the downlink message static route module 43 in the CPE 100 in response to the uplink message.
[0060] S508, the downlink message static route module 43 searches the static route table generated by the static route generating module 42.
[0061] Specifically, the downlink packet static routing module 43 looks up the static routing table generated by the static routing generation module 42 to determine the MAC address associated with the destination IP address in the downlink packet.
[0062] S509, the downlink packet static routing module 43 sends the downlink packet to the device under the corresponding MAC address associated with the destination IP address in the downlink packet.
[0063] Specifically, after the downlink packet static routing module 43 finds the MAC address associated with the destination IP address in the downlink packet, the corresponding device under the MAC address can be known, and then the downlink packet can be sent to the device under the MAC address, and the downlink packet can be forwarded to the device corresponding to the destination IP address by the device under the MAC address.
[0064] It can be understood that when the downlink packet static routing module 43 does not find the MAC address associated with the destination IP address in the downlink packet in the static routing table, the downlink packet static routing module 43 can process the downlink packet in a dynamic routing manner. It can be understood that whether the downlink packet static routing module 43 first looks up the static routing table or first uses the dynamic routing manner to process, it can be determined according to actual conditions, which is not limited here.
[0065] In this way, when the source IP address of the uplink packet is a static IP address, the CPE 100 can generate a static routing table, and when sending a downlink packet, the MAC address associated with the destination IP address in the downlink packet can be found from the static routing table, so that the downlink packet can be sent to the device under the corresponding MAC address, and then the forwarding of the downlink data is realized, so that when the device under the CPE does not support the NAT function or the NAT function is closed, the CPE can also normally transmit the downlink data. Thus, it is avoided that the CPE does not know which device to deliver the packet to when the device under the CPE closes the NAT function or does not support the NAT function, and ultimately leads to the situation that the user cannot normally use the service due to the network configuration. In addition, by automatically generating the static routing table, the user can also ensure smooth service configuration without self-setting, improve the convenience of user networking and online experience, and reduce the current network public opinion problem. Moreover, when the user networking environment of the current network is complex and manual configuration is required when a problem occurs, the maintenance cost can also be reduced by using the scheme.
[0066] For ease of understanding, the processes of the CPE in processing the uplink (UL) and downlink (DL) packets are described by way of example.
[0067] For example, as shown in FIG. 4, when the CPE 100 receives a downlink packet, the downlink packet static routing module 43 in the CPE 100 first looks up the static routing table to determine the MAC address associated with the destination IP address in the downlink packet. Figure 6As shown, after the CPE is powered on and working normally, when the CPE detects an IP packet, it determines whether the current packet is an uplink UL or a downlink DL.
[0068] If the received IP packet is an uplink packet, it is necessary to determine whether the source IP address of the current IP packet is a static IP address. If the source IP address is a static IP address, it is checked whether the current static routing table contains information about the source IP address and the MAC address associated with it. If this information is not found, the source IP address of the current packet and the MAC address of the device connected to the CPE are recorded in the static routing table; otherwise, no action is taken. If the source IP address is a dynamic IP address, no action is taken.
[0069] If the received IP packet is a downlink packet, it is necessary to determine whether the destination IP address of the current IP packet is in the static routing list. If the destination IP address of the current IP packet is in the static routing list, the packet is routed to the corresponding downstream device according to the static routing table information. If the destination IP address of the current IP packet is not in the static routing list, it is forwarded according to the product's default dynamic routing list information.
[0070] For example, Figure 7 This illustrates a process where host A transmits a message to host B. For example... Figure 7As shown, the host A, the switch, the CPE and the host B form a network. When the host A sends a packet to the host B, the source IP address in the IP packet sent by the host A is its own IP address, and the destination IP address is the IP address of the host B. When transmitting, it can generate a data frame with its own MAC address and the MAC address of the switch, encapsulate the IP packet to be sent in the data area of the data frame, and then send the data frame to the switch. After the switch obtains the data frame, it can parse the IP packet in the data frame, then generate a data frame with its own MAC address and the MAC address of the CPE, encapsulate the IP packet in the data area of the data frame, and then send the data frame to the CPE. After the CPE obtains the data frame, it can parse the IP packet in the data frame, then generate a data frame with its own MAC address and the MAC address of the host B, encapsulate the IP packet in the data area of the data frame, and then send the data frame to the host B. In this way, the host B obtains the IP packet sent by the host A. Wherein, after the CPE obtains the data frame sent by the switch, if the source IP address in the IP packet is a static IP, the CPE constructs the association relationship between the source IP address and the MAC address of the switch, and then generates a static routing table. In this way, when the CPE obtains the IP packet sent by the host B to the host A, it can find the MAC address of the switch from the static routing table according to the destination IP address (i.e. the IP address of the host A) in the IP packet, and then send the IP packet to the switch and to the host A by the switch. Thus, when the switch does not support or closes the NAT function, the CPE can also determine which device it needs to send the downlink packet to when obtaining the downlink packet, so that the data service can proceed smoothly.
[0071] Next, based on the adaptive routing method described above, a routing information generation method provided by an embodiment of the present application is introduced. It can be understood that this method is based on the adaptive routing method described above, and part or all of the contents in this method can be referred to the description of the adaptive routing method above.
[0072] Please refer to Figure 8 , Figure 8 is a flowchart of a routing information generation method provided by an embodiment of the present application. It can be understood that this method can be executed by any device, equipment, platform, device cluster with computing and processing capability, such as the CPE described above. For ease of description, the following describes the CPE described above as an example, as shown in Figure 8 The routing information generation method includes:
[0073] At S801, the CPE can acquire the uplink packet sent by the lower-attached device. Wherein, the lower-attached device of the CPE can send the uplink packet (i.e. the packet in uplink) to the CPE, so that the CPE can acquire the uplink packet sent by the lower-attached device. In some embodiments, continuing to refer to Figure 2 The lower-attached device can be, but is not limited to, the switch 200. For example, the lower-attached device can not support the network address translation (NAT) function, or the lower-attached device supports the NAT function but has closed the NAT function.
[0074] At S802, the CPE determines whether the source IP address in the uplink packet is a static IP address. Wherein, the CPE can determine whether the source IP address in the uplink packet is a static IP address. For example, it can determine whether the source IP address is a static IP address according to the first indication identifier in the uplink packet, wherein the first indication identifier is used to indicate whether the source IP address is a static IP address. In addition, the CPE can also determine whether the source IP address is assigned by itself, and when it is not assigned by itself, it can determine that the source IP address is a static IP address.
[0075] At S803, when the source IP address is a static IP address, the CPE generates first routing information, and the first routing information includes the association relationship between the source IP address and the MAC address of the lower-attached device, wherein the first routing information is recorded in the static routing table. Wherein, when the CPE determines that the source IP address is a static IP address, it can generate the first routing information including the association relationship between the source IP address and the MAC address of the lower-attached device, wherein the first routing information can be recorded in the static routing table.
[0076] In this way, when the source IP address of the uplink packet is a static IP address, the CPE can generate the routing information related to the source IP address and record the routing information in the static routing table, so that the MAC address associated with the destination IP address in the downlink packet can be found from the static routing table when the downlink packet is sent, and then the downlink packet is sent to the lower-attached device corresponding to the MAC address, realizing the forwarding of the downlink data, so that the CPE can also normally transmit the downlink data when the lower-attached device of the CPE does not support the NAT function or closes the NAT function. Thus, it is avoided that the CPE is unclear about which device to deliver the packet to when the lower-attached device of the CPE closes the NAT function or does not support the NAT function, and finally leads to the situation that the user cannot normally use the service due to the network configuration.
[0077] In some embodiments, after obtaining the downlink packet sent by the server, the CPE can determine whether the destination IP address in the downlink packet exists in the static routing table, and route the downlink packet to a target device under hanging when the destination IP address exists in the static routing table or not, wherein the MAC address of the target device under hanging is the MAC address associated with the target IP address in the static routing table. In this way, the downlink packet forwarding can be realized by the static routing table, so that the CPE can also normally transmit downlink data when the device under hanging of the CPE does not support or closes the NAT function.
[0078] In some embodiments, before generating the first routing information, it can also be determined that the source IP address does not exist in the static routing table. In this way, the routing information associated with the source IP address can be avoided from being repeatedly generated.
[0079] Based on the method in the above embodiments, the embodiments of the present application provide a routing information generation device. Please refer to Figure 9 , Figure 9 is a structural schematic diagram of a routing information generation device provided by the embodiments of the present application. As shown in Figure 9 , the routing information generation device 900 comprises: a static IP judgment module 901, configured to obtain an uplink packet sent by a device under hanging; the static IP judgment module 901 is further configured to determine whether the source IP address in the uplink packet is a static IP address; a static routing generation module 902, configured to generate first routing information when the static IP judgment module 901 determines that the source IP address is a static IP address, the first routing information comprising an association relationship between the source IP address and the MAC address of the device under hanging, wherein the first routing information is recorded in a static routing table.
[0080] In some embodiments, the device under hanging does not support the network address translation (NAT) function, or the device under hanging supports the NAT function but has closed the NAT function.
[0081] In some embodiments, the device further comprises: a downlink packet static routing module (not shown in the figure), configured to obtain a downlink packet sent by a server; the downlink packet static routing module is further configured to determine whether the destination IP address in the downlink packet exists in the static routing table; the downlink packet static routing module is further configured to route the downlink packet to a target device under hanging when the destination IP address exists in the static routing table or not, wherein the MAC address of the target device under hanging is the MAC address associated with the target IP address in the static routing table.
[0082] In some embodiments, before the static routing generation module 902 generates the first routing information, the static IP judgment module 901 is further configured to determine that the source IP address does not exist in the static routing table.
[0083] In some embodiments, the static IP judging module 901 is specifically configured to determine whether the source IP address is a static IP address according to the first indication identifier in the uplink packet, wherein the first indication identifier is used to indicate whether the source IP address is a static IP address.
[0084] It should be understood that the above apparatus is used to execute the method in the above embodiments, and the corresponding program modules in the apparatus have similar implementation principles and technical effects to those described in the above method, and the working process of the apparatus can refer to the corresponding process in the above method, which will not be described here.
[0085] It can be understood that the processor in the embodiments of the present application can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor.
[0086] The method steps in the embodiments of the present application can be realized in the form of hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), a register, a hard disk, a mobile hard disk, a CD-ROM or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC.
[0087] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in or transmitted by a computer readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)) and the like.
[0088] It can be understood that various numerical numbers involved in the embodiments of the present application are only distinguished for convenience of description, and are not used to limit the scope of the embodiments of the present application.
Claims
1. A method of generating routing information, characterized by, The method comprises: obtaining an uplink message sent by a hung device, the hung device not supporting a network address translation (NAT) function or the hung device supporting the NAT function but having closed the NAT function; judging whether a source IP address in the uplink message is a static IP address; when the source IP address is a static IP address, generating first routing information and sending the uplink message to a server, the first routing information comprising an association between the source IP address and a MAC address of the hung device, wherein the first routing information is recorded in a static routing table; obtaining a downlink message sent by the server; judging whether a destination IP address in the downlink message exists in the static routing table; when the destination IP address exists in the static routing table, routing the downlink message to a target hung device, wherein the MAC address of the target hung device is a MAC address associated with the destination IP address in the static routing table.
2. The method of claim 1, wherein, Before the first routing information is generated, the method further comprises: determining that the source IP address does not exist in the static routing table.
3. The method according to any of claims 1-2, characterized by, The judgment of whether the source IP address in the uplink message is a static IP address specifically comprises: determining whether the source IP address is a static IP address according to a first indication identifier in the uplink message, wherein the first indication identifier is used to indicate whether the source IP address is a static IP address.
4. A routing information generating apparatus characterized by comprising: The device comprises: a static IP judgment module, configured to obtain an uplink message sent by a hung device, the hung device not supporting a network address translation (NAT) function or the hung device supporting the NAT function but having closed the NAT function; the static IP judgment module is further configured to judge whether a source IP address in the uplink message is a static IP address; a static routing generation module, configured to, when the static IP judgment module judges that the source IP address is a static IP address, generate first routing information and send the uplink message to a server, the first routing information comprising an association between the source IP address and a MAC address of the hung device, wherein the first routing information is recorded in a static routing table; a downlink message static routing module, configured to obtain a downlink message sent by the server; the downlink message static routing module is further configured to judge whether a destination IP address in the downlink message exists in the static routing table; the downlink message static routing module is further configured to, when the destination IP address exists in the static routing table, route the downlink message to a target hung device, wherein the MAC address of the target hung device is a MAC address associated with the destination IP address in the static routing table.
5. The apparatus of claim 4, wherein, Before the static routing generation module generates the first routing information, the static IP judgment module is further configured to determine that the source IP address does not exist in the static routing table.
6. The apparatus of any of claims 4-5, wherein, The static IP judgment module is specifically configured to: According to the first indication in the uplink packet, it is determined whether the source IP address is a static IP address, wherein the first indication is used to indicate whether the source IP address is a static IP address.
7. An electronic device, comprising: Comprising at least one memory for storing a program; at least one processor for executing the program stored in the memory; wherein when the program stored in the memory is executed, the processor is configured to perform the method of any one of claims 1-3.
8. A computer readable storage medium, the computer readable storage medium storing a computer program, when the computer program is run on an electronic device, the computer program causes the electronic device to perform the method of any one of claims 1-3.
9. A computer program product, characterised in that, When the computer program product is run on an electronic device, the computer program product causes the electronic device to perform the method of any one of claims 1-3.
Citation Information
Patent Citations
ARP table updating method and device
CN113810511A