ROUTE INFORMATION STORAGE METHOD AND APPARATUS
20230026626 · 2023-01-26
Inventors
Cpc classification
H04W40/02
ELECTRICITY
International classification
Abstract
This application discloses a route information storage method. The method is applied to a wireless mesh network, the wireless mesh network includes a first node, a second node, and at least two stations STAs, the first node is an upper-level node of the second node, the at least two STAs include a first STA and a second STA, and the first STA and the second STA are connected to the second node. In the method, the first node receives a routing request for access requested by the first STA, and if it is determined that a first route entry corresponding to the second STA already exists, the first node no longer generates a new route entry for the first STA, but reuses the first route entry.
Claims
1. A route information storage method, wherein the method is applied to a mesh network, the mesh network comprises a first node, a second node, and at least two stations (STAs), the first node is an upper-level node of the second node, the at least two STAs comprise a first STA and a second STA, the first STA and the second STA are connected to the second node, and the method comprises: receiving, by the first node, a routing request from the second node, wherein the routing request is used for requesting the first STA to access the first node, and the routing request comprises a first identifier for indicating the second node; determining, by the first node based on the first identifier, a first route entry corresponding to a station connected to the second node, wherein the first route entry corresponds to the second STA; and reusing, by the first node, the first route entry as a route entry of the first STA.
2. The method according to claim 1, wherein the determining, by the first node based on the first identifier, a first route entry corresponding to a station connected to the second node comprises: generating, by the first node, a first prefix based on the first identifier and at least a part of an address of the second node; and determining, by the first node based on the first prefix, the first route entry corresponding to a station connected to the second node, wherein the first route entry comprises a field the same as the first prefix.
3. The method according to claim 1, wherein the determining, by the first node based on the first identifier, a first route entry corresponding to a station connected to the second node comprises: searching, by the first node, a route table based on the first identifier, to determine the first route entry corresponding to a station connected to the second node, wherein a target address field of the first route entry comprises the first identifier.
4. The method according to claim 1, wherein the first identifier is located in a node identifier field of the first route entry.
5. The method according to claim 1, wherein the first identifier is located in an option field of the routing request.
6. The method according to claim 1, wherein the first node is a mesh border router (MBR), and the method further comprises: allocating, by the MBR, the first identifier to the second node; and generating, by the MBR, a second route entry from the MBR to the second node, wherein the second route entry comprises the first identifier.
7. The method according to claim 1, wherein the first node is a mesh gate MG, and the method further comprises: receiving, by the MG, the first identifier from a mesh border router MBR; and generating, by the MG, a third route entry from the MG to the second node, wherein the third route entry comprises the first identifier.
8. The method according to claim 1, wherein the first identifier uniquely identifies the second node in the mesh network.
9. The method according to claim 1, wherein the method further comprises: restarting, by the first node, before receiving the routing request; and replacing, by the first node, the first identifier with a second identifier after receiving the routing request from the second node.
10. The method according to claim 1, wherein the method further comprises: receiving, by the first node, a first downlink packet and a second downlink packet, wherein the first downlink packet comprises a media access control (MAC) address of the first STA and a second prefix, the second downlink packet comprises a MAC address of the second STA and the second prefix, and the second prefix is the same as content of the target address field of the first route entry; determining, by the first node based on the second prefix, the first route entry reused by the first STA and the second STA; and sending, by the first node, the first downlink packet and the second downlink packet to the second node based on the first route entry.
11. A first node for route information storage, and the first node comprises: a memory and at least one processor, wherein the memory is coupled to the at least one processor; and the memory stores program instructions, and when the program instructions are run by the processor, the at least one processor is enabled to perform the following steps: receive, a routing request from the second node, wherein the routing request is used for requesting a first STA to access the first node, and the routing request comprises a first identifier for indicating the second node, wherein the first STA and a second STA are connected to the second node; determine, based on the first identifier, a first route entry corresponding to a station connected to the second node, wherein the first route entry corresponds to the second STA; and reuse, the first route entry as a route entry of the first STA.
12. The first node according to claim 11, wherein further cause the at least one processor to: generate a first prefix based on the first identifier and at least a part of an address of the second node; and determine, based on the first prefix, the first route entry corresponding to a station connected to the second node, wherein the first route entry comprises a field the same as the first prefix.
13. The first node according to claim 11, wherein further cause the at least one processor to: search, a route table based on the first identifier, to determine the first route entry corresponding to a station connected to the second node, wherein a target address field of the first route entry comprises the first identifier.
14. The first node according to claim 11, wherein the first identifier is located in a node identifier field of the first route entry.
15. The first node according to claim 11, wherein the first identifier is located in an option field of the routing request.
16. The first node according to claim 11, wherein the first node is a mesh border router (MBR), and wherein further cause the at least one processor to: allocate the first identifier to the second node; and generate a second route entry from the MBR to the second node, wherein the second route entry comprises the first identifier.
17. A computer-readable storage medium, storing one or more instructions that, when the computer-readable storage medium is on a first node, when the medium is executed by at least one processor, cause the at least one processor to: receive, a routing request from a second node, wherein the routing request is used for requesting a first STA to access the first node, and the routing request comprises a first identifier for indicating the second node, wherein the first STA and a second STA are connected to the second node; determine, based on the first identifier, a first route entry corresponding to a station connected to the second node, wherein the first route entry corresponds to the second STA; and reusing, the first route entry as a route entry of the first STA.
18. The computer-readable storage medium according to claim 17, further cause the at least one processor to: generate, a first prefix based on the first identifier and at least a part of an address of the second node; and determine based on the first prefix, the first route entry corresponding to a station connected to the second node, wherein the first route entry comprises a field the same as the first prefix.
19. The computer-readable storage medium according to claim 17, further cause the at least one processor to: search, a route table based on the first identifier, to determine the first route entry corresponding to a station connected to the second node, wherein a target address field of the first route entry comprises the first identifier.
20. The computer-readable storage medium according to claim 17, wherein the first node is a mesh border router (MBR), and further cause the at least one processor to: allocate, the first identifier to the second node; and generate, a second route entry from the MBR to the second node, wherein the second route entry comprises the first identifier.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
DESCRIPTION OF EMBODIMENTS
[0054] The following describes embodiments of this application with reference to the accompanying drawings. It is clear that the described embodiments are merely some but not all of embodiments of this application. A person of ordinary skill in the art may learn that the technical solutions provided in embodiments of this application are also applicable to a similar technical problem as a technology develops and a new scenario emerges.
[0055] In the specification, claims, and accompanying drawings of this application, the terms “first”, “second”, and so on are intended to distinguish between similar objects but do not necessarily indicate a specific order or sequence. It should be understood that the data termed in such a way are interchangeable in proper circumstances so that embodiments described herein can be implemented in other orders than the order illustrated or described herein. In addition, the terms “include”, “contain” and any other variants mean to cover the non-exclusive inclusion, for example, a process, method, system, product, or device that includes a list of steps or units is not necessarily limited to those expressly listed steps or units, but may include other steps or units that are not expressly listed or that are inherent to such a process, method, system, product, or device.
[0056] Embodiments of this application provide a route information storage method, to reduce buffer space occupied by buffered route information. This application further provides a corresponding apparatus. Details are separately described below.
[0057] A route information storage method provided in embodiments of this application may be applied to a mesh (mesh) network. As shown in a schematic diagram of a network communication architecture shown in
[0058]
[0059] As shown in
[0060] The MBR is responsible for route maintenance of the wireless mesh network, and is directly connected to the routing device 20 in
[0061] The MG is responsible for forwarding a data packet. A network with two levels of MGs is used as an example. A first-level MG is connected to a second-level MG, and the second-level MG is connected to a STA. Therefore, the first-level MG also needs to maintain information about routes to another second-level MG and the STA.
[0062] The STA is the last-hop node and generally does not have a data forwarding function.
[0063] The MBR and the MG generally support a routing protocol for low-power and lossy networks (routing protocol for Low-Power and lossy networks, RPL). A request sent by the MG to the MBR is generally a destination advertisement object (destination advertisement object, DAO) request, and an acknowledgment (acknowledgment, ACK) sent by the MBR to the MG is generally a DAO-ACK or a grounded acknowledgment (grounded acknowledgment, GACK).
[0064] The STA generally supports a router solicitation/router advertisement (router solicitation/router advertisement, RS/RA).
[0065] After the second node 102 and each STA under the second node 102 access the first node 101, the first node 101 stores route entries to the second node and to the STAs, where a route entry is a piece of route information stored in a form of a target address. In this embodiment of this application, only one route entry is stored for the STAs under the second node 102, and each STA under the second node 102 reuses the route entry. Reusing indicates that an existing route entry is used, and a new route entry is no longer generated for the first STA. It may alternatively be understood that respective route entries of the STAs connected to the same second node 102 may be stored in an aggregated manner on the first node. For example, the first STA reuses a route entry of the second STA, which may be understood as: A route entry of the first STA and a route entry of the second STA are stored in an aggregated manner.
[0066] The foregoing implementation process of reusing the same route entry by the STAs under the second node 102 may be understood with reference to a schematic diagram of an embodiment of a route information storage method shown in
[0067] As shown in
[0068] 201: A first node receives a routing request from a second node.
[0069] The routing request is used for requesting a first STA to access the first node. The routing request includes a first identifier for indicating the second node.
[0070] The routing request may be a DAO request.
[0071] Optionally, the first identifier uniquely identifies the second node in the mesh network. The first identifier may be located in an option (option) field of the routing request. The option field may be implemented by extending the routing request, or may be implemented by using an idle field in the routing request.
[0072] 202: The first node determines, based on a first identifier, a first route entry corresponding to a station connected to the second node.
[0073] The first route entry is generated for a STA that is the first one accessing the first node and that is under the second node. The first route entry corresponds to a second STA. If the second STA is the STA that is the first one accessing the first node and that is under the second node, the first route entry is generated for the second STA. If the second STA is not the STA that is the first one accessing the first node and that is under the second node, the first node reuses the first route entry as a route entry of the second STA.
[0074] The first route entry includes a target address field, and the target address field includes the first identifier. Therefore, the first route entry may be determined based on the first identifier.
[0075] 203: The first node reuses the first route entry as a route entry of a first STA.
[0076] In embodiments of this application, for the at least two STAs under the same second node, the same first route entry may be reused on the first node, and only one route entry needs to be stored for all the STAs under the same second node. This reduces storage space occupied for storing route entries of the STAs.
[0077] Optionally, the foregoing step 202 of determining the first route entry may be implemented by using the following two solutions.
[0078] Solution 1: The first node generates a first prefix based on the first identifier and at least a part of an address of the second node; and the first node determines, based on the first prefix, the first route entry corresponding to a station connected to the second node, where the first route entry includes a field the same as the first prefix.
[0079] The address of the second node may be an internet protocol version 6 (internet protocol version 6, IPv6) address of the second node, and the at least a part of the address of the second node may be an IPv6 64-bit prefix. The first identifier may be a random value, and the random value may have 8 bits. The at least a part of the address of the second node may be combined with the first identifier in a serial combination manner, to obtain the first prefix. Certainly, the first prefix may further include another field, for example, an anti-collision field for preventing a collision between the first prefix and an existing IPv6 address. For example, a mesh node identifier (mesh node identifier, MNID) represents the first identifier, 0xff represents the anti-collision field, and then the first prefix (prefix) may be represented as: The IPv6 address prefix of the second node (64 bits)+0xff (8 bits)+MNID (8 bits), where “+” indicates string concatenation. Certainly, this is only a representation manner. Actually, a sequence of the concatenated character strings may be changed, and bits of each character may be extended or reduced, or other information may be added. For example, the first prefix may further include a reserved field, and the reserved field is used for subsequently extending the identifier of the second node when there are an excessively large quantity of second nodes in the mesh network.
[0080] The first route entry may be understood by using a route table shown in the following Table 1:
TABLE-US-00001 TABLE 1 Route table including a first route entry Target address field Next-hop field Node identifier field Prefix (second node) Second node MNID
[0081] The prefix (second node) in the first route entry indicates the prefix of the second node, and the prefix (second node) may include: the IPv6 address prefix of the second node (64 bits)+0xff (8 bits)+MNID (8 bits). The node identifier field may be extended in the first route entry, and the first identifier MNID is located in the node identifier field of the first route entry. Alternatively, the node identifier field may not be extended in the first route entry, and in this case, the first identifier MNID only needs to be stored in a buffer.
[0082] The first node may generate the first prefix according to the foregoing rule for generating the first prefix, where the first prefix also includes the IPv6 address prefix of the second node (64 bits)+0xff (8 bits)+MNID (8 bits). In this way, the first route entry may be found in the route table based on the first prefix.
[0083] In this possible embodiment, the first prefix is generated to indicate the second node, so that a route entry can be quickly found.
[0084] Solution 2: The first node searches a route table based on the first identifier, to determine the first route entry corresponding to a station connected to the second node, where a target address field of the first route entry includes the first identifier.
[0085] The route table stores route entries of nodes, and each route entry includes a target address field. In the foregoing solution 1, the prefix (second node) of the target address field in Table 1 includes the first identifier. Therefore, the target address field may be searched based on the first identifier. Because an identifier of each node is unique and all STAs under each node reuse a same route entry, the first route entry may be uniquely found based on the first identifier.
[0086] In this possible embodiment, the first route entry is searched based on the first identifier, so that a route entry can be quickly found.
[0087] For ease of understanding this application, the following uses a wireless mesh network as an example to describe a route information storage process in this application with reference to an example scenario.
[0088]
[0089] As shown in
[0090] 301: During initialization, the node C sends a first DAO request, where the first DAO request is used for requesting to establish an A-C route.
[0091] 302: After receiving the first DAO request, the node B buffers a B-C route entry, and sends a second DAO message to the node A.
[0092] In
[0093] 303: The node A receives the second DAO message, and allocates identifiers.
[0094] The MBR has an identifier allocation function. The MBR allocates a different identifier to each of the node B and the node C, and the MBR may also allocate an identifier to the MBR. For example, the identifier allocated by the MBR to the MBR is MNID=1, the identifier allocated to the node B is MNID=2, and the identifier allocated to the node C is MNID=3. Certainly, the identifiers 1, 2, and 3 allocated herein are merely examples for description, the identifier may be a randomly generated value, and a specific value is not limited in this application.
[0095] 304: The node A generates an A-B/A-C route entry, and stores an MNID value of the node B and an MNID value of the node C in the corresponding route entry.
[0096] As shown in
TABLE-US-00002 TABLE 2 Route table Target address field Next-hop field Node identifier field Address of a node B B 2 Address of a node C B 3
[0097] After generating the A-B/A-C route entry, the node A feeds back to the node B. A corresponding process in a downlink direction may be understood with reference to
[0098] 305: The node A sends a first DAO-ACK to the node B, where the first DAO-ACK includes the MNID value of the node B and/or the MNID value of the node C.
[0099] In this embodiment of this application, the identifier of the node B and the identifier of the node C may be separately sent to the node B by using two acknowledgments, or may be sent to the node B by using one acknowledgment. When the identifiers are sent by using one acknowledgment, two option fields may be configured in the acknowledgment, the MNID value of the node B is located in a first option field, and the MNID value of the node C is located in a second option field.
[0100] If the node A is a root node, the first DAO-ACK may alternatively be replaced with a GACK.
[0101] 306: The node B obtains the identifier MNID=2, and updates the MIND value of the node C in the B-C route entry in a route table.
[0102] 307: The node B sends a second DAO-ACK to the node C, where the second DAO-ACK includes the MNID value of the node C.
[0103] 308: The node C obtains the identifier MNID=3.
[0104] Then, the station D, the station E, and the station F sequentially request to access the mesh network. This process may be understood with reference to
[0105] As shown in
[0106] 401: The station D sends a first RS/RA request to the node C, where the first RS/RA request is used for requesting to access the node A, the node B, and the node C.
[0107] 402: The node C generates a C-D route entry.
[0108] In
[0109] 403: The node C sends a third DAO request, where the third DAO request is used for requesting to establish an A-D route, and the third DAO request includes the identifier MNID=3 of the node C.
[0110] 404: The node B receives the third DAO request, and generates a B-D route entry based on the identifier MNID=3 of the node C.
[0111] A prefix (Prefix C) of the node C is generated according to the foregoing rule, where the prefix (Prefix C) may be represented as: The prefix C (80 bits)=an IPv6 address prefix of the node C (64 bits)+0xff (8 bits)+MNID (8 bits). An MNID value of a node identifier field of the B-D route entry is modified to 3.
[0112] Before generating the B-D route entry, the node B searches for a route entry including the prefix (Prefix C), and performs step 404 only when determining that the route entry does not exist.
[0113] 405: The node B sends a fourth DAO request to the node A, where the fourth DAO request is used for requesting to establish the A-D route, and the fourth DAO request includes the identifier MNID=3 of the node C.
[0114] 406: The node A generates an A-D route entry based on the identifier MNID=3 of the node C.
[0115] The rule for generating a prefix on the node A is the same as the rule for generating a prefix on the node B, and the prefix C is the same as that in step 404.
[0116] Before generating the A-D route entry, the node A searches for a route entry including the prefix (Prefix C), and performs step 406 only when determining that the route entry does not exist.
[0117] When the station E accesses the mesh network, as shown in
[0118] 501: The station E sends a second RS/RA request to the node C, where the second RS/RA request is used for requesting to access the node A, the node B, and the node C.
[0119] 502: The node C generates a C-E route entry.
[0120] In
[0121] 503: The node C sends a fifth DAO request, where the fifth DAO request is used for requesting to establish an A-E route, and the fifth DAO request includes the identifier MNID=3 of the node C.
[0122] 504: The node B receives the fifth DAO request, determines, based on the identifier MNID=3 of the node C, a B-D route entry that already includes the prefix C, and reuses the B-D route entry.
[0123] The node B may generate the prefix (Prefix C) of the node C according to the foregoing rule based on the MNID=3 in the fifth DAO request, and then find, based on the prefix C, the route entry including the prefix C, or may find the prefix C in the target address field based on the MNID=3, where the prefix C includes the MNID=3.
[0124] 505: The node B sends a sixth DAO request to the node A, where the sixth DAO request is used for requesting to establish the A-E route, and the sixth DAO request includes the identifier MNID=3 of the node C.
[0125] 506: The node A determines, based on the identifier MNID=3 of the node C, the B-D route entry that already includes the prefix C, and reuses the B-D route entry.
[0126] The node A may generate the prefix (Prefix C) of the node C according to the foregoing rule based on the MNID=3 in the sixth DAO request, and then find, based on the prefix C, the route entry including the prefix C, or may find the prefix C in the target address field based on the MNID=3, where the prefix C includes the MNID=3.
[0127] A process in which the station F accesses the wireless mesh network is basically the same as a process in which the station E accesses the wireless mesh network. Details are not described herein again.
[0128] It can be learned from the foregoing process that, the node A and the node B need to store only one route entry for the stations D, E, and F. In other words, the stations D, E, and F connected to the node C may reuse one route entry. This reduces storage space occupied for storing route entries of the STAs.
[0129] In the scenarios shown in
[0130] Option type: 0xf2. If the option type field includes 0xf2, it indicates that an MNID needs to be read. If the option type field does not include 0xf2, it indicates that the requests or the acknowledgments are not related to the MNID. The MNID field has 8 bits and ranges from 1 to 255, and 0 is an invalid value. The flags field identifies a status of the MNID. If the flags field is represented by 0, it may indicate that the first identifier is not updated, and an MNID value of the node A, the MNID value of the node B, and the MNID value of the node C are still original 1, 2, and 3. If the flags field is represented by 1, it indicates that the MBR is restarted, and the MBR updates an MNID value of the node A, the MNID value of the node B, and the MNID value of the node C. For example, the MNID value of the node A, the MNID value of the node B, and the MNID value of the node C are updated to 4, 5, and 6 respectively. In this case, the node A, the node B, and the node C need to read the updated values 4, 5, and 6. The original first identifier is replaced with the updated second identifier in respective buffers and corresponding route entries, that is, 1 is replaced with 4, 2 is replaced with 5, and 3 is replaced with 6. Certainly, the function indicated when the flags field is 0 or 1 herein is merely an example for description, and may alternatively be indicated by using another value or character. This is not limited in this application.
[0131] Optionally, the route information storage method provided in this embodiment of this application further includes: The first node restarts before receiving the routing request; and the first node replaces the first identifier with a second identifier after receiving the routing request from the second node.
[0132] The wireless mesh network is used as an example. Considering that the MBR may be restarted due to a fault, generally, after the MBR is restarted, a unique identifier is reallocated to each second node under the MBR. Regardless of whether the first node is an MBR or an MG, after obtaining a new unique identifier, the first node uses the new unique identifier to update a corresponding route entry. In this case, if the second node still uses an original first identifier when sending the routing request, after receiving the routing request, the first node replaces the first identifier with a reallocated new second identifier, and then uses the second identifier to perform a subsequent corresponding step of searching for a route entry. This possible embodiment can avoid a problem that a route entry cannot be searched after an MBR is restarted.
[0133] Optionally, as shown in
[0134] 601: The first node receives a first downlink packet and a second downlink packet.
[0135] The first downlink packet includes a media access control (media access control, MAC) address of the first STA and a second prefix, the second downlink packet includes a MAC address of the second STA and the second prefix, and the second prefix is the same as content of the target address field of the first route entry.
[0136] 602: The first node determines, based on the second prefix, the first route entry reused by the first STA and the second STA.
[0137] The first node stores only one route entry, that is, the first route entry, for the first STA and the second STA.
[0138] Optionally, step 602 includes: The first node searches target address fields in a route table based on the second prefix, to determine the first route entry whose content of the target address field is the same as the second prefix.
[0139] 603: The first node sends the first downlink packet and the second downlink packet to the second node based on the first route entry.
[0140] 604: The second node sends the first downlink packet to the first STA.
[0141] The second node sends the first downlink packet to the first STA based on the MAC address of the first STA.
[0142] 605: The second node sends the second downlink packet to the second STA.
[0143] The second node sends the second downlink packet to the second STA based on the MAC address of the second STA.
[0144] In this embodiment, for downlink packets sent to different STAs, the first node may use a same route entry for sending, and the first node needs to store only one route entry for the different STAs. This reduces storage space occupied for storing route entries of the STAs.
[0145] The embodiment corresponding to
[0146] For ease of understanding, a process of sending the foregoing downlink packets is further described with reference to
[0147] As shown in
[0148] 701: The node A receives a packet D, a packet E, and a packet F.
[0149] The packet D includes a station prefix C and a MAC address of the station D, the packet E includes a station prefix C and a MAC address of the station E, and the packet F includes a station prefix C and a MAC address of the station F.
[0150] 702: The node A determines, based on the prefix C, a route entry whose target address field includes the prefix C.
[0151] 703: The node A sends the packet D, the packet E, and the packet F to the node B based on the route entry including the prefix C.
[0152] 704: After receiving the packet D, the packet E, and the packet F, the node B determines, based on the prefix C, a route entry whose target address field includes the prefix C.
[0153] 705: The node B sends the packet D, the packet E, and the packet F to the node C based on the route entry including the prefix C.
[0154] 706: After receiving the packet D, the packet E, and the packet F, the node C sends the packet D to the node D based on a C-D route entry, sends the packet E to the node E based on a C-E route entry, and sends the packet F to the node F based on a C-F route entry.
[0155] It can be learned from the description of this embodiment that the node A and the node B each need to store only one route entry for the stations D, E, and F, to send packets to different stations. This reduces storage space.
[0156] The foregoing describes the mesh network and the method in embodiments of this application. The following describes an apparatus in embodiments of this application with reference to the accompanying drawings. The apparatus is applied to the first node in the foregoing embodiment.
[0157]
[0158] As shown in
[0159] a receiving unit 801, configured to receive a routing request from the second node, where the routing request is used for requesting the first STA to access the first node, and the routing request includes a first identifier for indicating the second node;
[0160] a determining unit 802, configured to determine, based on the first identifier in the routing request received by the receiving unit 801, a first route entry corresponding to a station connected to the second node, where the first route entry corresponds to the second STA; and a reusing unit 803, configured to reuse the first route entry determined by the determining unit 802 as a route entry of the first STA.
[0161] In embodiments of this application, for the at least two STAs under the same second node, the same first route entry may be reused on the first node, and only one route entry needs to be stored for all the STAs under the same second node. This reduces storage space occupied for storing route entries of the STAs.
[0162] Optionally, the determining unit 802 is configured to generate a first prefix based on the first identifier and at least a part of an address of the second node; and determine, based on the first prefix, the first route entry corresponding to a station connected to the second node, where the first route entry includes a field the same as the first prefix.
[0163] Optionally, the determining unit 802 is configured to search a route table based on the first identifier, to determine the first route entry corresponding to a station connected to the second node, where a target address field of the first route entry includes the first identifier.
[0164] Optionally, the first identifier is located in a node identifier field of the first route entry.
[0165] Optionally, the first identifier is located in an option field of the routing request.
[0166] Optionally, the first node is a mesh border router MBR, and the apparatus 80 further includes:
[0167] an allocation unit, configured to allocate the first identifier to the second node before the receiving unit receives the routing request; and
[0168] a first generation unit, configured to generate a second route entry from the MBR to the second node, where the second route entry includes the first identifier allocated by the allocation unit.
[0169] Optionally, the first node is a mesh gate MG, and the apparatus further includes a second generation unit;
[0170] the receiving unit 801 is further configured to receive the first identifier from a mesh border router MBR; and
[0171] the second generation unit is configured to generate a third route entry from the MG to the second node, where the third route entry includes the first identifier received by the receiving unit 801.
[0172] Optionally, the apparatus further includes:
[0173] a restarting unit, configured to restart before the receiving unit receives the routing request; and
[0174] a replacement unit, configured to replace the first identifier with a second identifier after the receiving unit receives the routing request from the second node.
[0175] Optionally, the apparatus further includes a sending unit;
[0176] the receiving unit 801 is further configured to receive a first downlink packet and a second downlink packet, where the first downlink packet includes a media access control MAC address of the first STA and a second prefix, the second downlink packet includes a MAC address of the second STA and the second prefix, and the second prefix is the same as content of the target address field of the first route entry;
[0177] the determining unit 802 is further configured to determine, based on the second prefix, the first route entry reused by the first STA and the second STA; and
[0178] the sending unit is configured to send the first downlink packet and the second downlink packet to the second node based on the first route entry determined by the determining unit 802.
[0179] It should be noted that related content of the route information storage apparatus 80 may be understood with reference to related descriptions in the method embodiment. Details are not described herein again.
[0180]
[0181] As shown in
[0182] a receiving unit 901, configured to receive a first downlink packet and a second downlink packet, where the first downlink packet includes a MAC address of the first STA and a second prefix, the second downlink packet includes a MAC address of the second STA and the second prefix, and the second prefix is the same as content of the target address field of the first route entry;
[0183] a determining unit 902, configured to determine, based on the second prefix received by the receiving unit 901, the first route entry reused by the first STA and the second STA, where the first route entry corresponds to each STA under the second node; and
[0184] a sending unit 903, configured to send the first downlink packet and the second downlink packet to the second node based on the first route entry determined by the determining unit 902.
[0185] In this embodiment of this application, for downlink packets sent to different STAs, the first node may use a same route entry for sending, and the first node needs to store only one route entry for the different STAs. This reduces storage space occupied for storing route entries of the STAs.
[0186] Optionally, the determining unit 902 is configured to search target address fields in a route table based on the second prefix, to determine the first route entry whose content of the target address field is the same as the second prefix.
[0187]
[0188] The processing circuit 1001 may be a general-purpose processing circuit, a digital signal processing circuit, an application-specific integrated circuit, a field programmable gate array or another programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The processing circuit may implement or execute various example logical blocks, modules, and circuits described with reference to content disclosed in this application. The processing circuit 1001 may alternatively be a combination for implementing a computing function, for example, a combination including one or more microprocessing circuits, or a combination of a digital signal processing circuit and a microprocessing circuit.
[0189] In another embodiment of this application, a computer-readable storage medium is further provided. The computer-readable storage medium stores computer-executable instructions. When at least one processing circuit of a device executes the computer-executable instructions, the device performs the route information storage method and the packet sending method described in embodiments in
[0190] In another embodiment of this application, a computer program product is further provided. The computer program product includes computer-executable instructions, and the computer-executable instructions are stored in a computer-readable storage medium. At least one processing circuit of a device may read the computer-executable instructions from the computer-readable storage medium, and the at least one processing circuit executes the computer-executable instructions, so that the device performs the route information storage method and the packet sending method described in embodiments in
[0191] In another embodiment of this application, a chip system is further provided. The chip system includes a processing circuit, configured to support a route information storage apparatus in implementing functions in the route information storage method and the packet sending method described in embodiments in
[0192] A person of ordinary skill in the art may be aware that, in combination with the examples described in embodiments disclosed in this specification, units and algorithm steps may be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed by hardware or software depends on particular applications and design constraint conditions of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of embodiments of this application.
[0193] It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments. Details are not described herein again.
[0194] In the several embodiments provided in embodiments of this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, division into the units is merely logical function division and may be other division during actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in an electrical form, a mechanical form, or another form.
[0195] The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one location, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objective of the solutions of embodiments.
[0196] In addition, functional units in embodiments of this application may be integrated into one processing unit, each of the units may exist alone physically, or two or more units may be integrated into one unit.
[0197] When the functions are implemented in a form of a software function unit and sold or used as an independent product, the functions may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the conventional technology, or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the methods described in embodiments of this application. The foregoing storage medium includes various media that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk, or an optical disc.