US20230336472A1 - Method and electronic device for saving power applied to a router - Google Patents
Method and electronic device for saving power applied to a router Download PDFInfo
- Publication number
- US20230336472A1 US20230336472A1 US17/724,043 US202217724043A US2023336472A1 US 20230336472 A1 US20230336472 A1 US 20230336472A1 US 202217724043 A US202217724043 A US 202217724043A US 2023336472 A1 US2023336472 A1 US 2023336472A1
- Authority
- US
- United States
- Prior art keywords
- nat
- routing rule
- software
- hardware
- routing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 30
- 230000006870 function Effects 0.000 description 37
- 230000003247 decreasing effect Effects 0.000 description 6
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/56—Routing software
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/14—Routing performance; Theoretical aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/2514—Translation of Internet protocol [IP] addresses between local and global IP addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/255—Maintenance or indexing of mapping tables
- H04L61/2553—Binding renewal aspects, e.g. using keep-alive messages
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/256—NAT traversal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/143—Termination or inactivation of sessions, e.g. event-controlled end of session
- H04L67/145—Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Definitions
- the present invention is related to a method for saving power, and in particular it is related to a method and an electronic device for saving power applied to a router.
- Routers are currently used to translate the IP address of data packets in an Intranet to that of the data packets in an Extranet.
- the router may include an application microcontroller and a hardware network address translator.
- the hardware network address translator offloads Linux Network Stack network address translation (NAT) from the application microcontroller, but needs to send a keep-alive packet every 32 seconds to the application microcontroller, so that the application microcontroller can keep connection tracking with the data packets to remember the link.
- NAT Linux Network Stack network address translation
- the application microcontroller may leave a suspend mode every 32 seconds, causing a rise in power consumption by the router.
- the present invention provides a method of routing data packets for a router.
- the router includes a software network address translator (NAT) and a hardware NAT.
- the method includes routing, by the software NAT, a first data packet based on a routing rule stored in the software NAT, wherein the software NAT has a routing rule removing function to remove the routing rule stored in the software NAT; sending, by the software NAT, the routing rule to the hardware NAT; storing the routing rule, by the hardware NAT, in the hardware NAT; and routing, by the hardware NAT instead of the software NAT, a second data packet based on the routing rule stored in the hardware NAT.
- the routing rule removing function of the software NAT for the routing rule stored in the software NAT is disabled.
- the hardware NAT has the routing rule removing function to remove the routing rule stored in the hardware NAT.
- the routing rule removing function of the hardware NAT for the routing rule stored in the hardware NAT is disabled.
- the hardware NAT has a keep-alive function to send a keep-alive packet periodically to the software NAT.
- the keep-alive function of the hardware NAT for the routing rule stored in the hardware NAT is disabled.
- the step of sending, by the software NAT, the routing rule to the hardware NAT includes: sending, by the software NAT, the routing rule to the hardware NAT based on a threshold number of the data packets relative to the routing rule received by the software NAT from the hardware NAT within a predetermined time.
- the threshold number is an integer between one and five.
- a timeout used for determining whether to remove the routing rule stored in the software NAT is disabled.
- a timeout used for determining whether to remove the routing rule stored in the software NAT is set to be its maximum value.
- the present invention also provides an electronic device.
- the electronic device includes a software network address translator (NAT) and a hardware NAT.
- the software NAT is configured to route a first data packet based on a routing rule stored in the software NAT, and send out the routing rule.
- the software NAT has a routing rule removing function to remove the routing rule stored in the software NAT.
- the hardware NAT is configured to receive the routing rule from the software NAT, store the routing rule in the hardware NAT, and route a second data packet based on the routing rule stored in the hardware NAT.
- the routing rule removing function of the software NAT for the routing rule stored in the software NAT is disabled.
- the hardware NAT has the routing rule removing function to remove the routing rule stored in the hardware NAT.
- the routing rule removing function of the hardware NAT for the routing rule stored in the hardware NAT is disabled.
- the hardware NAT has a keep-alive function to send a keep-alive packet periodically to the software NAT.
- the keep-alive function of the hardware NAT for the routing rule stored in the hardware NAT is disabled.
- the software NAT sends the routing rule to the hardware NAT based on a threshold number of the data packets relative to the routing rule received by the software NAT from the hardware NAT within a predetermined time.
- the threshold number is an integer between one and five.
- a timeout used for the software NAT to determine whether to remove the routing rule stored in the software NAT is disabled.
- a timeout used for the software NAT to determine whether to remove the routing rule stored in the software NAT is set to be its maximum value.
- FIG. 1 is a flow chart of a method of routing data packets for a router including a software network address translator (NAT) and a hardware NAT in accordance with some embodiments of the present invention.
- NAT software network address translator
- FIG. 2 is a schematic diagram of an electronic device 200 in accordance with some embodiments of the present invention.
- FIG. 3 is a flow chart of the method in FIG. 1 applied to the electronic device 200 in FIG. 2 in accordance with some embodiments of the present invention.
- FIG. 1 is a flow chart of a method of routing data packets for a router including a software network address translator (NAT) and a hardware NAT in accordance with some embodiments of the present invention.
- the hardware NAT receives data packets relative to a routing rule, and passes the data packets to the software NAT based on the routing rule.
- the routing rule may include the source that the data packets come from, the destination that the data packets send to, and the types of the data packets. In some embodiments, if two groups of data packets have different sources, different destination or different types, the two groups are relative to different routing rules.
- the hardware NAT may check whether the routing rule has been recorded in a connection table in the hardware NAT. If yes, the hardware NAT directly sends the data packets to the corresponding destination. If no, the hardware NAT passes the data packets to the software NAT.
- the hardware NAT has a routing rule removing function to remove the routing rule stored in the hardware NAT. In some embodiments, the hardware NAT determines whether to remove the routing rule stored in it-self based on a timeout in the hardware NAT.
- the software NAT determines whether to send the routing rule to the hardware network address translator based on a threshold number of the data packets relative to the routing rule received by the software NAT from the hardware NAT within a predetermined time.
- the threshold number is an integer between one and five.
- the software NAT stores the routing rule in a connection table itself and has a routing rule removing function to remove the routing rule stored in the software NAT originally.
- the software NAT determines whether to remove the routing rule stored in it-self based on a timeout in the software NAT.
- the method of the present invention includes routing, by the software NAT, a first data packet based on a routing rule stored in the software NAT, the software NAT has a routing rule removing function to remove the routing rule stored in the software NAT, the routing rule removing function of the software NAT for the routing rule stored in the software NAT is disabled (step S 100 ); sending, by the software NAT, the routing rule to the hardware NAT (step S 102 ); storing the routing rule, by the hardware NAT, in the hardware NAT (step S 104 ); and routing, by the hardware NAT instead of the software NAT, a second data packet based on the routing rule stored in the hardware NAT (step S 106 ).
- the software NAT routes a data packet based on a routing rule stored in the software NAT.
- the routing rule is stored in a connection table in the software NAT.
- the connection table is present in a memory of the software NAT.
- the software NAT may be an application microcontroller, but the present invention is not limited thereto.
- the software NAT has a routing rule removing function to remove the routing rule stored in the software NAT. In the routing rule removing function, a timeout (set in the software NAT) is used for software NAT to determine whether to remove the routing rule stored in the software NAT.
- the software NAT may remove the routing rule.
- the routing rule removing function of the software NAT for the routing rule stored in the software NAT is disabled. Therefore, even if the time period that the software NAT does not receive any data packet relative to the routing rule is longer than the timeout, the software NAT may not remove the routing rule, thereby saving the computing resource of the software NAT. That is, the software NAT is unnecessary to prepare (for example, search from communication commands between user ends) the routing rule for the received data packet relative to the same routing rule again, because the routing rule is still stored in the software NAT.
- the timeout used for the software NAT to determine whether to remove the routing rule stored in the software NAT is set to be its maximum value (for example, 65535). In some embodiments, the timeout used for the software NAT to determine whether to remove the routing rule stored in the software NAT is disabled.
- the software NAT sends the routing rule to the hardware routing rule.
- the software NAT sends the routing rule to the hardware NAT based on a threshold number of the data packets relative to the routing rule received by the software NAT from the hardware NAT within a predetermined time.
- the threshold number may be an integer between 1 and 5. The less the threshold number (or called threshold number) of the data packets is set, the software NAT is easier to send the routing rule to the hardware NAT. For example, if the threshold number of the data packets is set as 1, once the software NAT receives one data packet (for example, per second) relative to the routing rule passed from the hardware NAT, the software NAT may send the routing rule to the hardware NAT.
- the software NAT may send the routing rule to the hardware NAT. However, once the software NAT receives 4 data packets (for example, per second) relative to the routing rule passed from the hardware NAT, the software NAT may not send the updated routing rule to the hardware NAT. In some embodiments, the NAT capability of the hardware NAT is much better than that of the software NAT.
- the hardware NAT stores the routing rule in the hardware NAT.
- the routing rule is stored in a connection table in the hardware NAT.
- the hardware NAT has a routing rule removing function.
- a timeout (set in the hardware NAT) is used for hardware NAT to determine whether to remove the routing rule stored in the hardware NAT. For example, originally, if the time period that the hardware NAT does not receive any data packet relative to the routing rule is longer than the timeout, the hardware NAT may remove the routing rule. However, in some embodiments of the present invention, the routing rule removing function of the hardware NAT for the routing rule stored in the hardware NAT is disabled. Therefore, even if the time period that the hardware NAT does not receive any data packet relative to the routing rule is longer than the timeout, the hardware NAT may not remove the routing rule.
- the timeout used for the hardware NAT to determine whether to remove the routing rule stored in the hardware NAT is set to be its maximum value (for example, 65535). In some embodiments, the timeout used for the hardware NAT to determine whether to remove the routing rule stored in the hardware NAT is disabled.
- the hardware NAT has a keep-alive function to send a keep-alive packet periodically to the software NAT.
- the keep-alive function of the hardware NAT for the routing rule stored in the hardware NAT is disabled, so that the software NAT may not be wakeup in a suspend mode by receiving the keep-alive packet from the hardware NAT.
- the software NAT enters the suspend mode if there are no wakeup events.
- the wakeup events may include receiving other data packets relative to other routing rules; receiving the event that a USB device is installed in the router; or receiving the event that the power key of the router has been pressed.
- the software NAT enters the suspend mode for saving power consumption of the router, the hardware network address translator is still working for NAT, so that the router can remain normal operation.
- FIG. 2 is a schematic diagram of an electronic device 200 in accordance with some embodiments of the present invention.
- the electronic device 200 is a router, but the present invention is not limited thereto.
- the electronic device 200 includes a hardware NAT 202 and a software NAT 204 .
- the hardware NAT 202 is configured to receive data packets relative to a routing rule from Wi-Fi 214 , Ethernet 216 or a modem 218 , and translate an IP address of the data packets in Intranet (such as Wi-Fi 214 and Ethernet 216 ) to that of the data packets in Extranet (such as the modem 218 and a network 219 ).
- the hardware NAT 202 is configured to translate an IP address of data packets in Wi-Fi 214 to that of the data packets in the network 219 through links 224 and 228 and a modem 218 .
- the hardware NAT 202 is configured to translate an IP address of data packets in Ethernet 216 to that of the data packets in the network 219 through the links 226 and 228 and the modem 218 .
- the hardware NAT 202 After receiving the data packets relative to the routing rule, if the routing rule has been recorded in the connection table in the hardware NAT 202 , the hardware NAT 202 directly sends the data packets to the corresponding destination, for example, Wi-Fi 214 , Ethernet 216 or the modem 218 . If the routing rule has not been recorded in the second connection table in the hardware NAT 202 , the hardware NAT 202 passes the data packets to the software NAT 204 through a link 222 .
- a driver 210 and a connection tracker 212 are executed by the software NAT 204 .
- the driver 210 includes the program code for the operation of the software NAT 204 , and the threshold number of the data packets relative to the routing rule for the software NAT 204 to determine whether to send the routing rule to the hardware NAT 202 .
- the connection tracker 212 is able to control the routing rule removing function to remove the routing rule stored in the software NAT 204 .
- the method of present invention sets the threshold number of data packets as 1 to 5 per second by changing the setting in the driver 210 .
- the method of present invention enables or disables the timeout for the routing rule removing function in the software NAT 204 and hardware NAT 202 by changing the setting in the driver 210 . In some embodiments, the method of present invention enables or disables the routing rule removing function in the software NAT 204 by changing the setting in the connection tracker 212 . In some embodiments, the software NAT 204 sends the routing rule to the hardware NAT 202 through a link 220 .
- FIG. 3 is a flow chart of the method in FIG. 1 applied to the electronic device 200 in FIG. 2 in accordance with some embodiments of the present invention.
- the software NAT 204 first receives data packets relative to a routing rule passed from the hardware NAT 202 , and routes the data packets based on the routing rule (step S 100 in FIG. 1 ).
- the routing rule has been stored in the connection table in the software NAT 204 .
- the software NAT 204 has a routing rule removing function to remove the routing rule. As shown in FIG.
- the software NAT 204 executes the driver 210 to set the threshold number of data packets that the software NAT 204 determines to send the routing rule to the hardware NAT 202 as 1 to 5 per second( in the block 300 )(step S 102 in FIG. 1 ). After that, the software NAT 204 executes the driver 210 to send the routing rule to the hardware NAT 202 through a command 302 . In some embodiments, the software NAT 204 further executes the driver 210 to disable the periodical transmission of a keep-alive packet from the hardware NAT 202 (that is, the keep-alive function in hardware NAT 202 ) to the software NAT 204 through a command 304 .
- the software NAT 204 executes the driver 210 to send the command 304 to the hardware NAT 202 , so that the hardware NAT 202 disables its routing rule removing function based on the command 304 .
- the software NAT 204 executes the driver 210 to disable the routing rule removing function in the software NAT 204 by sending a command 306 to the connection tracker 212 , so that the connection tracker 212 may disable the routing rule removing function in the software NAT 204 . That is, the connection tracker 212 is able to disable the timeout for determining whether to remove the routing rule stored in the software NAT 204 according to the command 306 .
- the hardware NAT 202 After the hardware NAT 202 receives the routing rule from the software NAT 204 through the command 302 , the hardware NAT 202 stores the routing rule in the connection table in the hardware NAT 202 , and is able to translate an IP address of data packets 350 in the Wi-Fi 214 to that of the data packets 350 in the network 219 , and sends the data packets 350 to the network 219 through the modem 218 . Similarly, the hardware NAT 202 is able to translate an IP address of data packets 352 in the network 219 to that of the data packets 352 in the Wi-Fi 214 , and sends the data packets 352 to the Wi-Fi 214 through the modem 218 .
- the software NAT 204 when there are no other data packets received by the software NAT 204 (in the block 308 ) from the hardware NAT 202 , the software NAT 204 is able to enter a suspend mode (in the block 310 ). In some embodiments, the software NAT 204 enters the suspend mode if there is no wakeup events.
- the wakeup events may include receiving other data packets relative to other routing rules; receiving the event that a USB device is installed in the router; or receiving the event that the power key of the router has been pressed, but the present invention is not limited thereto.
- the hardware NAT 202 is still able to translate an IP address of data packets 354 and 356 in the Wi-Fi 214 to that of the data packets 354 and 356 in the network 219 , and sends the data packets 354 and 356 to the network 219 through the modem 218 , because the routing rules relative to the data packets 354 and 356 are still present in the hardware NAT 202 .
- the software NAT 204 suffers a wakeup event (in the block 312 ), so that the software NAT 204 leaves the suspend mode (in the block 314 ).
- the software NAT 204 executes the driver 210 to update the connection table based on newly received data packets from the hardware NAT 202 relative to other routing rules through a command 322 .
- the routing rule removing function of the hardware NAT 202 Since the routing rule removing function of the hardware NAT 202 is disabled, the number of routing rules stored in the hardware NAT 202 may not decreased, thereby decreasing the possibility for the hardware NAT 202 to pass the data packets to the software NAT 204 , and the possibility for the software NAT 204 to leave the suspend mode is also decreased. Similarly, the keep-alive function of the hardware NAT 202 is disabled, the hardware NAT 202 may not send the keep-alive packet periodically to the software NAT 204 , thereby also decreasing the probability for the software NAT 204 to leave the suspend mode.
- the routing rule removing function of the software NAT 202 since the routing rule removing function of the software NAT 202 is disabled, the number of routing rules stored in the software NAT 204 may not decreased, thereby decreasing the probability of facing new routing rule that has not stored in the software NAT 204 . That is, the software NAT 204 is unnecessary to prepare (for example, search from communication commands between user ends) the routing rule for the received data packet relative to the same routing rule again.
- the method of routing data packets and the electronic device of the present invention can achieve the technical effect of saving power.
- the method and the electronic device of the present invention may let the application microcontroller remain in the suspend mode when the data packets is transmitted by the hardware network address translator. That is, all data packets are stored in the second connection table in the hardware network address translator. The connection timeouts in the both application microcontroller and hardware network address translator are both disabled. The application microcontroller enters the suspend mode for saving power.
- the disclosed system, device, and method can be implemented using other methods.
- the device embodiments described above are merely illustrative, for example, the division of units is only a logical function division, and there may be other divisions in actual implementation. For example, multiple units or elements can be combined or integrated into another system, or some features may be omitted or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communicative connecting may be indirect coupling or communicatively connecting through some interfaces, device or units, and may be in electrical, mechanical, or other forms.
- the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit can be realized either in the form of hardware or in the form of a software functional unit.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
- The present invention is related to a method for saving power, and in particular it is related to a method and an electronic device for saving power applied to a router.
- Routers are currently used to translate the IP address of data packets in an Intranet to that of the data packets in an Extranet. The router may include an application microcontroller and a hardware network address translator. The hardware network address translator offloads Linux Network Stack network address translation (NAT) from the application microcontroller, but needs to send a keep-alive packet every 32 seconds to the application microcontroller, so that the application microcontroller can keep connection tracking with the data packets to remember the link.
- However, due to the keep-alive packet being sent every 32 seconds, the application microcontroller may leave a suspend mode every 32 seconds, causing a rise in power consumption by the router.
- In order to resolve the issue described above, the present invention provides a method of routing data packets for a router. The router includes a software network address translator (NAT) and a hardware NAT. The method includes routing, by the software NAT, a first data packet based on a routing rule stored in the software NAT, wherein the software NAT has a routing rule removing function to remove the routing rule stored in the software NAT; sending, by the software NAT, the routing rule to the hardware NAT; storing the routing rule, by the hardware NAT, in the hardware NAT; and routing, by the hardware NAT instead of the software NAT, a second data packet based on the routing rule stored in the hardware NAT. The routing rule removing function of the software NAT for the routing rule stored in the software NAT is disabled.
- According to the method described above, the hardware NAT has the routing rule removing function to remove the routing rule stored in the hardware NAT. The routing rule removing function of the hardware NAT for the routing rule stored in the hardware NAT is disabled.
- According to the method described above, the hardware NAT has a keep-alive function to send a keep-alive packet periodically to the software NAT. The keep-alive function of the hardware NAT for the routing rule stored in the hardware NAT is disabled.
- According to the method described above, the step of sending, by the software NAT, the routing rule to the hardware NAT includes: sending, by the software NAT, the routing rule to the hardware NAT based on a threshold number of the data packets relative to the routing rule received by the software NAT from the hardware NAT within a predetermined time. The threshold number is an integer between one and five.
- According to the method described above, a timeout used for determining whether to remove the routing rule stored in the software NAT is disabled.
- According to the method described above, a timeout used for determining whether to remove the routing rule stored in the software NAT is set to be its maximum value.
- The present invention also provides an electronic device. The electronic device includes a software network address translator (NAT) and a hardware NAT. The software NAT is configured to route a first data packet based on a routing rule stored in the software NAT, and send out the routing rule. The software NAT has a routing rule removing function to remove the routing rule stored in the software NAT. The hardware NAT is configured to receive the routing rule from the software NAT, store the routing rule in the hardware NAT, and route a second data packet based on the routing rule stored in the hardware NAT. The routing rule removing function of the software NAT for the routing rule stored in the software NAT is disabled.
- According to the electronic device described above, the hardware NAT has the routing rule removing function to remove the routing rule stored in the hardware NAT. The routing rule removing function of the hardware NAT for the routing rule stored in the hardware NAT is disabled.
- According to the electronic device described above, the hardware NAT has a keep-alive function to send a keep-alive packet periodically to the software NAT. The keep-alive function of the hardware NAT for the routing rule stored in the hardware NAT is disabled.
- According to the electronic device described above, the software NAT sends the routing rule to the hardware NAT based on a threshold number of the data packets relative to the routing rule received by the software NAT from the hardware NAT within a predetermined time. The threshold number is an integer between one and five.
- According to the electronic device described above, a timeout used for the software NAT to determine whether to remove the routing rule stored in the software NAT is disabled.
- According to the electronic device described above, a timeout used for the software NAT to determine whether to remove the routing rule stored in the software NAT is set to be its maximum value.
- The disclosure can be more fully understood by reading the subsequent detailed description with references made to the accompanying figures. It should be understood that the figures are not drawn to scale in accordance with standard practice in the industry. In fact, it is allowed to arbitrarily enlarge or reduce the size of components for clear illustration. This means that many special details, relationships and methods are disclosed to provide a complete understanding of the disclosure.
-
FIG. 1 is a flow chart of a method of routing data packets for a router including a software network address translator (NAT) and a hardware NAT in accordance with some embodiments of the present invention. -
FIG. 2 is a schematic diagram of anelectronic device 200 in accordance with some embodiments of the present invention. -
FIG. 3 is a flow chart of the method inFIG. 1 applied to theelectronic device 200 inFIG. 2 in accordance with some embodiments of the present invention. - Certain words are used to refer to specific elements in the specification and the claims. Those with ordinary knowledge in the technical field should understand that hardware manufacturers may use different terms to refer to the same component. The specification and the claims of the present invention do not use differences in names as a way to distinguish elements, but use differences in functions of elements as a criterion for distinguishing. The “comprise” and “include” mentioned in the entire specification and the claims are open-ended terms, so they should be interpreted as “including but not limited to”. “Generally” means that within an acceptable error range, a person with ordinary knowledge in the technical field can solve the technical problem within a certain error range, and basically achieve the technical effect. In addition, the term “coupled” herein includes any direct and indirect electrical connection means. Therefore, if it is described in the text that a first device is coupled to a second device, it means that the first device can be directly electrically connected to the second device, or indirectly electrically connected to the second device through other devices or connecting means.
- The following description is the best embodiment expected of the present invention. These descriptions are used to illustrate the general principles of the present invention and should not be used to limit the present invention. The protection scope of the present invention should be determined on the basis of referring to the scope of the claims of the present invention.
-
FIG. 1 is a flow chart of a method of routing data packets for a router including a software network address translator (NAT) and a hardware NAT in accordance with some embodiments of the present invention. In some embodiments, the hardware NAT receives data packets relative to a routing rule, and passes the data packets to the software NAT based on the routing rule. In some embodiments, the routing rule may include the source that the data packets come from, the destination that the data packets send to, and the types of the data packets. In some embodiments, if two groups of data packets have different sources, different destination or different types, the two groups are relative to different routing rules. In some embodiments, after the hardware NAT receives the data packets relative to the routing rule, the hardware NAT may check whether the routing rule has been recorded in a connection table in the hardware NAT. If yes, the hardware NAT directly sends the data packets to the corresponding destination. If no, the hardware NAT passes the data packets to the software NAT. In some embodiments, the hardware NAT has a routing rule removing function to remove the routing rule stored in the hardware NAT. In some embodiments, the hardware NAT determines whether to remove the routing rule stored in it-self based on a timeout in the hardware NAT. - The software NAT determines whether to send the routing rule to the hardware network address translator based on a threshold number of the data packets relative to the routing rule received by the software NAT from the hardware NAT within a predetermined time. In some embodiments, the threshold number is an integer between one and five. In some embodiments, the software NAT stores the routing rule in a connection table itself and has a routing rule removing function to remove the routing rule stored in the software NAT originally. In some embodiments, the software NAT determines whether to remove the routing rule stored in it-self based on a timeout in the software NAT.
- As shown in
FIG. 1 , the method of the present invention includes routing, by the software NAT, a first data packet based on a routing rule stored in the software NAT, the software NAT has a routing rule removing function to remove the routing rule stored in the software NAT, the routing rule removing function of the software NAT for the routing rule stored in the software NAT is disabled (step S100); sending, by the software NAT, the routing rule to the hardware NAT (step S102); storing the routing rule, by the hardware NAT, in the hardware NAT (step S104); and routing, by the hardware NAT instead of the software NAT, a second data packet based on the routing rule stored in the hardware NAT (step S106). - In step S100, the software NAT routes a data packet based on a routing rule stored in the software NAT. In some embodiments, the routing rule is stored in a connection table in the software NAT. The connection table is present in a memory of the software NAT. In some embodiments, the software NAT may be an application microcontroller, but the present invention is not limited thereto. In some embodiments, the software NAT has a routing rule removing function to remove the routing rule stored in the software NAT. In the routing rule removing function, a timeout (set in the software NAT) is used for software NAT to determine whether to remove the routing rule stored in the software NAT. For example, originally, if the time period that the software NAT does not receive any data packet relative to the routing rule is longer than the timeout, the software NAT may remove the routing rule. However, in some embodiments of the present invention, the routing rule removing function of the software NAT for the routing rule stored in the software NAT is disabled. Therefore, even if the time period that the software NAT does not receive any data packet relative to the routing rule is longer than the timeout, the software NAT may not remove the routing rule, thereby saving the computing resource of the software NAT. That is, the software NAT is unnecessary to prepare (for example, search from communication commands between user ends) the routing rule for the received data packet relative to the same routing rule again, because the routing rule is still stored in the software NAT.
- In some embodiments, the timeout used for the software NAT to determine whether to remove the routing rule stored in the software NAT is set to be its maximum value (for example, 65535). In some embodiments, the timeout used for the software NAT to determine whether to remove the routing rule stored in the software NAT is disabled.
- In step S102, the software NAT sends the routing rule to the hardware routing rule. In some embodiments, the software NAT sends the routing rule to the hardware NAT based on a threshold number of the data packets relative to the routing rule received by the software NAT from the hardware NAT within a predetermined time. For example, the threshold number may be an integer between 1 and 5. The less the threshold number (or called threshold number) of the data packets is set, the software NAT is easier to send the routing rule to the hardware NAT. For example, if the threshold number of the data packets is set as 1, once the software NAT receives one data packet (for example, per second) relative to the routing rule passed from the hardware NAT, the software NAT may send the routing rule to the hardware NAT. If the threshold number of the data packets is set as 5, once the software NAT receives 10 data packets (for example, per second) relative to the routing rule passed from the hardware NAT, the software NAT may send the routing rule to the hardware NAT. However, once the software NAT receives 4 data packets (for example, per second) relative to the routing rule passed from the hardware NAT, the software NAT may not send the updated routing rule to the hardware NAT. In some embodiments, the NAT capability of the hardware NAT is much better than that of the software NAT.
- In some embodiments, after the hardware NAT receives the routing rule from the software NAT, in step S104, the hardware NAT stores the routing rule in the hardware NAT. For example, the routing rule is stored in a connection table in the hardware NAT. Once the hardware network address translator receives the data packets relative to the same routing rule received from the software NAT, for example in step S106, the hardware NAT sends (or routes) the data packets directly to the destination based on the routing rule stored in the hardware NAT. In other words, the hardware NAT is used to accelerate the efficiency of network address translation.
- In some embodiments, the hardware NAT has a routing rule removing function. In the routing rule removing function, a timeout (set in the hardware NAT) is used for hardware NAT to determine whether to remove the routing rule stored in the hardware NAT. For example, originally, if the time period that the hardware NAT does not receive any data packet relative to the routing rule is longer than the timeout, the hardware NAT may remove the routing rule. However, in some embodiments of the present invention, the routing rule removing function of the hardware NAT for the routing rule stored in the hardware NAT is disabled. Therefore, even if the time period that the hardware NAT does not receive any data packet relative to the routing rule is longer than the timeout, the hardware NAT may not remove the routing rule.
- In some embodiments, the timeout used for the hardware NAT to determine whether to remove the routing rule stored in the hardware NAT is set to be its maximum value (for example, 65535). In some embodiments, the timeout used for the hardware NAT to determine whether to remove the routing rule stored in the hardware NAT is disabled.
- Originally, the hardware NAT has a keep-alive function to send a keep-alive packet periodically to the software NAT. However, in some embodiments of the present invention, the keep-alive function of the hardware NAT for the routing rule stored in the hardware NAT is disabled, so that the software NAT may not be wakeup in a suspend mode by receiving the keep-alive packet from the hardware NAT.
- In some embodiments, the software NAT enters the suspend mode if there are no wakeup events. In some embodiments, the wakeup events may include receiving other data packets relative to other routing rules; receiving the event that a USB device is installed in the router; or receiving the event that the power key of the router has been pressed. Although the software NAT enters the suspend mode for saving power consumption of the router, the hardware network address translator is still working for NAT, so that the router can remain normal operation.
-
FIG. 2 is a schematic diagram of anelectronic device 200 in accordance with some embodiments of the present invention. In some embodiments, theelectronic device 200 is a router, but the present invention is not limited thereto. As shown inFIG. 2 , theelectronic device 200 includes ahardware NAT 202 and asoftware NAT 204. Thehardware NAT 202 is configured to receive data packets relative to a routing rule from Wi-Fi 214,Ethernet 216 or amodem 218, and translate an IP address of the data packets in Intranet (such as Wi-Fi 214 and Ethernet 216) to that of the data packets in Extranet (such as themodem 218 and a network 219). For example, thehardware NAT 202 is configured to translate an IP address of data packets in Wi-Fi 214 to that of the data packets in thenetwork 219 throughlinks modem 218. Similarly, thehardware NAT 202 is configured to translate an IP address of data packets inEthernet 216 to that of the data packets in thenetwork 219 through thelinks modem 218. After receiving the data packets relative to the routing rule, if the routing rule has been recorded in the connection table in thehardware NAT 202, thehardware NAT 202 directly sends the data packets to the corresponding destination, for example, Wi-Fi 214,Ethernet 216 or themodem 218. If the routing rule has not been recorded in the second connection table in thehardware NAT 202, thehardware NAT 202 passes the data packets to thesoftware NAT 204 through alink 222. - In some embodiments, a
driver 210 and aconnection tracker 212 are executed by thesoftware NAT 204. In some embodiments, thedriver 210 includes the program code for the operation of thesoftware NAT 204, and the threshold number of the data packets relative to the routing rule for thesoftware NAT 204 to determine whether to send the routing rule to thehardware NAT 202. Theconnection tracker 212 is able to control the routing rule removing function to remove the routing rule stored in thesoftware NAT 204. In some embodiments, the method of present invention sets the threshold number of data packets as 1 to 5 per second by changing the setting in thedriver 210. In some embodiments, the method of present invention enables or disables the timeout for the routing rule removing function in thesoftware NAT 204 andhardware NAT 202 by changing the setting in thedriver 210. In some embodiments, the method of present invention enables or disables the routing rule removing function in thesoftware NAT 204 by changing the setting in theconnection tracker 212. In some embodiments, thesoftware NAT 204 sends the routing rule to thehardware NAT 202 through alink 220. -
FIG. 3 is a flow chart of the method inFIG. 1 applied to theelectronic device 200 inFIG. 2 in accordance with some embodiments of the present invention. Thesoftware NAT 204 first receives data packets relative to a routing rule passed from thehardware NAT 202, and routes the data packets based on the routing rule (step S100 inFIG. 1 ). In some embodiments, the routing rule has been stored in the connection table in thesoftware NAT 204. Thesoftware NAT 204 has a routing rule removing function to remove the routing rule. As shown inFIG. 3 , thesoftware NAT 204 executes thedriver 210 to set the threshold number of data packets that thesoftware NAT 204 determines to send the routing rule to thehardware NAT 202 as 1 to 5 per second( in the block 300)(step S102 inFIG. 1 ). After that, thesoftware NAT 204 executes thedriver 210 to send the routing rule to thehardware NAT 202 through acommand 302. In some embodiments, thesoftware NAT 204 further executes thedriver 210 to disable the periodical transmission of a keep-alive packet from the hardware NAT 202 (that is, the keep-alive function in hardware NAT 202) to thesoftware NAT 204 through acommand 304. In some embodiments, thesoftware NAT 204 executes thedriver 210 to send thecommand 304 to thehardware NAT 202, so that thehardware NAT 202 disables its routing rule removing function based on thecommand 304. In some embodiments, thesoftware NAT 204 executes thedriver 210 to disable the routing rule removing function in thesoftware NAT 204 by sending acommand 306 to theconnection tracker 212, so that theconnection tracker 212 may disable the routing rule removing function in thesoftware NAT 204. That is, theconnection tracker 212 is able to disable the timeout for determining whether to remove the routing rule stored in thesoftware NAT 204 according to thecommand 306. - After the
hardware NAT 202 receives the routing rule from thesoftware NAT 204 through thecommand 302, thehardware NAT 202 stores the routing rule in the connection table in thehardware NAT 202, and is able to translate an IP address ofdata packets 350 in the Wi-Fi 214 to that of thedata packets 350 in thenetwork 219, and sends thedata packets 350 to thenetwork 219 through themodem 218. Similarly, thehardware NAT 202 is able to translate an IP address ofdata packets 352 in thenetwork 219 to that of thedata packets 352 in the Wi-Fi 214, and sends thedata packets 352 to the Wi-Fi 214 through themodem 218. - In some embodiments, when there are no other data packets received by the software NAT 204 (in the block 308) from the
hardware NAT 202, thesoftware NAT 204 is able to enter a suspend mode (in the block 310). In some embodiments, thesoftware NAT 204 enters the suspend mode if there is no wakeup events. For example, the wakeup events may include receiving other data packets relative to other routing rules; receiving the event that a USB device is installed in the router; or receiving the event that the power key of the router has been pressed, but the present invention is not limited thereto. - After the
software NAT 204 has entered the suspend mode, thehardware NAT 202 is still able to translate an IP address ofdata packets Fi 214 to that of thedata packets network 219, and sends thedata packets network 219 through themodem 218, because the routing rules relative to thedata packets hardware NAT 202. After that, thesoftware NAT 204 suffers a wakeup event (in the block 312), so that thesoftware NAT 204 leaves the suspend mode (in the block 314). Thesoftware NAT 204 executes thedriver 210 to update the connection table based on newly received data packets from thehardware NAT 202 relative to other routing rules through acommand 322. - Since the routing rule removing function of the
hardware NAT 202 is disabled, the number of routing rules stored in thehardware NAT 202 may not decreased, thereby decreasing the possibility for thehardware NAT 202 to pass the data packets to thesoftware NAT 204, and the possibility for thesoftware NAT 204 to leave the suspend mode is also decreased. Similarly, the keep-alive function of thehardware NAT 202 is disabled, thehardware NAT 202 may not send the keep-alive packet periodically to thesoftware NAT 204, thereby also decreasing the probability for thesoftware NAT 204 to leave the suspend mode. In addition, since the routing rule removing function of thesoftware NAT 202 is disabled, the number of routing rules stored in thesoftware NAT 204 may not decreased, thereby decreasing the probability of facing new routing rule that has not stored in thesoftware NAT 204. That is, thesoftware NAT 204 is unnecessary to prepare (for example, search from communication commands between user ends) the routing rule for the received data packet relative to the same routing rule again. The method of routing data packets and the electronic device of the present invention can achieve the technical effect of saving power. - The method and the electronic device of the present invention may let the application microcontroller remain in the suspend mode when the data packets is transmitted by the hardware network address translator. That is, all data packets are stored in the second connection table in the hardware network address translator. The connection timeouts in the both application microcontroller and hardware network address translator are both disabled. The application microcontroller enters the suspend mode for saving power.
- In the several embodiments provided by the present invention, it should be understood that the disclosed system, device, and method can be implemented using other methods. The device embodiments described above are merely illustrative, for example, the division of units is only a logical function division, and there may be other divisions in actual implementation. For example, multiple units or elements can be combined or integrated into another system, or some features may be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communicative connecting may be indirect coupling or communicatively connecting through some interfaces, device or units, and may be in electrical, mechanical, or other forms.
- In addition, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be realized either in the form of hardware or in the form of a software functional unit.
- Although the present invention is disclosed above in the preferred embodiment, it is not intended to limit the scope of the present invention. Anyone with ordinary knowledge in the relevant technical field can make changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope of the claims.
Claims (12)
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/724,043 US11805054B1 (en) | 2022-04-19 | 2022-04-19 | Method and electronic device for saving power applied to a router |
TW111132463A TWI830350B (en) | 2022-04-19 | 2022-08-29 | Methods and electronic devices for routing data packets |
CN202211080387.7A CN116962292A (en) | 2022-04-19 | 2022-09-05 | Method for routing data packets and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/724,043 US11805054B1 (en) | 2022-04-19 | 2022-04-19 | Method and electronic device for saving power applied to a router |
Publications (2)
Publication Number | Publication Date |
---|---|
US20230336472A1 true US20230336472A1 (en) | 2023-10-19 |
US11805054B1 US11805054B1 (en) | 2023-10-31 |
Family
ID=88307375
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/724,043 Active US11805054B1 (en) | 2022-04-19 | 2022-04-19 | Method and electronic device for saving power applied to a router |
Country Status (3)
Country | Link |
---|---|
US (1) | US11805054B1 (en) |
CN (1) | CN116962292A (en) |
TW (1) | TWI830350B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013063791A1 (en) * | 2011-11-04 | 2013-05-10 | Qualcomm Atheros, Inc. | Nat/firewall accelerator |
US20140068044A1 (en) * | 2012-06-20 | 2014-03-06 | Alcatel-Lucent Usa, Inc. | Method of maintaining network address translation mapping and client device employing same |
US20190379600A1 (en) * | 2016-07-01 | 2019-12-12 | Telefonaktiebolaget Lm Ericsson (Publ) | Efficient nat in sdn network |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109088957B (en) * | 2018-08-30 | 2022-03-25 | 京信网络系统股份有限公司 | NAT rule management method, device and equipment |
-
2022
- 2022-04-19 US US17/724,043 patent/US11805054B1/en active Active
- 2022-08-29 TW TW111132463A patent/TWI830350B/en active
- 2022-09-05 CN CN202211080387.7A patent/CN116962292A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013063791A1 (en) * | 2011-11-04 | 2013-05-10 | Qualcomm Atheros, Inc. | Nat/firewall accelerator |
US20140068044A1 (en) * | 2012-06-20 | 2014-03-06 | Alcatel-Lucent Usa, Inc. | Method of maintaining network address translation mapping and client device employing same |
US20190379600A1 (en) * | 2016-07-01 | 2019-12-12 | Telefonaktiebolaget Lm Ericsson (Publ) | Efficient nat in sdn network |
Also Published As
Publication number | Publication date |
---|---|
TW202344018A (en) | 2023-11-01 |
CN116962292A (en) | 2023-10-27 |
TWI830350B (en) | 2024-01-21 |
US11805054B1 (en) | 2023-10-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2562970B1 (en) | Switch, and flow table control method | |
US8391289B1 (en) | Managing a forwarding table in a switch | |
US10079894B2 (en) | Method and apparatus for dynamic destination address control in a computer network | |
CN108259347B (en) | Message transmission method and device | |
CN108337161B (en) | Method for smoothly switching three-layer data flow of MLAG interface fault | |
US8213325B2 (en) | Packet analysis method, packet analysis apparatus, recording medium storing packet analysis program | |
CN110011941B (en) | Message forwarding method and device | |
CN109088957B (en) | NAT rule management method, device and equipment | |
US7961614B2 (en) | Information processing device, information processing method, and recording medium for reducing consumption of memory capacity | |
US20100094994A1 (en) | Network structure information acquiring method and device | |
RU2602333C2 (en) | Network system, packet processing method and storage medium | |
US9984036B2 (en) | Communication system, control apparatus, communication method, and program | |
US8886913B2 (en) | Apparatus and method for identifier management | |
US11805054B1 (en) | Method and electronic device for saving power applied to a router | |
CN102413197A (en) | Access statistics processing method and device | |
CN105144643A (en) | System for conversational link aggregation resolution in a network switch | |
US7257624B2 (en) | System for storing active and inactive configuration commands at a network node for managing its configuration state | |
US11784929B2 (en) | Heterogeneous link data translation and distribution method, system and device, and storage medium | |
CN111641659A (en) | Method, device, equipment and storage medium for preventing central processing unit of switch from being attacked | |
CN104618148A (en) | Firewall device and backup method thereof | |
KR20150104435A (en) | Method of performing transition of operation mode for a routing processor | |
US20190273690A1 (en) | Communication device, communication system, and communication method | |
EP2928126A1 (en) | Subnet route processing method and message forwarding device | |
CN109361781B (en) | Message forwarding method, device, server, system and storage medium | |
CN110138819B (en) | Host state detection method and system of network switch |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: MEDIATEK INC., TAIWAN Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:HUANG, YU-HUA;LIN, MING-JUN;YANG, HUEI-JING;AND OTHERS;SIGNING DATES FROM 20200413 TO 20220415;REEL/FRAME:059638/0970 |
|
FEPP | Fee payment procedure |
Free format text: ENTITY STATUS SET TO UNDISCOUNTED (ORIGINAL EVENT CODE: BIG.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
AS | Assignment |
Owner name: MEDIATEK INC., TAIWAN Free format text: CORRECTIVE ASSIGNMENT TO CORRECT THE EXECUTION DATE OF THE FIRST INVENTOR PREVIOUSLY RECORDED ON REEL 059638 FRAME 0970. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT;ASSIGNORS:HUANG, YU-HUA;LIN, MING-JUN;YANG, HUEI-JING;AND OTHERS;SIGNING DATES FROM 20211228 TO 20220415;REEL/FRAME:059772/0329 |
|
STCF | Information on status: patent grant |
Free format text: PATENTED CASE |