Address assignment method and device
The method addresses the inefficiencies in the DHCP address allocation scheme by directly assigning network addresses based on type identifiers, thereby simplifying the process and improving efficiency.
Patent Information
- Application Number
- JP2024563177
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-05-02
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing DHCP address allocation scheme is complex and time-consuming, leading to reduced network address allocation efficiency due to the need for multiple interactions between DHCP clients and servers to verify address availability.
A method and apparatus for improving network address allocation efficiency by directly assigning network addresses of a specified type to nodes or services based on a type identifier, simplifying the address allocation interaction process.
The proposed method enhances network address allocation efficiency by streamlining the interaction process and reducing the load on nodes, while ensuring unique and non-overlapping address assignments.
Smart Images

Figure 2025514165000001_ABST
Abstract
Description
[Technical field]
[0001] The present application relates to the field of wireless communication, and in particular to an address assignment method and apparatus. [Background technology]
[0002] Wireless communication is widely used in scenarios such as smart cars, smart homes, smart terminals, and smart manufacturing. Compared with wired communication, wireless communication can effectively shorten the harness, reduce the weight of the harness, and reduce the number of connectors.
[0003] In general, the Dynamic Host Configuration Protocol (DHCP) is typically used to dynamically assign Internet Protocol IP addresses to nodes in a network for use in communication. The node used to assign IP addresses is called a DHCP server, and the node that needs to obtain an IP address is called a DHCP client.
[0004] In the DHCP address allocation method, after a DHCP client selects a network address from the network addresses provided by multiple DHCP servers, each of the multiple DHCP servers needs to further confirm whether the DHCP server is the selected DHCP server, and the selected DHCP server needs to further send an acknowledgement message indicating that the network address is available for the DHCP client. Such an interaction process of address allocation is complicated and time-consuming, which reduces the efficiency of network address allocation. Summary of the Invention
[0005] This application discloses an address allocation method and apparatus for allocating network addresses of a specified address type and improving network address allocation efficiency.
[0006] According to a first aspect, the present application provides a method for address allocation, the method comprising: receiving a first message sent by a first node, where the first message includes a first type identifier, the first type identifier indicating a first address type; and sending a second message to the first node, where the second message includes a first network address assigned to the first node or a service of the first node, the address type of the first network address being the first address type.
[0007] The method may be applied to scenarios such as in-vehicle communication, smart home, and battery management system (BMS). In the in-vehicle communication scenario, the first node may be, for example, a user terminal in a vehicle, or a component in a user terminal (for example, a board, a line card, or a chip). The user terminal may be, for example, a mobile phone, a tablet computer, a palmtop computer, a desktop computer, an earphone, a speaker, a wearable device, an in-vehicle device, a virtual reality device, or an augmented reality device. The second node may be, for example, a telematics box (T-Box). In the smart home scenario, the first node may be, for example, a home device or a component in a home device. The home device may be, for example, a television, a floor scanning robot, a printer, a projector, a user mobile phone, a rice cooker, a speaker, a microphone, or a wireless router. The second node may be, for example, a gateway, a customer premises equipment (CPE), a wireless router, or a user mobile phone. In the BMS scenario, the first node may be, for example, a battery monitoring unit (BMU). The second node may be, for example, a battery control unit (BCU) or a BMU.
[0008] In the above method, a network address of a specified address type is provided for the first node or a service on the first node based on a first type identifier carried in the first message, which indicates a first address type. The interaction process of address allocation is simple, and network address allocation efficiency is improved.
[0009] Optionally, the method is applied to a second node, the first node and the second node belonging to a first communication domain.
[0010] For example, before receiving the first message sent by the first node, the method further includes the steps of receiving an access request sent by the first node; and accessing the first node based on the access request.
[0011] Optionally, the first address type is a communication domain address or an IP address.
[0012] The first address type is an address type to which the first network address expected to be assigned belongs. When the first address type is a communication domain address, the first network address is a network layer short address, the length of the first network address may be 2 bytes (i.e., 16 bits), and the first network address may be used to address in a corresponding communication system. For example, for SparkLink communication technology, the communication domain address may be used to address in the SparkLink communication system. The communication domain address may be understood to be another address type different from an IP address.
[0013] In implementation, when the first address type is a communication domain address, the length of the first network address may also be 8 bits, 24 bits, or another number of bits, and this specification does not particularly limit this.
[0014] In such implementations, the address type of the network address to be assigned may be recognized based on the first address type.
[0015] Optionally, the method further comprises obtaining the first network address based on the first address type.
[0016] In the above implementation, the precise allocation of the first network address is implemented by using a first address type.
[0017] Optionally, the first message further includes an identity of the first node, and obtaining the first network address based on the first address type includes: obtaining the first network address based on a first mapping relationship, where the first mapping relationship represents a mapping relationship between the identity of the first node, the first network address, and the first address type, where the first mapping relationship belongs to a set that includes a mapping relationship between the identity of the node to which the network address is assigned, the network address of the node, and the address type of the network address of the node.
[0018] The first node identity identifies the first node. For example, the first node identity may be a Layer 2 Identification (L2ID).
[0019] In the above implementation, when a first network address is obtained based on the first mapping relationship, it indicates that a network address of the same type has been assigned to the first node in the past, and the network address is used as the first network address assigned to the first node, so that not only can the waste of network addresses be avoided, but also address conflicts can be avoided.
[0020] Optionally, the first message further includes an identity of the first node and an identifier of the first service of the first node, and the step of obtaining the first network address based on the first address type includes: obtaining the first network address based on a second mapping relationship, where the second mapping relationship represents a mapping relationship between the identity of the first node, the identifier of the first service, the first network address, and the first address type, where the second mapping relationship belongs to a set including a mapping relationship between an identifier of the service to which the network address is assigned, the network address of the service, the address type of the network address of the service, and the identity of the node on which the service is located.
[0021] In the above implementation, when a first network address is obtained based on the second mapping relationship, it indicates that the same type of network address has been assigned to the first service on the first node in the past, and the network address is used as the first network address assigned to the first service, so that not only can the waste of network addresses be avoided, but also address conflicts can be avoided.
[0022] Optionally, obtaining the first network address based on the first address type comprises allocating the first network address based on the first address type.
[0023] In this specification, the second node is a management node in the first communication domain.
[0024] That is, the second node may directly assign the first network address to the first node or the first service on the first node. In the conventional DHCP address allocation method, after the node selects a network address from the network addresses provided by the multiple DHCP servers, each of the multiple DHCP servers further needs to determine whether the DHCP server is the selected DHCP server, and the selected DHCP server further needs to send an acknowledgement message to indicate that the node can use the address. The interaction process is complicated and time-consuming. Compared with the conventional DHCP address allocation method, the second node directly assigns the first network address, and the signaling interaction process in the DHCP acknowledgement stage is omitted. This shortens the interaction process of address allocation and improves address allocation efficiency.
[0025] Optionally, the first message further includes an identifier of a first service on the first node, and obtaining the first network address based on the first address type includes obtaining a first network address assigned to the first service based on the first address type and the identifier of the first service.
[0026] In such an implementation, a first network address is assigned to a first service on a first node.
[0027] Optionally, when the first address type is an IP address, the method further comprises: sending a third message to a Dynamic Host Configuration Protocol DHCP server, where the third message includes the first type identifier, and the third message further includes one or more of the following: an identity of the first node, and an identifier of a first service on the first node; and receiving a fourth message sent by the DHCP server, where the fourth message includes the first network address, and the first network address is assigned by the DHCP server based on the third message.
[0028] In another implementation, alternatively, the second node may: send a third message to a plurality of DHCP servers, where the third message includes a first type identifier, and the third message further includes one or more of an identity of the first node and an identifier of a first service on the first node; receive a fourth message sent by the plurality of DHCP servers, where the fourth message corresponding to the DHCP server includes a first network address assigned by the DHCP server based on the third message; and obtain the first network address based on the fourth message sent by a target DHCP server in the plurality of DHCP servers. In this case, compared with the traditional DHCP address allocation method, the client's work of performing address selection and receiving an acknowledgement message from the DHCP server is offloaded to the second node. In this way, the load of the first node can be reduced, the protocol stack on the first node is lightened, and the power consumption of the first node is reduced. The target DHCP server may be the DHCP server corresponding to the maximum signal strength, or may be the DHCP server corresponding to the fourth message received first by the second node, or may be the DHCP server corresponding to the highest priority, or may be determined by the second node based on multiple factors of the detected signal strength, the priority information of the DHCP server, and the reception time corresponding to the third message, but this specification is not particularly limited thereto.
[0029] In an implementation, the third message includes all information related to the allocation of the first network address in the first message.
[0030] For example, if the first message received by the second node includes a first type identifier and an identity of the first node, the third message also includes the first type identifier and an identity of the first node, in this case, the first network address is assigned to the first node by a DHCP server based on the third message.
[0031] As another example, if the first message received by the second node includes a first type identifier, an identity of the first node, and an identifier of the first service, the third message also includes the first type identifier, an identity of the first node, and an identifier of the first service, in this case, the first network address is assigned by the DHCP server to the first service on the first node based on the third message.
[0032] Furthermore, when the first message received by the second node further includes other information related to address allocation, the third message further includes the same other information related to address allocation. For example, the other information related to address allocation further includes at least one of unicast address identification information, multicast address identification information, anycast address identification information, or quantity identification information. For details of each information, please refer to the relevant description of the corresponding information below. The details will not be described again here.
[0033] It may be understood that the second node may send the third message to the DHCP server and the second node may be considered a forwarding node, however, the second node does not directly forward or transparently transmit the first message, but rather transmits the information in the first message related to the allocation of the first network address by sending the third message.
[0034] In the above implementation, when the second node is a management node in the communication domain but the second node does not have a DHCP function, the second node may further request the DHCP server to allocate a first network address to the first node or the first service on the first node through a third message, thereby enriching the application scenario of address allocation.
[0035] Optionally, the method further comprises: sending a third message to a third node, where the third message includes the first type identifier, and the third message further includes one or more of an identity of the first node and an identifier of the first service on the first node, the third node being a management node in the first communication domain; and receiving a fifth message sent by the third node, where the fifth message includes the first network address, and the first network address is assigned by the third node based on the third message.
[0036] For details of the third message, please refer to the relevant description of the third message above, and the details will not be described again here.
[0037] In the above implementation, the second node may further request, via a third message, a management node in the communication domain to allocate a first network address to the first node or to a first service on the first node, thereby enriching application scenarios of address allocation.
[0038] Optionally, the first communication domain includes a plurality of management nodes, and the method further comprises: sending a third message to the plurality of management nodes, where the third message includes a first type identifier, and the third message further includes one or more of an identity of the first node and an identifier of the first service on the first node; receiving a sixth message sent by the plurality of management nodes, where the sixth message corresponding to the management node includes a network address assigned by the management node based on the third message; and obtaining the first network address based on the sixth message sent by a target management node in the plurality of management nodes.
[0039] For details of the third message, please refer to the relevant description of the third message above, and the details will not be described again here.
[0040] For example, the target management node may be the management node corresponding to the highest priority, or may be the management node corresponding to the maximum signal strength, or may be the management node corresponding to the first received sixth message, or may be determined by the second node based on multiple factors including the priority information of the management nodes, the detected signal strength, and the time of receiving the sixth message, etc. This specification is not particularly limited thereto.
[0041] In the above implementation, the second node may request multiple management nodes in the communication domain to allocate a first network address through the third message, and select a first network address provided by one management node from the first network addresses allocated by the multiple management nodes, thereby enriching the application scenario of address allocation.
[0042] Optionally, the first address type is an IP address, and the method further comprises: obtaining a previously assigned second network address, where the second network address is a network address used by the first node in the first communication domain and has an address type of a communication domain address; and obtaining the first network address based on an IPv6 prefix of the first communication domain and the second network address.
[0043] In the above implementation, a second network address of type communication domain address previously assigned to the first node is used as an interface identifier of the first node, where the interface identifier is used to construct a local IPv6 address of the first node, so that consumption of address quantity can be reduced and the first network address assigned to node 1 can be determined to be non-duplicate.
[0044] Optionally, the first address type is an IP address, and the method further comprises: assigning a second network address to the first node, where an address type of the second network address is a communication domain address; and obtaining the first network address based on an IPv6 prefix of the first communication domain and the second network address.
[0045] In the above implementation, the second node can directly assign a local IPv6 address to the first node, which enriches the application scenarios of address assignment.
[0046] Optionally, the first address type is an IP address, and the method further comprises: sending a third message to a fourth node, where the third message includes the first type identifier and an identity of the first node, the fourth node being a management node in the first communication domain; and receiving a seventh message sent by the fourth node, where the seventh message includes a first network address assigned by the fourth node based on the third message, the first network address including an IPv6 prefix of the first communication domain, and a second network address, the second network address being a network address used by the first node in the first communication domain, the address type being a communication domain address.
[0047] In an implementation, the third message includes all information related to the allocation of the first network address in the first message.
[0048] For example, in addition to the first type identifier and the identity of the first node, the first message received by the second node further includes other information related to the allocation of the first network address, such as one or more items of unicast address identification information, multicast address identification information, or quantity identification information. In this case, in addition to the first type identifier and the identity of the first node, the third message further includes the same other information related to the allocation of the first network address. For a specific description of the unicast address identification information, multicast address identification information, and quantity identification information, please refer to the following description of the corresponding information. This specification does not particularly limit this.
[0049] In the above implementation, the second node may request a management node in the communication domain to assign a local IPv6 address to the first node via a third message, thereby enriching the application scenario of address assignment.
[0050] Optionally, the first message further includes at least one of the following information: a unicast address identification indicating that the first network address is a unicast address; a multicast address identification indicating that the first network address is a multicast address; an anycast address identification indicating that the first network address is an anycast address; or a quantity identification indicating a quantity of the first network addresses being claimed.
[0051] The unicast address identification information is optional information in the first message. The unicast address identification information may be represented by using a flag bit, a field or a bit. The flag bit is used as an example. When the corresponding flag bit is set, it indicates that the first network address is a unicast address. Through the unicast address identification information, the second node may recognize that the first network address requested by the first node to be assigned to the first node or the first service on the first node is used for unicast.
[0052] The multicast address identification information is optional information in the first message. The multicast address identification information may be represented by using a flag bit, a field, or a bit. Through the multicast address identification information, the second node may recognize that the first network address requested by the first node to be assigned to the first node or the first service on the first node is used for multicast.
[0053] In this specification, the unicast address identification information and the multicast address identification information may be represented separately as described above, or may be represented by using one flag bit, for example, when the flag bit is a first value, it indicates that the first network address is used for unicast, or when the flag bit is a second value, it indicates that the first network address is used for multicast.
[0054] The anycast address identification information is optional information in the first message, through which the second node may recognize that the first network address requested by the first node to be assigned to the first service on the first node is used for anycast.
[0055] If the first network address is assigned to the first node, the first network address may be a unicast address or a multicast address. If the first network address is assigned to a first service on the first node, the first network address may be a unicast address, a multicast address, or an anycast address.
[0056] For example, the unicast address identification information, the multicast address identification information, and the anycast address identification information may be represented separately, or may be represented jointly by using a single field, a single flag bit, or the like, although this specification is not particularly limited in this regard.
[0057] The quantity identification information is optional information in the first message. The quantity identification information corresponds to the quantity of the identifiers of the first service in the first message. Specifically, the quantity of the applied first network addresses is the same as the quantity of the identifiers of the first service. For example, the identifiers of the first service included in the first message include AID1, AID2, and AID3. This means that the first message is used to apply for allocation of one first network address to each of three services: AID1, AID2, and AID3, that is, the quantity of the identifiers of the first service in the first message is three. In this case, the applied quantity of the first network addresses, indicated by the quantity identification information, is also three. It can be seen that when there are multiple identifiers of the first service in the first message, the first message further includes quantity identification information. The corresponding network addresses can be assigned to multiple services on the first node through the quantity identification information.
[0058] When there are multiple first service identifiers in the first message, each identifier of the first service may alternatively have a corresponding unicast address identification, multicast address identification, or anycast address identification. In some possible embodiments, when the first network addresses corresponding to the multiple first service identifiers are all used for unicast, multicast, or anycast, the first network addresses may alternatively be represented by using one flag bit.
[0059] Optionally, the method further comprises: receiving an eighth message sent by the first node, where the eighth message includes a second type identifier, the second type identifier indicating a second address type, the second address type different from the first address type; and sending a ninth message to the first node, where the ninth message includes a third network address assigned to the first node or a service on the first node, and an address type of the third network address is the second address type.
[0060] In such implementations, network addresses of different address types may be assigned to the first node or to services on the first node.
[0061] According to a second aspect, the present application provides an address allocation method applied to a first node, the method comprising the steps of: sending a first message to a second node, where the first message includes a first type identifier, the first type identifier indicating a first address type; receiving a second message sent by the second node, where the second message includes a first network address assigned to the first node or a service on the first node, the address type of the first network address being the first address type; and obtaining the first network address based on the second message.
[0062] The method may be applied to scenarios such as in-vehicle communication, smart home, and battery management system (BMS). In an in-vehicle communication scenario, the first node may be, for example, a user terminal in a vehicle, or a component in a user terminal (for example, a board, a line card, or a chip). The user terminal may be, for example, a mobile phone, a tablet computer, a palmtop computer, a desktop computer, an earphone, a speaker, a wearable device, an in-vehicle device, a virtual reality device, or an augmented reality device. The second node may be, for example, a telematics box (T-Box). In a smart home scenario, the first node may be, for example, a home device or a component in a home device. The home device may be, for example, a television, a floor scanning robot, a printer, a projector, a user mobile phone, a rice cooker, a speaker, a microphone, or a wireless router. The second node may be, for example, a gateway, a customer premises equipment (CPE), a wireless router, or a user mobile phone. In a BMS scenario, the first node may be, for example, a battery monitoring unit (BMU), and the second node may be, for example, a battery control unit (BCU) or a BMU.
[0063] In the above implementation, the address type is specified by using a first type identifier carried in the first message, and the network addresses of the specified address type allocated to the first node or the service on the first node are obtained only from the second node accessed by the first node. The interaction process of address allocation is simple, which helps improve the efficiency of network address allocation.
[0064] Optionally, the first node and the second node belong to a first communication domain.
[0065] For example, before sending the first message to the second node, the method may further include: receiving a broadcast message sent by the second node, where the broadcast message includes a service identifier, the service identifier indicating that the second node provides an address allocation service; and sending an access request to the second node to request access to the second node.
[0066] In another implementation, before sending the first message to the second node, the following steps may be performed: receiving a broadcast message transmitted by at least one node, where the broadcast message corresponding to the node includes a service identifier corresponding to the node, and the service identifier corresponding to the node instructs the node to provide an address allocation service; selecting a second node from the at least one node as an access point for the first node based on the broadcast message transmitted by the at least one node; and transmitting an access request to the second node to request access to the second node.
[0067] Furthermore, the second node may be the node corresponding to the greatest signal strength, may be the node corresponding to the highest priority, may be the node corresponding to the broadcast message received first by the first node, or may be determined by the first node from at least one node based on multiple factors of the detected signal strength and the time when the first node receives the broadcast message, but this specification is not particularly limited thereto.
[0068] In the above implementation, the first node can timely discover nodes having address allocation capabilities and determine the nodes that are only accessed by the first node, thereby obtaining only assigned network addresses of the specified address type from the nodes.
[0069] Optionally, the first address type is a communication domain address or an IP address.
[0070] For a specific description of the first address type, please refer to the relevant description of the first address type in the first aspect, and the details will not be described again here.
[0071] Optionally, the first address type is an IP address, and the first network address is an IPv6 address used locally by the first node, the first network address including an IPv6 prefix of the first communication domain and a second network address, and the second network address is a network address used by the first node in the first communication domain, the address type being a communication domain address.
[0072] In the above implementation, a local IPv6 address is assigned to a first node, and a network address used by the first node in a first communication domain, whose address type is a communication domain address, is used as an interface identifier of the first node, where the interface identifier is used to construct a local IPv6 address of the first node, so that consumption of address quantity can be reduced.
[0073] Optionally, the first message further comprises an identifier of a first service on the first node, the first network address being assigned to the first service.
[0074] In the above implementation, a network address of a specified address type can be applied for a service on the first node, which enriches the application scenarios of address allocation.
[0075] Optionally, the first message further includes at least one of the following information: an identity of the first node; a unicast address identification indicating that the first network address is a unicast address; a multicast address identification indicating that the first network address is a multicast address; an anycast address identification indicating that the first network address is an anycast address; or a quantity identification indicating a quantity of the first network addresses being claimed.
[0076] The identity of the first node identifies the first node. For example, the identity of the first node may be a Layer 2 Identification (L2ID). For a specific description of the information in the first message, please refer to the related description of the corresponding information in the first message in the first aspect. The details will not be described again here.
[0077] Optionally, the method further comprises: sending a third message to the second node, where the third message includes a second type identifier, the second type identifier indicating a second address type, the second address type different from the first address type; receiving a fourth message sent by the second node, where the fourth message includes a third network address assigned to the first node or a service on the first node, where an address type of the third network address is the second address type; and obtaining the third network address based on the fourth message.
[0078] In the aforementioned implementation, the first node may change the address type of the network address, so that the first node may flexibly obtain network addresses of different address types.
[0079] According to a third aspect, the present application provides an address allocation apparatus, comprising: a receiving unit configured to receive a first message sent by a first node, where the first message includes a first type identifier, the first type identifier indicating a first address type; and a sending unit configured to send a second message to the first node, where the second message includes a first network address assigned to the first node or a service on the first node, where the address type of the first network address is the first address type.
[0080] Optionally, the device and the first node belong to a first communication domain.
[0081] In an implementation, the receiving unit is further configured to receive an access request sent by the first node. The apparatus further comprises a processing unit configured to access the first node based on the access request.
[0082] Optionally, the first address type is a communication domain address or an IP address.
[0083] Optionally, the processing unit is further configured to obtain the first network address based on the first address type.
[0084] Optionally, the first message further includes an identity of the first node, and the processing unit is specifically configured to: obtain the first network address based on a first mapping relationship, where the first mapping relationship represents a mapping relationship between the identity of the first node, the first network address, and the first address type, where the first mapping relationship belongs to a set including a mapping relationship between the identity of the node to which the network address is assigned, the network address of the node, and the address type of the network address of the node.
[0085] Optionally, the first message further includes an identity of the first node and an identifier of the first service on the first node, and the processing unit is specifically configured to: obtain the first network address based on a second mapping relationship, where the second mapping relationship represents a mapping relationship between the identity of the first node, the identifier of the first service, the first network address, and the first address type, where the second mapping relationship belongs to a set including mapping relationships between an identifier of the service to which the network address is assigned, the network address of the service, the address type of the network address of the service, and the identity of the node on which the service is located.
[0086] Optionally, the processing unit is specifically configured to assign the first network address based on the first address type.
[0087] Optionally, the first message further includes an identifier of the first service on the first node, and the processing unit is specifically configured to obtain a first network address assigned to the first service based on the first address type and the identifier of the first service.
[0088] Optionally, the first address type is an IP address. The sending unit is further configured to send a third message to a Dynamic Host Configuration Protocol DHCP server, where the third message includes the first type identifier, and the third message further includes one or more of: an identity of the first node, and an identifier of a first service on the first node. The receiving unit is further configured to receive a fourth message sent by the DHCP server, where the fourth message includes the first network address, and the first network address is assigned by the DHCP server based on the third message.
[0089] Optionally, the sending unit is further configured to send a third message to a third node, where the third message includes the first type identifier, where the third message further includes one or more of an identity of the first node and an identifier of the first service on the first node, where the third node is a management node in the first communication domain. The receiving unit is further configured to receive a fifth message sent by the third node, where the fifth message includes the first network address, where the first network address is assigned by the third node based on the third message.
[0090] Optionally, the first communication domain includes a plurality of management nodes. The sending unit is further configured to send a third message to the plurality of management nodes, where the third message includes the first type identifier, and the third message further includes one or more of an identity of the first node and an identifier of a first service on the first node. The receiving unit is further configured to receive a sixth message sent by the plurality of management nodes, where the sixth message corresponding to the management node includes a network address assigned by the management node based on the third message. The processing unit is further configured to obtain the first network address based on the sixth message sent by a target management node in the plurality of management nodes.
[0091] Optionally, if the first address type is an IP address, the processing unit is further configured to: obtain a previously assigned second network address, where the second network address is a network address used by the first node in the first communication domain and has an address type of a communication domain address; and obtain the first network address based on an IPv6 prefix of the first communication domain and the second network address.
[0092] Optionally, the first address type is an IP address. The processing unit is further configured to: assign a second network address to the first node, where an address type of the second network address is a communication domain address; and obtain the first network address based on an IPv6 prefix of the first communication domain and the second network address.
[0093] Optionally, the first address type is an IP address. The sending unit is further configured to send a third message to a fourth node, where the third message includes the first type identifier and an identity of the first node, the fourth node being an administrative node in the first communication domain. The receiving unit is further configured to receive a seventh message sent by the fourth node, where the seventh message includes a first network address assigned by the fourth node based on the third message, the first network address includes an IPv6 prefix of the first communication domain and a second network address, the second network address being a network address used by the first node in the first communication domain, the address type being a communication domain address.
[0094] Optionally, the first message further includes at least one of the following information: a unicast address identification indicating that the first network address is a unicast address; a multicast address identification indicating that the first network address is a multicast address; an anycast address identification indicating that the first network address is an anycast address; or a quantity identification indicating a quantity of the first network addresses being claimed.
[0095] Optionally, the receiving unit is further configured to receive an eighth message sent by the first node, where the eighth message includes a second type identifier, the second type identifier indicating a second address type, the second address type different from the first address type. The sending unit is further configured to send a ninth message to the first node, where the ninth message includes a third network address assigned to the first node or a service on the first node, and an address type of the third network address is the second address type.
[0096] According to a fourth aspect, the present application provides an address acquisition apparatus, comprising: a sending unit configured to send a first message to a second node, where the first message includes a first type identifier, the first type identifier indicating a first address type; a receiving unit configured to receive a second message sent by the second node, where the second message includes a first network address assigned to the first node or a service on the first node, where the address type of the first network address is the first address type; and an acquiring unit configured to acquire the first network address based on the second message.
[0097] Optionally, the first node and the second node belong to a first communication domain.
[0098] In an implementation, the receiving unit is further configured to receive a broadcast message transmitted by the second node, where the broadcast message includes a service identifier, the service identifier indicating that the second node provides an address allocation service. The sending unit is further configured to send an access request to the second node to request access to the second node.
[0099] Optionally, the first address type is a communication domain address or an IP address.
[0100] Optionally, the first address type is an IP address, and the first network address is an IPv6 address used locally by the first node, the first network address including an IPv6 prefix of the first communication domain and a second network address, and the second network address is a network address used by the first node in the first communication domain, the address type being a communication domain address.
[0101] Optionally, the first message further comprises an identifier of a first service on the first node, the first network address being assigned to the first service.
[0102] Optionally, the first message further includes at least one of the following information: an identity of the first node; a unicast address identification indicating that the first network address is a unicast address; a multicast address identification indicating that the first network address is a multicast address; an anycast address identification indicating that the first network address is an anycast address; or a quantity identification indicating a quantity of the first network addresses being claimed.
[0103] Optionally, the sending unit is further configured to send a third message to the second node, where the third message includes a second type identifier, where the second type identifier indicates a second address type, where the second address type is different from the first address type. The receiving unit is further configured to receive a fourth message sent by the second node, where the fourth message includes a third network address assigned to the first node or a service on the first node, where the address type of the third network address is the second address type. The obtaining unit is further configured to obtain the third network address based on the fourth message.
[0104] According to a fifth aspect, the present application provides an address allocation apparatus, the apparatus comprising at least one processor and a communication interface, the communication interface being configured to provide information input and / or output for the at least one processor, the apparatus being configured to implement a method according to the first aspect or any one of the possible embodiments of the first aspect.
[0105] According to a sixth aspect, the present application provides an address obtaining apparatus, the apparatus comprising at least one processor and a communication interface, the communication interface being configured to provide information input and / or output for the at least one processor, the apparatus being configured to implement a method according to the second aspect or any viable implementation of the second aspect.
[0106] According to a seventh aspect, the present application provides a computer readable storage medium comprising computer instructions which, when executed by a processor, implement a method according to the first aspect or any executable implementation of the first aspect.
[0107] According to an eighth aspect, the present application provides a computer readable storage medium comprising computer instructions which, when executed by a processor, implement a method according to the second aspect or any executable implementation of the second aspect.
[0108] According to a ninth aspect, the present application provides a computer program product. When the computer program product is executed by a processor, the method according to the first aspect or any executable implementation of the first aspect is implemented. For example, the computer program product may be a software installation package. When the method provided in any possible design of the first aspect needs to be used, the computer program product may be downloaded and executed on the processor to implement the method according to the first aspect or any executable implementation of the first aspect.
[0109] According to a tenth aspect, the present application provides a computer program product. When the computer program product is executed by a processor, the method according to the second aspect or any executable implementation of the second aspect is implemented. For example, the computer program product may be a software installation package. When the method provided in any possible design of the second aspect needs to be used, the computer program product may be downloaded and executed on the processor and implements the method according to the second aspect or any executable implementation of the second aspect.
[0110] According to an eleventh aspect, the present application provides a terminal, the terminal comprising a first device or a second device, the first device being a device according to the fourth aspect or any possible implementation of the fourth aspect or a device according to the sixth aspect, the second device being a device according to the third aspect or any possible implementation of the third aspect or a device according to the fifth aspect.
[0111] Examples of terminals include, but are not limited to, smart home devices (e.g., televisions, floor scanning robots, smart desk lamps, speaker systems, intelligent lighting systems, electrical control systems, home background music, home theater systems, intercom systems, and video surveillance), smart transportation equipment (e.g., automobiles, ships, unmanned aerial vehicles, trains, trucks and lorries), smart manufacturing equipment (e.g., robots, industrial equipment, smart logistics, and smart factories), and smart terminals (mobile phones, computers, tablet computers, palmtop computers, desktop computers, headsets, speakers, wearable devices, in-vehicle devices, virtual reality devices, augmented reality devices, and the like).
[0112] According to a twelfth aspect, the present application provides a communication system. The system comprises a first device and a second device. The first device is a device according to the fourth aspect or any possible implementation of the fourth aspect, or a device according to the sixth aspect. The second device is a device according to the third aspect or any possible implementation of the third aspect, or a device according to the fifth aspect. [Brief description of the drawings]
[0113] [Figure 1] 1 is a diagram of some system architectures according to embodiments of the present application.
[0114] [Diagram 2] FIG. 1 is a diagram of a smart home wireless communication scenario according to an embodiment of the present application.
[0115] [Diagram 3] 2 is a flowchart of an address allocation method according to an embodiment of the present application;
[0116] [Figure 4] 4 is a flowchart of another address allocation method according to an embodiment of the present application;
[0117] [Diagram 5] 4 is a flowchart of another address allocation method according to an embodiment of the present application;
[0118] [Figure 6] 4 is a flowchart of another address allocation method according to an embodiment of the present application;
[0119] [Figure 7] FIG. 2 is a structural diagram of an address assignment device according to an embodiment of the present application;
[0120] [Figure 8] FIG. 2 is a structural diagram of an address acquisition device according to an embodiment of the present application;
[0121] [Figure 9] FIG. 2 is a diagram of the structure of a communication device according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0122] The terms used in the embodiments of the present application are merely intended to describe certain embodiments and are not intended to limit the present application. In the specification and claims of the present application, prefixes such as "first" and "second" are used only to distinguish different described objects, and do not constitute any limitations on the location, order, priority, quantity, content, or the like of the described objects. In the embodiments of the present application, the use of prefixes used to distinguish described objects does not constitute limitations on the described objects. Please refer to the context description in the claims or embodiments for the description of the described objects. The use of prefixes should not constitute any unnecessary limitations.
[0123] In the embodiments of the present application, a description such as "at least one of a1, a2, ..., or an" is used, which includes the case where any one of a1, a2, ..., and an exists alone, and also includes the case where any combination of a1, a2, ..., and an exists. Each case may exist alone. For example, the description "at least one of a, b, or c" includes the cases of a single a, a single b, a single c, a combination of a and b, a combination of a and c, a combination of b and c, or a combination of a, b, and c.
[0124] Hereinafter, the technical solutions of the embodiments in the present application will be described with reference to the accompanying drawings.
[0125] FIG. 1 is an example diagram of three system architectures to which the embodiments of the present application are applicable, for example as shown in FIG. 1(a), (b) and (c).
[0126] The communication domain includes a plurality of communication devices. There is a communication connection relationship (i.e., a communication link) between the communication devices, and the communication devices may exchange information through the communication link. The plurality of communication devices includes at least one management node and at least one end node. The management node may also be referred to as a grant node (G node for short), and the end node may also be referred to as an end node (T node for short). The G node is configured to transmit data scheduling information in an access layer of the communication system (e.g., the SparkLink communication system). The T node is configured to receive the data scheduling information in the access layer of the communication system, and transmit corresponding data based on the received data scheduling information.
[0127] FIG. 1(a) shows a star single-hop topology structure. In FIG. 1(a), a communication domain 1 includes a node G and a plurality of nodes T (e.g., T1, T2, ..., and Tn), where node G is an access point for each node T, node G is a management node in the communication domain 1, and node G may assign an IP address to node T, for example, node G serves as a DHCP server to assign an IP address to node T, or node G serves as an IP address assignment agent to request a DHCP server to assign an IP address to node T. In some possible embodiments, the communication domain 1 may be, for example, a SparkLink domain in a SparkLink communication system. In this case, node G may further assign a network address of a communication domain address type to node T, and implement addressing in the SparkLink communication system. In FIG. 1(a), communication between node G and node T may be bidirectional unicast or may be a broadcast communication from G to T.
[0128] Optionally, the architecture shown in FIG. 1(a) is applicable to an in-vehicle communication scenario. For example, in an in-vehicle communication scenario, node G may be a telematics box (T-Box), and node T may be a user terminal in a vehicle, where the user terminal may be, for example, a mobile phone, a tablet computer, a palmtop computer, a desktop computer, an earphone, a speaker, a wearable device, an in-vehicle device, a virtual reality device, or an augmented reality device. The T-Box may also be referred to as a remote in-vehicle terminal or an Internet of Vehicles communication terminal. The T-Box is generally used as a wireless gateway to provide a remote communication interface for the whole vehicle, providing services including driving data collection, driving route recording, vehicle fault monitoring, remote vehicle query and control, driving behavior analysis, and wireless hotspot sharing. For example, the T-Box can send collected vehicle data (e.g., drive motor data, vehicle data, battery data, and status data of a new energy vehicle) to a cloud platform, and forward control instructions received from the cloud platform to the vehicle. Alternatively, the T-Box can establish a transmission channel with a mobile phone app through Bluetooth to control door opening, door locking, vehicle window control, air conditioning switch, engine start and stop, and the like.
[0129] Fig. 1(b) shows a tree-like multi-hop topology structure. In Fig. 1(b), a communication domain 2 includes nodes G1, G2, G3, G4, and nodes T1, T2, and T3, where node G1 is connected to nodes G2 and G3, node G2 is further connected to nodes T1 and G4, node G3 is further connected to nodes T3 and G4, and node G4 is further connected to node T2. It can be seen that node G1 is an access point of nodes G2 and G3; node G2 is an access point of nodes T1 and G4; node G3 is an access point of nodes T3 and G4; and node G4 is an access point of node T2. Node G1 is a management node in communication domain 2, i.e., node G1 has an address allocation function and can allocate network addresses to other nodes in communication domain 2. When nodes G2, G3, and G4 have their own network addresses, nodes G2, G3, G4 may have an address allocation proxy service function.
[0130] In this communication scenario, it can be seen that the communication domain 2 includes a number of nodes G (nodes G1, G2, G3, and G4) and a number of nodes T (nodes T1, T2, and T3). Node G1 is a management node in the communication domain 2. Nodes G2, G3, and G4 are communication nodes with dual identities. Node G2 is used as an example. For communication between nodes G2 and T1, node G2 is used as node G, and node T1 is used as node T. For communication between nodes G2 and G1, node G1 is used as node G, and node G2 is used as node T. A communication node with dual identity, such as G2, can be denoted as G2(T).
[0131] Optionally, the architecture shown in (b) of FIG. 1 is applicable to a smart home scenario. FIG. 2 is a diagram of a smart home wireless communication scenario according to an embodiment of the present application. In FIG. 2, node G has IP capability, and node G includes a gateway / customer premises equipment (CPE), a child router, a mobile phone, and a large screen. The management node in the communication domain shown in FIG. 2 may be a gateway / customer premises equipment (CPE). Node G with dual identity may be a child router, a mobile phone, and a large screen. The T nodes in FIG. 2 include a smart lamp, an air conditioner, a printer, a microphone, and a sound box, where the T nodes include not only nodes G that support IP, such as a printer, but also nodes G that do not support IP, such as a smart lamp and an air conditioner.
[0132] Fig. 1(c) shows a tree-like three-layer multi-hop topology structure. In Fig. 1(c), the communication domain 3 includes nodes G1, G2, and G3, and nodes T1, T2, T3, and T4, where node G1 is connected to nodes G2 and G3, i.e., node G1 is an access point of nodes G2 and G3; node G2 is connected to nodes T1 and T2, i.e., node G2 is an access point of nodes T1 and T2; node G3 is connected to nodes T3 and T4, i.e., node G3 is an access point of nodes T3 and T4. Node G1 serves as a management node in the communication domain 3, node G1 may provide address allocation services, and nodes G2 and G3 may provide address allocation proxy services. In Fig. 1(b) and (c), the communication between node G and node T may be bidirectional unicast from T→G(T)→G or broadcast communication from G→G(T)→T.
[0133] Optionally, the architecture shown in Fig. 1(c) is applicable to a battery management system (BMS). For example, in Fig. 1(c), node G1 may be a battery control unit (BCU) in the BMS, nodes T1, T2, T3, and T4 may be battery monitoring units (BMUs), and nodes G2 and G3 may be BMUs with address allocation proxy service functions.
[0134] It should be noted that Fig. 1 is merely an example of an architecture diagram, and may alternatively be another form of architecture diagram, for example, a diagram of a tree-like four-layer (or more layers) multi-hop topology structure. In addition to the functional entities shown in Fig. 1, other functional entities may be included in Fig. 1 but are not shown in Fig. 1. In addition, the method provided in the embodiment of the present application may be applied to the communication system shown in Fig. 1. Of course, the method provided in the embodiment of the present application may alternatively be applied to another communication system. This is not limited to the embodiment of the present application.
[0135] 3 is a flowchart of an address allocation method according to an embodiment of the present application, the method including but not limited to the following steps:
[0136] S101: A first node sends a first message to a second node, where the first message includes a first type identifier, and the first type identifier indicates a first address type.
[0137] In response, the second node receives the first message sent by the first node.
[0138] The first node and the second node belong to a first communication domain. The second node enables the access of the first node based on an access request sent by the first node. In other words, the second node is an access point of the first node.
[0139] For example, in FIG. 1(a), the first node may be any node T among nodes T1, T2, . . . , and Tn, and the second node may be node G.
[0140] For example, in FIG. 1B, the first node may be any one of nodes T1, T2, and T3. If the first node is node T1, the second node is node G2. If the first node is node T2, the second node is node G4. If the first node is node T3, the second node is node G3. In some possible embodiments, when nodes T1, T2, and T3 in FIG. 1B are not accessed, the first node may alternatively be node G4, and the second node may be node G2 or G3. In some possible embodiments, when nodes T1, T2, T3, and G4 in FIG. 1B are not accessed, the first node may alternatively be node G2 or G3, and the second node is node G1.
[0141] For example, in (c) of FIG. 1, the first node may be any one of nodes T1, T2, T3, and T4. If the first node is T1 or T2, the second node is node G2. If the first node is node T3 or T4, the second node is node G3. In some possible embodiments, when nodes T1, T2, T3, and T4 in (c) of FIG. 1 are not accessed, the first node may be node G2 or G3, and the second node is node G1.
[0142] In this embodiment of the present application, the first address type is a communication domain address or an IP address.
[0143] The first address type is an address type to which the first network address expected to be assigned belongs. When the first address type is a communication domain address, the first network address is a network layer short address, the length of the first network address may be 2 bytes (i.e., 16 bits), and the first network address may be used to address in a corresponding communication system. For example, for SparkLink communication technology, the communication domain address may be used to address in the SparkLink communication system. The communication domain address may be understood to be another address type different from an IP address.
[0144] In some possible embodiments, when the first address type is a communication domain address, the length of the first network address may also be 8 bits, 24 bits, or another number of bits, although this specification is not particularly limited thereto.
[0145] For example, the first type identifier may indicate the first address type through bit mapping, a binary value, or another manner, e.g., when the first type identifier is a first value, the first address type is a communication domain address; or when the first type identifier is a second value, the first address type is an IP address.
[0146] Optionally, in some possible embodiments, before the first node transmits the first message to the second node, the first node first performs the following steps: determining that the second node is an access point of the first node.
[0147] In an implementation, determining that the second node is an access point of the first node includes receiving a broadcast message transmitted by the second node, where the broadcast message includes a service identifier, the service identifier indicating that the second node provides an address allocation service; and sending an access request to the second node to request access to the second node.
[0148] In another implementation, the step of determining that the second node is an access point of the first node includes: receiving a broadcast message transmitted by the at least one node, where the broadcast message corresponding to the node includes a service identifier corresponding to the node, and the service identifier corresponding to the node indicates that the node provides an address allocation service; selecting the second node from the at least one node as an access point of the first node based on a preset condition and the broadcast message transmitted by the at least one node; and transmitting an access request to the second node to request access to the second node.
[0149] The pre-set conditions include at least one of the following conditions: (1) a node corresponding to a broadcast message that is received first serves as the second node; (2) a node corresponding to the greatest signal strength serves as the second node; or (3) a node having the highest priority serves as the second node.
[0150] For example, the first message may be carried on a common management transport channel, the common management transport channel being a communication channel. It may be understood that before the first node obtains an assigned network address, the first node may access the second node by establishing a default bearer to activate the common management transport channel. In some possible embodiments, the first message may alternatively be carried on another communication channel. This specification is not particularly limited thereto.
[0151] In this embodiment of the present application, the first message further includes an identity of the first node, where the identity of the first node identifies the first node. For example, the identity of the first node may be a Layer 2 Identification (L2ID) of the first node. In this case, if the first message does not include an identifier of any service, it indicates that the first message is used to request that a first network address of a first address type be assigned to the first node.
[0152] In some possible embodiments, the first message further includes an identifier of the first service on the first node, indicating that the first message is used to request assignment of a first network address of the first address type to the first service on the first node.
[0153] S102: The second node obtains a first network address based on the first address type.
[0154] The type of the first network address is a first address type.
[0155] In this embodiment of the present application, the first network address can be assigned to the first node, or can be assigned to a service (also called an application) on the first node. The following specifically describes the process of assigning the first network address in two cases.
[0156] Case 1: A first network address is assigned to a first node.
[0157] In this embodiment of the present application, the first message further includes an identity of the first node, and obtaining the first network address based on the first address type includes obtaining a first network address to be assigned to the first node based on the first address type and the identity of the first node.
[0158] In a specific implementation, obtaining the first network address based on the first address type and the identity of the first node includes: when the first mapping information includes a first mapping relationship, obtaining the first network address based on the first mapping relationship, where the first mapping relationship represents a mapping relationship between the identity of the first node, the first network address, and the first address type, and the first mapping information is a set including a mapping relationship between the identity of the node to which the network address is assigned, the network address of the node, and the address type of the network address of the node.
[0159] When the first mapping information includes a first mapping relationship, it indicates that a network address of the same type has been assigned to the first node in the past, and the previously assigned network address of the same type is used as the first network address, so that waste of network addresses can be effectively avoided, and it can be further determined that the first network address assigned to the first node is not duplicated, which can be understood to prevent address conflict.
[0160] The first mapping information is maintained locally by the second node. The first mapping information may be represented by using a table, a diagram, or the like.
[0161] For example, when the first mapping information is represented by using a mapping table, the mapping table may be in the form shown in Table 1. Specifically, Table 1 shows a mapping relationship between the identity of a node, the address type of a network address, and the network address of a node. When the value of the address type of a network address is "0", it indicates that the address type of the network address is a communication domain address; or, when the value of the address type of a network address is "1", it indicates that the address type of the network address is an IP address. In Table 1, based on the mapping relationship "L2ID&1-0-Address 1", it can be seen that Address 1, whose address type is a communication domain address, was previously assigned to a node whose identity is L2ID&1. Based on the mapping relationship "L2ID&1-1-Address 2", it can be seen that Address 2, whose address type is an IP address, was previously assigned to a node whose identity is L2ID&1. Based on the mapping relationship "L2ID&3-0-Address 3", it can be seen that Address 3, whose address type is a communication domain address, was previously assigned to a node whose identity is L2ID&3.
[0162] It can be seen from Table 1 that two types of network addresses may have been assigned to a node in the past (e.g., a node whose identity is L2ID&1), or one type of network address may be assigned to a node (e.g., a node whose identity is L2ID&3), or no type of network address may have been assigned to a node in the past (e.g., a node whose identity is L2ID&3). Table 1 [Table 1]
[0163] It can be understood that Table 1 is used merely as an example to reflect the correspondence between the identity of the node, the address type of the network address, and the network address of the node. In practical applications, the text content and storage method of the correspondence may alternatively be in another form. This specification does not particularly limit this.
[0164] The process of the second node assigning a first network address to the first node by searching the first mapping information is specifically described based on Table 1. If the identity of the first node is "L2ID&1" and the value of the first type identifier is "1" (equivalent to the first address type being "communication domain address"), if it is found in Table 1 that the mapping relationship "L2ID&1-1-Address2" exists, then Address2 is used as the first network address assigned to the first node.
[0165] In this embodiment of the present application, when the first mapping information does not include the first mapping relationship, it indicates that the first network address of the first address type has not been assigned to the first node in the past. In this case, for specific assignment methods of the first network address, please refer to the following methods A1 and A2.
[0166] Scheme A1: The second node is a management node in the first communication domain.
[0167] In implementation, when the second node is a management node in the first communication domain, the second node assigns a first network address to the first node based on a first address type. The first address type may be a communication domain address or an IP address. For example, when the first address type is an IP address, the first network address may specifically be an IPv4 address or an IPv6 address.
[0168] In some possible embodiments, when the second node is an administration node in the first communication domain and the first address type is an IP address, the second node may send a third message to the DHCP server, where the third message includes the first type identifier and the identity of the first node; and may receive a fourth message sent by the DHCP server, where the fourth message includes the first network address assigned to the first node. In this case, the first network address is assigned to the first node by the DHCP server based on the third message. In other words, when the second node is an administration node in the first communication domain and the first address type is an IP address, if the second node does not have a DHCP function, the second node may request the DHCP server to assign the first network address, where the first address type is an IP address, to the first node via the third message.
[0169] When the second node is a management node in the first communication domain, it can be seen that: (1) when the first address type is a communication domain address, the first network address of the first node is assigned by the second node, and (2) when the first address type is an IP address, the first network address of the first node is assigned by the second node (when the second node has DHCP function), or the first network address of the first node is assigned by a DHCP server by using the second node (when the second node does not have DHCP function).
[0170] For example, referring to FIG. 1, the first node and the second node may satisfy any one of the following cases: (1) in FIG. 1(a), the first node is any node T, and the second node is node G; (2) in FIG. 1(b), the first node is node G2 or G3, and the second node is node G1; and (3) in FIG. 1(c), the first node is node G2 or G3, and the second node is node G1.
[0171] Scheme A2: The second node is not a management node in the first communication domain.
[0172] In an implementation, when the second node is not an administrative node in the first communication domain, the second node sends a third message to a third node, where the third message includes the first type identifier and an identity of the first node, and the third node is an administrative node in the first communication domain; and receives a fifth message sent by the third node, where the fifth message includes the first network address assigned to the first node. In this case, the first network address is assigned to the first node by the administrative node based on the third message.
[0173] In another implementation, when there are multiple management nodes in the first communication domain and the second node is not a management node in the first communication domain, the second node sends a third message to the multiple management nodes, where the third message includes a first type identifier and an identity of the first node; receives a sixth message sent by the multiple management nodes, where the sixth message corresponding to the management node includes a network address assigned to the first node by the management node based on the third message; selects a target management node from the multiple management nodes; and obtains the first network address based on the sixth message sent by the target management node.
[0174] For example, the target management node selected by the second node satisfies at least one of the following conditions: (1) a management node whose priority exceeds a preset level; (2) a management node corresponding to the sixth message first received by the second node; or (3) a management node whose signal strength exceeds a preset threshold.
[0175] For example, the target management node may be the management node with the highest priority, or the management node corresponding to the highest signal strength, although this specification is not particularly limited thereto.
[0176] In some possible embodiments, when there are multiple management nodes in the first communication domain, after the second node selects the target management node, the second node may further broadcast a response message, where the response message indicates that the second node has selected the network address provided by the target management node. In this way, the target management node receiving the response message may store a mapping relationship between the network address assigned to the first node, the first address type, and the identity of the first node, and another management node receiving the response message may recognize that the network address provided by another management node is not selected by the second node. In this way, the provided network address may be reclaimed, and address waste is avoided.
[0177] In the above two implementations, the type of the first network address can be a communication domain address or an IP address. This specification does not particularly limit this. For example, when the first address type is an IP address, the first network address can specifically be an IPv4 address or an IPv6 address.
[0178] When the second node is not a management node in the first communication domain, it can be seen that: (1) when there is only one management node in the first communication domain, the second node sends the third message to the management node, in this case the first network address is assigned by the management node to the first node by using the second node; (2) when there are multiple management nodes in the first communication domain, the second node broadcasts the third message to the multiple management nodes, and may select a network address provided by one management node from the network addresses provided by the multiple management nodes as the first network address to be assigned to the first node.
[0179] For example, referring to FIG. 1, the first node and the second node satisfy any one of the following cases: (1) in FIG. 1(b), the first node is node T1 or G4, and the second node is node G2; (2) in FIG. 1(b), the first node is node T2, and the second node is node G4; (3) in FIG. 1(b), the first node is node G4 or T3, and the second node is node G3; (4) in FIG. 1(c), the first node is node T1 or T2, and the second node is node G2; and (5) in FIG. 1(c), the first node is node T3 or T4, and the second node is node G3.
[0180] In FIG. 1(b), the third node is node G1, and in FIG. 1(c), the third node is node G1.
[0181] In some possible embodiments, if the first mapping information does not include the first mapping relationship, when the second node obtains the first network address assigned to the first node, the second node may further add a mapping relationship between the identity of the first node, the first address type, and the first network address to the first mapping information. For example, assume that the identity of the first node is "L2ID&2" and the first address type is "communication domain address". After querying Table 1 based on the identity and the first address type of the first node, the second node determines that the first mapping relationship does not exist in Table 1. In this case, the second node obtains the first network address (assumed to be "Address 4") assigned to the first node in the above-mentioned method A1 or method A2, and the second node may add the mapping relationship "L2ID&2-0-Address 4" to the above-mentioned Table 1.
[0182] In some possible embodiments, when the first address type is an IP address, the first network address may alternatively be a local IPv6 address assigned to the first node. In this case, please refer to the following two implementations for the assignment of the first network address.
[0183] In the implementation, when the first address type is an IP address, the second node obtains a previously assigned second network address, where the second network address is a network address used by the first node in the first communication domain, the address type of which is a communication domain address; and obtains a first network address assigned to the first node based on the IPv6 prefix of the first communication domain and the second network address. In this way, the second network address previously assigned to the first node, the address type of which is a communication domain address, is used as an interface identifier of the first node, and the interface identifier is used to construct a local IPv6 address of the first node, so that the consumption of address quantity can be reduced, and the first network address assigned to the first node can be determined to be non-duplicate, and address conflicts can be prevented.
[0184] In another implementation, when a second network address of address type communication domain address used by a first node in a first communication domain has not been previously assigned, the assignment of a local IPv6 address of a first node may be further divided into the following cases 1 and 2 based on whether the second node is a management node in the first communication domain.
[0185] Case 1
[0186] When the second node is a management node in the first communication domain, the second node assigns a second network address to the first node and obtains the first network address assigned to the first node based on an IPv6 prefix of the first communication domain and the second network address.
[0187] Case 2:
[0188] When the second node is not a management node in the first communication domain, the second node sends a third message to the management node in the first communication domain, where the third message includes the first type identifier and the identity of the first node; and receives a seventh message sent by the management node in the first communication domain, where the seventh message includes a first network address assigned by the management node based on the third message, where the first network address includes an IPv6 prefix of the first communication domain and a second network address assigned to the first node, and the address type of the second network address is a communication domain address. Thus, the second node obtains the first network address assigned to the first node. It is found that the management node in the first communication domain can assign a local IPv6 address to the first node by using the second node, thereby supporting the first node to access the network by using a multi-hop wireless link.
[0189] In an implementation, the third message includes all information related to the allocation of the first network address in the first message.
[0190] For example, if the first message received by the second node includes a first type identifier and the identity of the first node, then the third message sent by the second node also includes the first type identifier and the identity of the first node.
[0191] For example, in addition to the first type identifier and the identity of the first node, the first message received by the second node further includes other information related to the allocation of the first network address, such as one or more items of unicast address identification information, multicast address identification information, or quantity identification information. In this case, in addition to the first type identifier and the identity of the first node, the third message further includes the same other information related to the allocation of the first network address. For a specific description of the unicast address identification information, multicast address identification information, and quantity identification information, please refer to the following description of the corresponding information. This specification does not particularly limit this.
[0192] In the above embodiment, it can be understood that the second node sends the third message to a DHCP server or a management node in the first communication domain, and the second node can be considered as a forwarding node. However, the second node does not directly forward or transparently transmit the first message, but transmits the information in the first message related to the allocation of the first network address by transmitting the third message.
[0193] For example, based on the first mapping information, it can be determined whether a second network address, the address type of which is a communication domain address, used by a first node in a first communication domain has been assigned. Specifically, when the first mapping information includes a third mapping relationship, it indicates that the second network address has been assigned in the past, where the third mapping relationship represents a mapping relationship between the identity of the first node, the first network address, and the type of the communication domain address. When the first mapping information does not include the third mapping relationship, it indicates that the second network address has not been assigned in the past.
[0194] Case 2: A first network address is assigned to a service on a first node.
[0195] In this embodiment of the present application, the first message further includes an identifier of a first service on the first node, and obtaining the first network address based on the first address type includes obtaining a first network address assigned to the first service based on the first address type and the identifier of the first service.
[0196] In a specific implementation, obtaining the first network address based on the first address type and the identifier of the first service includes: when the second mapping information includes a second mapping relationship, obtaining the first network address based on the second mapping relationship, where the second mapping relationship represents a mapping relationship between the identity of the first node, the identifier of the first service, the first network address, and the first address type, and the second mapping information is a set including a mapping relationship between an identifier of the service to which the network address is assigned, the network address of the service, a type identifier of the network address of the service, and the identity of the node on which the service is located.
[0197] It can be understood that when the second mapping information includes a second mapping relationship, it indicates that a network address of the same type has been assigned to a first service on the first node in the past, and the previously assigned network address of the same type is used as the first network address, so that not only can the waste of network addresses be effectively avoided, but also the first network address assigned to the first service on the first node can be further determined to be non-duplicate.
[0198] The second mapping information is maintained locally by the second node. The second mapping information may be represented by using a table, a diagram, or the like.
[0199] For example, when the second mapping information is represented by using a mapping table, the second mapping information may be represented in the form shown in Table 2. Specifically, Table 2 shows a mapping relationship between the identity of a node, the identifier of a service, the address type of a network address, and the network address of a service, where when the value of the address type of a network address is "0", it indicates that the address type of the network address is a communication domain address, and when the value of the address type of a network address is 1, it indicates that the address type of the network address is an IP address. In Table 2, based on the mapping relationship "L2ID&1-AID1-0-Address1", it can be seen that an address 11, whose address type is a communication domain address, was previously assigned to a service AID1 on a node whose identity is L2ID&1. Based on the mapping relationship "L2ID&1-AID2-1-Address12", it can be seen that an address 12, whose address type is an IP address, was previously assigned to a service AID2 on a node whose identity is L2ID&1. Based on this mapping relationship "L2ID&3-AID1-0-Address 13", it can be seen that Address 13, whose address type is a communication domain address, was previously assigned to service AID1 on a node whose identity is L2ID&3.
[0200] It can be seen from Table 2 that different services on the same node may have network addresses of different address types, and the same service on different nodes may have network addresses of the same address type. In some possible embodiments, the same service on the same node may also have network addresses of two different address types, and the address types of the network addresses of the same service on different nodes may also be different. This specification does not particularly limit this. It can be understood that the network addresses of different services on different nodes are different. If the network addresses of the same service on different nodes have the same address type, the network addresses of the same service on different nodes are identical. For example, based on Table 2, it can be seen that both node L2ID&1 and node L2ID&3 provide service AID1, and the address types of the network addresses corresponding to the two nodes are identical. Therefore, "Address 11" and "Address 13" are also identical. Table 2 [Table 2]
[0201] It can be understood that Table 2 is used as an example only to reflect the correspondence between the identity of a node, the identifier of a service on the node, the network address of the service, and the address type of the network address. In actual application, the text content and storage method of the correspondence may alternatively be in another form. This specification does not particularly limit this.
[0202] It may be understood that Table 2 and Table 1 may be represented and stored separately, as described above. In some possible embodiments, Table 1 and Table 2 may alternatively be represented and stored combined in one table. In this case, the identifier of the service in the mapping relationship that records the assignment of the network address of the address type to the node may be the default. This specification is not particularly limited in this respect.
[0203] The process of the second node assigning a first network address to a first service by searching for the second mapping information is specifically described based on Table 2: if the identity of the first node is “L2ID&1”, the identifier of the first service is “AID2”, and the value of the first type identifier is “1” (equivalent to the first address type being “IP address”), and it is found in Table 2 that the mapping relationship “L2ID&1-AID2-1-Address 12” exists, then Address 12 is used as the first network address assigned to the first service on the first node.
[0204] In this embodiment of the present application, when the second mapping information does not include the second mapping relationship, it indicates that the first network address of the first address type has not been previously assigned to the first service on the first node. In this case, for specific assignment methods of the first network address, please refer to the following methods B1 and B2.
[0205] Scheme B1: The second node is a management node in the first communication domain.
[0206] When the second node is an administrative node in the first communication domain, the second node assigns a first network address to the first service based on the first address type and the identifier of the first service, where the first address type can be a communication domain address or an IP address.
[0207] In some possible embodiments, when the second node is an administration node in the first communication domain and the first address type is an IP address, the second node may send a third message to the DHCP server, where the third message includes a first type identifier, an identity of the first node, and an identifier of the first service on the first node; and may receive an eighth message sent by the DHCP server, where the eighth message includes a first network address assigned to the first service. In this case, the first network address is assigned to the first service on the first node by the DHCP server based on the third message. That is, when the second node is an administration node in the first communication domain and the first address type is an IP address, if the second node does not have a DHCP function, the second node may request the DHCP server to assign the first network address, the first address type of which is an IP address, to the first service via the third message.
[0208] When the second node is a management node in the first communication domain, it is found that: (1) when the first address type is a communication domain address, the first network address of the first service is assigned by the second node; or (2) when the first address type is an IP address, the first network address of the first service is assigned by the second node, or by a DHCP server using the second node.
[0209] Scheme B2: The second node is not a management node in the first communication domain.
[0210] In an implementation, when the second node is not an administrative node in the first communication domain, the second node sends a third message to a third node, where the third message includes the first type identifier, an identity of the first node, and an identifier of the first service on the first node, and the third node is an administrative node in the first communication domain; and receives a ninth message sent by the third node, where the ninth message includes a first network address assigned to the first service. In this case, the first network address is assigned by the administrative node to the first service on the first node based on the third message.
[0211] In another implementation, the first communication domain includes a plurality of management nodes, and the second node is not a management node in the first communication domain. The second node sends a third message to the plurality of management nodes in the first communication domain, where the third message includes a first type identifier, an identity of the first node, and an identifier of the first service on the first node; receives a tenth message sent by the plurality of management nodes, where the tenth message corresponding to the management node includes a network address assigned to the first service by the management node based on the third message; selects a target management node from the plurality of management nodes; and obtains the first network address based on the tenth message sent by the target management node.
[0212] For example, the target management node selected by the second node satisfies at least one of the following conditions: (1) a management node whose priority exceeds a preset level; (2) a management node corresponding to the tenth message first received by the second node; or (3) a management node whose signal strength exceeds a preset threshold.
[0213] For example, the target management node may be the management node with the highest priority, or the management node corresponding to the highest signal strength, although this specification is not particularly limited thereto.
[0214] In the above two implementations, the type of the first network address may be a communication domain address or may be an IP address, which is not particularly limited in this specification.
[0215] In some possible embodiments, when there are multiple management nodes in the first communication domain, after the second node selects the target management node, the second node may further broadcast a response message, where the response message indicates that the second node has selected the network address provided by the target management node for the first service. In this way, the target management node receiving the response message may store a mapping relationship between the identifier of the first service, the network address assigned to the first service, the first address type, and the identity of the first node, and another management node receiving the response message may recognize that the network address provided by another management node is not selected. In this way, the provided network address may be reclaimed, and address waste is avoided.
[0216] When the second node is not an administrative node in the first communication domain, it can be seen that: (1) when there is only one administrative node in the first communication domain, the second node sends the third message to the administrative node, in this case the first network address is assigned by the administrative node to the first service on the first node by using the second node; (2) when the first communication domain includes multiple administrative nodes, the second node can broadcast the third message to the multiple administrative nodes and select a network address provided by one administrative node from the network addresses provided by the multiple administrative nodes as the first network address to be assigned to the first service.
[0217] In an implementation, the third message includes all information related to the allocation of the first network address in the first message.
[0218] For example, if a first message received by a second node includes a first type identifier, an identity of the first node, and an identifier of a first service on the first node, a third message sent by the second node also includes the first type identifier, the identity of the first node, and an identifier of the first service on the first node.
[0219] Furthermore, the first message received by the second node further includes other information related to the allocation of the first network address, such as one or more of a unicast address identification information, a multicast address identification information, an anycast address identification information, or a quantity identification information. In this case, the third message further includes the same other information related to the allocation of the first network address. For a specific description of the unicast address identification information, the multicast address identification information, the anycast address identification information, and the quantity identification information, please refer to the following description of the corresponding information. This specification does not particularly limit this.
[0220] In the above embodiment, it can be understood that the second node sends the third message to a DHCP server or a management node in the first communication domain, and the second node can be considered as a forwarding node. However, the second node does not directly forward or transparently transmit the first message, but transmits the information in the first message related to the allocation of the first network address by transmitting the third message.
[0221] In some possible embodiments, if the second mapping information does not include the second mapping relationship, when the second node obtains the first network address assigned to the first service on the first node, the second node may further add a mapping relationship between the identity of the first node, the identifier of the first service, the first address type, and the first network address to the second mapping information. For example, assume that the identity of the first node is "L2ID&1", the identifier of the first service is "AID3", and the first address type is "IP address". After querying table 2 based on the identity of the first node, the identifier of the first service, and the first address type, the second node determines that the second mapping relationship does not exist in table 2. In this case, the second node obtains the first network address (assumed to be "Address 14") assigned to the first service in the above-mentioned method B1 or method B2, and the second node may add the mapping relationship "L2ID&1-AID3-1-Address 14" to the above-mentioned table 2.
[0222] In some possible embodiments, the first message further includes at least one of the following information: a unicast address identification indicating that the first network address is a unicast address; a multicast address identification indicating that the first network address is a multicast address; an anycast address identification indicating that the first network address is an anycast address; or a quantity identification indicating the quantity of the first network addresses being claimed.
[0223] If the first network address is assigned to the first node, the first network address may be a unicast address or a multicast address. If the first network address is assigned to a first service on the first node, the first network address may be a unicast address, a multicast address, or an anycast address.
[0224] In a specific implementation, the quantity identification information is optional information in the first message. For example, the quantity identification information may correspond to the quantity of the identifiers of the first service in the first message. Specifically, the quantity of the applied first network addresses is the same as the quantity of the identifiers of the first service. For example, the identifiers of the first service included in the first message include AID1, AID2, and AID3. This means that the first message is used to apply for allocation of one first network address to each of three services: AID1, AID2, and AID3, that is, the quantity of the identifiers of the first service in the first message is 3. In this case, the applied quantity of the first network addresses indicated by the quantity identification information is also 3. The corresponding network addresses can be assigned to multiple services on the first node through the quantity identification information. In another example, when the first network address is assigned to the first node, the quantity identification information indicates that the quantity of the applied first network address is 1.
[0225] In some possible embodiments, when there are multiple first service identifiers in the first message, each identifier of the first service may have a corresponding unicast address identification, multicast address identification, or anycast address identification. In some possible embodiments, when the first network addresses corresponding to the multiple first service identifiers are all used for unicast, multicast, or anycast, the first network address may alternatively be represented by using one flag bit. This specification is not particularly limited thereto.
[0226] In a specific implementation, the unicast address identification information is optional information in the first message. The unicast address identification information may be represented by using a field, a flag bit, or a bit. The flag bit is used as an example. When the corresponding flag bit is set, it indicates that the first network address is a unicast address. Through the unicast address identification information, the second node may recognize that the first network address requested by the first node to be assigned to the first node or the first service on the first node is used for unicast.
[0227] In a specific implementation, the multicast address identification information is optional information in the first message. The multicast address identification information may be represented by using a field, a flag bit, or a bit. Through the multicast address identification information, the second node may recognize that the first network address requested by the first node to be assigned to the first node or the first service on the first node is used for multicast.
[0228] It is understood that the unicast address identification and the multicast address identification can be represented separately as described above. In this case, if the first message includes a unicast address identification and a multicast address identification and the first network address is used for unicast, only the corresponding configuration operation needs to be performed on the unicast address identification.
[0229] In some possible embodiments, the unicast address identification information and the multicast address identification information may alternatively be represented by using one flag bit, for example, when the flag bit is a first value, it indicates that the first network address is used for unicast, or when the flag bit is a second value, it indicates that the first network address is used for multicast.
[0230] In a specific implementation, the anycast address identification information is optional information in the first message. Through the anycast address identification information, the second node may recognize that the first network address requested by the first node to be assigned to the first service on the first node is used for anycast. The multicast address identification information may be represented by using a field, a flag bit, or a bit. In some possible embodiments, the unicast address identification information, the multicast address identification information, and the anycast address identification information may alternatively be represented by using a field, a flag bit, or the like. Details will not be described again here.
[0231] At least one of the unicast address identification information, the multicast address identification information, the anycast address identification information, or the quantity identification information may specifically include the following cases:
[0232] (1) Unicast address identification information
[0233] For example, the first message may include a first address type, an identity of the first node, and a unicast address identification information, and may indicate that a first network address of the first address type is requested to be assigned to the first node, and that the first network address will be used for unicast.
[0234] (2) Multicast address identification information
[0235] For example, the first message may include a first address type, an identity of the first node, and a multicast address identification information, and may indicate that a first network address of the first address type is requested to be assigned to the first node, and that the first network address is to be used for multicast.
[0236] (3) Anycast address identification information
[0237] For example, the first message may include a first address type, an identity of the first node, an identifier of the first service, and an anycast address identification, and may indicate that a first network address of the first address type is requested to be assigned to the first service on the first node, and that the first network address will be used for anycast.
[0238] (4) Quantity identification information
[0239] For example, the first message includes a first address type, an identity of the first node, and a quantity identification (indicating that the quantity of the first network address being applied for is 1). In this case, it may be set by default by the system that the first network address is used for unicast or multicast.
[0240] In another example, the first message includes an identifier of a first service, an identity of the first node, a first address type, and a quantity identification, where the identifier of the first service includes AID1 and AID2, and the quantity identification indicates that the quantity of the first network addresses applied for is 2. The first message indicates that a first network address of the first address type is requested to be assigned to each of the services AID1 and AID2. In this case, it may be set by default by the system that the first network address is used for unicast, multicast, or anycast.
[0241] (5) Unicast address identification information and multicast address identification information
[0242] For example, the first message requests that a first network address of a first address type be assigned to the first node, assuming the first network address is used for unicast. If the first message includes a unicast address identification and a multicast address identification, the unicast address identification and the multicast address identification may be represented separately by using flag bits, where the flag bit corresponding to the unicast address identification is set, but the flag bit corresponding to the multicast address identification is not set.
[0243] In another example, assume that the first message requests assignment of a first network address of a first address type to each of services AID1 and AID2, and the first message further includes a unicast address identification and a multicast address identification. In this case, if the unicast address identification corresponds to AID1, the first message indicates that the first network address assigned to AID1 is used for unicast; or, if the multicast address identification corresponds to AID2, the first message indicates that the first network address assigned to AID2 is used for multicast.
[0244] (6) Unicast address identification information and anycast address identification information For more details, please refer to the example shown in case (5).
[0245] (7) Multicast address identification information and anycast address identification information For more details, please refer to the example shown in case (5).
[0246] (8) Unicast address identification information and quantity identification information
[0247] For example, assume that the first message requests that a first network address of a first address type be assigned to a first node, and if the first message includes a unicast address identifier and a quantity identifier, the first network address is used for unicast and the quantity identifier indicates that the quantity of the requested first network address is one.
[0248] In another example, assume that the first message requests allocation of a first network address of a first address type to each of services AID1 and AID2. If the first message includes a unicast address identifier and a quantity identifier, both first network addresses are used for unicast and the quantity identifier indicates that the quantity of the requested first network addresses is two.
[0249] (9) Multicast address identification information and quantity identification information For more details, please refer to the example shown in case (8).
[0250] (10) Anycast address identification information and quantity identification information For more details, please refer to the example shown in case (8).
[0251] (11) Unicast address identification information, multicast address identification information, and anycast address identification information In this case, the unicast address identification information, the multicast address identification information and the anycast address identification information can be represented separately by using flag bits (or fields or bits). Whether the corresponding flag bits (or fields or bits) are set is determined based on the actual application.
[0252] (12) Unicast address identification information, multicast address identification information, and quantity identification information
[0253] For example, assume that the first message requests to assign a first network address of a first address type to the first node, and the first message includes a unicast address identification, a multicast address identification, and a quantity identification. In this case, the unicast address identification and the multicast address identification may be represented separately by using flag bits. Assume that the flag bit corresponding to the unicast address identification is not set, but the flag bit corresponding to the multicast address identification is set, and the quantity identification indicates that the quantity of the requested first network address is 1. It can be seen that the first network address is used for multicast.
[0254] In another example, assume that the first message requests to assign a first network address of a first address type to each of services AID1 and AID2, and the first message includes a unicast address identification, a multicast address identification, and a quantity identification. In this case, if the unicast address identification corresponds to AID1, the first message indicates that the first network address assigned to AID1 is used for unicast; or, if the multicast address identification corresponds to AID2, the first message indicates that the first network address assigned to AID2 is used for multicast. Thus, the quantity identification indicates that the quantity of the requested first network address is 2.
[0255] (13) Unicast address identification information, anycast address identification information, and quantity identification information For more details, please refer to the example shown in Case (12).
[0256] (14) Multicast address identification information, anycast address identification information, and quantity identification information For more details, please refer to the example shown in Case (12).
[0257] (15) Unicast address identification information, multicast address identification information, anycast address identification information, and quantity identification information In this case, the unicast address identification information, the multicast address identification information and the anycast address identification information can be represented separately by using flag bits (or fields or bits). Whether the corresponding flag bits (or fields or bits) are set is determined based on the actual situation.
[0258] In some possible embodiments, a network address previously assigned to a node may not be permanently stored in the first mapping information maintained by the second node, and a network address previously assigned to a service on the node may not be permanently stored in the second mapping information. For example, if the second node detects that the length of time that the node does not use a network address reaches a preset threshold, the second node may remove the network address corresponding to the node from the first mapping information. If the second node detects that the length of time that the network address is not used by a service reaches a preset threshold, the second node may remove the network address corresponding to the service from the second mapping information. In another example, the second node receives an address release request sent by the node. In this case, in response to the address release request, the second node may remove the network address corresponding to the node from the first mapping information.
[0259] S103: The second node sends a second message to the first node, where the second message includes the first network address.
[0260] In response, the first node receives a second message sent by the second node.
[0261] In this embodiment of the present application, the first network address may be assigned to the first node or may be assigned to a first service on the first node.
[0262] Specifically, when the first message received by the second node includes an identifier of a service on the first node, the first network address is assigned to the first service on the first node; or, when the first message received by the second node does not include an identifier of any service, the first network address is assigned to the first node.
[0263] S104: The first node obtains a first network address based on the second message.
[0264] In this embodiment of the present application, a first network address is assigned to a first node or a first service on the first node.
[0265] The type of the first network address is a first address type, and the first address type is a communication domain address or an IP address.
[0266] For example, when the first address type is an IP address, the first network address can be an IPv4 address or an IPv6 address. In some possible embodiments, when the first address type is an IP address, the first network address can alternatively be a local IPv6 address assigned to the first node. In this case, the first network address includes an IPv6 prefix of the first communication domain and a second network address, and the second network address is a network address used by the first node in the first communication domain, the address type of which is a communication domain address.
[0267] In some possible embodiments, the first node may further change the address type. Specifically, the first node sends an eleventh message to the second node, where the eleventh message includes a second type identifier, where the second type identifier indicates a second address type, and the second address type is different from the first address type; receives a twelfth message sent by the second node, where the twelfth message includes a third network address assigned to the first node or a first service on the first node, and the address type of the third network address is the second address type; and obtains the third network address based on the twelfth message.
[0268] Further optionally, before proposing to change the address type, the first node may first request the second node to release a first network address of the first address type that was previously applied for the first node or the first service on the first node. In some possible embodiments, the first node may alternatively not perform an action that requests address release. This specification is not particularly limited in this regard.
[0269] For example, assume that a first network address of a first address type has been applied for in the past for a first node, and before changing the address type, the first node may send a release request command to the second node, so that the second node deletes the mapping relationship between the identity of the first node, the first address type, and the first network address from the first mapping information.
[0270] In another example, assume that a first network address of a first address type has been previously applied for a first service on a first node. Before changing the address type, the first node may send a release request command to the second node, so that the second node deletes the mapping relationship between the identity of the first node, the identifier of the first service, the first address type, and the first network address from the second mapping information.
[0271] According to this embodiment of the present application, a first node newly coming online in a network can uniquely determine the accessed second node having address allocation service function, and the first node knows to obtain the assigned network address only from the second node. The interaction process of address allocation is simple, which helps to improve the efficiency of network address allocation. In addition, the mapping information locally maintained by the second node can ensure that the network addresses assigned to the first node or the services on the first node are not duplicated. In addition, the first node can further indicate the address type of the network address expected to be assigned, for example, a communication domain address or an IP address, so that the first node can flexibly obtain different types of network addresses. In addition, a local IPv6 address can further be assigned to the first node, thereby supporting the first node to access the network using a multi-hop wireless link.
[0272] 4 is a flowchart of another address allocation method according to an embodiment of the present application. The method is applied to a communication system. The communication system includes at least node 1 and node 2. Node 1 is a node that applies for an address, and node 2 is a management node. The method includes, but is not limited to, the following steps:
[0273] S201: Node 1 selects to access node 2 based on a broadcast message sent by node 2.
[0274] The broadcast message sent by node 2 includes a service identifier, which indicates that node 2 provides an address allocation service, ie, node 2 has an address allocation function.
[0275] In some possible embodiments, node 2 may alternatively be determined by node 1 from at least one node that transmits a broadcast message. In implementation, node 2 may be determined by node 1 from at least one node based on at least one of node priority information, detected signal strength, or reception time of the broadcast message. For example, node 2 may be a node corresponding to a broadcast message first received by node 1, or may be a node corresponding to a maximum signal strength detected by node 1, or may be a node with the highest priority. This specification does not particularly limit this.
[0276] For example, node 1 selecting to access node 2 may result in node 1 establishing a default bearer with node 2 and activating a common management transport channel such that node 1 may exchange address application signaling with node 2 over the common management transport channel, e.g., a first message described below. The common management transport channel is a communication channel.
[0277] In this embodiment of the present application, node 2 is a management node in the communication domain, and node 2 is also an access point for node 1.
[0278] For example, node 1 may be any node T among nodes T1, T2, . . . , and Tn in FIG. 1(a), and node 2 is node G in FIG. 1(a).
[0279] For example, node 1 may be node G2 or G3 in FIG. 1(b), and node 2 is node G1 in FIG. 1(b).
[0280] For example, node 1 may be node G2 or G3 in FIG. 1(c), and node 2 is node G1 in FIG. 1(c).
[0281] S202: Node 1 sends a first message to node 2.
[0282] In an implementation, the first message includes an identity of node 1 and a first type identifier, where the first type identifier indicates a first address type. In this case, if the first message does not include an identifier of any service, it indicates that the first message is used to request that a first network address be assigned to node 1.
[0283] The first address type is a communication domain address or an IP address.
[0284] The node 1 identity identifies the node 1. For example, the node 1 identity may be the L2 ID of the node 1.
[0285] In another implementation, the first message further includes an identifier of the first service on node 1, which in this case indicates that the first message is used to request that the first network address be assigned to the first service.
[0286] S203: Node 2 sends a second message to node 1.
[0287] In this embodiment of the present application, before node 2 sends the second message to node 1, node 2 first needs to obtain a first network address based on the first address type. For specific processes, please refer to C11 to C13.
[0288] C11: Determine whether the first message includes an identifier of a first service.
[0289] If the first message does not include an identifier of the first service, it is determined that the first network address is assigned to node 1 and C12 is executed; alternatively, if the first message does include an identifier of the first service, it is determined that the first network address is assigned to the first service on node 1 and C13 is executed.
[0290] C12: Obtain a first network address assigned to node 1 based on the first address type and the identity of node 1.
[0291] In a specific implementation, the first network address assigned to node 1 is obtained based on a first mapping relationship, where the first mapping relationship represents a mapping relationship between the identity of node 1, the first network address, and the first address type, and the first mapping relationship belongs to set 1 including a mapping relationship between the identity of the node to which the network address is assigned, the network address of the node, and the address type of the network address of the node. Set 1 can be understood as the first mapping information in the embodiment in FIG. 3.
[0292] In another specific implementation, node 2 assigns a first network address to node 1 based on the first address type and the identity of node 1. In other words, when a network address of the first address type has not been previously assigned to node 1, node 2 assigns the first network address to node 1. In addition, node 2 may further add the first network address of the first address type that is assigned to node 1 to set 1.
[0293] The first address type may be a communication domain address or an IP address.
[0294] In this instance, the second message sent by node 2 to node 1 includes the first network address, where the first network address is assigned to node 1.
[0295] C13: Obtain a first network address assigned to the first service based on the first address type and the identifier of the first service.
[0296] In a specific implementation, the first network address assigned to the first service is obtained based on the second mapping relationship, where the second mapping relationship represents a mapping relationship between the identity of the node 1, the identifier of the first service, the first network address, and the first address type, and the second mapping relationship belongs to set 2, which includes a mapping relationship between the identifier of the service to which the network address is assigned, the network address of the service, the address type of the network address, and the identity of the node where the service is located. Set 2 can be understood as the second mapping information in the embodiment in FIG. 3.
[0297] In another specific implementation, node 2 assigns the first network address to the first service based on the identifier of the first address type and the first service. In other words, node 2 assigns the first network address to the first service when a network address of the first address type has not been previously assigned to the first service on node 1. In addition, node 2 may further add the first network address of the first address type that is assigned to the first service on node 1 to set 2.
[0298] The first address type may be a communication domain address or an IP address.
[0299] In this case, the second message sent by node 2 to node 1 includes the first network address, where the first network address is assigned to the first service on node 1.
[0300] Optionally, in some possible embodiments, when the first address type is an IP address and node 2 does not have DHCP functionality, before sending the second message to node 1, node 2 may further obtain the first network address by using S204 and S205.
[0301] S204: Node 2 sends a third message to the DHCP server.
[0302] In implementation, the third message includes the first type identifier and the identity of node 1, thereby requesting the DHCP server to allocate the first network address to node 1. In this case, for details of the third message, please refer to the relevant description of the third message in the embodiment of "First Case: First Network Address is Allocated to First Node" in S102 of Fig. 3. The details will not be described again here.
[0303] In another implementation, the third message includes the first type identifier, the identity of node 1, and the identifier of the first service on node 1, thereby requesting the DHCP server to allocate the first network address to the first service on node 1. In this case, for details of the third message, please refer to the relevant description of the third message in the embodiment "Second Case: The First Network Address is Allocated to the Service on the First Node" in S102 of Fig. 3. The details will not be described again here.
[0304] The first network address type is an IP address.
[0305] S205: The DHCP server sends the first network address to node 2.
[0306] In implementation, when the first message does not include an identifier of the first service, the DHCP server assigns a first network address to the node 1 based on the first address type and the identity of the node 1.
[0307] In another implementation, when the first message includes an identifier of the first service, the DHCP server assigns a first network address to the first service on node 1 based on the first address type and the identifier of the first service.
[0308] After obtaining the first network address in the above implementation, the DHCP server may send a message to node 2 carrying the first network address.
[0309] In addition, the DHCP server may further add, to the local address management information, information related to the newly assigned first network address, such as a mapping relationship between the identity of the node 1, the first address type, and the first network address of the node 1, or a mapping relationship between the identifier of the first service, the first network address of the first service, the first address type, and the identity of the node 1. This specification does not particularly limit this.
[0310] In some possible embodiments, node 2 may further send a third message in S204 to a plurality of DHCP servers; receive address allocation feedback messages sent by the plurality of DHCP servers, where the address allocation feedback messages corresponding to the DHCP servers include a first network address assigned by the DHCP server based on the third message; select a target DHCP server from the plurality of DHCP servers; and obtain the first network address based on the address allocation feedback messages sent by the target DHCP server. In addition, after node 2 obtains the first network address, node 2 may further broadcast message 1, where message 1 indicates that node 2 has selected the network address provided by the target DHCP server. In this way, the target DHCP server receiving message 1 may send an acknowledgement message to node 2, indicating that the first network address selected by node 2 is available, and another unselected DHCP server receiving message 1 may recognize that the network address provided by the DHCP server is not selected by node 2. In this way, the provided network address may be reclaimed, and address waste is avoided.
[0311] In this case, compared to the conventional DHCP address allocation scheme, the client's work of performing address selection and receiving an acknowledgement message from the DHCP server is offloaded to node 2. In this way, the load on node 1 can be reduced, the protocol stack on node 1 is lightened, and the power consumption of node 1 is reduced.
[0312] The target DHCP server may be a DHCP server corresponding to the maximum signal strength, or may be a DHCP server corresponding to the address allocation feedback message received first by node 2, or may be a DHCP server corresponding to the highest priority, or may be determined by node 2 based on multiple factors including the detected signal strength, the priority information of the DHCP server, and the reception time corresponding to the address allocation feedback message, etc. This specification does not particularly limit this.
[0313] S206: Node 1 obtains the first network address based on the second message.
[0314] After obtaining the first network address, node 1 may perform local configuration based on the first network address.
[0315] It can be seen that in this embodiment of the present application, the node 1 applying for an address can determine to discover and access the node 2 having the address allocation service, and can receive only the assigned first network address from the node 2. This can help improve the network address allocation efficiency and implement the network address allocation in a star single-hop topology scenario. In addition, the node 1 can further choose to apply for an expected address type and apply for a network address for a specific object (e.g., a node or a service on a node). This enriches the application scenarios of the address allocation.
[0316] 5 is a flowchart of another address allocation method according to an embodiment of the present application. The method is applied to a communication system. The communication system includes at least node 1, node 2 and node 3. Node 1 is a node that applies for an address, node 2 is an access point of node 1, and node 3 is a management node. The method includes, but is not limited to, the following steps:
[0317] S301: Node 1 selects to access node 2 based on a broadcast message sent by node 2.
[0318] For the specific process of node 1 accessing node 2, please refer to the relevant description of S201 in the embodiment of Figure 4. The details will not be described again here.
[0319] In this embodiment of the present application, node 3 is a management node in the first communication domain, and node 1, node 2 and node 3 all belong to the first communication domain.
[0320] For example, referring to (b) in FIG. 1, node 3 may be node G1, and node 1 and node 2 satisfy any one of the following cases: (1) node 1 is node T1 or G4, and node 2 is node G2; (2) node 1 is node T2, and node 2 is node G4; and (3) node 1 is node G4 or T3, and node 2 is node G3.
[0321] For example, referring to (c) in FIG. 1, node 3 may be node G1, and node 1 and node 2 satisfy any one of the following cases: (1) node 1 is node T1 or T2, and node 2 is node G2; or (2) the first node is node T3 or T4, and the second node is node G3.
[0322] S302: Node 1 sends a first message to node 2. For details of this step, please refer to the relevant description of S202 in the embodiment of Figure 4. The details will not be described again here.
[0323] S303: Node 2 determines whether the first message includes an identifier of the first service.
[0324] If the first message does not include an identifier of the first service, which indicates that the first message is used to request that a first network address be assigned to node 1, S304 is executed.
[0325] When the first message includes an identifier of the first service, which indicates that the first message is used to request allocation of a first network address to the first service on node 1, S305 is executed.
[0326] S304: NODE 2 determines whether the mapping information includes the first mapping relationship.
[0327] The first mapping relationship represents a mapping relationship between the identity of node 1, the first network address, and the first address type.
[0328] In this case, the mapping information is a set including a mapping relationship between the identity of the node to which the network address is assigned, the network address of the node, and the address type of the network address of the node. In this case, the mapping information is the first mapping information in the embodiment of FIG. 3 or set 1 in the embodiment of FIG. 4.
[0329] When the mapping information includes the first mapping relationship, the first network address assigned to node 1 may be obtained based on the first mapping relationship.
[0330] When the mapping information does not include the first mapping relationship, S306 is executed, so that node 3 executes S307.
[0331] S305: NODE 2 determines whether the mapping information includes a second mapping relationship.
[0332] The second mapping relationship represents a mapping relationship between the identity of node 1, the identifier of the first service, the first network address, and the first address type. In this case, the mapping information is a set including a mapping relationship between an identifier of a service to which a network address is assigned, a network address of the service, a type identifier of the network address, and an identity of a node where the service is located. In this case, the mapping information is the second mapping information in the embodiment of FIG. 3 or set 2 in the embodiment of FIG. 4.
[0333] When the mapping information includes a second mapping relationship, the first network address assigned to the first service may be obtained based on the second mapping relationship.
[0334] When the mapping information does not include the second mapping relationship, S306 is executed, so that NODE 3 executes S308.
[0335] S306: Node 2 sends a third message to node 3.
[0336] In response, node 3 receives the third message sent by node 2.
[0337] In a specific implementation, corresponding to S304, the third message includes a first type identifier and an identity of node 1, where the first type identifier indicates a first address type, and the first message does not include an identifier of any service. In this case, for details of the third message, please refer to the relevant description of the third message in the embodiment of "First Case: A First Network Address is Assigned to a First Node" in S102 of FIG. 3. The details will not be described again here.
[0338] In another specific implementation, corresponding to S305, the third message includes the first type identifier, the identity of node 1, and the identifier of the first service on node 1. In this case, for details of the third message, please refer to the relevant description of the third message in the embodiment "Second Case: A First Network Address is Assigned to a Service on a First Node" in S102 of Fig. 3. The details will not be described again here.
[0339] In some possible embodiments, there may be at least one aggregation node between node 2 and node 3. In this case, node 2 may further transmit all information related to the allocation of the first network address in the first message to node 3 via the at least one aggregation node.
[0340] In some possible embodiments, node 3 includes multiple nodes, meaning that multiple management nodes are in the first communication domain. In this case, node 2 sending the third message to node 3 includes node 1 broadcasting the third message to node 3.
[0341] S307: Node 3 assigns a first network address to node 1 based on the first address type and the identity of node 1.
[0342] In some possible embodiments, after node 3 assigns the first network address to node 1, node 3 may further store a mapping relationship between node 1's identity, the first address type, and the first network address, ensuring that the assigned network addresses are not duplicated.
[0343] S308: Node 3 assigns a first network address to the first service based on the first address type and the identifier of the first service.
[0344] In some possible embodiments, after node 3 assigns the first network address to the first service on node 1, node 3 may further store a mapping relationship between the identifier of the first service, the first network address, the first address type, and the identity of node 1 to ensure that the assigned network addresses are not duplicated.
[0345] S309: Node 3 sends the first network address to node 2.
[0346] The first network address may be carried in a message, for example, an address assignment feedback message.
[0347] In response, node 2 obtains the first network address from node 3. That is, when node 2 does not find the first mapping relationship or the second mapping relationship in the locally stored mapping information, node 2 may obtain the assigned first network address from node 3.
[0348] In some possible embodiments, when the node 3 includes multiple nodes, before the node 2 obtains the first network address from the node 3, the node 2 may select one target management node from the multiple nodes according to a preset rule, and obtain the first network address provided by the target management node. In addition, after the node 2 obtains the first network address, the node 2 may further broadcast a message 2, where the message 2 indicates that the node 2 has selected the first network address provided by the target management node. In this way, the target management node receiving the message 2 may further send an acknowledgement message to the node 2 to indicate that the first network address selected by the node 2 is available, and another unselected management node receiving the message 2 may recognize that the network address provided by the management node is not selected by the node 2. In this way, the provided network address may be reclaimed, and address waste is avoided.
[0349] The preset rules include, but are not limited to, the priority exceeds a preset level, the signal strength exceeds a preset threshold, the node responds to the first received address allocation feedback message, and the like. For this embodiment, please refer to the relevant description of the selection of the target management node in the embodiment of Figure 3. The details will not be described again here.
[0350] In some possible embodiments, when there is at least one aggregation node between node 3 and node 2, node 3 transmitting the first network address to node 2 may be: node 3 transmitting the first network address to node 2 via the at least one aggregation node.
[0351] S310: Node 2 sends a second message to node 1.
[0352] In a specific implementation, the second message includes a first network address, and the first network address is assigned to node 1.
[0353] In another specific implementation, the second message includes a first network address, where the first network address is assigned to a first service on node 1.
[0354] Based on S304 to S309, it can be seen that the first network address can be obtained by the node 2 from local mapping information, or the first network address can be obtained by the node 2 from the node 3. This specification does not particularly limit this.
[0355] S311: Node 1 obtains a first network address based on the second message.
[0356] It can be seen that in this embodiment of the present application, a node 1 applying for an address can determine to discover and access a node 2 having an address allocation service, and can receive only the assigned first network address from the node 2. This can help improve the network address allocation efficiency and implement the network address allocation in a tree-like multi-hop topology scenario. In addition, the node 1 can further apply for an expected address type and apply for a network address for a specific object (e.g., a node or a service on a node). This enriches the application scenarios of address allocation.
[0357] Fig. 6 is a flow chart of another address allocation method according to an embodiment of the present application. The method is applied to a communication system. The communication system includes at least node 1, node 2 and node 3. Node 1 is a node applying for an address, node 2 is an access point of node 1, and node 3 is a management node. Different from the embodiment of Fig. 5, Fig. 6 provides a method for allocating a local IPv6 address to a node when the first address type is an IP address. The method includes, but is not limited to, the following steps:
[0358] S401: Node 1 selects to access node 2 based on the broadcast message sent by node 2. For details of this step, please refer to the relevant description of S301 in the embodiment of Figure 5. The details will not be described again here.
[0359] S402: Node 1 sends a first message to node 2.
[0360] The first message includes a node 1 identity and a first type identifier, where the first type identifier indicates a first address type and the node 1 identity identifies the node 1.
[0361] In this embodiment of the present application, the first address type is an IP address.
[0362] S403: Node 2 determines whether a second network address used by node 1 in the first communication domain, whose address type is a communication domain address, has been assigned previously.
[0363] Specifically, when it is determined that the second network address has been previously assigned, the node 2 executes S404 and S408; or, when it is determined that the second network address has not been previously assigned, the node 2 sequentially executes S405 to S408.
[0364] For example, node 2 may determine, based on the locally maintained address allocation information (e.g., the first mapping information in the embodiment of FIG. 3), whether a second network address used by node 1 in the first communication domain, whose address type is a communication domain address, has been previously assigned. Specifically, when node 2 finds a network address corresponding to node 1's identity in the mapping information and the address type of the network address is a communication domain address, it indicates that the second network address has been previously assigned; or, when node 2 does not find a network address corresponding to node 1's identity in the mapping information, or when node 2 finds a network address corresponding to node 1's identity in the mapping information but the address type of the network address is not a communication domain address, it indicates that the second network address has not been previously assigned.
[0365] S404: Node 2 obtains a previously assigned second network address, and obtains a first network address based on the second network address and an IPv6 prefix of the first communication domain.
[0366] That is, the first network address may be assigned directly by node 2 when the second network address was previously assigned.
[0367] The type of the second network address is a communication domain address. The second network address can be obtained by the node 2 from the mapping information. The second network address is a network address corresponding to the mapping relationship between the identity of the node 1 and the communication domain address type in the mapping information.
[0368] In implementation, the length of the second network address may be 8 bits, 16 bits, 24 bits, or another amount of bits, and is not specifically limited in this specification.
[0369] In a specific implementation, obtaining the first network address based on the second network address and an IPv6 prefix of the first communication domain includes embedding the second network address behind the IPv6 prefix of the first communication domain to generate the first network address.
[0370] In this manner, the second network address of type communication domain address previously assigned to node 1 is used as an interface identifier for node 1, where the interface identifier is used to construct a local IPv6 address for node 1, such that address quantity consumption may be reduced and the first network address assigned to node 1 may be determined to be non-duplicate.
[0371] S405: Node 2 sends a third message to node 3.
[0372] If the second network address has not been assigned before, node 2 sends a third message to node 3, requesting node 3 to assign the first network address to node 1 based on the third message, where the third message includes the first type identifier and the identity of node 1. For details of the third message, please refer to the relevant description of the third message in the embodiment of "First Case: First Network Address is Assigned to First Node" in S102 of Fig. 3. The details will not be described again here.
[0373] In response, node 3 receives the third message sent by node 2.
[0374] In some possible embodiments, when there is at least one aggregation node between node 2 and node 3, node 2 may further transmit all information related to the allocation of the first network address in the first message to node 3 via the at least one aggregation node.
[0375] S406: Node 3 assigns a second network address to node 1, and obtains a first network address based on the second network address and an IPv6 prefix of the first communication domain.
[0376] S407: Node 3 sends the first network address to node 2.
[0377] The first network address may be carried in the message.
[0378] In response, node 2 obtains the first network address from node 3 .
[0379] In some possible embodiments, when there is at least one aggregation node between node 3 and node 2, node 3 transmitting the first network address to node 2 may be: node 3 transmitting the first network address to node 2 via the at least one aggregation node.
[0380] S408: Node 2 sends a second message to node 1.
[0381] In response, node 1 receives the second message sent by node 2.
[0382] The second message includes the first network address assigned to node 1.
[0383] S409: Node 1 obtains the first network address based on the second message.
[0384] In this embodiment of the present application, it can be seen that a node 1 applying for an address can determine to discover and access a node 2 having an address allocation service, and can receive only the assigned first network address from the node 2. This helps to improve the network address allocation efficiency, and supports the allocation of local IPv6 addresses to nodes by using a multi-hop mechanism. In addition, the node 1 can further apply for a specific type of network address, which enriches the application scenarios of address allocation.
[0385] 7 is a structural diagram of an address assignment device according to an embodiment of the present application. The address assignment device 30 includes a receiving unit 310 and a sending unit 312. The device 30 can be implemented by hardware, software, or a combination of software and hardware.
[0386] The receiving unit 310 is configured to receive a first message sent by a first node, where the first message includes a first type identifier, where the first type identifier indicates a first address type. The sending unit 312 is configured to send a second message to the first node, where the second message includes a first network address assigned to the first node or a service on the first node, where the address type of the first network address is the first address type.
[0387] In some possible embodiments, the address assignment device 30 further includes a processing unit (not shown in the figures), which is configured to obtain the first network address based on the first address type.
[0388] The address allocation device 30 may be configured to implement the method at the second node side described in the embodiment of Fig. 3. In the embodiment of Fig. 3, the receiving unit 310 may be configured to perform S101, and the sending unit 312 may be configured to perform S103. Optionally, the processing unit may be configured to perform S102 in the embodiment of Fig. 3. The address allocation device 30 may further be configured to implement the method at the node 2 side described in the embodiments of Fig. 4, Fig. 5 and Fig. 6. For the sake of brevity of the specification, the details will not be described again in this specification.
[0389] One or more of the units in the embodiment shown in Figure 7 may be implemented by software, hardware, firmware, or a combination thereof. Software or firmware may include, but is not limited to, computer program instructions or code and be executed by a hardware processor. Hardware may include, but is not limited to, various integrated circuits such as a central processing unit (CPU), a digital signal processor (DSP), a field-programmable gate array (FPGA), or an application-specific integrated circuit (ASIC).
[0390] 8 is a structural diagram of an address acquisition device according to an embodiment of the present application. The address acquisition device 40 includes a sending unit 410, an acquiring unit 412, and a receiving unit 414. The address acquisition device 40 can be implemented by hardware, software, or a combination of software and hardware.
[0391] The sending unit 410 is configured to send a first message to the second node, where the first message includes a first type identifier, where the first type identifier indicates a first address type. The receiving unit 414 is configured to receive a second message sent by the second node, where the second message includes a first network address assigned to the first node or a service on the first node, where the address type of the first network address is the first address type. The obtaining unit 412 is configured to obtain the first network address based on the second message.
[0392] The address obtaining device 40 may be configured to implement the method at the first node side described in the embodiment of Fig. 3. In the embodiment of Fig. 3, the sending unit 410 may be configured to perform S101, the receiving unit 414 may be configured to perform S103, and the obtaining unit 412 may be configured to perform S104. The address obtaining device 40 may further be configured to implement the method at the node 1 side described in the embodiments of Fig. 4, Fig. 5, and Fig. 6. For the sake of brevity of the specification, the details will not be described again in this specification.
[0393] One or more of the units in the embodiment shown in Figure 8 may be implemented by software, hardware, firmware, or a combination thereof. Software or firmware may include, but is not limited to, computer program instructions or code and be executed by a hardware processor. Hardware may include, but is not limited to, a central processing unit (CPU), a digital signal processor (DSP), various integrated circuits such as a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC).
[0394] 9 is a structural diagram of a communication device according to an embodiment of the present application. As shown in FIG. 9, the communication device 50 includes a processor 501, a communication interface 502, a memory 503 and a bus 504. The processor 501, the memory 503 and the communication interface 502 communicate with each other through the bus 504.
[0395] It should be understood that the number of processors and memories in the communication device 50 is not limited herein.
[0396] In a specific implementation, the communication device 50 may be a first node that applies for an address in the above embodiment, and the first node may be, for example, a user terminal in a vehicle in an in-vehicle communication scenario, and the user terminal may be, for example, a mobile phone, a tablet computer, a palmtop computer, a desktop computer, an earphone, a speaker, a wearable device, an in-vehicle device, a virtual reality device, or an augmented reality device. For example, the first node may also be a home device in a smart home scenario, and may be, for example, a television, a robot vacuum cleaner, a printer, a projector, a user mobile phone, a rice cooker, a speaker, a microphone, or a wireless router. The first node may alternatively be, for example, a BMU in a battery management system BMS scenario. In some possible embodiments, the first node may alternatively be a component in a user terminal or a component in a home device. The component may be, for example, a board, a line card, or a chip.
[0397] In another specific implementation, the communication device 50 may be a second node having an address allocation function in the above embodiment, and the second node may be, for example, a T-Box or a component in the T-Box, such as a board, a line card, or a chip, in an in-vehicle communication scenario. The second node may also be, for example, a gateway, a user terminal device CPE, a wireless router, or a user mobile phone in a smart home scenario. Alternatively, the second node may be, for example, a BCU or BMU in a battery management system BMS scenario. This specification does not particularly limit this.
[0398] The bus 504 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like. The bus may be classified as an address bus, a data bus, a control bus, and the like. For ease of representation, the bus is represented using only one line in FIG. 8. However, it is not meant to imply that there is only one bus or only one type of bus. The bus 504 may include paths for transmitting information between components of the communication device 50 (e.g., the memory 503, the processor 501, and the communication interface 502).
[0399] The processor 501 may include any one or more of a processor, such as a central processing unit (CPU), a microprocessor (MP), or a digital signal processor (DSP).
[0400] The memory 503 is configured to provide a storage space, which may store data, such as an operating system and computer programs. The memory 503 may be one or a combination of a random access memory (RAM), an erasable programmable read-only memory (EPROM), a read-only memory (ROM), a compact disc read-only memory (CD-ROM), or the like. The memory 503 may exist independently or may be integrated into the processor 501.
[0401] The communication interface 502 may be configured to provide information input or output for the processor 501. Alternatively, the communication interface 502 may be configured to receive data transmitted from an external source and / or transmit data to an external source and may be a wired link interface including an Ethernet cable or may be a wireless link (e.g., Wi-Fi, Bluetooth, or universal wireless transmission) interface. Alternatively, the communication interface 502 may further include a transmitter (e.g., a radio frequency transmitter or antenna), a receiver, or the like coupled to the interface.
[0402] The processor 501 in the communication device 50 is configured to read a computer program stored in the memory 503 and to execute the aforementioned methods, for example the methods described in FIG. 3, FIG. 4, FIG. 5 or FIG. 6.
[0403] In a possible design manner, the communication device 50 may be one or more modules in an execution body for executing the method on the first node side shown in Fig. 3. The processor 501 may be configured to read one or more computer programs stored in the memory and perform the following operations: sending a first message to the second node by using the sending unit 410, where the first message includes a first type identifier, and the first type identifier indicates a first address type; receiving a second message sent by the second node by using the receiving unit 414, where the second message includes a first network address assigned to the first node or a service on the first node, and the address type of the first network address is the first address type; and obtaining the first network address based on the second message.
[0404] In a possible design manner, the communication device 50 may be one or more modules in an execution body for executing the method on the second node side shown in Fig. 3. The processor 501 may be configured to read one or more computer programs stored in the memory and perform the following operations: receiving a first message sent by the first node by using the receiving unit 310, where the first message includes a first type identifier, where the first type identifier indicates a first address type; and sending a second message to the first node by using the sending unit 312, where the second message includes a first network address assigned to the first node or a service on the first node, where the address type of the first network address is the first address type.
[0405] The embodiment of the present application further provides a communication system. The communication system includes a first device and a second device. The first device can be, for example, the address acquisition device 40 shown in FIG. 8, or the communication device 50 used as the first node shown in FIG. 9. The second device can be, for example, the address assignment device 30 shown in FIG. 7, or the communication device 50 used as the second node shown in FIG. 9. The first device can be configured to perform the method on the first node side shown in the embodiment in FIG. 3, and the second device can be configured to perform the method on the second node side shown in the embodiment in FIG. 3. In some possible embodiments, the communication system can be further configured to perform the method shown in FIG. 4, FIG. 5, or FIG. 6.
[0406] In the above embodiments in this specification, the description of each embodiment has its own focus. For the part not described in detail in one embodiment, please refer to the related description in another embodiment.
[0407] It should be noted that a person skilled in the art can understand that all or part of the steps in each method of the above embodiments can be implemented by a program that instructs related hardware. The program may be stored in a computer-readable storage medium. The storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or another optical disc memory, a magnetic disc memory, a magnetic tape memory, or any other computer-readable medium that can be configured to hold or store data.
[0408] The technical solution of the present application may be essentially implemented in the form of a software product, or the part that contributes to the prior art, or all or a part of the technical solution may be implemented in the form of a software product. The computer program product is stored in a storage medium and includes a plurality of instructions for instructing a device (which may be a personal computer, a server, or a network device, a robot, a single-chip microcomputer, a chip, a robot, or the like) to execute all or a part of the steps of the method described in the embodiments of the present application.
Claims
1. receiving a first message transmitted by a first node, wherein the first message includes a first type identifier, the first type identifier indicating a first address type; and sending a second message to the first node, wherein the second message includes a first network address assigned to the first node or a service on the first node, and an address type of the first network address is the first address type; An address assignment method comprising:
2. The method of claim 1 , wherein the method is applied to a second node, the first node and the second node belonging to a first communication domain.
3. The method of claim 2 , wherein the first address type is a communication domain address or an IP address.
4. The method of claim 1 , further comprising obtaining the first network address based on the first address type.
5. The first message further includes an identity of the first node, and the step of obtaining the first network address based on the first address type includes: obtaining the first network address based on a first mapping relationship, where the first mapping relationship represents a mapping relationship between the identity of the first node, the first network address, and the first address type; Including, 5. The method of claim 4, wherein the first mapping relationship belongs to a set that includes mapping relationships between an identity of a node to which a network address is assigned, the network address of the node, and an address type of the network address of the node.
6. The first message further includes an identity of the first node and an identifier of a first service of the first node, and the step of obtaining the first network address based on the first address type includes: obtaining the first network address based on a second mapping relationship, where the second mapping relationship represents a mapping relationship between the identity of the first node, the identifier of the first service, the first network address, and the first address type; Including, wherein the second mapping relationship belongs to a set including mapping relationships between an identifier of a service to which a network address is assigned, the network address of the service, an address type of the network address of the service, and an identity of a node on which the service is located. The method according to claim 4.
7. The step of obtaining the first network address based on the first address type comprises: Allocating the first network address based on the first address type. The method of claim 4 , comprising:
8. The first message further includes an identifier of a first service on the first node, and the step of obtaining the first network address based on the first address type includes: obtaining the first network address assigned to the first service based on the first address type and the identifier of the first service. The method of claim 4 , comprising:
9. The first address type is the IP address, and the method further comprises: sending a third message to a Dynamic Host Configuration Protocol (DHCP) server, where the third message includes the first type identifier, and the third message further includes one or more of an identity of the first node and an identifier of a first service on the first node; and receiving a fourth message sent by the DHCP server, wherein the fourth message includes the first network address, the first network address being assigned by the DHCP server based on the third message; The method of claim 3 comprising:
10. The method further comprises: sending a third message to a third node, where the third message includes the first type identifier, the third message further includes one or more of an identity of the first node and an identifier of a first service on the first node, the third node being an administration node in the first communication domain; and receiving a fifth message sent by the third node, wherein the fifth message includes the first network address, the first network address being assigned by the third node based on the third message; The method according to claim 2 or 3, comprising:
11. The first communication domain includes a plurality of management nodes, and the method further comprises: sending a third message to the plurality of management nodes, wherein the third message includes the first type identifier, and the third message further includes one or more of an identity of the first node and an identifier of a first service on the first node; receiving a sixth message sent by the plurality of management nodes, where the sixth message corresponding to the management node includes a network address assigned by the management node based on the third message; and obtaining the first network address based on a sixth message sent by a target management node in the plurality of management nodes; The method according to claim 2 or 3, comprising:
12. The first address type is the IP address, and the method further comprises: obtaining a previously assigned second network address, where the second network address is a network address used by the first node in the first communication domain, the address type of which is the communication domain address; and obtaining the first network address based on an IPv6 prefix of the first communication domain and the second network address; Equipped with The method according to claim 3.
13. The first address type is the IP address, and the method further comprises: assigning a second network address to the first node, where an address type of the second network address is the communication domain address; and obtaining the first network address based on an IPv6 prefix of the first communication domain and the second network address; The method of claim 3 comprising:
14. The first address type is the IP address, and the method further comprises: sending a third message to a fourth node, where the third message includes the first type identifier and an identity of the first node, the fourth node being an administrator node in the first communication domain; and receiving a seventh message sent by the fourth node, wherein the seventh message includes the first network address, the first network address including an IPv6 prefix of the first communication domain and a second network address, the second network address being a network address used by the first node in the first communication domain, the address type being the communication domain address, and the first network address being assigned by the fourth node based on the third message. The method of claim 3 comprising:
15. The first message further comprises the following information: a unicast address identification indicating that the first network address is a unicast address; a multicast address identification indicating that the first network address is a multicast address; an anycast address identification indicating that the first network address is an anycast address; or Quantity identification information indicating the quantity of the first network addresses to be applied for. The method according to claim 1 , comprising at least one of the following:
16. The method further comprises: receiving an eighth message sent by the first node, where the eighth message includes a second type identifier, the second type identifier indicating a second address type, the second address type being different from the first address type; and sending a ninth message to the first node, wherein the ninth message includes a third network address assigned to the first node or a service on the first node, and an address type of the third network address is the second address type.
16. The method of claim 1 , comprising:
17. 1. A method of address assignment applied to a first node, comprising: sending a first message to a second node, wherein said first message includes a first type identifier, said first type identifier indicating a first address type; receiving a second message sent by the second node, where the second message includes a first network address assigned to the first node or a service on the first node, and an address type of the first network address is the first address type; and obtaining the first network address based on the second message; A method comprising:
18. The method of claim 17 , wherein the first node and the second node belong to a first communication domain.
19. 19. The method according to claim 17 or 18, wherein the first address type is a communication domain address or an IP address.
20. 20. The method of claim 19, wherein the first address type is the IP address, and the first network address is an IPv6 address used locally by the first node, the first network address comprising an IPv6 prefix of the first communication domain and a second network address, and the second network address is a network address used by the first node in the first communication domain, the address type being the communication domain address.
21. 20. The method of claim 17, wherein the first message further comprises an identifier of a first service on the first node, and the first network address is assigned to the first service.
22. The first message further comprises the following information: the identity of the first node; a unicast address identification indicating that the first network address is a unicast address; a multicast address identification indicating that the first network address is a multicast address; an anycast address identification indicating that the first network address is an anycast address; or Quantity identification information indicating the quantity of the first network addresses to be applied for.
22. The method of any one of claims 17 to 21, comprising at least one of the following:
23. The method further comprises: sending a third message to the second node, wherein the third message includes a second type identifier, the second type identifier indicating a second address type, the second address type being different from the first address type; receiving a fourth message sent by the second node, where the fourth message includes a third network address assigned to the first node or the service on the first node, and an address type of the third network address is the second address type; and obtaining the third network address based on the fourth message; 23. The method of any one of claims 17 to 22, comprising:
24. An address allocation device, the device comprising a processing unit and a communication unit, the communication device being configured to implement the method according to any one of claims 1 to 16.
25. An address obtaining device comprising a processing unit and a communication unit, said communication unit being configured to implement the method according to any one of claims 17 to 23.
26. A communication device comprising at least one processor and a communication interface, the communications interface is configured to receive and / or transmit data and / or the communications interface is configured to provide input and / or output for the processor; The at least one processor is configured to implement a method according to any one of claims 1 to 16 or configured to implement a method according to any one of claims 17 to 23. Communications equipment.
27. A system comprising at least a first device and a second device, The first device includes an address acquisition device according to claim 25; The second device comprises an address assignment device according to claim 24. system.
28. A terminal comprising an apparatus according to any one of claims 24 to 26 or comprising a system according to claim 27.
29. A computer readable storage medium storing instructions which, when executed by at least one processor, implement the method of any one of claims 1 to 16 or the method of any one of claims 17 to 23.
Citation Information
Patent Citations
Operation management method, operation management program, operation management system, and operation management device
JP2008035456A
Identifier allocating device, identifier allocating system and identifier allocating program
JP2008252840A
Bridge multicast management system and bridge multicast management method
JP2009278298A