Method, apparatus, communication device and readable storage medium for allocating identity
By extending the DHCPv6 protocol, dynamic SID announcement between the DHCPv6 server and client is enabled, solving the problem of the inability of the DHCPv6 server and client to exchange SIDs and ensuring the normal operation of the SRv6 protocol system.
Patent Information
- Application Number
- CN202111648821.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The inability of DHCPv6 servers and clients to exchange SIDs affects the normal operation of the SRv6 protocol system.
Extend the DHCPv6 protocol to enable dynamic SID announcement between DHCPv6 servers and clients, and request and allocate SIDs by sending and receiving messages with specific fields.
Ensure that the DHCPv6 server and client can send and receive SRv6 messages normally, and guarantee the normal operation of the SRv6 protocol system.
Smart Images

Figure CN116418741B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of communication, and particularly relates to a method and device for allocating an identifier, a communication device and a readable storage medium. BACKGROUND
[0002] At present, SRv6 is a segment routing (SR) solution based on an Internet Protocol Version 6 (IPv6) extension. For the SRv6 solution, a Segment ID (SID) of a Dynamic Host Configuration Protocol Version 6 (DHCPv6) server, such as an edge device of an operator network, is generated by calculation and dynamically updated along with a network state, and a SID of a DHCPv6 client is dynamically calculated based on a self-locating Locator identifier. In this case, due to management authority and security reasons, the DHCPv6 server and the client cannot interact with the SIDs, which will cause that the SRv6 messages cannot be normally transmitted and received between the two, and affect the operation of the SRv6 protocol system. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide a method and device for allocating an identifier, a communication device and a readable storage medium, so as to solve the problem that the DHCPv6 server and the client cannot interact with the SIDs.
[0004] In order to solve the above technical problems, the present application is implemented as follows:
[0005] In a first aspect, a method for allocating an identifier is provided, applied to a first device, and comprising:
[0006] sending a first message; wherein the first message comprises a first field, and the first field is used to request a second device to allocate a Segment ID (SID) of a first path and / or a first service for the first device;
[0007] receiving a target SID from a target second device; wherein the target SID is a SID allocated by the target second device for the first device; the first device is a DHCPv6 client, and the second device is a DHCPv6 server; or the first device is a DHCPv6 server, and the second device is a DHCPv6 client.
[0008] In a second aspect, a method for allocating an identifier is provided, applied to a second device, and comprising:
[0009] receiving a first message from a first device; wherein the first message comprises a first field, and the first field is used to request a second device to allocate a first path and / or a first service SID for the first device;
[0010] sending the allocated SID to the first device; wherein the first device is a DHCPv6 client and the second device is a DHCPv6 server, or the first device is a DHCPv6 server and the second device is a DHCPv6 client.
[0011] In a third aspect, a device for allocating an identifier is provided, and applied to a first device, comprising:
[0012] a first sending module configured to send a first message; wherein the first message comprises a first field, and the first field is used to request a second device to allocate a first path and / or a first service SID for the first device;
[0013] a first receiving module configured to receive a target SID from a target second device; wherein the target SID is a SID allocated by the target second device for the first device; the first device is a DHCPv6 client and the second device is a DHCPv6 server, or the first device is a DHCPv6 server and the second device is a DHCPv6 client.
[0014] In a fourth aspect, a device for allocating an identifier is provided, and applied to a second device, comprising:
[0015] a third receiving module configured to receive a first message from a first device; wherein the first message comprises a first field, and the first field is used to request a second device to allocate a first path and / or a first service SID for the first device;
[0016] a third sending module configured to send the allocated SID to the first device; wherein the first device is a DHCPv6 client and the second device is a DHCPv6 server, or the first device is a DHCPv6 server and the second device is a DHCPv6 client.
[0017] In a fifth aspect, an embodiment of the present application provides a communication device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction is executed by the processor to implement the steps of the method according to the first aspect, or to implement the steps of the method according to the second aspect.
[0018] In a sixth aspect, an embodiment of the present application provides a readable storage medium, the readable storage medium storing a program or instructions, the program or instructions being executed by a processor to implement the steps of the method according to the first aspect, or to implement the steps of the method according to the second aspect.
[0019] In the embodiment of the present application, the first device can send a first packet, the first packet including a first field, the first field being used to request the second device to allocate a first path and / or a SID of a first service for the first device, and receive a target SID allocated by the target second device; wherein the first device is a DHCPv6 client, and the second device is a DHCPv6 server; or the first device is a DHCPv6 server, and the second device is a DHCPv6 client. Thus, the DHCPv6 can be extended to realize dynamic announcement of the SID between the DHCPv6 server and the client, so that the SRv6 packet can be normally transmitted and received between the DHCPv6 server and the client, and the SRv6 protocol system is ensured to run. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 is a schematic diagram of an SRH in the embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a SID format in the embodiment of the present application;
[0022] Figure 3 is a flowchart of a method for allocating an identifier provided by the embodiment of the present application;
[0023] Figure 4 is a flowchart of another method for allocating an identifier provided by the embodiment of the present application;
[0024] Figure 5 is a flowchart of a SID announcement process in the embodiment of the present application;
[0025] Figure 6 is a structural schematic diagram of a device for allocating an identifier provided by the embodiment of the present application;
[0026] Figure 7 is a structural schematic diagram of another device for allocating an identifier provided by the embodiment of the present application;
[0027] Figure 8 is a structural schematic diagram of a communication device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0028] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are some of the embodiments of the present application, but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0029] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally a category and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in a "or" relationship.
[0030] In order to facilitate the understanding of the embodiments of the present application, the following content is first described.
[0031] SRv6 is the abbreviation of SR-IPv6, which means applying Segment Routing (SR) to IPv6 forwarding plane, that is, encapsulating the instruction list (SID list) of SR in the IPv6 packet to guide the packet to forward according to source route. Among them, the IPv6 Header and Segment Routing Header (SRH) can be as shown in Figure 1 The Next Header in the IPv6 Header is 43, indicating that the lower layer header is a Routing Extension Header. The SRv6 data plane can use Segment Routing Header (SRH) encapsulation, and the segment list information is encapsulated in SRH. Each segment is a 128-bit IPv6 address. The SRv6 tunnel is a management entity corresponding to the SID list, and it presents to the service as other tunnels. The SRv6 tunnel can carry all known types of payloads such as layer 2, layer 3, Multi-Protocol Label Switching (MPLS), Transmission Control Protocol (TCP), User Datagram Protocol (UDP), etc.
[0032] The SID of SRv6 can be understood as an IP address of a router, and the SID list represents an IP address list of the entire routing path. Figure 2 As shown in the figure, the SID of SRv6 can be a 128-bit programmable SID, which can include a Locator, a Function (FUNCT), and Arguments (ARGS). The Locator is an identification of a network node in the SRv6 protocol system, which is an identification assigned to a network node in the network topology, and is used to forward a data packet to the network node. The Locator corresponding route will be published to the network by the network node through the Interior Gateway Protocol (IGP), to help other devices forward the data packet to the node network publishing the Locator. In the SRv6 SID, the Locator length is variable, which is used to adapt to different sizes of networks. The Locator can be further divided into B and N. B identifies the SRv6 SID block (Block), which is generally assigned by an operator to a certain subnet, and is usually represented by a prefix. N is an identification of a node in the subnet. The Function (FUNCT) is used to express the forwarding action to be performed, which is equivalent to the operation code of the computer instruction. In SRv6 network programming, different forwarding behaviors (Behaviors) are described by the Function part, such as forwarding a data packet to a specified link, or table lookup forwarding in a specified table, etc. The Arguments (ARGS) is an optional field, which is the parameter corresponding to the instruction when executed. These parameters can include data flow, service or any other related information.
[0033] For the IPv6 protocol system, client devices such as optical network units (ONUs), routers, switches, etc. can cooperate with edge devices of the operator network such as broadband remote access servers (BRASs), service routers (SRs), etc. to automatically obtain IPv6 addresses from the BRAS / SR through the DHCPv6 protocol. The BRAS / SR directly has host routing / direct routing of downstream devices, and the default route of the client device points to the BRAS / SR.
[0034] Optionally, in the embodiments of the present application, the DHCPv6 client can include but is not limited to 4G / 5G devices, small switches, routers, and other client-side devices. The DHCPv6 server can be an edge device of the operator network, such as a BRAS, an SR, etc.
[0035] Optionally, the SID in the embodiments of the present application is specifically the SID of SRv6.
[0036] In order to solve the problem that the SID cannot be interacted between the DHCPv6 server and the client at present, the embodiment of the application extends the DHCPv6, and proposes that the SID is dynamically announced between the DHCPv6 server and the client, so that the SRv6 message can be normally transmitted and received between the DHCPv6 server and the client, and the operation of the SRv6 protocol system is ensured.
[0037] The method for allocating an identifier, the device, the communication device and the readable storage medium provided by the embodiment of the application will be described in detail in combination with the drawings, specific embodiments and application scenarios.
[0038] Please refer to Figure 3 , Figure 3 is a flowchart of a method for allocating an identifier provided by the embodiment of the application, and the method is applied to a first device, which can be selected as a DHCPv6 client or a DHCPv6 server. As shown in Figure 3 , the method comprises the following steps:
[0039] Step 31: sending a first message.
[0040] In the embodiment, the first message can comprise a first field, and the first field is used to request a second device to allocate a SID of a first path and / or a first service for the first device. The first path is a specific path, such as a service link with certain threshold requirements for at least one of a passing point, a bandwidth, a delay, a jitter, a packet loss rate, etc., which can be determined based on actual needs. The first service can be understood as a virtual private network (VPN), and by allocating the SID of the VPN, the network through which the message is transmitted and received can be indicated, so as to ensure the normal forwarding of the message.
[0041] For example, the first path is a service link with certain threshold requirements for the bandwidth and the delay; or the first path is a service link with certain threshold requirements for the jitter; or the first path is a service link with certain threshold requirements for the delay, the jitter and the packet loss rate; or the first path is a service link with certain threshold requirements for the passing point, the bandwidth, the delay, the jitter and the packet loss rate; and the like.
[0042] In some embodiments, the first message can be selected as a solicit message.
[0043] In some embodiments, the first field can be selected as an option field. For example, the first field is a special option field in the solicit message, which can be represented as option AA.
[0044] In some embodiments, the first device can send the first message, such as the solicit message, to multiple second devices in a multicast manner.
[0045] Optionally, the first device is a DHCPv6 client, and the second device is a DHCPv6 server; or the first device is a DHCPv6 server, and the second device is a DHCPv6 client. That is, the DHCPv6 client and the server can request and allocate the SID to each other.
[0046] Step 32: receiving a target SID from a target second device.
[0047] The target SID is the SID allocated to the first device by the target second device. The target second device can be determined by negotiation among multiple second devices, or selected by the first device from the multiple second devices, which is not limited.
[0048] The method for allocating an identifier according to the embodiments of the present application can send a first message by the first device, the first message including a first field, the first field being used to request the second device to allocate the first device with a SID of a first path and / or a first service, and receiving a target SID allocated by the target second device; wherein the first device is a DHCPv6 client, and the second device is a DHCPv6 server; or the first device is a DHCPv6 server, and the second device is a DHCPv6 client. In this way, the DHCPv6 can be extended to realize dynamic announcement of the SID between the DHCPv6 server and the client, so that the SRv6 message can be normally transmitted and received between the DHCPv6 server and the client, and the SRv6 protocol system is ensured to run. Further, the SRv6 protocol system can cover not only the operator devices such as core devices and edge devices, but also the service side devices and the client side devices.
[0049] Optionally, the above receiving the target SID from the target second device can include: first, receiving a second message from multiple second devices respectively; wherein the second message includes a second field, the second field being used to indicate the SID allocated to the first device; then, determining a server meeting a preset condition in the multiple second devices as the target second device, and determining the SID indicated by the second field in the second message sent by the target second device as the target SID.
[0050] Optionally, the server meeting the preset condition can be a server with the highest priority among multiple DHCPv6 servers, or a server meeting certain selection rules among the multiple DHCPv6 servers, which is not limited.
[0051] In some embodiments, the second message can be an advertise message.
[0052] In some embodiments, the second field can be an option field. For example, the second field can be a special option field in the advertise packet, which can be denoted as option BB.
[0053] In some embodiments, the second field can also indicate other required configuration parameters of the corresponding SID, such as Locator length (Block length and Node length), FUNCT length, ARGS length, etc.
[0054] Optionally, after determining the target second device, the first device can send a third packet to the plurality of second devices respectively; wherein the third packet comprises a third field, and the third field is used to indicate the identification ID of the target second device, so that all the related second devices obtain the target device determined by the first device.
[0055] In some embodiments, the third packet can be a request packet.
[0056] In some embodiments, the third field can be an option field. For example, the third field can be a special option field in the request packet, which can be denoted as option CC.
[0057] In some embodiments, the first device can send the third packet, such as the request packet, to the plurality of second devices by using the multicast mode.
[0058] Optionally, after sending the request third packet to the plurality of second devices respectively, the first device can receive a fourth packet from the target second device; wherein the fourth packet comprises a fourth field, and the fourth field is used to confirm that the target SID is allocated to the first device for use.
[0059] In some embodiments, the fourth packet can be a reply packet.
[0060] In some embodiments, the fourth field can be an option field. For example, the fourth field can be a special option field in the reply packet, which can be denoted as option DD.
[0061] In some embodiments, the fourth field can also confirm other required configuration parameters of the corresponding SID, such as Locator length (Block length and Node length), FUNCT length, ARGS length, etc.
[0062] It should be noted that the first field, the second field, the third field and the fourth field can have different lengths or the same length, which is determined based on actual needs and is not limited.
[0063] Please see Figure 4 , Figure 4 This is a flowchart illustrating a method for allocating identifiers according to an embodiment of this application. The method is applied to a second device, which may be a DHCPv6 client or a DHCPv6 server. Figure 4 As shown, the method includes the following steps:
[0064] Step 41: Receive the first message from the first device.
[0065] In this embodiment, the first message may include a first field, which is used to request the second device to allocate a SID for a first path and / or a first service to the first device. The first path is a specific path, such as a service link with certain threshold requirements for at least one of the following: path points, bandwidth, latency, jitter, packet loss rate, etc., and can be determined based on actual needs. The first service can be understood as a VPN. By allocating a VPN SID, the network traversed by the sent and received messages can be indicated, thereby ensuring normal message forwarding.
[0066] In some embodiments, the first message may be a solicitation message.
[0067] In some embodiments, the first field can be an option field. For example, the first field is a dedicated option field in a solicited message, such as option AA.
[0068] In some embodiments, the first device may send a first message, such as a solicit message, to multiple second devices via multicast.
[0069] Optionally, the first device can be a DHCPv6 client, and the second device can be a DHCPv6 server; or, the first device can be a DHCPv6 server, and the second device can be a DHCPv6 client. In other words, the DHCPv6 client and server can mutually request and assign SIDs.
[0070] Step 42: Send the SID assigned to the first device.
[0071] The method for allocating an identifier according to the embodiments of the application can comprise: receiving, by a second device, a first message from a first device, the first message comprising a first field, the first field being used to request the second device to allocate a first path and / or a first service SID for the first device, and sending, by the second device, the allocated SID to the first device, wherein the first device is a DHCPv6 client and the second device is a DHCPv6 server, or the first device is a DHCPv6 server and the second device is a DHCPv6 client. Thus, the DHCPv6 can be extended to realize dynamic announcement of the SID between the DHCPv6 server and the client, so that the SRv6 message can be normally transmitted and received between the DHCPv6 server and the client, and the SRv6 protocol system can be ensured to operate.
[0072] Optionally, the sending of the allocated SID to the first device can comprise: sending a second message to the first device, wherein the second message comprises a second field, and the second field is used to indicate the allocated SID for the first device.
[0073] In some embodiments, the second message can be an advertise message.
[0074] In some embodiments, the second field can be an option field. For example, the second field can be a special option field in the advertise message, which can be represented as option BB.
[0075] In some embodiments, the second field can further indicate other required configuration parameters of the corresponding SID, such as Locator length (Block length and Node length), FUNCT length, ARGS length, and the like.
[0076] Optionally, after the sending of the second message to the first device, the second device can receive a third message from the first device, wherein the third message comprises a third field, and the third field is used to indicate an ID of a target second device. The target second device is one of the multiple second devices that satisfy a preset condition and to which the first device determines to send the second message.
[0077] Optionally, the server satisfying the preset condition can be a server with the highest priority among multiple DHCPv6 servers, or can be a server that meets certain selection rules among the multiple DHCPv6 servers, and the application does not limit this.
[0078] In some embodiments, the third message can be a request message.
[0079] In some embodiments, the third field can be an option field. For example, the third field can be a special option field in the request message, which can be represented as option CC.
[0080] In some embodiments, the first device can send a third message, such as a request message, to multiple second devices through a multicast manner.
[0081] Optionally, after receiving the third message from the first device, the second device can first determine whether it is the target second device according to the identification of the target second device indicated by the third field in the third message; and then, if it is determined that it is the target second device, send a fourth message to the first device; wherein the fourth message includes a fourth field, and the fourth field is used to confirm that the target SID is allocated to the first device for use, and the target SID is the SID allocated to the target second device.
[0082] In some embodiments, the fourth message can be a reply message.
[0083] In some embodiments, the fourth field can be an option field. For example, the fourth field is a special option field in the reply message, which can be represented as option DD.
[0084] In some embodiments, the fourth field can also confirm other required configuration parameters of the corresponding SID, such as Locator length (Block length and Node length), FUNCT length, ARGS length, etc.
[0085] Next, referring to FIG. 1, the SID announcement process in the embodiments of the present application is described. Figure 5
[0086] As shown in FIG. 1, the specific SID announcement process can include: Figure 5
[0087] S51: The DHCPv6 client sends a solicit message to multiple DHCPv6 servers through a multicast manner, wherein the first field such as option AA is carried, which is used to request the DHCPv6 server to allocate a SID for a specific path / service for it.
[0088] S52: The DHCPv6 server replies to the DHCPv6 client with an advertise message, wherein the second field such as option BB is carried, which is used to indicate the SID allocated for the DHCPv6 client and other required configuration parameters such as Locator length (Block length and Node length), FUNCT length, ARGS length, etc.
[0089] S53: The DHCPv6 client selects a server satisfying preset conditions as a target DHCPv6 server, and sends a request message to all related DHCPv6 servers through multicast, wherein the request message carries a third field such as option CC, which is used to indicate the ID of the target DHCPv6 server.
[0090] S54: The target DHCPv6 server returns a reply message to the DHCPv6 client, wherein the reply message carries a fourth field such as option DD, which is used to determine that the target SID and other required network configuration parameters are allocated to the DHCPv6 client for use.
[0091] In this way, the SID dynamic advertisement of SRv6 can be implemented by means of the above-mentioned DHCPv6 protocol interaction process.
[0092] Please refer to Figure 6 , Figure 6 is a structural schematic diagram of an identifier allocation apparatus provided by an embodiment of the present application, which is applied to a first device, which can be selected as a DHCPv6 client or a DHCPv6 server. As shown in Figure 6 , the identifier allocation apparatus 60 can include:
[0093] a first sending module 61, configured to send a first message; wherein the first message includes a first field, and the first field is used to request a second device to allocate a SID of a first path and / or a first service for the first device;
[0094] a first receiving module 62, configured to receive a target SID from a target second device; wherein the target SID is a SID allocated by the target second device for the first device; the first device is a DHCPv6 client, and the second device is a DHCPv6 server; or the first device is a DHCPv6 server, and the second device is a DHCPv6 client.
[0095] Optionally, the first receiving module 62 includes:
[0096] a receiving unit, configured to receive second messages from a plurality of second devices respectively; wherein the second message includes a second field, and the second field is used to indicate a SID allocated for the first device;
[0097] a determining unit, configured to determine a server satisfying preset conditions in the plurality of second devices as the target second device, and determine the SID indicated by the second field in the second message sent by the target second device as the target SID.
[0098] Optionally, the identifier allocation apparatus 60 further includes:
[0099] The second sending module is configured to send a third message to the multiple second devices respectively, wherein the third message comprises a third field, and the third field is used to indicate the identity of the target second device.
[0100] Optionally, the apparatus 60 for allocating identity further comprises:
[0101] The second receiving module is configured to receive a fourth message from the target second device, wherein the fourth message comprises a fourth field, and the fourth field is used to confirm that the target SID is allocated to the first device.
[0102] It can be understood that the apparatus 60 for allocating identity according to the embodiments of the present application can realize the above-mentioned Figure 3 The apparatus for allocating identity according to the embodiments of the present application can realize the above-mentioned
[0103] Please refer to Figure 7 , Figure 7 is a structural schematic diagram of an apparatus for allocating identity provided by the embodiments of the present application, and the apparatus is applied to a second device, which can be a DHCPv6 client or a DHCPv6 server. As shown in Figure 7 The apparatus 70 for allocating identity can comprise:
[0104] The third receiving module 71 is configured to receive a first message from a first device, wherein the first message comprises a first field, and the first field is used to request the second device to allocate a SID of a first path and / or a first service to the first device.
[0105] The third sending module 72 is configured to send the allocated SID to the first device; the first device is a DHCPv6 client, and the second device is a DHCPv6 server; or the first device is a DHCPv6 server, and the second device is a DHCPv6 client.
[0106] Optionally, the third sending module 72 is specifically configured to send a second message to the first device, wherein the second message comprises a second field, and the second field is used to indicate the SID allocated to the first device.
[0107] Optionally, the apparatus 70 for allocating identity further comprises:
[0108] The fourth receiving module is configured to receive a third message from the first device, wherein the third message comprises a third field, and the third field is used to indicate the identity of a target second device; the target second device is one of the multiple second devices which satisfy a preset condition and to which the first device sends the second message.
[0109] Optionally, the apparatus 70 for assigning an identity further comprises:
[0110] a judging module, configured to judge whether the second device to which the apparatus belongs is the target second device according to the identity of the target second device indicated by the third field in the third message;
[0111] a fourth sending module, configured to send a fourth message to the first device in the case that the second device to which the apparatus belongs is judged to be the target second device; wherein the fourth message comprises a fourth field, and the fourth field is used to confirm that the target SID is assigned to the first device, and the target SID is the SID assigned to the target second device.
[0112] It can be understood that the apparatus 70 for assigning an identity according to the embodiments of the present application can implement the processes of the method for assigning an identity as described above, and can achieve the same technical effects. For the purpose of avoiding repetition, no further description is given here. Figure 4 The method for assigning an identity as shown in the embodiments of the present application can implement the processes of the method for assigning an identity as described above, and can achieve the same technical effects. For the purpose of avoiding repetition, no further description is given here.
[0113] In addition, the embodiments of the present application further provide a communication device 80, which comprises a processor 81, a memory 82, a program or instructions stored in the memory 82 and executable on the processor 81. For example, when the communication device 80 is a DHCPv6 client, the program or instructions are executed by the processor 81 to implement the processes of the method for assigning an identity as described above, and can achieve the same technical effects. When the communication device 80 is a DHCPv6 server, the program or instructions are executed by the processor 81 to implement the processes of the method for assigning an identity as described above, and can achieve the same technical effects. For the purpose of avoiding repetition, no further description is given here. Figure 3 Figure 4 In addition, the embodiments of the present application further provide a communication device 80, which comprises a processor 81, a memory 82, a program or instructions stored in the memory 82 and executable on the processor 81. For example, when the communication device 80 is a DHCPv6 client, the program or instructions are executed by the processor 81 to implement the processes of the method for assigning an identity as described above, and can achieve the same technical effects. When the communication device 80 is a DHCPv6 server, the program or instructions are executed by the processor 81 to implement the processes of the method for assigning an identity as described above, and can achieve the same technical effects. For the purpose of avoiding repetition, no further description is given here.
[0114] The embodiments of the present application further provide a readable storage medium having a program or instructions stored thereon, and the program or instructions are executable by a processor to implement the processes of the method for assigning an identity as described above, and can achieve the same technical effects. For the purpose of avoiding repetition, no further description is given here.
[0115] Computer-readable media includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0116] It should be noted that in this paper, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of another identical element in the process, method, article or device including the element.
[0117] The above-mentioned application embodiment serial number is only for description, not representing the pros and cons of the embodiment.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by software plus the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a plurality of instructions for making a service classification device (which can be a mobile phone, computer, server, air conditioner or network device, etc.) execute the method described in each embodiment of the present application.
[0119] The above-mentioned is only the preferred embodiment of the present application, it should be pointed out that, for those skilled in the art, without departing from the principle of the present application, a number of improvements and refinements can be made, these improvements and refinements should be regarded as the protection scope of the present application.
Claims
1. A method of allocating an identity, characterized by, The method applied to a first device comprises: sending a first message in a multicast mode; wherein the first message comprises a first field, and the first field is used to request a second device to allocate a segment identifier (SID) of a first path and / or a first service for the first device; receiving a target SID from a target second device; wherein the target SID is the SID allocated by the target second device for the first device; wherein the first device is a dynamic host configuration protocol version 6 (DHCPv6) client, and the second device is a DHCPv6 server; wherein the receiving of the target SID from the target second device comprises: receiving second messages from a plurality of second devices respectively; wherein the second message comprises a second field, and the second field is used to indicate the SID allocated for the first device; determining a server meeting a preset condition in the plurality of second devices as the target second device, and determining the SID indicated by the second field in the second message sent by the target second device as the target SID.
2. The method of claim 1, wherein, After the target second device is determined, the method further comprises: sending third messages to the plurality of second devices respectively; wherein the third message comprises a third field, and the third field is used to indicate an identity of the target second device.
3. The method of claim 2, wherein, After the request third messages are sent to the plurality of second devices respectively, the method further comprises: receiving a fourth message from the target second device; wherein the fourth message comprises a fourth field, and the fourth field is used to confirm that the target SID is allocated to the first device.
4. A method of allocating an identity, characterized by, The method applied to a second device comprises: receiving a first message from a first device; wherein the first message comprises a first field, and the first field is used to request the second device to allocate a SID of a first path and / or a first service for the first device; and the first message is sent by the first device in a multicast mode; sending the SID allocated for the first device to the first device; wherein the first device is a DHCPv6 client, and the second device is a DHCPv6 server; wherein the sending of the SID allocated for the first device to the first device comprises: sending a second message to the first device; wherein the second message comprises a second field, and the second field is used to indicate the SID allocated for the first device; and when the second messages are received from a plurality of second devices respectively by the first device, a server meeting a preset condition in the plurality of second devices is determined as a target second device, and the SID indicated by the second field in the second message sent by the target second device is determined as a target SID.
5. The method of claim 4, wherein, After the second message is sent to the first device, the method further comprises: receiving a third message from the first device; wherein the third message comprises a third field, and the third field is used to indicate an identity of the target second device.
6. The method of claim 5, wherein, After the third message is received from the first device, the method further comprises: judging whether the second device is the target second device according to the identity of the target second device indicated by the third field in the third message. If it is judged that the device itself is the target second device, a fourth message is sent to the first device; wherein the fourth message includes a fourth field, and the fourth field is used to confirm that the target SID is allocated to the first device.
7. An apparatus for allocating an identity, characterized by Applied to a first device, comprising: A first sending module is configured to send a first message in a multicast mode; wherein the first message includes a first field, and the first field is used to request a second device to allocate a first path and / or a first service SID for the first device; A first receiving module is configured to receive a target SID from a target second device; wherein the target SID is a SID allocated by the target second device for the first device; Wherein the first device is a DHCPv6 client, and the second device is a DHCPv6 server; Wherein the first receiving module comprises: A receiving unit is configured to receive second messages from multiple second devices respectively; wherein the second message includes a second field, and the second field is used to indicate a SID allocated for the first device; A determining unit is configured to determine a server in the multiple second devices that meets a preset condition as the target second device, and determine the SID indicated by the second field in the second message sent by the target second device as the target SID.
8. The apparatus of claim 7, wherein, The device further comprises: A second sending module is configured to send third messages to the multiple second devices respectively; wherein the third message includes a third field, and the third field is used to indicate an identity of the target second device.
9. The apparatus of claim 8, wherein, The device further comprises: A second receiving module is configured to receive a fourth message from the target second device; wherein the fourth message includes a fourth field, and the fourth field is used to confirm that the target SID is allocated to the first device.
10. An apparatus for allocating an identity, characterized by Applied to a second device, comprising: A third receiving module is configured to receive a first message from a first device; wherein the first message includes a first field, and the first field is used to request a second device to allocate a first path and / or a first service SID for the first device; and the first message is sent by the first device in a multicast mode; A third sending module is configured to send a SID allocated for the first device to the first device; Wherein the first device is a DHCPv6 client, and the second device is a DHCPv6 server; Wherein the third sending module is specifically configured to send a second message to the first device; wherein the second message includes a second field, and the second field is used to indicate a SID allocated for the first device; when the first device receives second messages from multiple second devices respectively, the first device determines a server in the multiple second devices that meets a preset condition as a target second device, and determines a SID indicated by the second field in the second message sent by the target second device as a target SID.
11. The apparatus of claim 10, wherein, The device further comprises: A fourth receiving module is configured to receive a third message from the first device; wherein the third message includes a third field, and the third field is used to indicate an identity of the target second device.
12. The apparatus of claim 11, wherein, The device further comprises: A judging module is configured to judge whether the second device to which the first device belongs is the target second device according to the identification of the target second device indicated by the third field in the third packet. A fourth sending module is configured to send a fourth packet to the first device if it is judged that the second device to which the first device belongs is the target second device, wherein the fourth packet comprises a fourth field, and the fourth field is used to confirm that the target SID is allocated to the first device.
13. A communication device, characterized by A processor, a memory, and a program or instructions stored in the memory and executable on the processor are included, and the program or instructions are executed by the processor to implement the steps of the method for allocating an identification according to any one of claims 1 to 3 or the steps of the method for allocating an identification according to any one of claims 4 to 6.
14. A readable storage medium, characterized by, A readable storage medium stores a program or instructions, and the program or instructions are executed by a processor to implement the steps of the method for allocating an identification according to any one of claims 1 to 3 or the steps of the method for allocating an identification according to any one of claims 4 to 6.
Citation Information
Patent Citations
Assignment of segment identifiers in segment routing
US11165691B1