WO2023138256A1 - Communication method and communication apparatus - Google Patents

Communication method and communication apparatus Download PDF

Info

Publication number
WO2023138256A1
WO2023138256A1 PCT/CN2022/137884 CN2022137884W WO2023138256A1 WO 2023138256 A1 WO2023138256 A1 WO 2023138256A1 CN 2022137884 W CN2022137884 W CN 2022137884W WO 2023138256 A1 WO2023138256 A1 WO 2023138256A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
message
address
field
sends
Prior art date
Application number
PCT/CN2022/137884
Other languages
French (fr)
Chinese (zh)
Inventor
许培
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202210327033.1A external-priority patent/CN116527579A/en
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023138256A1 publication Critical patent/WO2023138256A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation

Definitions

  • the present application relates to the technical field of communication, and in particular, to a communication method and a communication device.
  • Hierarchical addresses are an addressing method used in tree-type network topology scenarios, which can reduce the number of device forwarding entries and improve service convergence performance.
  • One type of device is a device with lower-level nodes, which can be called a network device; the other is a device without a lower-level node, which can be called a terminal device.
  • a network device a device with lower-level nodes
  • a terminal device a device without a lower-level node
  • their hierarchical addresses need to be manually configured.
  • manual configuration needs to be laborious.
  • manual configuration may also cause configuration errors and cause network paralysis.
  • the present application provides a communication method and a communication device, which are used to realize automatic allocation of hierarchical addresses through interaction between upper and lower nodes in a tree-type network topology scene, so as to avoid network paralysis caused by manual configuration errors and improve network stability.
  • the first aspect of the embodiments of the present application provides a communication method, the method is executed by the first node, or the method is executed by some components in the first node (such as a processor, chip or chip system, etc.), or the method is implemented by a logic module or software that can realize all or part of the functions of the first node.
  • description is made by taking the communication method executed by a first node as an example, where the first node may be a device such as a router, a switch, or a virtual machine.
  • the first node sends a first discovery message, and the first discovery message is used to request an address allocation;
  • the first node receives a first provision message from a second node, and the first provision message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is a superior node of the first node, and the value of the second field is an identifier of the first node;
  • the first node receives a second discovery message from a third node, the second discovery message
  • the text is used to request an address allocation, and the third node is a subordinate node of the first node;
  • the first node sends a second providing message to the third node, the second providing message includes a second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of
  • the first providing message received by the first node includes a first address, the value of the first field in the first address is the value of the address of the second node and the value of the second field in the first address is the identifier of the first node; and the second providing message sent by the first node includes a second address, the value of the third field in the second address is the value of the address of the first node and the value of the fourth field in the second address is the identifier of the third node.
  • the second node is a superior node of the first node and the third node is a subordinate node of the first node, that is, the first node can not only receive the hierarchical address assigned by the superior node, but also assign a hierarchical address to the subordinate node.
  • the first node in a tree-type network topology scenario including the second node, the first node, and the third node, the first node can serve as a terminal device to receive an automatically assigned hierarchical address from a superior node, and can also serve as a network device to automatically assign a hierarchical address to a subordinate node. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP).
  • NewIP New Internet Protocol
  • the above-mentioned technical effect can also be expressed as the automatic allocation of the hierarchical address in the NewIP protocol through the interaction between the upper and lower nodes in the tree-type network topology scene.
  • the discovery messages involved in the embodiments of the present application are used to request address allocation, that is, the discovery message is a message sent when the sender of the discovery message does not have an address. For this reason, the sender may send the discovery message in a flooding manner, hoping that the discovery message can be received by multiple receivers and obtain responses to the discovery message (that is, provide a message).
  • the sending end of the discovery message has an interface for communicating with the upper node (which may be called a northbound interface) and an interface for communicating with the lower node (which may be called a southbound interface), since generally only the upper node has the ability to allocate addresses, for this reason, the discovery message may also be sent by flooding the interface for communicating with the upper node to save overhead.
  • the sender of the discovery message can flexibly select the above sending method in different scenarios. For example, in the case that the sender (due to no configuration) cannot determine which nodes among the connected nodes are upper-level nodes, the sender may send the discovery message in a manner of collective flooding. For another example, when the sender can perceive which nodes among the connected nodes are upper-level nodes, the discovery message may be sent in a selective flooding manner to save overhead.
  • the address assigned by the upper-level node to the lower-level node includes a field whose value is the identifier of the lower-level node (for example, the second field in the first address assigned by the second node to the first node, the fourth field in the second address assigned by the first node to the third node, and other assigned fields in the following).
  • the field that takes the value as the identifier of the lower-level node can have a variety of value situations. It can be a value configured by the upper-level node (for example, the value is the serial number configured by the upper-level node according to the time sequence in which multiple lower-level nodes send discovery messages, and the value is the time stamp when the upper-level node receives discovery messages from multiple lower-level nodes, etc.), or it can be different values pre-configured for multiple lower-level nodes (for example, the value is a media access control (MAC) of multiple lower-level nodes. ) address, which is the device number of multiple subordinate nodes, etc.), or other implementation methods, which are not limited here.
  • MAC media access control
  • the method further includes: after determining to disconnect from the second node, the first node sends a first change message to the third node to instruct the third node to clear the second address.
  • the first node determines that the first address allocated by the second node to the first node is invalid and the second address allocated by the first node based on the first address is invalid.
  • the first node sends a first change message to the third node to instruct the third node to clear the second address, so that the third node knows that the second address is invalid and clears the second address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
  • the method further includes: after determining to disconnect from the second node, the first node sends a third discovery message, where the third discovery message is used to request address allocation; the first node receives a third offer message from the fourth node, and the third offer message includes the third address allocated by the fourth node to the first node;
  • the value of the address of the node, the value of the sixth field is the identifier of the first node.
  • the first node determines that the first address allocated by the second node to the first node is invalid.
  • the first node may send a third discovery message for requesting address allocation to the other superior node (for example, the fourth node), and obtain the third address allocated to the first node from the fourth node. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
  • the value of the sixth field in the third address and the value of the second field in the first address are both identifiers of the first node.
  • the value of the sixth field in the third address and the value of the second field in the first address can be the same value, or the value of the sixth field in the third address and the value of the second field in the first address can also be different values, that is, the identifiers assigned to the first node by different upper-level nodes can be the same or different, which is not limited here.
  • the method further includes: after determining to disconnect from the second node, the first node clears the first address.
  • the first node determines that the first address assigned by the second node to the first node will become invalid. For this reason, the first node may clear the first address locally, and then obtain a new address from the upper node through a discovery message.
  • the determination by the first node to disconnect from the second node includes at least one of the following: the first node determines that the port status with the second node is down; or, the first node determines that the lease renewal of the first address has timed out; or, the first node receives a second change message from the second node to instruct the first node to clear the first address.
  • disconnection between the first node and the second node may include disconnection of the link between the first node and the second node, may also include dormancy of the link between the first node and the second node, and may also include failure of the second node (or a superior node of the second node), etc., which are not limited herein.
  • the first node may confirm that the second node is disconnected through the above-mentioned various methods, and further clarify that the first address allocated by the second node to the first node is invalid.
  • the method before the first node receives the first offer message from the second node, the method further includes: the first node receives a fourth discovery message, where the fourth discovery message is used to request address allocation; the first node sends a first non-confirmation message, where the first non-confirmation message is used to indicate refusal to allocate an address.
  • the first node before the first node receives the first providing message from the second node, that is, before the first node receives the address assigned by the upper-level node, the first node does not have the ability to assign addresses to lower-level nodes (or the current hierarchical address of the first node is invalid). For this reason, after the first node receives the fourth discovery message for requesting address allocation, the first node sends a first non-confirmation message for indicating refusal of address allocation, so that the receiver of the first non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
  • the method before the first node receives the first offer message from the second node, the method further includes: the first node receives a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  • the first node before the first node receives the first providing message, that is, before the first node receives the address assigned by the superior node, the first node does not know its own address, and correspondingly, the subordinate nodes (such as the third node) of the first node do not know its own address.
  • the number of the first discovery message sent by the first node may be multiple.
  • the third node After a certain first discovery message is received by the third node, because the third node does not have the ability to allocate addresses (or the current hierarchical address of the third node is invalid), the third node will send to the first node a second non-confirmation message for indicating refusal to allocate addresses, so that the first node determines based on the second non-confirmation message that the third node currently does not have the ability to allocate addresses.
  • the aforementioned non-confirmation messages (including the first non-confirmation message, the second non-confirmation message, and the third non-confirmation message, fourth non-confirmation message, and fifth non-confirmation message that may appear later) used to indicate the refusal to allocate addresses are messages based on the feedback of the discovery message.
  • the discovery message sent by the sender of the discovery message may be sent in a manner of flooding (full flooding or selective flooding). For this reason, the receiving end of the discovery message may receive the discovery message in various situations.
  • the receiving end of the discovery message has not received the address assigned by the upper-level node (that is, the receiving end does not have the address allocation capability, or the current hierarchical address of the receiving end is invalid)
  • the message fed back by the receiving end is a non-confirmation message for indicating that the address is rejected
  • the message fed back by the receiving end is an offer message for address allocation. Therefore, for any upper-level node, if the current hierarchical address of the upper-level node is invalid, it will feed back a non-confirmation message based on the received discovery message.
  • the automatic allocation of hierarchical addresses is realized by sequentially allocating addresses from upper-level nodes to lower-level nodes, so as to avoid network paralysis caused by manual configuration errors and improve network stability.
  • the method further includes: the first node sends a first request message to the second node, where the first request message is used to indicate a request to use the first address; and the first node receives a first confirmation message from the second node, where the first confirmation message is used to indicate permission to use the first address.
  • the first node after the first node receives the first provision message from the second node, the first node sends to the second node a first request message indicating that the first address is requested to be used, and receives a first confirmation message from the second node indicating that the first address is allowed to be used.
  • the first node can clearly allocate an address based on the first address based on the first confirmation message, the first node sends a second offer message including the second address allocated based on the first address to the third node.
  • the second node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the second node for requesting address allocation, and the second node may not only allocate the first address to the first node, but may also allocate the first address to other lower-level nodes.
  • the first node may clarify that the second node allows the first node to use the first address through the interaction of the first request message and the first confirmation message, that is, it is clear that other nodes other than the first node are not allowed to use the first address, so as to avoid address allocation conflicts.
  • the method before the first node receives the first confirmation message from the second node, the method further includes: the first node receives a fifth discovery message, where the fifth discovery message is used to request address allocation; the first node sends a third non-confirmation message, where the third non-confirmation message is used to indicate refusal to allocate an address.
  • the first node before the first node receives the first confirmation message from the second node, since the first node does not know whether the second node allows the first node to use the first address, that is, the first node does not know whether the first node can assign addresses to subordinate nodes based on the first address. For this reason, after the first node receives the fifth discovery message for requesting address allocation, the first node sends a third non-confirmation message for indicating refusal of address allocation, so that the recipient of the third non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
  • the method further includes: the first node receives a second request message from the third node, where the second request message is used to indicate a request to use the second address; the first node sends a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used.
  • the first node after the first node sends a second offer message to the third node, and after the first node receives a second request message from the third node indicating a request to use the second address, the first node sends to the third node a second confirmation message indicating permission to use the second address.
  • the third node can determine that the second address is an address allowed to be used based on the second confirmation message.
  • the first node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the first node to request address allocation, and the first node may not only allocate the second address to the third node, but may also allocate the second address to other lower-level nodes.
  • the second node can clarify that the first node allows the second node to use the second address through the interaction of the second request message and the second confirmation message, that is, it is clear that other nodes other than the second node are not allowed to use the second address, so as to avoid address allocation conflicts.
  • the first address and the second address are NewIP addresses.
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, in this implementation, different nodes (including the first node, the second node and the third node, etc.) can communicate based on the NewIP protocol. On this basis, the addresses allocated by the above-mentioned nodes (including the first address, the second address, and the possible third address, etc.) are NewIP addresses.
  • NewIP New Internet Protocol
  • the first discovery message, the first offer message, the second discovery message, and the second offer message are all dynamic host configuration protocol (dynamic host configuration protocol, DHCP) messages.
  • the first discovery message, the first provision message, the second discovery message and the second provision message are all DHCP messages, that is, the first discovery message and the second discovery message can be a Dynamic Host Configuration Protocol discovery (DHCP discover) message in DHCP, and the first provision message and the second provision message can provide a (DHCP offer) message for a Dynamic Host Configuration Protocol in DHCP.
  • DHCP discover Dynamic Host Configuration Protocol discovery
  • DHCP offer Dynamic Host Configuration Protocol
  • DHCP discover messages can all be DHCP discover messages
  • other provision messages involved in the present application can all be DHCP offer messages.
  • the request message involved in the application can also be a dynamic host configuration protocol request (DHCP request) message in DHCP
  • DHCP NAK Dynamic Host Configuration Protocol non-acknowledgement
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, the above technical solution can also be described as extending the DHCP protocol to support the automatic allocation of the hierarchical address in the NewIP protocol.
  • NewIP New Internet Protocol
  • the messages involved in this application are taken as examples for description.
  • the messages involved in this application can also be messages in the other address allocation protocols.
  • the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
  • the first field whose value is the address of the upper-level node may be located before the second field whose value is the identifier of the first node, so as to clarify based on the first address of the first node the address of the upper-level node of the first node and the network topology relationship of the network where the first node is located.
  • the third field whose value is the address of the upper-level node may be located before the fourth field whose value is the identifier of the third node, so as to clarify the address of the upper-level node of the third node based on the second address of the third node and the network topology relationship of the network where the third node is located.
  • the method is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
  • the second node can be the root node in the network topology (that is, only have the lower nodes and not have the upper nodes), and the second node can also be an intermediate node in the network topology (that is, have the lower nodes and have the upper nodes), which is not limited here.
  • the method is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
  • the third node can be a leaf node in the network topology (that is, only have a superior node but not a subordinate node), and the third node can also be an intermediate node in the network topology (that is, have a subordinate node and have a superior node), which is not limited here.
  • the second aspect of the embodiments of the present application provides a communication method, which is implemented by a communication system.
  • the method is executed by each node (including the first node, the second node, and the third node, etc.) in the communication system, or, the method is executed by some components (such as a processor, a chip, or a chip system, etc.) in each node (including the first node, the second node, and the third node, etc.), or, the method is implemented by a logic module or software that can realize all or part of the functions of each node (including the first node, the second node, and the third node, etc.).
  • the communication method is described as an example performed by various nodes (including the first node, the second node, and the third node, etc.), where each node (including the first node, the second node, and the third node, etc.) may be a device such as a router, a switch, or a virtual machine.
  • each node including the first node, the second node, and the third node, etc.
  • the second node is a superior node of the first node and the third node is a subordinate node of the first node.
  • the first node sends a first discovery message, and the first discovery message is used to request an address allocation;
  • the second node receives the first discovery message, and sends a first provision message to the first node, and the first provision message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node, and the value of the second field is an identifier of the first node;
  • the first node receives the first provision message;
  • the first node receives the second discovery message and sends a second offer message to the third node, the second offer message includes a second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field is an identifier
  • the first providing message received by the first node from the second node includes a first address, the value of the first field in the first address is the value of the address of the second node and the value of the second field in the first address is the identifier of the first node; and the second providing message sent by the first node to the third node includes a second address, the value of the third field in the second address is the value of the address of the first node and the value of the fourth field in the second address is the identifier of the third node.
  • the second node is a superior node of the first node and the third node is a subordinate node of the first node, that is, the first node can not only receive the hierarchical address assigned by the superior node, but also assign a hierarchical address to the subordinate node.
  • the first node in a tree-type network topology scenario including the second node, the first node, and the third node, the first node can serve as a terminal device to receive an automatically assigned hierarchical address from a superior node, and can also serve as a network device to automatically assign a hierarchical address to a subordinate node. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP).
  • NewIP New Internet Protocol
  • the above-mentioned technical effect can also be expressed as the automatic allocation of the hierarchical address in the NewIP protocol through the interaction between the upper and lower nodes in the tree-type network topology scene.
  • the discovery messages involved in the embodiments of the present application are used to request address allocation, that is, the discovery message is a message sent when the sender of the discovery message does not have an address. For this reason, the sender may send the discovery message in a flooding manner, hoping that the discovery message can be received by multiple receivers and obtain responses to the discovery message (that is, provide a message).
  • the sending end of the discovery message has an interface for communicating with the upper node (which may be called a northbound interface) and an interface for communicating with the lower node (which may be called a southbound interface), since generally only the upper node has the ability to allocate addresses, for this reason, the discovery message may also be sent by flooding the interface for communicating with the upper node to save overhead.
  • the sender of the discovery message can flexibly select the above sending method in different scenarios. For example, in the case that the sender (due to no configuration) cannot determine which nodes among the connected nodes are upper-level nodes, the sender may send the discovery message in a manner of collective flooding. For another example, when the sender can perceive which nodes among the connected nodes are upper-level nodes, the discovery message can be sent in a selective flooding manner to save overhead.
  • the address assigned by the upper-level node to the lower-level node includes a field whose value is the identifier of the lower-level node (for example, the second field in the first address assigned by the second node to the first node, the fourth field in the second address assigned by the first node to the third node, and other assigned fields in the following).
  • the field that takes the value as the identifier of the lower-level node can have a variety of value situations. It can be a value configured by the upper-level node (for example, the value is the serial number configured by the upper-level node according to the time sequence in which multiple lower-level nodes send discovery messages, and the value is the time stamp when the upper-level node receives discovery messages from multiple lower-level nodes, etc.), or it can be different values pre-configured for multiple lower-level nodes (for example, the value is a media access control (MAC) of multiple lower-level nodes. ) address, which is the device number of multiple subordinate nodes, etc.), or other implementation methods, which are not limited here.
  • MAC media access control
  • the method further includes: after the first node determines to disconnect from the second node, the first node sends a first change message to the third node to instruct the third node to clear the second address; the third node receives the first change message and clears the second address.
  • the first node determines that the first address allocated by the second node to the first node is invalid and the second address allocated by the first node based on the first address is invalid.
  • the first node sends a first change message to the third node to instruct the third node to clear the second address, so that the third node knows that the second address is invalid and clears the second address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
  • the method further includes: the third node sending the first change message to a subordinate node of the third node.
  • the third node when the third node also includes subordinate nodes, after the third node receives the first change message, the third node may also send the first change message to the subordinate nodes of the third node to instruct the subordinate nodes of the third node to clear the address allocated by the third node, so that the subordinate nodes of the third node clearly invalidate the allocated address and clear the address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized in the multi-layer network topology through negotiation among different nodes.
  • the system further includes a fourth node, where the fourth node is an upper-level node of the first node.
  • the method further includes: after determining to disconnect from the second node, the first node sends a third discovery message, where the third discovery message is used to request address allocation; the fourth node receives the third discovery message, and sends a third offer message to the first node, where the third offer message includes a third address allocated by the fourth node to the first node;
  • the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, the value of the sixth field is the identifier of the first node; the first node receives the third providing message.
  • the first node determines that the first address allocated by the second node to the first node is invalid.
  • the first node may send a third discovery message for requesting address allocation to other upper-level nodes (such as the fourth node), and obtain the third address allocated to the first node from the fourth node; in other words, after the first node determines that the upper-level node of the first node is changed from the second node to the fourth node, the first node obtains a new address from the fourth node. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
  • the value of the sixth field in the third address and the value of the second field in the first address are both identifiers of the first node.
  • the value of the sixth field in the third address and the value of the second field in the first address can be the same value, or the value of the sixth field in the third address and the value of the second field in the first address can also be different values, that is, the identifiers assigned to the first node by different upper-level nodes can be the same or different, which is not limited here.
  • the method further includes: the third node receiving the third discovery message; the third node sending a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address; and the first node receives the fourth non-confirmation message.
  • the first node before the first node receives the third providing message from the fourth node, that is, before the first node receives the address assigned by the upper-level node, the first node does not have the ability to assign addresses to lower-level nodes (or the current hierarchical address of the first node is invalid). For this reason, after the first node receives the fourth discovery message for requesting address allocation, the first node sends a fourth non-confirmation message for indicating refusal of address allocation, so that the receiver of the fourth non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
  • the method further includes: after determining to disconnect from the second node, the first node clears the first address.
  • the first node determines that the first address assigned by the second node to the first node will become invalid. For this reason, the first node may clear the first address locally, and then obtain a new address from the upper node through a discovery message.
  • the determination by the first node to disconnect from the second node includes at least one of the following: the first node determines that the state of the port with the second node is down; or, the first node determines that the lease renewal of the first address has timed out; or, the first node receives a second change message from the second node to instruct the first node to clear the first address.
  • disconnection between the first node and the second node may include disconnection of the link between the first node and the second node, may also include dormancy of the link between the first node and the second node, and may also include failure of the second node (or a superior node of the second node), etc., which are not limited herein.
  • the first node can explicitly disconnect from the second node through the above-mentioned various methods, and further clarify that the first address allocated by the second node to the first node is invalid.
  • the method before the first node receives the first provision message, the method further includes: the third node sends a fourth discovery message, where the fourth discovery message is used to request address allocation; the first node receives the fourth discovery message, and sends a first non-confirmation message to the third node, where the first non-confirmation message is used to indicate refusal to allocate an address; the third node receives the first non-confirmation message.
  • the first node before the first node receives the first providing message from the second node, that is, before the first node receives the address assigned by the upper-level node, the first node does not have the ability to assign addresses to lower-level nodes (or the current hierarchical address of the first node is invalid). For this reason, after the first node receives the fourth discovery message for requesting address allocation, the first node sends a first non-confirmation message for indicating refusal of address allocation, so that the receiver of the first non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
  • the method before the first node receives the first provision message, the method further includes: the third node receives the first discovery message; the third node sends a second non-confirmation message to the first node, and the second non-confirmation message is used to indicate refusal to allocate an address; the first node receives the second non-confirmation message.
  • the first node before the first node receives the first providing message, that is, before the first node receives the address assigned by the superior node, the first node does not know its own address, and correspondingly, the subordinate nodes (such as the third node) of the first node do not know its own address.
  • the number of the first discovery message sent by the first node may be multiple.
  • the third node After a certain first discovery message is received by the third node, because the third node does not have the ability to allocate addresses (or the current hierarchical address of the third node is invalid), the third node will send to the first node a second non-confirmation message for indicating refusal to allocate addresses, so that the first node determines based on the second non-confirmation message that the third node currently does not have the ability to allocate addresses.
  • the above non-confirmation messages (including the first non-confirmation message, the second non-confirmation message, and the third non-confirmation message, fourth non-confirmation message, and fifth non-confirmation message that may appear later) used to indicate the refusal to allocate addresses are messages based on the feedback of the discovery message.
  • the discovery message sent by the sender of the discovery message may be sent in a manner of flooding (full flooding or selective flooding). For this reason, the receiving end of the discovery message may receive the discovery message in various situations.
  • the receiving end of the discovery message has not received the address assigned by the upper-level node (that is, the receiving end does not have the address allocation capability, or the current hierarchical address of the receiving end is invalid)
  • the message fed back by the receiving end is a non-confirmation message for indicating that the address is rejected
  • the message fed back by the receiving end is an offer message for address allocation. Therefore, for any upper-level node, if the current hierarchical address of the upper-level node is invalid, it will feed back a non-confirmation message based on the received discovery message.
  • the automatic allocation of hierarchical addresses is realized by sequentially allocating addresses from upper-level nodes to lower-level nodes, so as to avoid network paralysis caused by manual configuration errors and improve network stability.
  • the method further includes: the first node sends a first request message, where the first request message is used to indicate a request to use the first address; the second node receives the first request message, and sends a first confirmation message to the first node, where the first confirmation message is used to indicate permission to use the first address; and the first node receives the first confirmation message.
  • the first node after the first node receives the first provision message from the second node, the first node sends to the second node a first request message indicating that the first address is requested to be used, and receives a first confirmation message from the second node indicating that the first address is allowed to be used.
  • the first node can clearly allocate an address based on the first address based on the first confirmation message, the first node sends a second offer message including the second address allocated based on the first address to the third node.
  • the second node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the second node for requesting address allocation, and the second node may not only allocate the first address to the first node, but may also allocate the first address to other lower-level nodes.
  • the first node can clarify that the second node allows the first node to use the first address through the interaction of the first request message and the first confirmation message, that is, it is clear that other nodes other than the first node are not allowed to use the first address, so as to avoid address allocation conflicts.
  • the method before the first node receives the first confirmation message, the method further includes: the third node sends a fifth discovery message, where the fifth discovery message is used to request address allocation; the first node receives the fifth discovery message, and sends a third non-confirmation message to the third node, where the third non-confirmation message is used to indicate refusal to allocate an address; and the third node receives the third non-confirmation message.
  • the first node before the first node receives the first confirmation message from the second node, since the first node does not know whether the second node allows the first node to use the first address, that is, the first node does not know whether the first node can assign addresses to subordinate nodes based on the first address. For this reason, after the first node receives the fifth discovery message for requesting address allocation, the first node sends a third non-confirmation message for indicating refusal of address allocation, so that the recipient of the third non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
  • the method further includes: the third node sends a second request message, where the second request message is used to indicate a request to use the second address; the first node receives the second request message, and sends a second confirmation message to the third node, where the second confirmation message is used to indicate permission to use the second address; and the third node receives the second confirmation message.
  • the first node after the first node sends a second offer message to the third node, and after the first node receives a second request message from the third node indicating a request to use the second address, the first node sends to the third node a second confirmation message indicating permission to use the second address.
  • the third node can determine that the second address is an address allowed to be used based on the second confirmation message.
  • the first node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the first node to request address allocation, and the first node may not only allocate the second address to the third node, but may also allocate the second address to other lower-level nodes.
  • the second node can clarify that the first node allows the second node to use the second address through the interaction of the second request message and the second confirmation message, that is, it is clear that other nodes other than the second node are not allowed to use the second address, so as to avoid address allocation conflicts.
  • the first address and the second address are NewIP addresses.
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, in this implementation, different nodes (including the first node, the second node and the third node, etc.) can communicate based on the NewIP protocol. On this basis, the addresses allocated by the above-mentioned nodes (including the first address, the second address, and the possible third address, etc.) are NewIP addresses.
  • NewIP New Internet Protocol
  • the first discovery message, the first offer message, the second discovery message, and the second offer message are all Dynamic Host Configuration Protocol DHCP messages.
  • the first discovery message, the first provision message, the second discovery message and the second provision message are all DHCP messages, that is, the first discovery message and the second discovery message can be a Dynamic Host Configuration Protocol discovery (DHCP discover) message in DHCP, and the first provision message and the second provision message can be a Dynamic Host Configuration Protocol (DHCP offer) message in DHCP.
  • DHCP discover Dynamic Host Configuration Protocol discovery
  • DHCP offer Dynamic Host Configuration Protocol
  • other discovery messages involved in the present application can all be DHCP discover messages, and other provision messages that the application involves can be DHCP offer messages.
  • the request message involved in the application can also be a dynamic host configuration protocol request (DHCP request) message in DHCP
  • the confirmation message involved in the application such as the first confirmation message, the second confirmation message, etc.
  • Dynamic Host Configuration Protocol non-acknowledgement DHCP NAK
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, the above technical solution can also be described as extending the DHCP protocol to support the automatic allocation of the hierarchical address in the NewIP protocol.
  • NewIP New Internet Protocol
  • the messages involved in this application are taken as examples for description.
  • the messages involved in this application can also be messages in the other address allocation protocols.
  • the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
  • the first field whose value is the address of the upper-level node may be located before the second field whose value is the identifier of the first node, so as to clarify based on the first address of the first node the address of the upper-level node of the first node and the network topology relationship of the network where the first node is located.
  • the third field whose value is the address of the upper-level node may be located before the fourth field whose value is the identifier of the third node, so as to clarify the address of the upper-level node of the third node based on the second address of the third node and the network topology relationship of the network where the third node is located.
  • the method is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
  • the second node can be the root node in the network topology (that is, only have the lower nodes and not have the upper nodes), and the second node can also be an intermediate node in the network topology (that is, have the lower nodes and have the upper nodes), which is not limited here.
  • the fourth node can be the root node in the network topology (that is, it only has a lower node and does not have a higher node), and the fourth node can also be an intermediate node in the network topology (that is, it has a lower node and a higher node), which is not limited here.
  • the method is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
  • the third node can be a leaf node in the network topology (that is, only have a superior node but not a subordinate node), and the third node can also be an intermediate node in the network topology (that is, have a subordinate node and have a superior node), which is not limited here.
  • a third aspect of the embodiments of the present application provides a communications device, which can implement the method in the foregoing first aspect or any possible implementation manner of the first aspect.
  • the apparatus includes corresponding units or modules for performing the above method.
  • the units or modules included in the device can be realized by software and/or hardware.
  • the device may be a communication device, or the device may be a component of the communication device (such as a processor, a chip or a chip system, etc.), or the device may also be a logic module or software capable of realizing all or part of the functions of the communication device.
  • the communication device includes a processing unit and a transceiver unit;
  • the sending unit is used to send a first discovery message, and the first discovery message is used to request address allocation;
  • the receiving unit is configured to receive a first provision message from a second node, the first provision message includes a first address assigned by the second node to the first node; wherein, the second node is a superior node of the first node, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node, and the value of the second field is the identifier of the first node;
  • the receiving unit is also used to receive a second discovery message from the third node, where the third node is a subordinate node of the first node, and the second discovery message is used to request address allocation;
  • the sending unit is further configured to send a second providing message to the third node, the second providing message includes a second address assigned by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field is an identifier of the third node.
  • the device further includes a processing unit; the sending unit is further configured to send a first change message to the third node after the processing unit determines to disconnect from the second node, to instruct the third node to clear the second address.
  • the sending unit is further configured to send a third discovery message, the third discovery message is used to request an address allocation; the receiving unit is also used to receive a third provision message from the fourth node, the third provision message includes a third address allocated by the fourth node to the first node; wherein, the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node and the fourth node is the superior node of the first node, and the value of the sixth field is The value is the ID of the first node.
  • the processing unit is further configured to clear the first address.
  • the determining by the processing unit to disconnect from the second node includes at least one of the following:
  • the processing unit determines that the state of the port with the second node is down; or,
  • the processing unit determines that the lease renewal of the first address is timed out; or,
  • the processing unit determines that the receiving unit receives the second change message from the second node, so as to instruct the first node to delete the first address.
  • the receiving unit is further configured to receive a fourth discovery message, where the fourth discovery message is used to request address allocation; the sending unit is also used to send a first non-confirmation message, where the first non-confirmation message is used to indicate refusal to allocate an address.
  • the receiving unit is further configured to receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  • the sending unit is further configured to send a first request message to the second node, where the first request message is used to indicate that the first address is requested to be used; the receiving unit is also used to receive a first confirmation message from the second node, where the first confirmation message is used to indicate that the first address is allowed to be used.
  • the receiving unit is further configured to receive a fifth discovery message, where the fifth discovery message is used to request address allocation; the sending unit is also used to send a third non-confirmation message, where the third non-confirmation message is used to indicate refusal to allocate an address.
  • the receiving unit is further configured to receive a second request message from the third node, where the second request message is used to indicate that the second address is requested to be used; the sending unit is also used to send a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used.
  • both the first address and the second address are NewIP addresses.
  • the first discovery message, the first offer message, the second discovery message, and the second offer message are all Dynamic Host Configuration Protocol DHCP messages.
  • the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
  • the device is applied to a tree network
  • the second node is a root node of the tree network or an intermediate node of the tree network.
  • the method is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
  • the components of the communication device can also be used to execute the steps executed in each possible implementation manner of the first aspect, and achieve corresponding technical effects.
  • the components of the communication device can also be used to execute the steps executed in each possible implementation manner of the first aspect, and achieve corresponding technical effects.
  • the fourth aspect of the embodiment of the present application provides a communication system, the system includes a plurality of communication devices, and the plurality of communication devices respectively correspond to different nodes (including a first node, a second node, a third node, etc., and the second node is a superior node of the first node and the third node is a subordinate node of the first node).
  • any communication device of the plurality of communication devices includes a sending unit and a receiving unit.
  • any device may implement the above-mentioned second aspect or the method in any possible implementation manner of the second aspect.
  • Any of the apparatuses includes corresponding units or modules for performing the above method.
  • the units or modules included in any device may be realized by software and/or hardware.
  • any of the devices may be a communication device, or any device may be a component of a communication device (such as a processor, a chip, or a chip system, etc.), or any device may also be a logic module or software that can realize all or part of the functions of the communication device.
  • the sending unit of the first node is used to send a first discovery message, and the first discovery message is used to request an address allocation;
  • the receiving unit of the second node is used to receive the first discovery message, and the sending unit of the second node is used to send a first offer message to the first node, and the first offer message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, and the value of the first field is the value of the address of the second node and the second node is a superior node of the first node, and the value of the second field is The identifier of the first node; the receiving unit of the first node is used to receive the first provision message; the sending unit of the third node is used to send a second discovery message, and the second discovery message is used to request an address allocation; the receiving unit of the first node is also used to receive the second discovery message, and the sending unit of the first node is also used to send a second provision message to
  • the first node further includes a processing unit; after the processing unit of the first node determines to disconnect from the second node, the sending unit of the first node is further configured to send a first change message to the third node to instruct the third node to clear the second address; the receiving unit of the third node is also configured to receive the first change message and clear the second address.
  • the sending unit of the third node is further configured to send the first change message to a subordinate node of the third node.
  • the system further includes a fourth node, and the fourth node is an upper-level node of the first node; after the processing unit of the first node determines to disconnect from the second node, the sending unit of the first node is further configured to send a third discovery message, and the third discovery message is used to request an address allocation; the receiving unit of the fourth node is used to receive the third discovery message, and the sending unit of the fourth node is used to send a third providing message to the first node, and the third providing message includes a third address allocated by the fourth node to the first node;
  • the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, the value of the sixth field is the identifier of the first node; the receiving unit of the first node is also used to receive the third providing message.
  • the receiving unit of the third node is further configured to receive the third discovery message; the sending unit of the third node is further configured to send a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address.
  • the processing unit of the first node determines to disconnect from the second node, the processing unit of the first node is further configured to clear the first address.
  • the determination by the processing unit of the first node to disconnect from the second node includes at least one of the following:
  • the processing unit of the first node determines that the state of the port with the second node is down; or,
  • the processing unit of the first node determines that the lease renewal of the first address is timed out; or,
  • the processing unit of the first node determines that the receiving unit of the first node receives the second change message from the second node, so as to instruct the first node to clear the first address.
  • the sending unit of the third node is further configured to send a fourth discovery message, where the fourth discovery message is used to request address allocation; the receiving unit of the first node is also used to receive the fourth discovery message, and send a first non-confirmation message to the third node, where the first non-confirmation message is used to indicate refusal to allocate an address.
  • the receiving unit of the first node is further configured to receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  • the sending unit of the first node is further configured to send a first request message, where the first request message is used to indicate that the first address is requested to be used; the receiving unit of the second node is also used to receive the first request message, and send a first confirmation message to the first node, where the first confirmation message is used to indicate that the first address is allowed to be used; the receiving unit of the first node is also used to receive the first confirmation message.
  • the sending unit of the third node is further configured to send a fifth discovery message, where the fifth discovery message is used to request address allocation; the receiving unit of the first node is also used to receive the fifth discovery message, and send a third non-confirmation message to the third node, where the third non-confirmation message is used to indicate refusal to allocate an address; the receiving unit of the third node is also used to receive the third non-confirmation message.
  • the sending unit of the third node is further configured to send a second request message, where the second request message is used to indicate that the second address is requested to be used; the receiving unit of the first node is also used to receive the second request message, and the sending unit of the first node is also used to send a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used; the receiving unit of the third node is also used to receive the second confirmation message.
  • both the first address and the second address are NewIP addresses.
  • the first discovery message, the first offer message, the second discovery message, and the second offer message are all Dynamic Host Configuration Protocol DHCP messages.
  • the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
  • the communication system is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
  • the communication system is applied to a tree network
  • the third node is a leaf node of the tree network or an intermediate node of the tree network.
  • the components of the communication device can also be used to execute the steps executed in each possible implementation manner of the second aspect, and achieve corresponding technical effects.
  • the components of the communication device can also be used to execute the steps executed in each possible implementation manner of the second aspect, and achieve corresponding technical effects.
  • a fifth aspect of the embodiment of the present application provides a communication device, including at least one processor, and the at least one processor is coupled to a memory;
  • the memory is used to store programs or instructions
  • the at least one processor is configured to execute the program or instruction, so that the device implements the method described in the foregoing first aspect or any possible implementation manner of the first aspect.
  • the sixth aspect of the embodiment of the present application provides a communication device, including at least one processor, and the at least one processor is coupled to a memory;
  • the memory is used to store programs or instructions
  • the at least one processor is used to execute the program or instructions, so that the device implements the method described in the second aspect or any possible implementation manner corresponding to any node (including the first node, the second node, the third node, the fourth node, or other nodes, etc.) in the communication system in the second aspect.
  • the seventh aspect of the embodiments of the present application provides a computer-readable storage medium, where the storage medium is used to store one or more computer-executable instructions.
  • the processor executes the method described in the above-mentioned first aspect or any possible implementation manner of the first aspect.
  • the eighth aspect of the embodiment of the present application provides a computer-readable storage medium.
  • the storage medium is used to store multiple computer-executable instructions.
  • the multiple computer-executable instructions correspond to the nodes (including the first node, the second node, the third node, the fourth node, and other nodes, etc.) included in the communication system in the second aspect or the second aspect.
  • a ninth aspect of the embodiments of the present application provides a computer program product (or called a computer program).
  • the computer program product is executed by a processor, the processor executes the method of the above-mentioned first aspect or any possible implementation manner of the first aspect.
  • the tenth aspect of the embodiments of the present application provides a computer program product (or called a computer program).
  • the computer program product is executed by a processor, the processor executes the method of the above-mentioned second aspect or any possible implementation manner of the second aspect.
  • the eleventh aspect of the embodiments of the present application provides a chip, where the chip includes at least one processor, configured to support the first node to implement the functions involved in the first aspect or any possible implementation manner of the first aspect.
  • the system-on-a-chip may further include a memory, and the memory is used for storing necessary program instructions and data of the communication device.
  • the system-on-a-chip may consist of chips, or may include chips and other discrete devices.
  • the chip system further includes an interface circuit, and the interface circuit provides program instructions and/or data for the at least one processor.
  • the twelfth aspect of the embodiment of the present application provides a chip, the chip includes at least one processor, configured to support nodes in the communication system (including the first node, the second node, the third node, the fourth node, or other nodes, etc.) to implement the functions involved in the second aspect or any possible implementation of the second aspect.
  • the system-on-a-chip may further include a memory, and the memory is used for storing necessary program instructions and data of the communication device.
  • the system-on-a-chip may consist of chips, or may include chips and other discrete devices.
  • the chip system further includes an interface circuit, and the interface circuit provides program instructions and/or data for the at least one processor.
  • the thirteenth aspect of the embodiment of the present application provides a communication system, the communication system includes the communication device in the above third aspect and any possible implementation thereof, and/or, the communication system includes multiple communication devices in the fourth aspect and any possible implementation thereof, and/or, the communication system includes the communication device in the fifth aspect and any possible implementation thereof, and/or, the communication system includes the nodes (including the first node, the second node, the third node, and a possible fourth node or other nodes, etc.) in the sixth aspect and any possible implementation thereof.
  • the technical effects brought about by any one of the design methods from the third aspect to the thirteenth aspect can refer to the technical effects brought about by the different implementation methods in the above-mentioned first aspect or the second aspect, and will not be repeated here.
  • Fig. 1 is a schematic diagram of the application scenario of the present application
  • Fig. 2 is another schematic diagram of the application scenario of the present application.
  • Fig. 3 is another schematic diagram of the application scenario of the present application.
  • Fig. 4 is a schematic diagram of the communication method provided by the present application.
  • FIG. 5 is another schematic diagram of the communication method provided by the present application.
  • Fig. 6a is another schematic diagram of the application scenario of the present application.
  • Fig. 6b is another schematic diagram of the application scenario of the present application.
  • FIG. 6c is another schematic diagram of the communication method provided by the present application.
  • Fig. 6d is another schematic diagram of the communication method provided by the present application.
  • FIG. 6e is another schematic diagram of the communication method provided by the present application.
  • Fig. 7a is another schematic diagram of the application scenario of the present application.
  • Fig. 7b is another schematic diagram of the application scenario of the present application.
  • Fig. 7c is another schematic diagram of the application scenario of the present application.
  • FIG. 8 is another schematic diagram of the communication method provided by the present application.
  • Fig. 9a is another schematic diagram of the application scenario of the present application.
  • Fig. 9b is another schematic diagram of the application scenario of the present application.
  • Fig. 9c is another schematic diagram of the application scenario of the present application.
  • Fig. 9d is another schematic diagram of the application scenario of the present application.
  • FIG. 10 is a schematic diagram of a communication device provided by the present application.
  • Fig. 11 is a schematic diagram of the communication system provided by the present application.
  • Fig. 12 is another schematic diagram of the communication device provided by the present application.
  • system and “network” in the embodiments of the present application may be used interchangeably.
  • “At least one” means one or more, and “plurality” means two or more.
  • “And/or” describes the association relationship of the associated objects, indicating that there may be three types of relationships, for example, A and/or B, which may indicate: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an “or” relationship.
  • “At least one of the following” or similar expressions refer to any combination of these items, including any combination of single or plural items.
  • At least one of A, B and C includes A, B, C, AB, AC, BC or ABC.
  • ordinal numerals such as “first” and “second” mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects.
  • FIG. 1 it is a schematic structural diagram of a communication system provided by an embodiment of the present application.
  • the system includes multiple network devices, such as network device 101 , network device 102 , network device 103 , network device 104 and network device 105 , and possibly other network devices.
  • a network device close to a terminal device may be called a customer edge (customer edge, CE) device, and the CE device may be a router, a switch or other forwarding devices.
  • CE customer edge
  • network device 101 and network device 102 serve as CE devices.
  • forwarding through the network device 101 to the network device 105 is required respectively.
  • the message sent by the terminal device 1 to the network device 2 needs to be forwarded by the network device 101, the network device 103, the network device 105, the network device 104, and the network device 102 respectively;
  • the terminal device can join the network through the CE device.
  • connection between the terminal device and the CE device may be in a direct connection mode, or may be implemented in a transfer mode through other devices.
  • the other devices may include an access point (access point, AP), a base station, etc., which are not specifically limited here.
  • a terminal device which may also be referred to as a user equipment (UE), a mobile station (MS), a mobile terminal (MT), or a terminal, is a device that provides voice and/or data connectivity to a user, or a chip disposed in the device, for example, a handheld device with a wireless connection function, a vehicle-mounted device, and the like.
  • UE user equipment
  • MS mobile station
  • MT mobile terminal
  • examples of some terminal devices are: mobile phones, desktop computers, tablet computers, notebook computers, PDAs, mobile internet devices (mobile internet device, MID), wearable devices, virtual reality (virtual reality, VR) devices, augmented reality (augmented reality, AR) devices, wireless terminals in industrial control, wireless terminals in self driving, remote medical Wireless terminals in surgery, wireless terminals in smart grid, wireless terminals in transportation safety, wireless terminals in smart city, wireless terminals in smart home, and home gateway devices (5G-residential gateway, 5G-RG) that support 5G access, etc.
  • mobile internet devices mobile internet device, MID
  • wearable devices virtual reality (virtual reality, VR) devices
  • augmented reality (augmented reality, AR) devices wireless terminals in industrial control, wireless terminals in self driving, remote medical Wireless terminals in surgery, wireless terminals in smart grid, wireless terminals in transportation safety, wireless terminals in smart city, wireless terminals in smart home, and home gateway devices (5G-residential gateway, 5G-RG) that support 5G access, etc.
  • the network device 103 , the network device 104 and the network device 105 are routers (routers), switches (switches), virtual machines (capable of forwarding) and other devices.
  • connection between the CE device shown in FIG. 1 and the network device in the forwarding network can be a wired connection/wireless connection, and the connection can also be transferred through other devices.
  • the other device may include a radio access network (radio access network, RAN) node (or device), which may also be called a base station.
  • radio access network radio access network, RAN
  • RAN equipment generation Node B (gNodeB), transmission reception point (TRP), evolved Node B (evolved Node B, eNB), radio network controller (radio network controller, RNC), node B (Node B, NB), base station controller (base station controller, BSC), base transceiver station in the 5G communication system.
  • base transceiver station, BTS home base station (for example, home evolved Node B, or home Node B, HNB), base band unit (base band unit, BBU), or wireless fidelity (wireless fidelity, Wi-Fi) access point (access point, AP), etc.
  • the network device connected to the user edge device is a provider edge (provider edge, PE) device.
  • the PE device is used to transmit messages between the user edge device 101 and the user edge device 102 .
  • both the network device 103 and the network device 104 are PE devices, the user edge device 101 is connected to the operator edge device 103 , and the user edge device 102 is connected to the operator edge device 104 .
  • Other network devices include operator (provider, P) devices, such as the network device 105 .
  • the provider edge device 103 and the provider edge device 104 are connected through one or more provider (provider, P) devices 105 .
  • the network topology formed between different nodes can be formed in various ways, and this application is mainly applied to a tree-type network topology.
  • the hierarchical address is an addressing method used in the tree-type network topology scenario, which can reduce the number of device forwarding entries and improve service convergence performance.
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP), and the hierarchical address can also be called a variable address, an IP address under the variable-length IP address system, a variable-length address, a flexible (flexible) address, a flexible IP address or other names, which are not limited here.
  • NewIP New Internet Protocol
  • this type of device is a device with lower-level nodes. In actual network scenarios, this type of device is usually a network device; the other type of device does not have a lower-level node. In actual network scenarios, this type of device is usually a terminal device.
  • the network topology scenario shown in FIG. 2 may be a part of the communication system shown in FIG. 1 .
  • network device 103 in FIG. 1 can be marked as network device A in FIG. 2
  • network device 101 in FIG. 1 can be marked as network device B in FIG. 2
  • terminal device 1 connected to network device 101 in FIG. 1 can be marked as terminal device A in FIG. 2 .
  • the other network devices can further access other terminal devices, wherein the other network devices can be denoted as network device C in FIG.
  • the terminal device that accesses the other network devices can be denoted as terminal device B in FIG. 2 .
  • the first layer includes network device A
  • the second layer includes network device B
  • the third layer includes network device C and terminal A
  • the fourth layer includes terminal B.
  • addresses of network devices are generated by manual configuration.
  • each node has only one directly connected parent node (or parent node).
  • the hierarchical address means that in addition to the root node, the node address of each node includes the address of the upper node; that is, the node address of each node can include two parts, one part is the address (or prefix address) of the node's parent node, and the other part is the identifier (identifier, ID) of the node.
  • the node address composition of other nodes can be expressed as "prefix address+ID”.
  • the address of each node may be called the node's own address or the locator address. For the convenience of description, the address of the node will be recorded as the locator address as an example for illustration.
  • the locator address representing the network device B can be recorded as "1/2", wherein “1" in “1/2” is the address of the parent node (i.e. network device A), and "2" in “1/2” is the ID of network device B.
  • the locator address of the terminal device A can be recorded as "1/2/2", wherein "1/2" in "1/2/2” is the address of the parent node (i.e. network device B), and the last digit "2" in "1/2/2” is the ID of the terminal device A.
  • the network device A in Figure 2 can be the convergence switch (switch, SW) in Figure 3, and the included Gigabit Ethernet (Gigabit Ethernet, ge) interface is marked as ge0;
  • the network device B in Figure 2 can be the access SW in Figure 3, and the included northward ge interface is marked as ge1, and the included southward ge interfaces are marked as ge2 and ge3;
  • Network device C in Figure 2 can be an access point (access point, AP) in Figure 3.
  • the hierarchical addresses of all network devices are manually configured.
  • the address of the terminal device can be dynamically assigned by an access network device (for example, access SW or AP).
  • FIG. 2 and FIG. 3 are only an implementation example. In practical applications, taking FIG. 2 as an example, the network device A shown in FIG. 2 can also access other upper-level nodes, or the network device A shown in FIG. 2 can also access other lower-level nodes different from network device B, or the network device B shown in FIG.
  • manual configuration needs to be laborious.
  • manual configuration may also cause configuration errors and cause network paralysis.
  • the present application provides a communication method and a communication device, which are used to realize the automatic allocation of hierarchical addresses through the interaction between the upper and lower nodes in the tree-type network topology scene, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
  • FIG. 4 is a schematic diagram of a communication method 100 provided by an embodiment of the present application. The method includes the following steps.
  • the communication method 100 shown in FIG. 4 may be applied to the aforementioned network topology scenarios shown in FIG. 2 and FIG. 3 .
  • the first node can be a node that has both upper-level nodes and lower-level nodes in the network topology, such as network device B or network device C in FIG. 2 , and access SW or AP in FIG. C. Terminal A or terminal B, and access SW, AP, terminal A or terminal B as shown in FIG. 3 .
  • the first node sends a first discovery packet.
  • the first node sends a first discovery message in step S101, and correspondingly, the second node receives the first discovery message in step S101.
  • the first discovery message is used to request address allocation.
  • the discovery messages involved in the embodiments of the present application are used to request address allocation, that is, the discovery message is a message sent when the sender of the discovery message does not have an address. For this reason, the sender may send the discovery message in a flooding manner, hoping that the discovery message can be received by multiple receivers and obtain responses to the discovery message (that is, provide a message).
  • the first node may be network device B in FIG. 2
  • the second node may be network device A in FIG. 2
  • the third node may be network device C in FIG. 2 .
  • the first node as network device B can send the discovery message in a flooded manner to all connected nodes, that is, network device B sends the first discovery message to network device A, network device C and terminal A in step S101.
  • the sending end of the discovery message has an interface for communicating with the upper node (which may be called a northbound interface) and an interface for communicating with the lower node (which may be called a southbound interface), since generally only the upper node has the ability to allocate addresses, for this reason, the discovery message may also be sent by flooding the interface for communicating with the upper node to save overhead.
  • the first node as network device B may send the discovery message to the connected upper node in a selective flooding manner, that is, network device B sends the first discovery message to network device A in step S101, but does not send the first discovery message to network device C and terminal A.
  • the sender of the discovery message can flexibly select the above sending method in different scenarios. For example, in the case that the sender (due to no configuration) cannot determine which nodes among the connected nodes are upper-level nodes, the sender may send the discovery message in a manner of collective flooding. For another example, when the sender can perceive which nodes among the connected nodes are upper-level nodes, the discovery message may be sent in a selective flooding manner to save overhead.
  • the second node sends the first provision message.
  • the second node sends the first provision message in step S102, and correspondingly, the first node receives the first provision message in step S102.
  • the first providing message includes the first address allocated by the second node to the first node; the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is the superior node of the first node, and the value of the second field is the identifier of the first node.
  • the method shown in FIG. 4 may be applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
  • the second node can be the root node in the network topology (that is, it only has a lower-level node and does not have a higher-level node), and the second node can also be an intermediate node in the network topology (that is, it has a lower-level node and a higher-level node), which is not limited here.
  • the third node sends a second discovery packet.
  • the third node sends the second discovery message in step S103, and correspondingly, the first node receives the second discovery message in step S103.
  • the second discovery message is used to request address allocation.
  • the third node is a leaf node or an intermediate node.
  • the third node can be a leaf node in the network topology (that is, it only has a higher-level node and does not have a lower-level node), and the third node can also be an intermediate node in the network topology (that is, it has a lower-level node and a higher-level node), which is not limited here.
  • the first node sends the second offer message.
  • the first node sends the second provision message in step S104, and correspondingly, the third node receives the second provision message in step S104.
  • the second providing message includes the second address assigned by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, the value of the fourth field is the identifier of the third node and the third node is a subordinate node of the first node.
  • the first field is located before the second field; and/or, in the second address carried in the second provision message sent by the first node in step S104, the third field is located before the fourth field.
  • the first field whose value is the address of the upper-level node may be located before the second field whose value is the identifier of the first node, so as to clarify based on the first address of the first node the address of the upper-level node of the first node and the network topology relationship of the network where the first node is located.
  • the third field whose value is the address of the upper-level node may be located before the fourth field whose value is the identifier of the third node, so as to clarify the address of the upper-level node of the third node based on the second address of the third node and the network topology relationship of the network where the third node is located.
  • the first discovery message, the first offer message, the second discovery message and the second offer message are all dynamic host configuration protocol DHCP messages.
  • the first discovery message, the first offer message, the second discovery message and the second offer message are all DHCP messages, that is, the first discovery message and the second discovery message may be DHCP discover (DHCP discover) messages in DHCP, and the first offer message and the second offer message may be dynamic host configuration protocol (DHCP offer) messages in DHCP.
  • DHCP discover DHCP discover
  • DHCP offer dynamic host configuration protocol
  • other discovery messages involved in the present application can be DHCP discover messages, and other providing messages involved in the present application can be DHCP offer messages.
  • the request message involved in the present application can also be a Dynamic Host Configuration Protocol request (DHCP request) message in DHCP
  • the confirmation message involved in this application can also be the Dynamic Host Configuration Protocol Non-Acknowledgment (DHCP NAK) message in DHCP.
  • DHCP request Dynamic Host Configuration Protocol request
  • DHCP NAK Dynamic Host Configuration Protocol Non-Acknowledgment
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, the above technical solution can also be described as extending the DHCP protocol to support the automatic allocation of the hierarchical address in the NewIP protocol.
  • NewIP New Internet Protocol
  • the first node provided the first address from the first node in the steps S102 contains the first address.
  • the value of the first field in the first address is the value of the address of the second node and the value of the second field in the first address is the logo of the first node; and the second node provides the second address of the second address in the third address of the third address in the step S104.
  • the value of the address of the first node and the value of the fourth field in the second address is the identification of the third node.
  • the second node is a superior node of the first node and the third node is a subordinate node of the first node, that is, the first node can not only receive the hierarchical address assigned by the superior node, but also assign a hierarchical address to the subordinate node.
  • the first node in a tree-type network topology scenario including the second node, the first node, and the third node, the first node can serve as a terminal device to receive an automatically assigned hierarchical address from a superior node, and can also serve as a network device to automatically assign a hierarchical address to a subordinate node. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
  • the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP).
  • NewIP New Internet Protocol
  • the above-mentioned technical effect can also be expressed as the automatic allocation of the hierarchical address in the NewIP protocol through the interaction between the upper and lower nodes in the tree-type network topology scene.
  • a hierarchical address may also be called a variable address, a variable-length address, a flexible (flexible) address, a flexible IP address or other names, which are not limited here.
  • the first node may be network device B in FIG. 2
  • the second node may be network device A in FIG. 2
  • the third node may be network device C in FIG. 2 .
  • the network device B receives in step S102 from the network device A.
  • the first provision message contains a first address, the value of the first field in the first address is the value of the address of the network device A and the value of the second field in the first address is the identifier of the network device B; and, the network device B sends the second provision to the network device C in step S104
  • the message includes a second address, the value of the third field in the second address is the value of the address of the first node, and the value of the fourth field in the second address is the identifier of the network device C.
  • the network device A is the upper-level node of the network device B and the network device C is the lower-level node of the network device B, that is, the network device B can receive the hierarchical address assigned by the network device A, and can also assign a hierarchical address to the network device C.
  • the network device B can not only receive the automatically assigned hierarchical address of the network device A as a terminal device, but also can automatically assign a hierarchical address to the network device C as a network device. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
  • FIG. 5 is a schematic diagram of a communication method 200 provided by an embodiment of the present application. The method includes the following steps.
  • the first node sends a first discovery packet.
  • the first node sends a first discovery message in step S201, and correspondingly, the second node receives the first discovery message in step S201.
  • the first discovery message is used to request address allocation.
  • the second node sends the first provision message.
  • the second node sends the first provision message in step S202, and correspondingly, the first node receives the first provision message in step S202.
  • the first providing message includes the first address allocated by the second node to the first node; the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is the superior node of the first node, and the value of the second field is the identifier of the first node.
  • step S201 and step S202 can refer to the implementation process of step S101 and step S102, and achieve corresponding technical effects, which are not limited here.
  • the method further includes step S20A and step S20B:
  • the third node sends a discovery message.
  • the first node sends a non-confirmation message.
  • the third node may also send a fourth discovery message in step S20A, where the fourth discovery message is used to request address allocation; the first node receives the fourth discovery message in S20A, and the first node sends a first non-confirmation message to the third node in step S20B, where the first non-confirmation message is used to indicate refusal to allocate an address.
  • the first node before the first node receives the first providing message from the second node, that is, before the first node receives the address assigned by the upper-level node, the first node does not have the ability to assign addresses to lower-level nodes (or the current hierarchical address of the first node is invalid).
  • the first node After the first node receives the fourth discovery message for requesting address allocation, the first node sends a first non-confirmation message for indicating refusal of address allocation, so that the receiver of the first non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
  • the first node may also receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  • the first node may also receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  • the first node may also receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  • the first node before the first node receives the first provision message, that is, before the first node receives the address assigned by the superior node, the first node does not know its own address, and correspondingly, the subordinate nodes (such as the third node) of the first node do not know its own address.
  • the number of the first discovery message sent by the first node may be multiple.
  • the third node After a certain first discovery message is received by the third node, because the third node does not have the ability to allocate addresses (or the current hierarchical address of the third node is invalid), the third node will send to the first node a second non-confirmation message for indicating refusal to allocate addresses, so that the first node determines based on the second non-confirmation message that the third node currently does not have the ability to allocate addresses.
  • the first node sends a first request message.
  • the first node sends the first request message in step S203, and correspondingly, the second node receives the first request message in step S203.
  • the first request message is used to request to use the first address.
  • the second node sends a first confirmation message.
  • the second node sends the first confirmation message in step S204, and correspondingly, the first node receives the first confirmation message in step S204.
  • the first confirmation message is used to indicate that the first address is allowed to be used.
  • the first node can also send the first request message to the second node in the step S203.
  • the first request message is used to indicate the request to use the first address; the second node receives the first request message in the step S203.
  • the second node sends the first confirmation message to the first node in the step S204. Allow the first address; the first node receives the first confirmation message in step S204.
  • the first node after the first node receives the first provision message from the second node, the first node sends to the second node a first request message indicating that the first address is requested to be used, and receives a first confirmation message from the second node indicating that the first address is allowed to be used.
  • the first node can clearly allocate an address based on the first address based on the first confirmation message, the first node sends a second offer message including the second address allocated based on the first address to the third node.
  • the second node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the second node for requesting address allocation, and the second node may not only allocate the first address to the first node, but may also allocate the first address to other lower-level nodes.
  • the first node may clarify that the second node allows the first node to use the first address through the interaction of the first request message and the first confirmation message, that is, it is clear that other nodes other than the first node are not allowed to use the first address, so as to avoid address allocation conflicts.
  • the first node may be network device B in FIG. 2
  • the second node may be network device A in FIG. 2
  • the third node may be network device C in FIG. 2 .
  • the lower-level nodes of network device A include network device B as the first node, it may also include other nodes (such as terminal C), so that network device A may also assign the first address to terminal C.
  • network device B as the first node can clarify that network device A allows network device B to use the first address through the interactive process of step S203 and step S204, that is, it is clear that other nodes other than network device B (such as terminal C) are not allowed to use the first address, so as to avoid address allocation conflicts.
  • the method further includes step S20C and step S20D:
  • the third node sends a discovery message.
  • the first node sends a non-confirmation message.
  • the third node may also send a fifth discovery message in step S20C, where the fifth discovery message is used to request address allocation; the first node receives the fifth discovery message in step S20C, and the first node sends a third non-confirmation message to the third node in step S20D, where the third non-confirmation message is used to indicate refusal to allocate an address; the third node receives the third non-confirmation message.
  • the first node before the first node receives the first confirmation message from the second node, since the first node does not know whether the second node allows the first node to use the first address, that is, the first node does not know whether the first node can assign addresses to subordinate nodes based on the first address. For this reason, after the first node receives the fifth discovery message for requesting address allocation, the first node sends a third non-confirmation message for indicating refusal of address allocation, so that the recipient of the third non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
  • the above-mentioned non-confirmation message used to indicate refusal to allocate an address are messages based on the feedback of the discovery message.
  • the discovery message sent by the sender of the discovery message may be sent in a manner of flooding (full flooding or selective flooding). For this reason, the receiving end of the discovery message may receive the discovery message in various situations.
  • the receiving end of the discovery message has not received the address assigned by the upper-level node (that is, the receiving end does not have the address allocation capability, or the current hierarchical address of the receiving end is invalid)
  • the message fed back by the receiving end is a non-confirmation message for indicating that the address is rejected
  • the message fed back by the receiving end is an offer message for address allocation. Therefore, for any upper-level node, if the current hierarchical address of the upper-level node is invalid, it will feed back a non-confirmation message based on the received discovery message.
  • the automatic allocation of hierarchical addresses is realized by sequentially allocating addresses from upper-level nodes to lower-level nodes, so as to avoid network paralysis caused by manual configuration errors and improve network stability.
  • the third node sends a second discovery packet.
  • the third node sends the second discovery message in step S205, and correspondingly, the first node receives the second discovery message in step S205.
  • the second discovery message is used to request address allocation.
  • the first node sends the second offer message.
  • the first node sends the second provision message in step S206, and correspondingly, the third node receives the second provision message in step S206.
  • the second providing message includes the second address assigned by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, the value of the fourth field is the identifier of the third node and the third node is a subordinate node of the first node.
  • step S205 and step S206 can refer to the implementation process of step S103 and step S104, and achieve corresponding technical effects, which are not limited here.
  • the third node sends a second request message.
  • the third node sends the second request message in step S207, and correspondingly, the first node receives the second request message in step S207.
  • the second request message is used to request to use the second address.
  • the first node sends a second confirmation message.
  • the first node sends the second confirmation message in step S208, and correspondingly, the third node receives the second confirmation message in step S208.
  • the second confirmation message is used to indicate that the second address is allowed to be used.
  • the third node may also send a second request message in step S207, the second request message is used to indicate the request to use the second address; the first node receives the second request message in step S207, the first node sends a second confirmation message to the third node in step S208, the second confirmation message is used to indicate permission to use the second address; the third node receives the second confirmation message in step S208, so that the third node Based on the second confirmation message, the node can determine that the second address is an address allowed to be used.
  • the first node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the first node to request address allocation, and the first node may not only allocate the second address to the third node, but may also allocate the second address to other lower-level nodes.
  • the second node can clarify that the first node allows the second node to use the second address through the interaction of the second request message and the second confirmation message, that is, it is clear that other nodes other than the second node are not allowed to use the second address, so as to avoid address allocation conflicts.
  • the first node may be network device B in FIG. 2
  • the second node may be network device A in FIG. 2
  • the third node may be network device C in FIG. 2 . Since the subordinate nodes of the network device B include not only the network device C as the third node, but also the terminal A, the network device B may also assign the second address to the terminal A.
  • the network device C as the third node can make it clear that the network device B allows the network device C to use the second address through the interactive process of steps S207 and S208, that is, it is clear that other nodes (such as terminal A) other than the network device C are not allowed to use the second address, so as to avoid address allocation conflicts.
  • the third node may be an intermediate node in a tree network topology scenario, that is, the third node may also have subordinate nodes. Similar to the implementation process of the aforementioned steps S20A to S20D, before step S206 or step S208, the third node may also receive a "discovery message" sent from a subordinate node of the third node. Since the third node does not yet have the ability to allocate addresses (or the current hierarchical address of the third node is invalid), the third node may reply with a "non-confirmation message" to indicate that the third node currently does not have the ability to allocate addresses.
  • step S206 or step S208 that is, when the third node obtains the second address or the third node determines that the first node allows the third node to use the second address
  • the third node can further assign an address to the subordinate node of the third node based on the second address.
  • the address assigned by the third node may include two fields, one field is the address of the third node, and the other field is the ID of the subordinate node of the third node.
  • DHCP-related messages between different nodes is taken as an example for illustration.
  • other messages such as BOOTP, a private address allocation protocol, or other protocols may also be used.
  • FIG. 3 The network topology scenarios of different nodes shown in FIG. 3 above can be applied to the embodiments described in FIG. 4 and FIG. 5 , and the implementation process can be shown in FIG. 6 a .
  • network device A can be a convergence switch (switch, SW), and the included Gigabit Ethernet (Gigabit Ethernet, ge) interface is marked as ge0, and network device A can be used as the second node in the embodiment described in Fig. 4 and Fig. 5;
  • the first node in; the network device C can be an access point (access point, AP), and any one of the network device C and the terminal A can be used as the third node in the embodiment described in FIG. 4 and FIG. 5 .
  • each node is in the initial state of locator invalid (invalid), and each node can send a dhcp discover message for requesting an address to other devices through the communication interface, that is, the sending and receiving process of the discovery message (comprising the first discovery message, the second discovery message, etc.) in the embodiment described in Figures 4 and 5.
  • the dhcp discover message is sent, the implementation process of each node is shown in Figure 6b.
  • the network device A since the network device A has pre-configured the address (marked as "locator 1"), the network device A has the ability to allocate addresses, so that the network device A receives the dhcp discover message of the network device B, and sends to the network device B a dhcp offer message carrying the address (marked as "1/2") of the network device B (distributed by the network device A), that is, the sending and receiving process of discovering messages (including the first providing message, etc.) in the embodiments described in Fig. 4 and Fig. 5 .
  • network device B For network device B, after network device B sends a dhcp discover message in a flooding manner in the process shown in Figure 6a, before network device B receives the address assigned by network device A in Figure 6b, after network device B receives a dhcp discover message from a lower-level node (including network device C and terminal A), then network device B will send a dhcp nak message to the lower-level node (including network device C and terminal A) to indicate that the lower-level node is currently the network device B It does not have the ability to assign addresses (or the current hierarchical address of network device B is invalid).
  • the network device C since the network device C has not received the address assigned by the network device, the network device C will send a dhcp nak message to the lower-level nodes (including the terminal B) to indicate that the lower-level node currently does not have the ability to assign addresses to the network device C (or the current hierarchical address of the network device C is invalid). That is, the sending and receiving process of non-confirmation messages (including the first non-confirmation message, the second non-confirmation message, etc.) in the embodiment described in FIG. 4 and FIG. 5 .
  • network device A as the root node, can obtain the pre-configured address in a variety of ways, such as receiving instructions from the server to obtain the pre-configured address in the way of an external server, obtaining the pre-configured address by manual configuration, or other implementation methods, which are not limited here.
  • network device A (denoted as device A in FIG. 6c and FIG. 6e ), network device B (denoted as device B in FIG. 6c and FIG. 6e ), network device C (denoted as device C in FIG. 6c and FIG. 6e), and terminal A (denoted as terminal a in FIG. 6c and FIG.
  • Network device B first sends to network device A a dhcp discover message for requesting an address. After network device A receives the dhcp request message, it sends a dhcp offer message carrying the address (referred to as "1/2") of network device B (assigned) to network device B; B sends a dhcp ack message allowing the use of this address.
  • network device C may also participate in it, as shown in FIG. 6c.
  • Network device C can send a dhcp discover message to the upper node (ie, network device B) multiple times before receiving the dhcp offer message.
  • the network device B before the network device B has the ability to assign addresses (that is, the network device B receives the dhcp ack message or the dhcp offer message), the network device B can send to the network device C a dhcp nak message for indicating that the address is rejected; and after the network device B has the ability to allocate addresses (that is, the network device B receives the dhcp ack message or the dhcp offer message), the network device B can send to the network device C. /2") dhcp offer message.
  • message exchange in the communication process between various nodes may be implemented by referring to the manner shown in FIG. 6e .
  • the process in which each device determines that the local hierarchical address is valid and assigns an address to a lower-level node is marked as an "OP" process
  • the process in which each device determines that a local hierarchical address is invalid and refuses to assign an address to a lower-level node is marked as a "loop" process.
  • any node such as device B, device C and terminal a
  • the node needs to execute the "OP" process in Figure 6e to obtain the address assigned by the superior node, and before the node executes the "OP" process in Figure 6e, since the node has not obtained a local address, the node can execute the "loop” process with the superior node before any time or the node can perform the "loop” process with the subordinate node before any time.
  • the device C in Figure 6e as an example, before the device C performs the "OP" process with the device B, the device B does not have the ability to assign addresses before the "OP" process between the device A and the device B.
  • the device B will execute the "loop" process between the device B and the device C after receiving the dhcp discover message from the device C; and before the device C performs the "OP" process with the device B, the device C does not have the ability to assign addresses. Therefore, the device C receives the terminal After the dhcp discover message of a, the "loop" process between device C and terminal a will be executed.
  • any node (such as device B, device C, and terminal a) with a superior node in Figure 6e
  • the node needs to execute the "OP" process in Figure 6e to obtain the address assigned by the superior node, and after the node executes the "OP" process in Figure 6e, since the node has obtained a local address, the node does not need to execute the sending of the dhcp discover message, that is, the node (before it is determined to be disconnected from the superior node) will not perform "loop" with the superior node or the subordinate node process or "OP" process.
  • the "OP" process between network device A and network device B can refer to the interaction process between network device A and network device B in Figure 6c
  • the "loop” process between network device B and network device C can refer to the interaction process between network device B and network device C in Figure 6c.
  • both network device B and network device C have respective upper-level nodes and lower-level nodes, that is, both network device B and network device C can serve as DHCP server (Server) and DHCP terminal (Client) roles in the network, so that both network device B and network device C can be used as the first node to execute the aforementioned embodiments shown in FIG. 4 and FIG. 5 .
  • the terminal device A in FIG. 6e is a leaf node and does not have the capability of being a DHCP server (Server), after receiving the dhcp discover message, the terminal device A ignores the dhcp discover message and does not process it.
  • the implementation process of adding nodes in the network topology can also be implemented based on the embodiments shown in FIG. 4 and FIG.
  • network device D intends to access the network through network device B, and network device D may act as the first node in the embodiments shown in FIGS. 4 and 5 to perform a response process.
  • network device D sends a dhcp discover message for requesting an address to network device B (it should be understood that because the local hierarchical address of network device B is valid, network device B will not send a dhcp discover message to network device D);
  • network device B since the local hierarchical address of network device B is valid, network device B performs an address assignment process, that is, network device B sends to network device D a dhcp offer message carrying the address of network device D "marked as 1/2/3";
  • the address of the network device D becomes effective, and possesses the ability to assign addresses to the subordinate nodes of the network device D.
  • the communication method provided by the present application can also support the process of dynamic address allocation in a scenario where a certain node is disconnected, which will be described in conjunction with more embodiments below.
  • FIG. 8 is a schematic diagram of a communication method 300 provided by an embodiment of the present application, and the method includes the following steps.
  • the first node sends a first discovery packet.
  • the first node sends a first discovery message in step S301, and correspondingly, the second node receives the first discovery message in step S301.
  • the first discovery message is used to request address allocation.
  • the second node sends the first provision message.
  • the second node sends the first provision message in step S302, and correspondingly, the first node receives the first provision message in step S302.
  • the first providing message includes the first address allocated by the second node to the first node; the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is the superior node of the first node, and the value of the second field is the identifier of the first node.
  • the first node sends a first request packet.
  • the first node sends the first request message in step S303, and correspondingly, the second node receives the first request message in step S303.
  • the first request message is used to request to use the first address.
  • the second node sends a first confirmation message.
  • the second node sends the first confirmation message in step S304, and correspondingly, the first node receives the first confirmation message in step S304.
  • the first confirmation message is used to indicate that the first address is allowed to be used.
  • steps S301 to S304 can refer to the implementation process of steps S201 to S204, and achieve corresponding technical effects, which are not limited here.
  • the first node determines to disconnect from the second node.
  • disconnection between the first node and the second node may include disconnection of the link between the first node and the second node, may also include dormancy of the link between the first node and the second node, and may also include failure of the second node (or a superior node of the second node), etc., which are not limited herein.
  • the method further includes: after the first node determines to disconnect from the second node in step S305, the first node sends a first change message to the third node to instruct the third node to clear the second address; the third node receives the first change message and clears the second address.
  • the first node determines that the first address allocated by the second node to the first node is invalid and the second address allocated by the first node based on the first address is invalid.
  • the first node sends a first change message to the third node to instruct the third node to clear the second address, so that the third node knows that the second address is invalid and clears the second address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
  • the first node determines that the first address allocated by the second node to the first node will become invalid. For this reason, the first node may clear the first address locally, and then obtain a new address from the upper node through a discovery message.
  • the third node may also send the first change message to the subordinate nodes of the third node to instruct the subordinate nodes of the third node to clear the address allocated by the third node, so that the subordinate nodes of the third node clearly invalidate the allocated address and clear the address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized in the multi-layer network topology through negotiation among different nodes.
  • the first node determining to disconnect from the second node includes at least one of the following: the first node determines that the port status with the second node is down; or, the first node determines that the lease renewal of the first address has timed out; or, the first node receives a second change message from the second node to instruct the first node to clear the first address.
  • the first node can confirm that the first node is disconnected from the second node through the above-mentioned various methods, and further clarify that the first address allocated by the second node to the first node is invalid.
  • the change message (including the first change message, the second change message, etc.) can be an extended message of DHCP, for example, it is recorded as a dhcp change (change) message.
  • the first node sends a third discovery packet.
  • the first node sends the third discovery message in step S306, and correspondingly, the fourth node receives the third discovery message in step S306.
  • the third discovery message is used to request address allocation.
  • the fourth node sends a third provision message.
  • the fourth node sends the second provision message in step S307, and correspondingly, the first node receives the third provision message in step S307.
  • the third providing message includes a third address assigned by the fourth node to the first node; wherein, the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, and the value of the sixth field is the identifier of the first node.
  • the communication system where the first node is located also includes a fourth node and the fourth node is the upper node of the first node; after the first node determines to disconnect from the second node in step S305, the first node may also send a third discovery message in step S306, and the third discovery message is used to request an address allocation; A third address assigned by the first node; wherein the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, and the value of the sixth field is the identifier of the first node; the first node receives the third providing message.
  • the first node determines that the first address allocated by the second node to the first node is invalid.
  • the first node may send a third discovery message for requesting address allocation to the other superior node (for example, the fourth node), and obtain the third address allocated to the first node from the fourth node. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
  • the method further includes: the third node receiving the third discovery message; the third node sending a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address.
  • the first node receives the third providing message from the fourth node in step S307, that is, before the first node receives the address assigned by the upper node, the first node does not have the ability to assign addresses to lower nodes.
  • the first node After the first node receives the fourth discovery message for requesting address allocation, the first node sends a fourth non-confirmation message for indicating refusal of address allocation, so that the receiver of the fourth non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
  • the first node sends a third request message.
  • the first node sends the third request message in step S308, and correspondingly, the fourth node receives the third request message in step S308.
  • the third request message is used to request to use the third address.
  • the fourth node sends a third confirmation message.
  • the fourth node sends the third confirmation message in step S309, and correspondingly, the first node receives the third confirmation message in step S309.
  • the third confirmation message is used to indicate that the third address is allowed to be used.
  • step S308 and step S309 are optional steps, and the first node may not execute them.
  • DHCP-related messages between different nodes is taken as an example for illustration.
  • other messages such as BOOTP, a private address allocation protocol, or other protocols may also be used.
  • network device D because network device B recycles the communication port with network device D (or network device B fails, or the link between network device and network device D fails, etc.), network device D detects that the upper node (i.e. network device B) is unreachable.
  • the network device D will clear the address assigned by the network device B to the network device D, and if there are other lower-level nodes in the network device D, the network device D will also send a dhcp change message to the lower-level node (if it exists), so that the lower-level node will clear the local hierarchical address based on the dhcp change message and further send the dhcp change message to the next-level node (if it exists), until the leaf node in the network topology.
  • network device D sends a dhcp discover message for requesting an address to an upper node (for example, network device F in FIG. 9b).
  • a dhcp discover message and a dhcp nak message will be exchanged between the lower-level node of the network device D (if it exists) and the network device D.
  • network device F and network device D exchange dhcp ack messages to realize the process of allocating addresses for network device D, wherein the address allocated for network device D can be recorded as "2/1/1". Similarly, network device D will also continue to exchange dhcp discover messages and dhcp nak messages with lower-level nodes (if they exist) during this process.
  • the network device D can further assign addresses to the lower-level nodes of the network device D.
  • the embodiment of the present application provides a communication device
  • the communication device 1000 can realize the function of the communication device (including the first node, the second node, the third node, the fourth node or other nodes) in the above method embodiment, so it can also realize the beneficial effects of the above method embodiment.
  • the communication device 1000 includes a receiving unit 1001 and a sending unit 1002 .
  • the communication device 1000 further includes a processing unit 1003 .
  • the communication device 1000 includes the following implementation process.
  • the sending unit 1002 is used to send a first discovery message, and the first discovery message is used to request an address allocation;
  • the receiving unit 1001 is used to receive a first provision message from a second node, and the first provision message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is a superior node of the first node, and the value of the second field is an identifier of the first node;
  • the second discovery message of the third node, the second discovery message is used to request address allocation;
  • the sending unit 1002 is also used to send a second provision message to the third node, the second provision message includes the second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, the value of the fourth field is the identifier of the third node and the
  • the apparatus further includes a processing unit 1003; the sending unit 1002 is further configured to, after the processing unit 1003 determines to disconnect from the second node, send a first change message to the third node to instruct the third node to clear the second address.
  • the sending unit 1002 is further configured to send a third discovery message, where the third discovery message is used to request an address allocation;
  • the receiving unit 1001 is also configured to receive a third offer message from the fourth node, the third offer message includes a third address allocated by the fourth node to the first node; wherein, the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node and the fourth node is the address of the first node For a superior node, the value of the sixth field is the identifier of the first node.
  • the processing unit 1003 is further configured to clear the first address.
  • the processing unit 1003 determining to disconnect from the second node includes at least one of the following:
  • the processing unit 1003 determines that the state of the port with the second node is down; or,
  • the processing unit 1003 determines that the lease renewal of the first address is timed out; or,
  • the processing unit 1003 determines that the receiving unit 1001 receives the second change message from the second node, so as to instruct the first node to delete the first address.
  • the receiving unit 1001 is further configured to receive a fourth discovery message, where the fourth discovery message is used to request address allocation; the sending unit 1002 is also configured to send a first non-confirmation message, where the first non-confirmation message is used to indicate refusal to allocate an address.
  • the receiving unit 1001 is further configured to receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  • the sending unit 1002 is further configured to send a first request message to the second node, where the first request message is used to indicate that the first address is requested to be used; the receiving unit 1001 is also used to receive a first confirmation message from the second node, where the first confirmation message is used to indicate that the first address is allowed to be used.
  • the receiving unit 1001 is further configured to receive a fifth discovery message, where the fifth discovery message is used to request address allocation; the sending unit 1002 is also configured to send a third non-confirmation message, where the third non-confirmation message is used to indicate refusal to allocate an address.
  • the receiving unit 1001 is further configured to receive a second request message from the third node, where the second request message is used to indicate that the second address is requested to be used; the sending unit 1002 is also used to send a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used.
  • both the first address and the second address are NewIP addresses.
  • the first discovery message, the first offer message, the second discovery message and the second offer message are all dynamic host configuration protocol DHCP messages.
  • the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
  • the apparatus is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
  • the apparatus is applied to a tree network
  • the third node is a leaf node of the tree network or an intermediate node of the tree network.
  • An embodiment of the present application also provides a communication system, and the communication method provided in any of the foregoing embodiments may be applied to the communication system shown in FIG. 11 .
  • the system includes a plurality of communication devices, and the plurality of communication devices respectively correspond to different nodes (including a first node, a second node, a third node, etc., and the second node is a superior node of the first node and the third node is a subordinate node of the first node).
  • the second node in the network topology before the arrow points to it, the second node is located at the nth layer (n is a natural number) in the network topology, the first node is located at the n+1th layer in the network topology, and the third node is located at the n+2th layer in the network topology.
  • the second node and the fourth node are located at the nth (n is a natural number) layer in the network topology, the first node is located at the n+1th layer in the network topology, and the third node is located at the n+2th layer in the network topology.
  • the scenario indicated by the arrows in FIG. 11 is that, after the first node determines to be disconnected from the second node, the first node is connected to the fourth node.
  • nodes in layer n+1, layer n+2, and layer n+3 in the network topology there are other nodes, which is not limited here.
  • both the fourth node and the second node may be a root node (n takes a value of 0) or an intermediate node (n takes a value greater than 0).
  • the fourth node and the second node may be connected to the same upper-level node, or to different upper-level nodes, which is not limited here.
  • any communication device of the plurality of communication devices can be implemented in the manner shown in FIG. 10 , that is, any communication device includes a receiving unit 1001 and a sending unit 1002 .
  • any communication device further includes a processing unit 1003 .
  • the sending unit of the first node is used to send a first discovery message, and the first discovery message is used to request an address allocation;
  • the receiving unit of the second node is used to receive the first discovery message, and the sending unit of the second node is used to send a first offer message to the first node, and the first offer message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, and the value of the first field is the value of the address of the second node and the second node is a superior node of the first node, and the value of the second field is The identification of the first node; the receiving unit of the first node is used to receive the first provision message; the sending unit of the third node is used to send a second discovery message, and the second discovery message is used to request an address assignment; the receiving unit of the first node is also used to receive the second discovery message, and the sending unit of the first node is also used to send a second provision message to the third
  • the first node further includes a processing unit; after the processing unit of the first node determines to disconnect from the second node, the sending unit of the first node is further configured to send a first change message to the third node to instruct the third node to clear the second address; the receiving unit of the third node is also configured to receive the first change message and clear the second address.
  • the sending unit of the third node is further configured to send the first change message to a subordinate node of the third node.
  • the system further includes a fourth node, and the fourth node is an upper-level node of the first node; after the processing unit of the first node determines to disconnect from the second node, the sending unit of the first node is further configured to send a third discovery message, and the third discovery message is used to request an address assignment; the receiving unit of the fourth node is used to receive the third discovery message, and the sending unit of the fourth node is used to send a third providing message to the first node, and the third providing message includes a third address allocated by the fourth node to the first node;
  • the fifth field and the sixth field the value of the fifth field is the value of the address of the fourth node, the value of the sixth field is the identifier of the first node; the receiving unit of the first node is also used to receive the third providing message.
  • the receiving unit of the third node is further configured to receive the third discovery message; the sending unit of the third node is further configured to send a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address.
  • the processing unit of the first node determines to disconnect from the second node, the processing unit of the first node is further configured to clear the first address.
  • the determination by the processing unit of the first node to disconnect from the second node includes at least one of the following:
  • the processing unit of the first node determines that the state of the port with the second node is down; or,
  • the processing unit of the first node determines that the lease renewal of the first address is timed out; or,
  • the processing unit of the first node determines that the receiving unit of the first node receives the second change message from the second node, so as to instruct the first node to clear the first address.
  • the sending unit of the third node is further configured to send a fourth discovery message, where the fourth discovery message is used to request address allocation; the receiving unit of the first node is also used to receive the fourth discovery message, and send a first non-confirmation message to the third node, where the first non-confirmation message is used to indicate refusal to allocate an address.
  • the receiving unit of the first node is further configured to receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  • the sending unit of the first node is further configured to send a first request message, where the first request message is used to indicate that the first address is requested to be used; the receiving unit of the second node is also used to receive the first request message, and send a first confirmation message to the first node, where the first confirmation message is used to indicate that the first address is allowed to be used; the receiving unit of the first node is also used to receive the first confirmation message.
  • the sending unit of the third node is further configured to send a fifth discovery message, where the fifth discovery message is used to request address allocation; the receiving unit of the first node is also used to receive the fifth discovery message, and send a third non-confirmation message to the third node, where the third non-confirmation message is used to indicate refusal to allocate an address; the receiving unit of the third node is also used to receive the third non-confirmation message.
  • the sending unit of the third node is further configured to send a second request message, where the second request message is used to indicate that the second address is requested to be used; the receiving unit of the first node is also used to receive the second request message, and the sending unit of the first node is also used to send a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used; the receiving unit of the third node is also used to receive the second confirmation message.
  • both the first address and the second address are NewIP addresses.
  • the first discovery message, the first offer message, the second discovery message and the second offer message are all dynamic host configuration protocol DHCP messages.
  • the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
  • the communication system is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
  • the communication system is applied to a tree network
  • the third node is a leaf node of the tree network or an intermediate node of the tree network.
  • the embodiment of the present application also provides a communication device 1200 , as shown in FIG. 12 , which is a schematic structural diagram of the communication device 1200 provided in the embodiment of the present application.
  • the communication device 1200 executes functions of the communication device in any of the foregoing embodiments (for example, the first node, the second node, and the third node in the implementation manner shown in FIG. 4 or FIG. 5 ).
  • the communication device 1300 in FIG. 12 may be used to perform functions of other communication devices.
  • the communication device 1300 when the communication device 1200 is the first node, the communication device 1300 can be used to perform the function of the second node, and the communication device 1400 can be used to perform the function of the third node; for another example, when the communication device 1200 is the third node, the communication device 1300 can be used to perform the function of the first node, and the communication device 1300 can be used to perform the function of the subordinate node of the third node.
  • the communication device 1200 shown in FIG. 12 includes a memory 1202 and at least one processor 1201 .
  • the processor 1201 implements the methods in the foregoing embodiments by reading instructions stored in the memory 1202, or, the processor 1201 may implement the methods in the foregoing embodiments through internally stored instructions.
  • the processor 1201 implements the methods in the above embodiments by reading the instructions stored in the memory 1202
  • the memory 1202 stores the instructions for implementing the methods provided in the above embodiments of the present application.
  • At least one processor 1201 is one or more CPUs, or a single-core CPU, or a multi-core CPU.
  • the memory 1202 includes, but is not limited to, RAM, ROM, EPROM, flash memory, or optical memory. Instructions of the operating system are stored in the memory 1202 .
  • the communication device executes corresponding operations in the foregoing embodiments.
  • the communication device shown in FIG. 12 further includes a network interface 1203 .
  • the network interface 1203 may be a wired interface, such as FDDI or GE interface; the network interface 1203 may also be a wireless interface.
  • the network interface 1203 is used to receive/transmit data in the foregoing embodiments.
  • the processor 1201 reads the program instructions in the memory 1202, for other functions that the communication device 1200 can perform, please refer to the descriptions in the foregoing method embodiments.
  • the communication device 1200 further includes a bus 1204, and the processor 1201 and the memory 1202 are usually connected to each other through the bus 1204, and may also be connected to each other in other ways.
  • the communication device 1200 further includes an input and output interface 1205, and the input and output interface 1205 is used to connect to an input device and receive relevant configuration information (such as the value of m, the value of n, the time domain length corresponding to the third time domain position, the time domain length corresponding to the fourth time domain position, etc.)
  • Input devices include, but are not limited to, keyboards, touch screens, microphones, and the like.
  • the communication device 1200 provided in the embodiments of the present application is configured to execute the methods performed by the communication device provided in the foregoing method embodiments, and achieve corresponding beneficial effects.
  • the disclosed system, device and method can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The present application provides a communication method and a communication apparatus, for use in realizing automatic allocation of hierarchical addresses by means of interaction between upper and lower nodes in a tree network topology scenario to avoid the situation of network paralysis caused by manual configuration errors and improve network stability. In the method, a first node sends a first discover packet, the first discover packet being used for requesting allocation of an address; the first node receives a first offer packet from a second node, the first offer packet comprising a first address allocated to the first node by the second node; the first node receives a second discover packet from a third node, the second discover packet being used for requesting allocation of an address; and the first node sends a second offer packet to the third node, the second offer packet comprising a second address allocated to the third node by the first node.

Description

一种通信方法及通信装置A communication method and communication device
本申请要求于2022年01月24日提交中国国家知识产权局、申请号为202210082179.4、发明名称为“一种NewIP树型拓扑层次化地址端到端动态分配的方法”的中国专利申请的优先权,以及,于2022年03月30日提交中国国家知识产权局、申请号为202210327033.1、发明名称为“一种通信方法及通信装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the State Intellectual Property Office of China on January 24, 2022, with the application number 202210082179.4, and the invention name is "A method for end-to-end dynamic allocation of NewIP tree topology hierarchical addresses", and the Chinese patent application submitted to the State Intellectual Property Office of China on March 30, 2022, with the application number 202210327033.1, and the invention name is "A Communication Method and Communication Device" priority, the entire contents of which are incorporated by reference into this application.
技术领域technical field
本申请涉及通信技术领域,尤其涉及一种通信方法及通信装置。The present application relates to the technical field of communication, and in particular, to a communication method and a communication device.
背景技术Background technique
层次化地址,是在树型的网络拓扑场景中使用的一种编址方式,能够减少设备转发表项数量、提升业务收敛性能。Hierarchical addresses are an addressing method used in tree-type network topology scenarios, which can reduce the number of device forwarding entries and improve service convergence performance.
目前,在树型的网络拓扑场景中,包含有两类设备,一类设备是存在下级节点的设备,这一类设备可以称为网络设备;另一类是不存在下级节点的设备,这一类设备可以称为终端设备。其中,对于网络设备而言,其层次化地址需要手工配置。At present, in the tree-type network topology scenario, there are two types of devices. One type of device is a device with lower-level nodes, which can be called a network device; the other is a device without a lower-level node, which can be called a terminal device. Wherein, for network devices, their hierarchical addresses need to be manually configured.
然而,在上述实现方式中,需要耗费人力进行手工配置。特别的,当网络拓扑发生改变时,例如新增设备或移除设备的情况下,由于设备修改配置工作量大,手工配置的方式也有可能出现配置出错而导致网络瘫痪的情况出现。However, in the above-mentioned implementation manner, manual configuration needs to be laborious. In particular, when the network topology changes, such as adding or removing devices, due to the large workload of device modification and configuration, manual configuration may also cause configuration errors and cause network paralysis.
为此,如何优化树型的网络拓扑场景中的地址分配方式,是一个亟待解决的技术问题。Therefore, how to optimize the address allocation method in the tree-type network topology scene is a technical problem to be solved urgently.
发明内容Contents of the invention
本申请提供了一种通信方法及通信装置,用于在树型的网络拓扑场景中通过上下级节点之间的交互实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。The present application provides a communication method and a communication device, which are used to realize automatic allocation of hierarchical addresses through interaction between upper and lower nodes in a tree-type network topology scene, so as to avoid network paralysis caused by manual configuration errors and improve network stability.
本申请实施例第一方面提供了一种通信方法,该方法由第一节点执行,或者,该方法由第一节点中的部分组件(例如处理器、芯片或芯片系统等)执行,或者,该方法由能实现全部或部分第一节点功能的逻辑模块或软件实现。在第一方面及其可能的实现方式中,以该通信方法由第一节点执行为例进行描述,其中,第一节点可以为路由器、交换机、虚拟机等设备。在该方法中,第一节点发送第一发现报文,该第一发现报文用于请求分配地址;该第一节点接收来自第二节点的第一提供报文,该第一提供报文包括该第二节点为该第一节点分配的第一地址;其中,该第一地址包括第一字段和第二字段,该第一字段的取值为该第二节点的地址的取值且该第二节点为该第一节点的上级节点,该第二字段的取值为该第一节点的标识;该第一节点接收来自第三节点的第二发现报文,该第二发现报文用于请求分配地址,该第三节点为该第一节点的下级节点;该第一节点向该第三节点发送第二提供报文,该第二提供报文包括该第一节点为该第三节点分配的第二地址,该第二地址包括第三字段和第四字段,该第三字段的取值为该第一地址的取值,该第四字段的取值为该第三节点的标识。The first aspect of the embodiments of the present application provides a communication method, the method is executed by the first node, or the method is executed by some components in the first node (such as a processor, chip or chip system, etc.), or the method is implemented by a logic module or software that can realize all or part of the functions of the first node. In the first aspect and possible implementation manners thereof, description is made by taking the communication method executed by a first node as an example, where the first node may be a device such as a router, a switch, or a virtual machine. In the method, the first node sends a first discovery message, and the first discovery message is used to request an address allocation; the first node receives a first provision message from a second node, and the first provision message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is a superior node of the first node, and the value of the second field is an identifier of the first node; the first node receives a second discovery message from a third node, the second discovery message The text is used to request an address allocation, and the third node is a subordinate node of the first node; the first node sends a second providing message to the third node, the second providing message includes a second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field is an identifier of the third node.
基于上述技术方案,第一节点接收的第一提供报文包含有第一地址,该第一地址中第一字段的取值为第二节点的地址的取值且该第一地址中第二字段的取值为该第一节点的标识;并且,第一节点发送的第二提供报文包含有第二地址,该第二地址中第三字段的取值为该第一节点的地址的取值且该第二地址中第四字段的取值为第三节点的标识。其中,该第二节点为该第一节点的上级节点且该第三节点为该第一节点的下级节点,即第一节点既能够接收上级节点分配的层次化地址,也能够向下级节点分配层次化地址。换言之,在包含有第二节点、第一节点和第三节点的树型的网络拓扑场景中,第一节点既能作为终端设备接收上级节点的自动分配的层次化地址,也能够作为网络设备自动向下级节点分配层次化地址。从而,在树型的网络拓扑场景中通过上下级节点之间的交互实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。Based on the above technical solution, the first providing message received by the first node includes a first address, the value of the first field in the first address is the value of the address of the second node and the value of the second field in the first address is the identifier of the first node; and the second providing message sent by the first node includes a second address, the value of the third field in the second address is the value of the address of the first node and the value of the fourth field in the second address is the identifier of the third node. Wherein, the second node is a superior node of the first node and the third node is a subordinate node of the first node, that is, the first node can not only receive the hierarchical address assigned by the superior node, but also assign a hierarchical address to the subordinate node. In other words, in a tree-type network topology scenario including the second node, the first node, and the third node, the first node can serve as a terminal device to receive an automatically assigned hierarchical address from a superior node, and can also serve as a network device to automatically assign a hierarchical address to a subordinate node. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
应理解,层次化地址为新互联网协议(NewIP)的特性之一,为此,上述技术效果也可以表述为在树型的网络拓扑场景中通过上下级节点之间的交互实现NewIP协议中层次化地址的自动分配。It should be understood that the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). For this reason, the above-mentioned technical effect can also be expressed as the automatic allocation of the hierarchical address in the NewIP protocol through the interaction between the upper and lower nodes in the tree-type network topology scene.
需要说明的是,本申请实施例中所涉及的发现报文(如第一发现报文,以及后文的第二发现报文,第三发现报文,第四发现报文等)用于请求分配地址,即该发现报文为该发现报文的发送端不具备地址的情况下所发送的报文。为此,该发送端可以以泛洪的方式发送该发现报文,以期该发现报文能被多个接收端接收并获得该发现报文的响应(即提供报文)。It should be noted that the discovery messages involved in the embodiments of the present application (such as the first discovery message, and the second discovery message, the third discovery message, the fourth discovery message, etc.) are used to request address allocation, that is, the discovery message is a message sent when the sender of the discovery message does not have an address. For this reason, the sender may send the discovery message in a flooding manner, hoping that the discovery message can be received by multiple receivers and obtain responses to the discovery message (that is, provide a message).
可选地,该发现报文的发送端存在向上级节点通信的接口(可称为北向接口)以及向下级节点通信的接口(可称为南向接口)的情况下,由于一般情况下仅有上级节点具备分配地址的能力,为此,该发现报文也可以为通过向上级节点通信的接口泛洪的方式发送,以节省开销。Optionally, when the sending end of the discovery message has an interface for communicating with the upper node (which may be called a northbound interface) and an interface for communicating with the lower node (which may be called a southbound interface), since generally only the upper node has the ability to allocate addresses, for this reason, the discovery message may also be sent by flooding the interface for communicating with the upper node to save overhead.
可见,发现报文的发送端可以在不同的场景下灵活地选用上述发送方式。例如,在该发送端(由于未经过配置而)无法确定所连接的节点中哪些节点是上级节点的情况下,发送端可以采用全体泛洪的方式发送该发现报文。又如,在该发送端能够感知所连接的节点中哪些节点是上级节点的情况下,可以采用选择性泛洪的方式发送该发现报文,以节省开销。It can be seen that the sender of the discovery message can flexibly select the above sending method in different scenarios. For example, in the case that the sender (due to no configuration) cannot determine which nodes among the connected nodes are upper-level nodes, the sender may send the discovery message in a manner of collective flooding. For another example, when the sender can perceive which nodes among the connected nodes are upper-level nodes, the discovery message may be sent in a selective flooding manner to save overhead.
此外,在本申请实施例中,上级节点可以为下级节点分配的地址中包括取值为该下级节点的标识的字段(例如第二节点为第一节点分配的第一地址中的第二字段,第一节点为第三节点分配的第二地址中的第四字段,以及后文存在的其他分配的字段),由于该上级节点可能为多个下级节点分配地址,为此,该字段的目的是用于通过不同的取值用以区分该多个下级节点。In addition, in the embodiment of the present application, the address assigned by the upper-level node to the lower-level node includes a field whose value is the identifier of the lower-level node (for example, the second field in the first address assigned by the second node to the first node, the fourth field in the second address assigned by the first node to the third node, and other assigned fields in the following).
可选地,取值为该下级节点的标识的字段可以存在多种取值情况,可以为上级节点配置的取值(例如该取值为上级节点按照多个下级节点发送发现报文的时间顺序所配置的序号,该取值为该上级节点分别接收来自多个下级节点的发现报文的时间戳等),也可以为多个下级节点预配置的互不相同的取值(例如该取值为多个下级节点的媒介接入控制(media access control,MAC)地址,该取值为多个下级节点的设备编号等),或者是其他的实现方式,此处不做限定。Optionally, the field that takes the value as the identifier of the lower-level node can have a variety of value situations. It can be a value configured by the upper-level node (for example, the value is the serial number configured by the upper-level node according to the time sequence in which multiple lower-level nodes send discovery messages, and the value is the time stamp when the upper-level node receives discovery messages from multiple lower-level nodes, etc.), or it can be different values pre-configured for multiple lower-level nodes (for example, the value is a media access control (MAC) of multiple lower-level nodes. ) address, which is the device number of multiple subordinate nodes, etc.), or other implementation methods, which are not limited here.
在第一方面的一种可能的实现方式中,在该第一节点向该第三节点发送第二提供报文之后,该方法还包括:在确定与该第二节点断开连接之后,该第一节点向该第三节点发送第一 变更报文,以指示该第三节点清除该第二地址。In a possible implementation of the first aspect, after the first node sends the second offer message to the third node, the method further includes: after determining to disconnect from the second node, the first node sends a first change message to the third node to instruct the third node to clear the second address.
基于上述技术方案,在该第一节点确定与该第二节点断开连接的情况下,第一节点确定该第二节点为该第一节点分配的第一地址失效且第一节点基于该第一地址分配的第二地址失效。为此,该第一节点向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址,使得第三节点明确该第二地址失效并清除该第二地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商实现层次化地址的动态更新。Based on the above technical solution, when the first node determines to be disconnected from the second node, the first node determines that the first address allocated by the second node to the first node is invalid and the second address allocated by the first node based on the first address is invalid. To this end, the first node sends a first change message to the third node to instruct the third node to clear the second address, so that the third node knows that the second address is invalid and clears the second address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
在第一方面的一种可能的实现方式中,在第一节点向第三节点发送第二提供报文之后之后,该方法还包括:在确定与该第二节点断开连接之后,该第一节点发送第三发现报文,该第三发现报文用于请求分配地址;该第一节点接收来自第四节点的第三提供报文,该第三提供报文包括该第四节点为该第一节点分配的第三地址;其中,该第四节点为该第一节点的上级节点,该第三地址包括第五字段和第六字段,该第五字段的取值为该第四节点的地址的取值,该第六字段的取值为该第一节点的标识。In a possible implementation of the first aspect, after the first node sends the second offer message to the third node, the method further includes: after determining to disconnect from the second node, the first node sends a third discovery message, where the third discovery message is used to request address allocation; the first node receives a third offer message from the fourth node, and the third offer message includes the third address allocated by the fourth node to the first node; The value of the address of the node, the value of the sixth field is the identifier of the first node.
基于上述技术方案,在该第一节点确定与该第二节点断开连接的情况下,第一节点确定该第二节点为该第一节点分配的第一地址失效。为此,该第一节点可以向该其它上级节点(例如第四节点)发送用于请求分配地址的第三发现报文,并获取来自该第四节点为该第一节点分配的第三地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商实现层次化地址的动态更新。Based on the above technical solution, when the first node determines to be disconnected from the second node, the first node determines that the first address allocated by the second node to the first node is invalid. To this end, the first node may send a third discovery message for requesting address allocation to the other superior node (for example, the fourth node), and obtain the third address allocated to the first node from the fourth node. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
可选地,第三地址中第六字段的取值和第一地址中的第二字段的取值均为第一节点的标识,如前文所示,作为下级节点的第一节点的标识可以存在多种实现方式。为此,第三地址中第六字段的取值和第一地址中的第二字段的取值可以是同一取值,或者,第三地址中第六字段的取值和第一地址中的第二字段的取值也可以是不同的取值,即不同上级节点为第一节点分配的标识可以相同,也可以不同,此处不做限定。Optionally, the value of the sixth field in the third address and the value of the second field in the first address are both identifiers of the first node. As shown above, there may be multiple implementations for the identifier of the first node as a subordinate node. For this reason, the value of the sixth field in the third address and the value of the second field in the first address can be the same value, or the value of the sixth field in the third address and the value of the second field in the first address can also be different values, that is, the identifiers assigned to the first node by different upper-level nodes can be the same or different, which is not limited here.
在第一方面的一种可能的实现方式中,在该第一节点接收来自第二节点的第一提供报文之后,该方法还包括:在确定与该第二节点断开连接之后,该第一节点清除该第一地址。In a possible implementation manner of the first aspect, after the first node receives the first offer message from the second node, the method further includes: after determining to disconnect from the second node, the first node clears the first address.
基于上述技术方案,该第一节点确定与该第二节点断开连接之后,该第一节点确定第二节点为该第一节点所分配的第一地址将会失效。为此,该第一节点可以在本地清除该第一地址,后续可以通过发现报文向上级节点获取新的地址。Based on the above technical solution, after the first node determines to disconnect from the second node, the first node determines that the first address assigned by the second node to the first node will become invalid. For this reason, the first node may clear the first address locally, and then obtain a new address from the upper node through a discovery message.
在第一方面的一种可能的实现方式中,该第一节点确定与该第二节点断开连接包括以下至少一项:该第一节点确定与该第二节点之间的端口状态为故障(down);或,该第一节点确定该第一地址续租超时;或,该第一节点接收来自该第二节点的第二变更报文,以指示该第一节点清除该第一地址。In a possible implementation manner of the first aspect, the determination by the first node to disconnect from the second node includes at least one of the following: the first node determines that the port status with the second node is down; or, the first node determines that the lease renewal of the first address has timed out; or, the first node receives a second change message from the second node to instruct the first node to clear the first address.
应理解,第一节点与该第二节点断开连接,可以包括该第一节点与第二节点之间的链路断开,也可以包括该第一节点与该第二节点之间的链路休眠,还可以包括第二节点(或第二节点的上级节点)故障等,此处不做限定。It should be understood that the disconnection between the first node and the second node may include disconnection of the link between the first node and the second node, may also include dormancy of the link between the first node and the second node, and may also include failure of the second node (or a superior node of the second node), etc., which are not limited herein.
基于上述技术方案,对于第一节点而言,第一节点可以通过上述多种方式明确第二节点断开连接,并进一步明确该第二节点为该第一节点分配的第一地址失效。Based on the above technical solution, for the first node, the first node may confirm that the second node is disconnected through the above-mentioned various methods, and further clarify that the first address allocated by the second node to the first node is invalid.
在第一方面的一种可能的实现方式中,在该第一节点接收来自该第二节点的该第一提供报文之前,该方法还包括:该第一节点接收第四发现报文,该第四发现报文用于请求分配地 址;该第一节点发送第一非确认报文,该第一非确认报文用于指示拒绝分配地址。In a possible implementation manner of the first aspect, before the first node receives the first offer message from the second node, the method further includes: the first node receives a fourth discovery message, where the fourth discovery message is used to request address allocation; the first node sends a first non-confirmation message, where the first non-confirmation message is used to indicate refusal to allocate an address.
基于上述技术方案,在该第一节点接收来自该第二节点的该第一提供报文之前,即第一节点未收到上级节点分配的地址之前,该第一节点不具备向下级节点分配地址的能力(或称第一节点当前的层次化地址无效)。为此,该第一节点接收用于请求分配地址的第四发现报文之后,该第一节点发送用于指示拒绝分配地址的第一非确认报文,使得该第一非确认报文的接收方明确该第一节点当前不具备分配地址的能力。Based on the above technical solution, before the first node receives the first providing message from the second node, that is, before the first node receives the address assigned by the upper-level node, the first node does not have the ability to assign addresses to lower-level nodes (or the current hierarchical address of the first node is invalid). For this reason, after the first node receives the fourth discovery message for requesting address allocation, the first node sends a first non-confirmation message for indicating refusal of address allocation, so that the receiver of the first non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
在第一方面的一种可能的实现方式中,在该第一节点接收来自该第二节点的第一提供报文之前,该方法还包括:该第一节点接收来自该第三节点的第二非确认报文,该第二非确认报文用于指示拒绝分配地址。In a possible implementation manner of the first aspect, before the first node receives the first offer message from the second node, the method further includes: the first node receives a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
基于上述技术方案,在该第一节点接收第一提供报文之前,即第一节点未收到上级节点分配的地址之前,第一节点并不明确自身的地址,相应的,第一节点的下级节点(例如第三节点)也不明确自身的地址。其中,第一节点所发送第一发现报文的数量可以为多个,某个第一发现报文被第三节点接收之后,由于该第三节点不具备分配地址的能力(或称第三节点当前的层次化地址无效),该第三节点会向该第一节点发送用于指示拒绝分配地址的第二非确认报文,使得第一节点基于该第二非确认报文明确第三节点当前不具备分配地址的能力。Based on the above technical solution, before the first node receives the first providing message, that is, before the first node receives the address assigned by the superior node, the first node does not know its own address, and correspondingly, the subordinate nodes (such as the third node) of the first node do not know its own address. Wherein, the number of the first discovery message sent by the first node may be multiple. After a certain first discovery message is received by the third node, because the third node does not have the ability to allocate addresses (or the current hierarchical address of the third node is invalid), the third node will send to the first node a second non-confirmation message for indicating refusal to allocate addresses, so that the first node determines based on the second non-confirmation message that the third node currently does not have the ability to allocate addresses.
此外,上述用于指示拒绝分配地址的非确认报文(包括第一非确认报文、第二非确认报文,以及后文可能出现的第三非确认报文、第四非确认报文和第五非确认报文等)为基于发现报文所反馈的报文。其中,发现报文的发送端所发送的发现报文可以是以泛洪(全体泛洪或选择性的泛洪)的方式发送的。为此,发现报文的接收端在多种情况下都有可能接收到该发现报文。其中,在该发现报文的接收端尚未接收到来自上级节点分配的地址(即该接收端不具备地址分配能力,或称该接收端的当前层次化地址无效)的情况下,在接收到发现报文之后,该接收端反馈的报文为用于指示拒绝分配地址的非确认报文;而在该发现报文的接收端确定已接收到来自上级节点分配的地址(即该接收端具备地址分配能力,或称该接收端的当前层次化地址有效)的情况下,在接收到发现报文之后,该接收端反馈的报文为用于分配地址的提供报文。从而,对于任一上级节点而言,该上级节点当前的层次化地址无效的情况下会基于接收到的发现报文反馈非确认报文,该上级节点当前的层次化地址有效的情况下会基于接收到的发现报文反馈提供报文,即该上级节点的层次化地址有效之后才会为下级节点分配地址以使得该下级节点的层次化地址有效。从而,基于该非确认报文和提供报文的反馈,在树形网络中通过从上级节点到下级节点的按序分配地址的方式,实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。In addition, the aforementioned non-confirmation messages (including the first non-confirmation message, the second non-confirmation message, and the third non-confirmation message, fourth non-confirmation message, and fifth non-confirmation message that may appear later) used to indicate the refusal to allocate addresses are messages based on the feedback of the discovery message. Wherein, the discovery message sent by the sender of the discovery message may be sent in a manner of flooding (full flooding or selective flooding). For this reason, the receiving end of the discovery message may receive the discovery message in various situations. Wherein, in the case where the receiving end of the discovery message has not received the address assigned by the upper-level node (that is, the receiving end does not have the address allocation capability, or the current hierarchical address of the receiving end is invalid), after receiving the discovery message, the message fed back by the receiving end is a non-confirmation message for indicating that the address is rejected; After the discovery message, the message fed back by the receiving end is an offer message for address allocation. Therefore, for any upper-level node, if the current hierarchical address of the upper-level node is invalid, it will feed back a non-confirmation message based on the received discovery message. Therefore, based on the non-confirmation message and the feedback of the provided message, in the tree network, the automatic allocation of hierarchical addresses is realized by sequentially allocating addresses from upper-level nodes to lower-level nodes, so as to avoid network paralysis caused by manual configuration errors and improve network stability.
在第一方面的一种可能的实现方式中,在该第一节点接收来自该第二节点的第一提供报文之后且在该第一节点向该第三节点发送该第二提供报文之前,该方法还包括:该第一节点向该第二节点发送第一请求报文,该第一请求报文用于指示请求使用该第一地址;该第一节点接收来自该第二节点的第一确认报文,该第一确认报文用于指示允许使用该第一地址。In a possible implementation of the first aspect, after the first node receives the first offer message from the second node and before the first node sends the second offer message to the third node, the method further includes: the first node sends a first request message to the second node, where the first request message is used to indicate a request to use the first address; and the first node receives a first confirmation message from the second node, where the first confirmation message is used to indicate permission to use the first address.
基于上述技术方案,在该第一节点接收来自该第二节点的第一提供报文之后,该第一节点向该第二节点发送用于指示请求使用该第一地址的第一请求报文,并接收来自该第二节点的用于指示允许使用该第一地址的第一确认报文。使得第一节点基于该第一确认报文明确能够基于该第一地址分配地址的情况下,该第一节点向该第三节点发送包含有基于该第一地址 所分配的第二地址的第二提供报文。Based on the above technical solution, after the first node receives the first provision message from the second node, the first node sends to the second node a first request message indicating that the first address is requested to be used, and receives a first confirmation message from the second node indicating that the first address is allowed to be used. In the case that the first node can clearly allocate an address based on the first address based on the first confirmation message, the first node sends a second offer message including the second address allocated based on the first address to the third node.
此外,第二节点可能存在多个下级节点,而该多个下级节点都有可能向该第二节点发送用于请求分配地址的发现报文,而第二节点有可能不止将该第一地址分配给第一节点,还可能将该第一地址分配给其它下级节点。为此,第一节点可以通过该第一请求报文以及第一确认报文的交互,以明确该第二节点允许该第一节点使用该第一地址,即明确该第一节点之外的其他节点未被允许使用该第一地址,以避免地址分配冲突。In addition, the second node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the second node for requesting address allocation, and the second node may not only allocate the first address to the first node, but may also allocate the first address to other lower-level nodes. For this reason, the first node may clarify that the second node allows the first node to use the first address through the interaction of the first request message and the first confirmation message, that is, it is clear that other nodes other than the first node are not allowed to use the first address, so as to avoid address allocation conflicts.
在第一方面的一种可能的实现方式中,在该第一节点接收来自该第二节点的该第一确认报文之前,该方法还包括:该第一节点接收第五发现报文,该第五发现报文用于请求分配地址;该第一节点发送第三非确认报文,该第三非确认报文用于指示拒绝分配地址。In a possible implementation manner of the first aspect, before the first node receives the first confirmation message from the second node, the method further includes: the first node receives a fifth discovery message, where the fifth discovery message is used to request address allocation; the first node sends a third non-confirmation message, where the third non-confirmation message is used to indicate refusal to allocate an address.
基于上述技术方案,在该第一节点接收来自该第二节点的该第一确认报文之前,由于第一节点并不明确第二节点是否允许该第一节点使用该第一地址,即第一节点并不明确第一节点是否能够基于该第一地址为下级节点分配地址。为此,该第一节点接收用于请求分配地址的第五发现报文之后,该第一节点发送用于指示拒绝分配地址的第三非确认报文,以使得该第三非确认报文的接收方明确该第一节点当前不具备分配地址的能力。Based on the above technical solution, before the first node receives the first confirmation message from the second node, since the first node does not know whether the second node allows the first node to use the first address, that is, the first node does not know whether the first node can assign addresses to subordinate nodes based on the first address. For this reason, after the first node receives the fifth discovery message for requesting address allocation, the first node sends a third non-confirmation message for indicating refusal of address allocation, so that the recipient of the third non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
在第一方面的一种可能的实现方式中,在该第一节点向该第三节点发送第二提供报文之后,该方法还包括:该第一节点接收来自该第三节点的第二请求报文,该第二请求报文用于指示请求使用该第二地址;该第一节点向该第三节点发送第二确认报文,该第二确认报文用于指示允许使用该第二地址。In a possible implementation manner of the first aspect, after the first node sends the second offer message to the third node, the method further includes: the first node receives a second request message from the third node, where the second request message is used to indicate a request to use the second address; the first node sends a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used.
基于上述技术方案,在该第一节点向该第三节点发送第二提供报文之后,该第一节点接收来自第三节点的用于指示请求使用该第二地址的第二请求报文之后,该第一节点向该第三节点发送用于指示允许使用该第二地址的第二确认报文。使得第三节点基于该第二确认报文能够明确该第二地址为允许使用的地址。Based on the above technical solution, after the first node sends a second offer message to the third node, and after the first node receives a second request message from the third node indicating a request to use the second address, the first node sends to the third node a second confirmation message indicating permission to use the second address. The third node can determine that the second address is an address allowed to be used based on the second confirmation message.
此外,第一节点可能存在多个下级节点,而该多个下级节点都有可能向该第一节点发送用于请求分配地址的发现报文,而第一节点有可能不止将该第二地址分配给第三节点,还可能将该第二地址分配给其它下级节点。为此,第二节点可以通过该第二请求报文以及第二确认报文的交互,以明确该第一节点允许该第二节点使用该第二地址,即明确该第二节点之外的其他节点未被允许使用该第二地址,以避免地址分配冲突。In addition, the first node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the first node to request address allocation, and the first node may not only allocate the second address to the third node, but may also allocate the second address to other lower-level nodes. For this reason, the second node can clarify that the first node allows the second node to use the second address through the interaction of the second request message and the second confirmation message, that is, it is clear that other nodes other than the second node are not allowed to use the second address, so as to avoid address allocation conflicts.
在第一方面的一种可能的实现方式中,该第一地址和第二地址为NewIP地址。In a possible implementation manner of the first aspect, the first address and the second address are NewIP addresses.
基于上述技术方案,层次化地址为新互联网协议(NewIP)的特性之一,为此,该实现方式中不同节点(包括第一节点、第二节点和第三节点等)之间可以基于NewIP这一协议进行通信,在此基础上,上述节点所分配的地址(包括第一地址、第二地址以及可能存在的第三地址等)为NewIP地址。Based on the above-mentioned technical solution, the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, in this implementation, different nodes (including the first node, the second node and the third node, etc.) can communicate based on the NewIP protocol. On this basis, the addresses allocated by the above-mentioned nodes (including the first address, the second address, and the possible third address, etc.) are NewIP addresses.
在第一方面的一种可能的实现方式中,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为动态主机配置协议(dynamic host configuration protocol,DHCP)报文。In a possible implementation manner of the first aspect, the first discovery message, the first offer message, the second discovery message, and the second offer message are all dynamic host configuration protocol (dynamic host configuration protocol, DHCP) messages.
基于上述技术方案,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为DHCP报文,即该第一发现报文和该第二发现报文可以为DHCP中的动态主机配置协议发现(DHCP discover)报文,该第一提供报文和该第二提供报文可以为DHCP中的动态主 机配置协议提供(DHCP offer)报文。使得该实现方式能够复用DHCP的报文处理机制实现层次化地址的自动分配。Based on the foregoing technical scheme, the first discovery message, the first provision message, the second discovery message and the second provision message are all DHCP messages, that is, the first discovery message and the second discovery message can be a Dynamic Host Configuration Protocol discovery (DHCP discover) message in DHCP, and the first provision message and the second provision message can provide a (DHCP offer) message for a Dynamic Host Configuration Protocol in DHCP. This enables the realization method to multiplex the message processing mechanism of DHCP to realize the automatic allocation of hierarchical addresses.
可选地,本申请涉及的其他发现报文(例如第三发现报文、第四发现报文、第五发现报文等)都可以为DHCP discover报文,本申请涉及的其他提供报文都可以为DHCP offer报文。类似地,本申请涉及的请求报文(例如第一请求报文、第二请求报文等)也可以为DHCP中的动态主机配置协议请求(DHCP request)报文,本申请涉及的确认报文(例如第一确认报文、第二确认报文等)也可以为DHCP中的动态主机配置协议确认(DHCP ACK)报文,本申请涉及的非确认报文(例如第一非确认报文、第二非确认报文等)也可以为DHCP中的动态主机配置协议非确认(DHCP NAK)报文。Optionally, other discovery messages involved in the present application (such as the third discovery message, the fourth discovery message, the fifth discovery message, etc.) can all be DHCP discover messages, and other provision messages involved in the present application can all be DHCP offer messages. Similarly, the request message involved in the application (such as the first request message, the second request message, etc.) can also be a dynamic host configuration protocol request (DHCP request) message in DHCP, the confirmation message involved in the application (such as the first confirmation message, the second confirmation message, etc.) Dynamic Host Configuration Protocol non-acknowledgement (DHCP NAK) message.
应理解,层次化地址为新互联网协议(NewIP)的特性之一,为此,上述技术方案也可以表述为通过对DHCP协议的扩展,以支持NewIP协议中层次化地址的自动分配。It should be understood that the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, the above technical solution can also be described as extending the DHCP protocol to support the automatic allocation of the hierarchical address in the NewIP protocol.
需要说明的是,上述技术方案中以本申请涉及的报文(例如该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文等)为DHCP报文作为示例进行说明。在实际应用中,当网络拓扑中的各个节点应用不同于DHCP的其它地址分配协议的情况下,例如引导程序协议(bootstrap protocol,BOOTP)、私有化的地址分配协议,或者其它地址分配协议的情况下,本申请涉及的报文还可以为该其他地址分配协议中的报文。It should be noted that, in the above technical solutions, the messages involved in this application (such as the first discovery message, the first offer message, the second discovery message, and the second offer message) are taken as examples for description. In practical applications, when each node in the network topology uses other address allocation protocols different from DHCP, such as a bootstrap protocol (bootstrap protocol, BOOTP), a privatized address allocation protocol, or other address allocation protocols, the messages involved in this application can also be messages in the other address allocation protocols.
在第一方面的一种可能的实现方式中,在该第一地址中,该第一字段位于该第二字段之前;和/或,在该第二地址中,该第三字段位于该第四字段之前。In a possible implementation manner of the first aspect, in the first address, the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
基于上述技术方案,在该第一地址中,取值为上级节点(即该第二节点)的地址的取值的第一字段可以位于取值为该第一节点的标识的第二字段之前,以便于基于该第一节点的第一地址明确第一节点的上级节点的地址以及第一节点所在网络的网络拓扑关系。Based on the above technical solution, in the first address, the first field whose value is the address of the upper-level node (that is, the second node) may be located before the second field whose value is the identifier of the first node, so as to clarify based on the first address of the first node the address of the upper-level node of the first node and the network topology relationship of the network where the first node is located.
类似地,在该第二地址中,取值为上级节点(即该第一节点)的地址的取值的第三字段可以位于取值为该第三节点的标识的第四字段之前,以便于基于该第三节点的第二地址明确第三节点的上级节点的地址以及第三节点所在网络的网络拓扑关系。Similarly, in the second address, the third field whose value is the address of the upper-level node (that is, the first node) may be located before the fourth field whose value is the identifier of the third node, so as to clarify the address of the upper-level node of the third node based on the second address of the third node and the network topology relationship of the network where the third node is located.
在第一方面的一种可能的实现方式中,该方法应用于树形网络,该第二节点为该树形网络的根节点或该树形网络的中间节点。In a possible implementation manner of the first aspect, the method is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
基于上述技术方案,作为第一节点的上级节点,该第二节点既可以为网络拓扑中的根节点(即仅具备下级节点不具备上级节点),第二节点也可以为网络拓扑中的中间节点(即具备下级节点且具备上级节点),此处不做限定。Based on the above technical solution, as the upper node of the first node, the second node can be the root node in the network topology (that is, only have the lower nodes and not have the upper nodes), and the second node can also be an intermediate node in the network topology (that is, have the lower nodes and have the upper nodes), which is not limited here.
在第一方面的一种可能的实现方式中,该方法应用于树形网络,该第三节点为该树形网络的叶子节点或该树形网络的中间节点。In a possible implementation manner of the first aspect, the method is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
基于上述技术方案,作为第一节点的下级节点,该第三节点既可以为网络拓扑中的叶子节点(即仅具备上级节点不具备下级节点),第三节点也可以为网络拓扑中的中间节点(即具备下级节点且具备上级节点),此处不做限定。Based on the above technical solution, as a subordinate node of the first node, the third node can be a leaf node in the network topology (that is, only have a superior node but not a subordinate node), and the third node can also be an intermediate node in the network topology (that is, have a subordinate node and have a superior node), which is not limited here.
本申请实施例第二方面提供了一种通信方法,该方法由通信系统实现。例如,该方法由通信系统中的各个节点(包括第一节点、第二节点和第三节点等)执行,或者,该方法由各个节点(包括第一节点、第二节点和第三节点等)中的部分组件(例如处理器、芯片或芯片 系统等)执行,或者,该方法由能实现全部或部分各个节点(包括第一节点、第二节点和第三节点等)功能的逻辑模块或软件实现。在第二方面及其可能的实现方式中,以该通信方法由各个节点(包括第一节点、第二节点和第三节点等)执行为例进行描述,其中,各个节点(包括第一节点、第二节点和第三节点等)可以为路由器、交换机、虚拟机等设备。其中,该第二节点为该第一节点的上级节点且该第三节点为该第一节点的下级节点。The second aspect of the embodiments of the present application provides a communication method, which is implemented by a communication system. For example, the method is executed by each node (including the first node, the second node, and the third node, etc.) in the communication system, or, the method is executed by some components (such as a processor, a chip, or a chip system, etc.) in each node (including the first node, the second node, and the third node, etc.), or, the method is implemented by a logic module or software that can realize all or part of the functions of each node (including the first node, the second node, and the third node, etc.). In the second aspect and possible implementations thereof, the communication method is described as an example performed by various nodes (including the first node, the second node, and the third node, etc.), where each node (including the first node, the second node, and the third node, etc.) may be a device such as a router, a switch, or a virtual machine. Wherein, the second node is a superior node of the first node and the third node is a subordinate node of the first node.
在该方法中,该第一节点发送第一发现报文,该第一发现报文用于请求分配地址;该第二节点接收该第一发现报文,并向该第一节点发送第一提供报文,该第一提供报文该第二节点为该第一节点分配的包括第一地址;其中,该第一地址包括第一字段和第二字段,该第一字段的取值为第二节点的地址的取值,该第二字段的取值为该第一节点的标识;该第一节点接收该第一提供报文;该第三节点发送第二发现报文,该第二发现报文用于请求分配地址;该第一节点接收该第二发现报文,并向该第三节点发送第二提供报文,该第二提供报文包括该第一节点为该第三节点分配的第二地址,该第二地址包括第三字段和第四字段,该第三字段的取值为该第一地址的取值,该第四字段的取值为该第三节点的标识;该第三节点接收该第二提供报文。In the method, the first node sends a first discovery message, and the first discovery message is used to request an address allocation; the second node receives the first discovery message, and sends a first provision message to the first node, and the first provision message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node, and the value of the second field is an identifier of the first node; the first node receives the first provision message; the third node sends a second discovery message, the second The discovery message is used to request address allocation; the first node receives the second discovery message and sends a second offer message to the third node, the second offer message includes a second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field is an identifier of the third node; the third node receives the second offer message.
基于上述技术方案,第一节点接收的来自于第二节点的第一提供报文包含有第一地址,该第一地址中第一字段的取值为第二节点的地址的取值且该第一地址中第二字段的取值为该第一节点的标识;并且,第一节点向第三节点发送的第二提供报文包含有第二地址,该第二地址中第三字段的取值为该第一节点的地址的取值且该第二地址中第四字段的取值为第三节点的标识。其中,该第二节点为该第一节点的上级节点且该第三节点为该第一节点的下级节点,即第一节点既能够接收上级节点分配的层次化地址,也能够向下级节点分配层次化地址。换言之,在包含有第二节点、第一节点和第三节点的树型的网络拓扑场景中,第一节点既能作为终端设备接收上级节点的自动分配的层次化地址,也能够作为网络设备自动向下级节点分配层次化地址。从而,在树型的网络拓扑场景中通过上下级节点之间的交互实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。Based on the above technical solution, the first providing message received by the first node from the second node includes a first address, the value of the first field in the first address is the value of the address of the second node and the value of the second field in the first address is the identifier of the first node; and the second providing message sent by the first node to the third node includes a second address, the value of the third field in the second address is the value of the address of the first node and the value of the fourth field in the second address is the identifier of the third node. Wherein, the second node is a superior node of the first node and the third node is a subordinate node of the first node, that is, the first node can not only receive the hierarchical address assigned by the superior node, but also assign a hierarchical address to the subordinate node. In other words, in a tree-type network topology scenario including the second node, the first node, and the third node, the first node can serve as a terminal device to receive an automatically assigned hierarchical address from a superior node, and can also serve as a network device to automatically assign a hierarchical address to a subordinate node. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
应理解,层次化地址为新互联网协议(NewIP)的特性之一,为此,上述技术效果也可以表述为在树型的网络拓扑场景中通过上下级节点之间的交互实现NewIP协议中层次化地址的自动分配。It should be understood that the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). For this reason, the above-mentioned technical effect can also be expressed as the automatic allocation of the hierarchical address in the NewIP protocol through the interaction between the upper and lower nodes in the tree-type network topology scene.
需要说明的是,本申请实施例中所涉及的发现报文(如第一发现报文,以及后文的第二发现报文,第三发现报文,第四发现报文等)用于请求分配地址,即该发现报文为该发现报文的发送端不具备地址的情况下所发送的报文。为此,该发送端可以以泛洪的方式发送该发现报文,以期该发现报文能被多个接收端接收并获得该发现报文的响应(即提供报文)。It should be noted that the discovery messages involved in the embodiments of the present application (such as the first discovery message, and the second discovery message, the third discovery message, the fourth discovery message, etc.) are used to request address allocation, that is, the discovery message is a message sent when the sender of the discovery message does not have an address. For this reason, the sender may send the discovery message in a flooding manner, hoping that the discovery message can be received by multiple receivers and obtain responses to the discovery message (that is, provide a message).
可选地,该发现报文的发送端存在向上级节点通信的接口(可称为北向接口)以及向下级节点通信的接口(可称为南向接口)的情况下,由于一般情况下仅有上级节点具备分配地址的能力,为此,该发现报文也可以为通过向上级节点通信的接口泛洪的方式发送,以节省开销。Optionally, when the sending end of the discovery message has an interface for communicating with the upper node (which may be called a northbound interface) and an interface for communicating with the lower node (which may be called a southbound interface), since generally only the upper node has the ability to allocate addresses, for this reason, the discovery message may also be sent by flooding the interface for communicating with the upper node to save overhead.
可见,发现报文的发送端可以在不同的场景下灵活地选用上述发送方式。例如,在该发送端(由于未经过配置而)无法确定所连接的节点中哪些节点是上级节点的情况下,发送端可以采用全体泛洪的方式发送该发现报文。又如,在该发送端能够感知所连接的节点中哪些 节点是上级节点的情况下,可以采用选择性泛洪的方式发送该发现报文,以节省开销。It can be seen that the sender of the discovery message can flexibly select the above sending method in different scenarios. For example, in the case that the sender (due to no configuration) cannot determine which nodes among the connected nodes are upper-level nodes, the sender may send the discovery message in a manner of collective flooding. For another example, when the sender can perceive which nodes among the connected nodes are upper-level nodes, the discovery message can be sent in a selective flooding manner to save overhead.
此外,在本申请实施例中,上级节点可以为下级节点分配的地址中包括取值为该下级节点的标识的字段(例如第二节点为第一节点分配的第一地址中的第二字段,第一节点为第三节点分配的第二地址中的第四字段,以及后文存在的其他分配的字段),由于该上级节点可能为多个下级节点分配地址,为此,该字段的目的是用于通过不同的取值用以区分该多个下级节点。In addition, in the embodiment of the present application, the address assigned by the upper-level node to the lower-level node includes a field whose value is the identifier of the lower-level node (for example, the second field in the first address assigned by the second node to the first node, the fourth field in the second address assigned by the first node to the third node, and other assigned fields in the following).
可选地,取值为该下级节点的标识的字段可以存在多种取值情况,可以为上级节点配置的取值(例如该取值为上级节点按照多个下级节点发送发现报文的时间顺序所配置的序号,该取值为该上级节点分别接收来自多个下级节点的发现报文的时间戳等),也可以为多个下级节点预配置的互不相同的取值(例如该取值为多个下级节点的媒介接入控制(media access control,MAC)地址,该取值为多个下级节点的设备编号等),或者是其他的实现方式,此处不做限定。Optionally, the field that takes the value as the identifier of the lower-level node can have a variety of value situations. It can be a value configured by the upper-level node (for example, the value is the serial number configured by the upper-level node according to the time sequence in which multiple lower-level nodes send discovery messages, and the value is the time stamp when the upper-level node receives discovery messages from multiple lower-level nodes, etc.), or it can be different values pre-configured for multiple lower-level nodes (for example, the value is a media access control (MAC) of multiple lower-level nodes. ) address, which is the device number of multiple subordinate nodes, etc.), or other implementation methods, which are not limited here.
在第二方面的一种可能的实现方式中,在该第一节点向该第三节点发送第二提供报文之后,该方法还包括:在该第一节点确定与该第二节点断开连接之后,该第一节点向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址;该第三节点接收该第一变更报文,并清除该第二地址。In a possible implementation of the second aspect, after the first node sends the second offer message to the third node, the method further includes: after the first node determines to disconnect from the second node, the first node sends a first change message to the third node to instruct the third node to clear the second address; the third node receives the first change message and clears the second address.
基于上述技术方案,在该第一节点确定与该第二节点断开连接的情况下,第一节点确定该第二节点为该第一节点分配的第一地址失效且第一节点基于该第一地址分配的第二地址失效。为此,该第一节点向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址,使得第三节点明确该第二地址失效并清除该第二地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商实现层次化地址的动态更新。Based on the above technical solution, when the first node determines to be disconnected from the second node, the first node determines that the first address allocated by the second node to the first node is invalid and the second address allocated by the first node based on the first address is invalid. To this end, the first node sends a first change message to the third node to instruct the third node to clear the second address, so that the third node knows that the second address is invalid and clears the second address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
在第二方面的一种可能的实现方式中,该方法还包括:该第三节点向该第三节点的下级节点发送该第一变更报文。In a possible implementation manner of the second aspect, the method further includes: the third node sending the first change message to a subordinate node of the third node.
基于上述技术方案,在第三节点还包含有下级节点的情况下,在第三节点接收该第一变更报文之后,第三节点还可以向该第三节点的下级节点发送该第一变更报文,以指示该第三节点的下级节点清除该第三节点所分配的地址,使得第三节点的下级节点明确所分配的地址失效并清除该地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商,在多层网络拓扑中实现层次化地址的动态更新。Based on the above technical solution, when the third node also includes subordinate nodes, after the third node receives the first change message, the third node may also send the first change message to the subordinate nodes of the third node to instruct the subordinate nodes of the third node to clear the address allocated by the third node, so that the subordinate nodes of the third node clearly invalidate the allocated address and clear the address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized in the multi-layer network topology through negotiation among different nodes.
在第二方面的一种可能的实现方式中,该系统还包括第四节点,该第四节点为该第一节点的上级节点,在该第一节点向该第三节点发送该第二提供报文之后,该方法还包括:在确定与该第二节点断开连接之后,该第一节点发送第三发现报文,该第三发现报文用于请求分配地址;该第四节点接收该第三发现报文,并向该第一节点发送第三提供报文,该第三提供报文包括该第四节点为该第一节点分配的第三地址;其中,该第三地址包括第五字段和第六字段,该第五字段的取值为第四节点的地址的取值,该第六字段的取值为该第一节点的标识;该第一节点接收该第三提供报文。In a possible implementation manner of the second aspect, the system further includes a fourth node, where the fourth node is an upper-level node of the first node. After the first node sends the second offer message to the third node, the method further includes: after determining to disconnect from the second node, the first node sends a third discovery message, where the third discovery message is used to request address allocation; the fourth node receives the third discovery message, and sends a third offer message to the first node, where the third offer message includes a third address allocated by the fourth node to the first node; The third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, the value of the sixth field is the identifier of the first node; the first node receives the third providing message.
基于上述技术方案,在该第一节点确定与该第二节点断开连接的情况下,第一节点确定该第二节点为该第一节点分配的第一地址失效。为此,该第一节点可以向该其它上级节点(例如第四节点)发送用于请求分配地址的第三发现报文,并获取来自该第四节点为该第一节 点分配的第三地址;换言之,在该第一节点确定该第一节点的上级节点由第二节点变为第四节点之后,该第一节点从该第四节点处获取新的地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商实现层次化地址的动态更新。Based on the above technical solution, when the first node determines to be disconnected from the second node, the first node determines that the first address allocated by the second node to the first node is invalid. To this end, the first node may send a third discovery message for requesting address allocation to other upper-level nodes (such as the fourth node), and obtain the third address allocated to the first node from the fourth node; in other words, after the first node determines that the upper-level node of the first node is changed from the second node to the fourth node, the first node obtains a new address from the fourth node. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
可选地,第三地址中第六字段的取值和第一地址中的第二字段的取值均为第一节点的标识,如前文所示,作为下级节点的第一节点的标识可以存在多种实现方式。为此,第三地址中第六字段的取值和第一地址中的第二字段的取值可以是同一取值,或者,第三地址中第六字段的取值和第一地址中的第二字段的取值也可以是不同的取值,即不同上级节点为第一节点分配的标识可以相同,也可以不同,此处不做限定。Optionally, the value of the sixth field in the third address and the value of the second field in the first address are both identifiers of the first node. As shown above, there may be multiple implementations for the identifier of the first node as a subordinate node. For this reason, the value of the sixth field in the third address and the value of the second field in the first address can be the same value, or the value of the sixth field in the third address and the value of the second field in the first address can also be different values, that is, the identifiers assigned to the first node by different upper-level nodes can be the same or different, which is not limited here.
在第二方面的一种可能的实现方式中,该方法还包括:该第三节点接收该第三发现报文;该第三节点向该第一节点发送第四非确认报文,该第四非确认报文用于指示拒绝分配地址;该第一节点接收该第四非确认报文。In a possible implementation manner of the second aspect, the method further includes: the third node receiving the third discovery message; the third node sending a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address; and the first node receives the fourth non-confirmation message.
基于上述技术方案,在该第一节点接收来自该第四节点的该第三提供报文之前,即第一节点未收到上级节点分配的地址之前,该第一节点不具备向下级节点分配地址的能力(或称第一节点当前的层次化地址无效)。为此,该第一节点接收用于请求分配地址的第四发现报文之后,该第一节点发送用于指示拒绝分配地址的第四非确认报文,使得该第四非确认报文的接收方明确该第一节点当前不具备分配地址的能力。Based on the above technical solution, before the first node receives the third providing message from the fourth node, that is, before the first node receives the address assigned by the upper-level node, the first node does not have the ability to assign addresses to lower-level nodes (or the current hierarchical address of the first node is invalid). For this reason, after the first node receives the fourth discovery message for requesting address allocation, the first node sends a fourth non-confirmation message for indicating refusal of address allocation, so that the receiver of the fourth non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
在第二方面的一种可能的实现方式中,在该第一节点接收来自该第二节点的第一提供报文之后,该方法还包括:在确定与该第二节点断开连接之后,该第一节点清除该第一地址。In a possible implementation manner of the second aspect, after the first node receives the first provision message from the second node, the method further includes: after determining to disconnect from the second node, the first node clears the first address.
基于上述技术方案,该第一节点确定与该第二节点断开连接之后,该第一节点确定第二节点为该第一节点所分配的第一地址将会失效。为此,该第一节点可以在本地清除该第一地址,后续可以通过发现报文向上级节点获取新的地址。Based on the above technical solution, after the first node determines to disconnect from the second node, the first node determines that the first address assigned by the second node to the first node will become invalid. For this reason, the first node may clear the first address locally, and then obtain a new address from the upper node through a discovery message.
在第二方面的一种可能的实现方式中,该第一节点确定与该第二节点断开连接包括以下至少一项:该第一节点确定与该第二节点之间的端口状态为故障down;或,该第一节点确定该第一地址续租超时;或,该第一节点接收来自该第二节点的第二变更报文,以指示该第一节点清除该第一地址。In a possible implementation manner of the second aspect, the determination by the first node to disconnect from the second node includes at least one of the following: the first node determines that the state of the port with the second node is down; or, the first node determines that the lease renewal of the first address has timed out; or, the first node receives a second change message from the second node to instruct the first node to clear the first address.
应理解,第一节点与该第二节点断开连接,可以包括该第一节点与第二节点之间的链路断开,也可以包括该第一节点与该第二节点之间的链路休眠,还可以包括第二节点(或第二节点的上级节点)故障等,此处不做限定。It should be understood that the disconnection between the first node and the second node may include disconnection of the link between the first node and the second node, may also include dormancy of the link between the first node and the second node, and may also include failure of the second node (or a superior node of the second node), etc., which are not limited herein.
基于上述技术方案,对于第一节点而言,第一节点可以通过上述多种方式明确与该第二节点断开连接,并进一步明确该第二节点为该第一节点分配的第一地址失效。Based on the above technical solution, for the first node, the first node can explicitly disconnect from the second node through the above-mentioned various methods, and further clarify that the first address allocated by the second node to the first node is invalid.
在第二方面的一种可能的实现方式中,在该第一节点接收该第一提供报文之前,该方法还包括:该第三节点发送第四发现报文,该第四发现报文用于请求分配地址;该第一节点接收该第四发现报文,并向该第三节点发送第一非确认报文,该第一非确认报文用于指示拒绝分配地址;该第三节点接收该第一非确认报文。In a possible implementation of the second aspect, before the first node receives the first provision message, the method further includes: the third node sends a fourth discovery message, where the fourth discovery message is used to request address allocation; the first node receives the fourth discovery message, and sends a first non-confirmation message to the third node, where the first non-confirmation message is used to indicate refusal to allocate an address; the third node receives the first non-confirmation message.
基于上述技术方案,在该第一节点接收来自该第二节点的该第一提供报文之前,即第一节点未收到上级节点分配的地址之前,该第一节点不具备向下级节点分配地址的能力(或称第一节点当前的层次化地址无效)。为此,该第一节点接收用于请求分配地址的第四发现报文之后,该第一节点发送用于指示拒绝分配地址的第一非确认报文,使得该第一非确认报文的 接收方明确该第一节点当前不具备分配地址的能力。Based on the above technical solution, before the first node receives the first providing message from the second node, that is, before the first node receives the address assigned by the upper-level node, the first node does not have the ability to assign addresses to lower-level nodes (or the current hierarchical address of the first node is invalid). For this reason, after the first node receives the fourth discovery message for requesting address allocation, the first node sends a first non-confirmation message for indicating refusal of address allocation, so that the receiver of the first non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
在第二方面的一种可能的实现方式中,在该第一节点接收第一提供报文之前,该方法还包括:该第三节点接收该第一发现报文;该第三节点向该第一节点发送第二非确认报文,该第二非确认报文用于指示拒绝分配地址;该第一节点接收该第二非确认报文。In a possible implementation manner of the second aspect, before the first node receives the first provision message, the method further includes: the third node receives the first discovery message; the third node sends a second non-confirmation message to the first node, and the second non-confirmation message is used to indicate refusal to allocate an address; the first node receives the second non-confirmation message.
基于上述技术方案,在该第一节点接收第一提供报文之前,即第一节点未收到上级节点分配的地址之前,第一节点并不明确自身的地址,相应的,第一节点的下级节点(例如第三节点)也不明确自身的地址。其中,第一节点所发送第一发现报文的数量可以为多个,某个第一发现报文被第三节点接收之后,由于该第三节点不具备分配地址的能力(或称第三节点当前的层次化地址无效),该第三节点会向该第一节点发送用于指示拒绝分配地址的第二非确认报文,使得第一节点基于该第二非确认报文明确第三节点当前不具备分配地址的能力。Based on the above technical solution, before the first node receives the first providing message, that is, before the first node receives the address assigned by the superior node, the first node does not know its own address, and correspondingly, the subordinate nodes (such as the third node) of the first node do not know its own address. Wherein, the number of the first discovery message sent by the first node may be multiple. After a certain first discovery message is received by the third node, because the third node does not have the ability to allocate addresses (or the current hierarchical address of the third node is invalid), the third node will send to the first node a second non-confirmation message for indicating refusal to allocate addresses, so that the first node determines based on the second non-confirmation message that the third node currently does not have the ability to allocate addresses.
此外,在上述用于指示拒绝分配地址的非确认报文(包括第一非确认报文、第二非确认报文,以及后文可能出现的第三非确认报文、第四非确认报文和第五非确认报文等)为基于发现报文所反馈的报文。其中,发现报文的发送端所发送的发现报文可以是以泛洪(全体泛洪或选择性的泛洪)的方式发送的。为此,发现报文的接收端在多种情况下都有可能接收到该发现报文。其中,在该发现报文的接收端尚未接收到来自上级节点分配的地址(即该接收端不具备地址分配能力,或称该接收端的当前层次化地址无效)的情况下,在接收到发现报文之后,该接收端反馈的报文为用于指示拒绝分配地址的非确认报文;而在该发现报文的接收端确定已接收到来自上级节点分配的地址(即该接收端具备地址分配能力,或称该接收端的当前层次化地址有效)的情况下,在接收到发现报文之后,该接收端反馈的报文为用于分配地址的提供报文。从而,对于任一上级节点而言,该上级节点当前的层次化地址无效的情况下会基于接收到的发现报文反馈非确认报文,该上级节点当前的层次化地址有效的情况下会基于接收到的发现报文反馈提供报文,即该上级节点的层次化地址有效之后才会为下级节点分配地址以使得该下级节点的层次化地址有效。从而,基于该非确认报文和提供报文的反馈,在树形网络中通过从上级节点到下级节点的按序分配地址的方式,实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。In addition, the above non-confirmation messages (including the first non-confirmation message, the second non-confirmation message, and the third non-confirmation message, fourth non-confirmation message, and fifth non-confirmation message that may appear later) used to indicate the refusal to allocate addresses are messages based on the feedback of the discovery message. Wherein, the discovery message sent by the sender of the discovery message may be sent in a manner of flooding (full flooding or selective flooding). For this reason, the receiving end of the discovery message may receive the discovery message in various situations. Wherein, in the case where the receiving end of the discovery message has not received the address assigned by the upper-level node (that is, the receiving end does not have the address allocation capability, or the current hierarchical address of the receiving end is invalid), after receiving the discovery message, the message fed back by the receiving end is a non-confirmation message for indicating that the address is rejected; After the discovery message, the message fed back by the receiving end is an offer message for address allocation. Therefore, for any upper-level node, if the current hierarchical address of the upper-level node is invalid, it will feed back a non-confirmation message based on the received discovery message. Therefore, based on the non-confirmation message and the feedback of the provided message, in the tree network, the automatic allocation of hierarchical addresses is realized by sequentially allocating addresses from upper-level nodes to lower-level nodes, so as to avoid network paralysis caused by manual configuration errors and improve network stability.
在第二方面的一种可能的实现方式中,在该第一节点接收第一提供报文之后且在该第一节点发送该第二提供报文之前,该方法还包括:该第一节点发送第一请求报文,该第一请求报文用于指示请求使用该第一地址;该第二节点接收该第一请求报文,并向该第一节点发送第一确认报文,该第一确认报文用于指示允许使用该第一地址;该第一节点接收该第一确认报文。In a possible implementation of the second aspect, after the first node receives the first offer message and before the first node sends the second offer message, the method further includes: the first node sends a first request message, where the first request message is used to indicate a request to use the first address; the second node receives the first request message, and sends a first confirmation message to the first node, where the first confirmation message is used to indicate permission to use the first address; and the first node receives the first confirmation message.
基于上述技术方案,在该第一节点接收来自该第二节点的第一提供报文之后,该第一节点向该第二节点发送用于指示请求使用该第一地址的第一请求报文,并接收来自该第二节点的用于指示允许使用该第一地址的第一确认报文。使得第一节点基于该第一确认报文明确能够基于该第一地址分配地址的情况下,该第一节点向该第三节点发送包含有基于该第一地址所分配的第二地址的第二提供报文。Based on the above technical solution, after the first node receives the first provision message from the second node, the first node sends to the second node a first request message indicating that the first address is requested to be used, and receives a first confirmation message from the second node indicating that the first address is allowed to be used. In the case that the first node can clearly allocate an address based on the first address based on the first confirmation message, the first node sends a second offer message including the second address allocated based on the first address to the third node.
此外,第二节点可能存在多个下级节点,而该多个下级节点都有可能向该第二节点发送用于请求分配地址的发现报文,而第二节点有可能不止将该第一地址分配给第一节点,还可能将该第一地址分配给其它下级节点。为此,第一节点可以通过该第一请求报文以及第一确 认报文的交互,以明确该第二节点允许该第一节点使用该第一地址,即明确该第一节点之外的其他节点未被允许使用该第一地址,以避免地址分配冲突。In addition, the second node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the second node for requesting address allocation, and the second node may not only allocate the first address to the first node, but may also allocate the first address to other lower-level nodes. For this reason, the first node can clarify that the second node allows the first node to use the first address through the interaction of the first request message and the first confirmation message, that is, it is clear that other nodes other than the first node are not allowed to use the first address, so as to avoid address allocation conflicts.
在第二方面的一种可能的实现方式中,在该第一节点接收第一确认报文之前,该方法还包括:该第三节点发送第五发现报文,该第五发现报文用于请求分配地址;该第一节点接收该第五发现报文,并向该第三节点发送第三非确认报文,该第三非确认报文用于指示拒绝分配地址;该第三节点接收该第三非确认报文。In a possible implementation of the second aspect, before the first node receives the first confirmation message, the method further includes: the third node sends a fifth discovery message, where the fifth discovery message is used to request address allocation; the first node receives the fifth discovery message, and sends a third non-confirmation message to the third node, where the third non-confirmation message is used to indicate refusal to allocate an address; and the third node receives the third non-confirmation message.
基于上述技术方案,在该第一节点接收来自该第二节点的该第一确认报文之前,由于第一节点并不明确第二节点是否允许该第一节点使用该第一地址,即第一节点并不明确第一节点是否能够基于该第一地址为下级节点分配地址。为此,该第一节点接收用于请求分配地址的第五发现报文之后,该第一节点发送用于指示拒绝分配地址的第三非确认报文,以使得该第三非确认报文的接收方明确该第一节点当前不具备分配地址的能力。Based on the above technical solution, before the first node receives the first confirmation message from the second node, since the first node does not know whether the second node allows the first node to use the first address, that is, the first node does not know whether the first node can assign addresses to subordinate nodes based on the first address. For this reason, after the first node receives the fifth discovery message for requesting address allocation, the first node sends a third non-confirmation message for indicating refusal of address allocation, so that the recipient of the third non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
在第二方面的一种可能的实现方式中,在该第一节点发送第二提供报文之后,该方法还包括:该第三节点发送第二请求报文,该第二请求报文用于指示请求使用该第二地址;该第一节点接收该第二请求报文,并向该第三节点发送第二确认报文,该第二确认报文用于指示允许使用该第二地址;该第三节点接收该第二确认报文。In a possible implementation manner of the second aspect, after the first node sends the second offer message, the method further includes: the third node sends a second request message, where the second request message is used to indicate a request to use the second address; the first node receives the second request message, and sends a second confirmation message to the third node, where the second confirmation message is used to indicate permission to use the second address; and the third node receives the second confirmation message.
基于上述技术方案,在该第一节点向该第三节点发送第二提供报文之后,该第一节点接收来自第三节点的用于指示请求使用该第二地址的第二请求报文之后,该第一节点向该第三节点发送用于指示允许使用该第二地址的第二确认报文。使得第三节点基于该第二确认报文能够明确该第二地址为允许使用的地址。Based on the above technical solution, after the first node sends a second offer message to the third node, and after the first node receives a second request message from the third node indicating a request to use the second address, the first node sends to the third node a second confirmation message indicating permission to use the second address. The third node can determine that the second address is an address allowed to be used based on the second confirmation message.
此外,第一节点可能存在多个下级节点,而该多个下级节点都有可能向该第一节点发送用于请求分配地址的发现报文,而第一节点有可能不止将该第二地址分配给第三节点,还可能将该第二地址分配给其它下级节点。为此,第二节点可以通过该第二请求报文以及第二确认报文的交互,以明确该第一节点允许该第二节点使用该第二地址,即明确该第二节点之外的其他节点未被允许使用该第二地址,以避免地址分配冲突。In addition, the first node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the first node to request address allocation, and the first node may not only allocate the second address to the third node, but may also allocate the second address to other lower-level nodes. For this reason, the second node can clarify that the first node allows the second node to use the second address through the interaction of the second request message and the second confirmation message, that is, it is clear that other nodes other than the second node are not allowed to use the second address, so as to avoid address allocation conflicts.
在第二方面的一种可能的实现方式中,该第一地址和第二地址为NewIP地址。In a possible implementation manner of the second aspect, the first address and the second address are NewIP addresses.
基于上述技术方案,层次化地址为新互联网协议(NewIP)的特性之一,为此,该实现方式中不同节点(包括第一节点、第二节点和第三节点等)之间可以基于NewIP这一协议进行通信,在此基础上,上述节点所分配的地址(包括第一地址、第二地址以及可能存在的第三地址等)为NewIP地址。Based on the above-mentioned technical solution, the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, in this implementation, different nodes (including the first node, the second node and the third node, etc.) can communicate based on the NewIP protocol. On this basis, the addresses allocated by the above-mentioned nodes (including the first address, the second address, and the possible third address, etc.) are NewIP addresses.
在第二方面的一种可能的实现方式中,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为动态主机配置协议DHCP报文。In a possible implementation manner of the second aspect, the first discovery message, the first offer message, the second discovery message, and the second offer message are all Dynamic Host Configuration Protocol DHCP messages.
基于上述技术方案,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为DHCP报文,即该第一发现报文和该第二发现报文可以为DHCP中的动态主机配置协议发现(DHCP discover)报文,该第一提供报文和该第二提供报文可以为DHCP中的动态主机配置协议提供(DHCP offer)报文。使得该实现方式能够复用DHCP的报文处理机制实现层次化地址的自动分配。Based on the foregoing technical scheme, the first discovery message, the first provision message, the second discovery message and the second provision message are all DHCP messages, that is, the first discovery message and the second discovery message can be a Dynamic Host Configuration Protocol discovery (DHCP discover) message in DHCP, and the first provision message and the second provision message can be a Dynamic Host Configuration Protocol (DHCP offer) message in DHCP. This enables the realization method to multiplex the message processing mechanism of DHCP to realize the automatic allocation of hierarchical addresses.
可选地,本申请涉及的其他发现报文(例如第三发现报文、第四发现报文、第五发现报文等)都可以为DHCP discover报文,本申请涉及的其他提供报文都可以为DHCP offer报文。 类似地,本申请涉及的请求报文(例如第一请求报文、第二请求报文等)也可以为DHCP中的动态主机配置协议请求(DHCP request)报文,本申请涉及的确认报文(例如第一确认报文、第二确认报文等)也可以为DHCP中的动态主机配置协议确认(DHCP ACK)报文,本申请涉及的非确认报文(例如第一非确认报文、第二非确认报文等)也可以为DHCP中的动态主机配置协议非确认(DHCP NAK)报文。Optionally, other discovery messages involved in the present application (such as the third discovery message, the fourth discovery message, the fifth discovery message, etc.) can all be DHCP discover messages, and other provision messages that the application involves can be DHCP offer messages. Similarly, the request message involved in the application (such as the first request message, the second request message, etc.) can also be a dynamic host configuration protocol request (DHCP request) message in DHCP, the confirmation message involved in the application (such as the first confirmation message, the second confirmation message, etc.) Dynamic Host Configuration Protocol non-acknowledgement (DHCP NAK) message.
应理解,层次化地址为新互联网协议(NewIP)的特性之一,为此,上述技术方案也可以表述为通过对DHCP协议的扩展,以支持NewIP协议中层次化地址的自动分配。It should be understood that the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, the above technical solution can also be described as extending the DHCP protocol to support the automatic allocation of the hierarchical address in the NewIP protocol.
需要说明的是,上述技术方案中以本申请涉及的报文(例如该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文等)为DHCP报文作为示例进行说明。在实际应用中,当网络拓扑中的各个节点应用不同于DHCP的其它地址分配协议的情况下,例如引导程序协议(bootstrap protocol,BOOTP)、私有化的地址分配协议,或者其它地址分配协议的情况下,本申请涉及的报文还可以为该其他地址分配协议中的报文。It should be noted that, in the above technical solutions, the messages involved in this application (such as the first discovery message, the first offer message, the second discovery message, and the second offer message) are taken as examples for description. In practical applications, when each node in the network topology uses other address allocation protocols different from DHCP, such as a bootstrap protocol (bootstrap protocol, BOOTP), a privatized address allocation protocol, or other address allocation protocols, the messages involved in this application can also be messages in the other address allocation protocols.
在第二方面的一种可能的实现方式中,在该第一地址中,该第一字段位于该第二字段之前;和/或,在该第二地址中,该第三字段位于该第四字段之前。In a possible implementation manner of the second aspect, in the first address, the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
基于上述技术方案,在该第一地址中,取值为上级节点(即该第二节点)的地址的取值的第一字段可以位于取值为该第一节点的标识的第二字段之前,以便于基于该第一节点的第一地址明确第一节点的上级节点的地址以及第一节点所在网络的网络拓扑关系。Based on the above technical solution, in the first address, the first field whose value is the address of the upper-level node (that is, the second node) may be located before the second field whose value is the identifier of the first node, so as to clarify based on the first address of the first node the address of the upper-level node of the first node and the network topology relationship of the network where the first node is located.
类似地,在该第二地址中,取值为上级节点(即该第一节点)的地址的取值的第三字段可以位于取值为该第三节点的标识的第四字段之前,以便于基于该第三节点的第二地址明确第三节点的上级节点的地址以及第三节点所在网络的网络拓扑关系。Similarly, in the second address, the third field whose value is the address of the upper-level node (that is, the first node) may be located before the fourth field whose value is the identifier of the third node, so as to clarify the address of the upper-level node of the third node based on the second address of the third node and the network topology relationship of the network where the third node is located.
在第二方面的一种可能的实现方式中,该方法应用于树形网络,该第二节点为该树形网络的根节点或该树形网络的中间节点。In a possible implementation manner of the second aspect, the method is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
基于上述技术方案,作为第一节点的上级节点,该第二节点既可以为网络拓扑中的根节点(即仅具备下级节点不具备上级节点),第二节点也可以为网络拓扑中的中间节点(即具备下级节点且具备上级节点),此处不做限定。Based on the above technical solution, as the upper node of the first node, the second node can be the root node in the network topology (that is, only have the lower nodes and not have the upper nodes), and the second node can also be an intermediate node in the network topology (that is, have the lower nodes and have the upper nodes), which is not limited here.
类似地,作为第一节点的上级节点,该第四节点既可以为网络拓扑中的根节点(即仅具备下级节点不具备上级节点),第四节点也可以为网络拓扑中的中间节点(即具备下级节点且具备上级节点),此处不做限定。Similarly, as the upper node of the first node, the fourth node can be the root node in the network topology (that is, it only has a lower node and does not have a higher node), and the fourth node can also be an intermediate node in the network topology (that is, it has a lower node and a higher node), which is not limited here.
在第二方面的一种可能的实现方式中,该方法应用于树形网络,该第三节点为该树形网络的叶子节点或该树形网络的中间节点。In a possible implementation manner of the second aspect, the method is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
基于上述技术方案,作为第一节点的下级节点,该第三节点既可以为网络拓扑中的叶子节点(即仅具备上级节点不具备下级节点),第三节点也可以为网络拓扑中的中间节点(即具备下级节点且具备上级节点),此处不做限定。Based on the above technical solution, as a subordinate node of the first node, the third node can be a leaf node in the network topology (that is, only have a superior node but not a subordinate node), and the third node can also be an intermediate node in the network topology (that is, have a subordinate node and have a superior node), which is not limited here.
本申请实施例第三方面提供了一种通信装置,该装置可以实现上述第一方面或第一方面任一种可能的实现方式中的方法。该装置包括用于执行上述方法的相应的单元或模块。该装置包括的单元或模块可以通过软件和/或硬件方式实现。例如,该装置可以为通信装置,或者,该装置可以为通信装置中的组件(例如处理器、芯片或芯片系统等),或者该装置还可以为能 实现全部或部分通信装置功能的逻辑模块或软件。A third aspect of the embodiments of the present application provides a communications device, which can implement the method in the foregoing first aspect or any possible implementation manner of the first aspect. The apparatus includes corresponding units or modules for performing the above method. The units or modules included in the device can be realized by software and/or hardware. For example, the device may be a communication device, or the device may be a component of the communication device (such as a processor, a chip or a chip system, etc.), or the device may also be a logic module or software capable of realizing all or part of the functions of the communication device.
该通信装置包括处理单元和收发单元;The communication device includes a processing unit and a transceiver unit;
该发送单元用于发送第一发现报文,该第一发现报文用于请求分配地址;The sending unit is used to send a first discovery message, and the first discovery message is used to request address allocation;
该接收单元用于接收来自第二节点的第一提供报文,该第一提供报文包括该第二节点为该第一节点分配的第一地址;其中,该第二节点为该第一节点的上级节点,该第一地址包括第一字段和第二字段,该第一字段的取值为该第二节点的地址的取值,该第二字段的取值为该第一节点的标识;The receiving unit is configured to receive a first provision message from a second node, the first provision message includes a first address assigned by the second node to the first node; wherein, the second node is a superior node of the first node, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node, and the value of the second field is the identifier of the first node;
该接收单元还用于接收来自该第三节点的第二发现报文,该第三节点为该第一节点的下级节点,该第二发现报文用于请求分配地址;The receiving unit is also used to receive a second discovery message from the third node, where the third node is a subordinate node of the first node, and the second discovery message is used to request address allocation;
该发送单元还用于向该第三节点发送第二提供报文,该第二提供报文包括该第一节点为该第三节点分配的第二地址,该第二地址包括第三字段和第四字段,该第三字段的取值为该第一地址的取值,该第四字段的取值为该第三节点的标识。The sending unit is further configured to send a second providing message to the third node, the second providing message includes a second address assigned by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field is an identifier of the third node.
在第三方面的一种可能的实现方式中,该装置还包括处理单元;该发送单元还用于在该处理单元确定与该第二节点断开连接之后,向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址。In a possible implementation manner of the third aspect, the device further includes a processing unit; the sending unit is further configured to send a first change message to the third node after the processing unit determines to disconnect from the second node, to instruct the third node to clear the second address.
在第三方面的一种可能的实现方式中,在该处理单元确定与该第二节点断开连接之后,该发送单元还用于发送第三发现报文,该第三发现报文用于请求分配地址;该接收单元还用于接收来自第四节点的第三提供报文,该第三提供报文包括该第四节点为该第一节点分配的第三地址;其中,该第三地址包括第五字段和第六字段,该第五字段的取值为该第四节点的地址的取值且该第四节点为该第一节点的上级节点,该第六字段的取值为该第一节点的标识。In a possible implementation of the third aspect, after the processing unit determines to disconnect from the second node, the sending unit is further configured to send a third discovery message, the third discovery message is used to request an address allocation; the receiving unit is also used to receive a third provision message from the fourth node, the third provision message includes a third address allocated by the fourth node to the first node; wherein, the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node and the fourth node is the superior node of the first node, and the value of the sixth field is The value is the ID of the first node.
在第三方面的一种可能的实现方式中,在该处理单元确定与该第二节点断开连接之后,该处理单元还用于清除该第一地址。In a possible implementation manner of the third aspect, after the processing unit determines to disconnect from the second node, the processing unit is further configured to clear the first address.
在第三方面的一种可能的实现方式中,该处理单元确定与该第二节点断开连接包括以下至少一项:In a possible implementation manner of the third aspect, the determining by the processing unit to disconnect from the second node includes at least one of the following:
该处理单元确定与该第二节点之间的端口状态为故障(down);或,The processing unit determines that the state of the port with the second node is down; or,
该处理单元确定该第一地址续租超时;或,The processing unit determines that the lease renewal of the first address is timed out; or,
该处理单元确定该接收单元接收来自该第二节点的第二变更报文,以指示该第一节点清除该第一地址。The processing unit determines that the receiving unit receives the second change message from the second node, so as to instruct the first node to delete the first address.
在第三方面的一种可能的实现方式中,该接收单元还用于接收第四发现报文,该第四发现报文用于请求分配地址;该发送单元还用于发送第一非确认报文,该第一非确认报文用于指示拒绝分配地址。In a possible implementation manner of the third aspect, the receiving unit is further configured to receive a fourth discovery message, where the fourth discovery message is used to request address allocation; the sending unit is also used to send a first non-confirmation message, where the first non-confirmation message is used to indicate refusal to allocate an address.
在第三方面的一种可能的实现方式中,该接收单元还用于接收来自该第三节点的第二非确认报文,该第二非确认报文用于指示拒绝分配地址。In a possible implementation manner of the third aspect, the receiving unit is further configured to receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
在第三方面的一种可能的实现方式中,该发送单元还用于向该第二节点发送第一请求报文,该第一请求报文用于指示请求使用该第一地址;该接收单元还用于接收来自该第二节点的第一确认报文,该第一确认报文用于指示允许使用该第一地址。In a possible implementation manner of the third aspect, the sending unit is further configured to send a first request message to the second node, where the first request message is used to indicate that the first address is requested to be used; the receiving unit is also used to receive a first confirmation message from the second node, where the first confirmation message is used to indicate that the first address is allowed to be used.
在第三方面的一种可能的实现方式中,该接收单元还用于接收第五发现报文,该第五发现报文用于请求分配地址;该发送单元还用于发送第三非确认报文,该第三非确认报文用于 指示拒绝分配地址。In a possible implementation of the third aspect, the receiving unit is further configured to receive a fifth discovery message, where the fifth discovery message is used to request address allocation; the sending unit is also used to send a third non-confirmation message, where the third non-confirmation message is used to indicate refusal to allocate an address.
在第三方面的一种可能的实现方式中,该接收单元还用于接收来自该第三节点的第二请求报文,该第二请求报文用于指示请求使用该第二地址;该发送单元还用于向该第三节点发送第二确认报文,该第二确认报文用于指示允许使用该第二地址。In a possible implementation manner of the third aspect, the receiving unit is further configured to receive a second request message from the third node, where the second request message is used to indicate that the second address is requested to be used; the sending unit is also used to send a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used.
在第三方面的一种可能的实现方式中,该第一地址和该第二地址均为NewIP地址。In a possible implementation manner of the third aspect, both the first address and the second address are NewIP addresses.
在第三方面的一种可能的实现方式中,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为动态主机配置协议DHCP报文。In a possible implementation manner of the third aspect, the first discovery message, the first offer message, the second discovery message, and the second offer message are all Dynamic Host Configuration Protocol DHCP messages.
在第三方面的一种可能的实现方式中,在该第一地址中,该第一字段位于该第二字段之前;和/或,在该第二地址中,该第三字段位于该第四字段之前。In a possible implementation manner of the third aspect, in the first address, the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
在第三方面的一种可能的实现方式中,该装置应用于树形网络,该第二节点为该树形网络的根节点或该树形网络的中间节点。In a possible implementation manner of the third aspect, the device is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
在第三方面的一种可能的实现方式中,该方法应用于树形网络,该第三节点为该树形网络的叶子节点或该树形网络的中间节点。In a possible implementation manner of the third aspect, the method is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
本申请实施例第三方面中,通信装置的组成模块还可以用于执行第一方面的各个可能实现方式中所执行的步骤,并实现相应的技术效果,具体均可以参阅第一方面,此处不再赘述。In the third aspect of the embodiment of the present application, the components of the communication device can also be used to execute the steps executed in each possible implementation manner of the first aspect, and achieve corresponding technical effects. For details, please refer to the first aspect, and details will not be repeated here.
本申请实施例第四方面提供了一种通信系统,该系统包括多个通信装置,且该多个通信装置分别对应于不同的节点(包括第一节点、第二节点、第三节点等,且该第二节点为该第一节点的上级节点且该第三节点为该第一节点的下级节点)。The fourth aspect of the embodiment of the present application provides a communication system, the system includes a plurality of communication devices, and the plurality of communication devices respectively correspond to different nodes (including a first node, a second node, a third node, etc., and the second node is a superior node of the first node and the third node is a subordinate node of the first node).
在该通信系统中,对于该多个通信装置的任一通信装置而言,该任一通信装置均包括发送单元和接收单元。此外,该任一装置可以实现上述第二方面或第二方面任一种可能的实现方式中的方法。该任一装置包括用于执行上述方法的相应的单元或模块。该任一装置包括的单元或模块可以通过软件和/或硬件方式实现。例如,该装置任一可以为通信装置,或者,该任一装置可以为通信装置中的组件(例如处理器、芯片或芯片系统等),或者该任一装置还可以为能实现全部或部分通信装置功能的逻辑模块或软件。In the communication system, any communication device of the plurality of communication devices includes a sending unit and a receiving unit. In addition, any device may implement the above-mentioned second aspect or the method in any possible implementation manner of the second aspect. Any of the apparatuses includes corresponding units or modules for performing the above method. The units or modules included in any device may be realized by software and/or hardware. For example, any of the devices may be a communication device, or any device may be a component of a communication device (such as a processor, a chip, or a chip system, etc.), or any device may also be a logic module or software that can realize all or part of the functions of the communication device.
在该通信系统中,该第一节点的发送单元用于发送第一发现报文,该第一发现报文用于请求分配地址;该第二节点的接收单元用于接收该第一发现报文,该第二节点的发送单元用于向该第一节点发送第一提供报文,该第一提供报文包括该第二节点为该第一节点分配的第一地址;其中,该第一地址包括第一字段和第二字段,该第一字段的取值为第二节点的地址的取值且该第二节点为该第一节点的上级节点,该第二字段的取值为该第一节点的标识;该第一节点的接收单元用于接收该第一提供报文;该第三节点的发送单元用于发送第二发现报文,该第二发现报文用于请求分配地址;该第一节点的接收单元还用于接收该第二发现报文,该第一节点的发送单元还用于向该第三节点发送第二提供报文,该第二提供报文包括该第一节点为该第三节点分配的第二地址,该第二地址包括第三字段和第四字段,该第三字段的取值为该第一地址的取值,该第四字段的取值为该第三节点的标识且该第三节点为该第一节点的下级节点;该第三节点的接收单元用于接收该第二提供报文。In the communication system, the sending unit of the first node is used to send a first discovery message, and the first discovery message is used to request an address allocation; the receiving unit of the second node is used to receive the first discovery message, and the sending unit of the second node is used to send a first offer message to the first node, and the first offer message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, and the value of the first field is the value of the address of the second node and the second node is a superior node of the first node, and the value of the second field is The identifier of the first node; the receiving unit of the first node is used to receive the first provision message; the sending unit of the third node is used to send a second discovery message, and the second discovery message is used to request an address allocation; the receiving unit of the first node is also used to receive the second discovery message, and the sending unit of the first node is also used to send a second provision message to the third node, the second provision message includes a second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field is The identifier of the third node and the third node is a subordinate node of the first node; the receiving unit of the third node is configured to receive the second providing message.
在第四方面的一种可能的实现方式中,该第一节点还包括处理单元;在该第一节点的处理单元确定与该第二节点断开连接之后,该第一节点的发送单元还用于向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址;该第三节点的接收单元还用于接收该第一 变更报文,并清除该第二地址。In a possible implementation manner of the fourth aspect, the first node further includes a processing unit; after the processing unit of the first node determines to disconnect from the second node, the sending unit of the first node is further configured to send a first change message to the third node to instruct the third node to clear the second address; the receiving unit of the third node is also configured to receive the first change message and clear the second address.
在第四方面的一种可能的实现方式中,该第三节点的发送单元还用于向该第三节点的下级节点发送该第一变更报文。In a possible implementation manner of the fourth aspect, the sending unit of the third node is further configured to send the first change message to a subordinate node of the third node.
在第四方面的一种可能的实现方式中,该系统还包括第四节点且该第四节点为该第一节点的上级节点;在该第一节点的处理单元确定与该第二节点断开连接之后,该第一节点的发送单元还用于发送第三发现报文,该第三发现报文用于请求分配地址;该第四节点的接收单元用于接收该第三发现报文,该第四节点的发送单元用于向该第一节点发送第三提供报文,该第三提供报文包括该第四节点为该第一节点分配的第三地址;其中,该第三地址包括第五字段和第六字段,该第五字段的取值为第四节点的地址的取值,该第六字段的取值为该第一节点的标识;该第一节点的接收单元还用于接收该第三提供报文。In a possible implementation manner of the fourth aspect, the system further includes a fourth node, and the fourth node is an upper-level node of the first node; after the processing unit of the first node determines to disconnect from the second node, the sending unit of the first node is further configured to send a third discovery message, and the third discovery message is used to request an address allocation; the receiving unit of the fourth node is used to receive the third discovery message, and the sending unit of the fourth node is used to send a third providing message to the first node, and the third providing message includes a third address allocated by the fourth node to the first node; The third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, the value of the sixth field is the identifier of the first node; the receiving unit of the first node is also used to receive the third providing message.
在第四方面的一种可能的实现方式中,该第三节点的接收单元还用于接收该第三发现报文;该第三节点的发送单元还用于向该第一节点发送第四非确认报文,该第四非确认报文用于指示拒绝分配地址。In a possible implementation manner of the fourth aspect, the receiving unit of the third node is further configured to receive the third discovery message; the sending unit of the third node is further configured to send a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address.
在第四方面的一种可能的实现方式中,在该第一节点的处理单元确定与该第二节点断开连接之后,该第一节点的处理单元还用于清除该第一地址。In a possible implementation manner of the fourth aspect, after the processing unit of the first node determines to disconnect from the second node, the processing unit of the first node is further configured to clear the first address.
在第四方面的一种可能的实现方式中,该第一节点的处理单元确定与该第二节点断开连接包括以下至少一项:In a possible implementation manner of the fourth aspect, the determination by the processing unit of the first node to disconnect from the second node includes at least one of the following:
该第一节点的处理单元确定与该第二节点之间的端口状态为故障down;或,The processing unit of the first node determines that the state of the port with the second node is down; or,
该第一节点的处理单元确定该第一地址续租超时;或,The processing unit of the first node determines that the lease renewal of the first address is timed out; or,
该第一节点的处理单元确定该第一节点的接收单元接收来自该第二节点的第二变更报文,以指示该第一节点清除该第一地址。The processing unit of the first node determines that the receiving unit of the first node receives the second change message from the second node, so as to instruct the first node to clear the first address.
在第四方面的一种可能的实现方式中,该第三节点的发送单元还用于发送第四发现报文,该第四发现报文用于请求分配地址;该第一节点的接收单元还用于接收该第四发现报文,并向该第三节点发送第一非确认报文,该第一非确认报文用于指示拒绝分配地址。In a possible implementation manner of the fourth aspect, the sending unit of the third node is further configured to send a fourth discovery message, where the fourth discovery message is used to request address allocation; the receiving unit of the first node is also used to receive the fourth discovery message, and send a first non-confirmation message to the third node, where the first non-confirmation message is used to indicate refusal to allocate an address.
在第四方面的一种可能的实现方式中,该第一节点的接收单元还用于接收来自该第三节点的第二非确认报文,该第二非确认报文用于指示拒绝分配地址。In a possible implementation manner of the fourth aspect, the receiving unit of the first node is further configured to receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
在第四方面的一种可能的实现方式中,该第一节点的发送单元还用于发送第一请求报文,该第一请求报文用于指示请求使用该第一地址;该第二节点的接收单元还用于接收该第一请求报文,并向该第一节点发送第一确认报文,该第一确认报文用于指示允许使用该第一地址;该第一节点的接收单元还用于接收该第一确认报文。In a possible implementation manner of the fourth aspect, the sending unit of the first node is further configured to send a first request message, where the first request message is used to indicate that the first address is requested to be used; the receiving unit of the second node is also used to receive the first request message, and send a first confirmation message to the first node, where the first confirmation message is used to indicate that the first address is allowed to be used; the receiving unit of the first node is also used to receive the first confirmation message.
在第四方面的一种可能的实现方式中,该第三节点的发送单元还用于发送第五发现报文,该第五发现报文用于请求分配地址;该第一节点的接收单元还用于接收该第五发现报文,并向该第三节点发送第三非确认报文,该第三非确认报文用于指示拒绝分配地址;该第三节点的接收单元还用于接收该第三非确认报文。In a possible implementation manner of the fourth aspect, the sending unit of the third node is further configured to send a fifth discovery message, where the fifth discovery message is used to request address allocation; the receiving unit of the first node is also used to receive the fifth discovery message, and send a third non-confirmation message to the third node, where the third non-confirmation message is used to indicate refusal to allocate an address; the receiving unit of the third node is also used to receive the third non-confirmation message.
在第四方面的一种可能的实现方式中,该第三节点的发送单元还用于发送第二请求报文,该第二请求报文用于指示请求使用该第二地址;该第一节点的接收单元还用于接收该第二请求报文,该第一节点的发送单元还用于向该第三节点发送第二确认报文,该第二确认报文用于指示允许使用该第二地址;该第三节点的接收单元还用于接收该第二确认报文。In a possible implementation manner of the fourth aspect, the sending unit of the third node is further configured to send a second request message, where the second request message is used to indicate that the second address is requested to be used; the receiving unit of the first node is also used to receive the second request message, and the sending unit of the first node is also used to send a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used; the receiving unit of the third node is also used to receive the second confirmation message.
在第四方面的一种可能的实现方式中,该第一地址和该第二地址均为NewIP地址。In a possible implementation manner of the fourth aspect, both the first address and the second address are NewIP addresses.
在第四方面的一种可能的实现方式中,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为动态主机配置协议DHCP报文。In a possible implementation manner of the fourth aspect, the first discovery message, the first offer message, the second discovery message, and the second offer message are all Dynamic Host Configuration Protocol DHCP messages.
在第四方面的一种可能的实现方式中,在该第一地址中,该第一字段位于该第二字段之前;和/或,在该第二地址中,该第三字段位于该第四字段之前。In a possible implementation manner of the fourth aspect, in the first address, the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
在第四方面的一种可能的实现方式中,该通信系统应用于树形网络,该第二节点为该树形网络的根节点或该树形网络的中间节点。In a possible implementation manner of the fourth aspect, the communication system is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
在第四方面的一种可能的实现方式中,该通信系统应用于树形网络,该第三节点为该树形网络的叶子节点或该树形网络的中间节点。In a possible implementation manner of the fourth aspect, the communication system is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
本申请实施例第四方面中,通信装置的组成模块还可以用于执行第二方面的各个可能实现方式中所执行的步骤,并实现相应的技术效果,具体均可以参阅第二方面,此处不再赘述。In the fourth aspect of the embodiment of the present application, the components of the communication device can also be used to execute the steps executed in each possible implementation manner of the second aspect, and achieve corresponding technical effects. For details, please refer to the second aspect, and details will not be repeated here.
本申请实施例第五方面提供了一种通信装置,包括至少一个处理器,该至少一个处理器与存储器耦合;A fifth aspect of the embodiment of the present application provides a communication device, including at least one processor, and the at least one processor is coupled to a memory;
该存储器用于存储程序或指令;The memory is used to store programs or instructions;
该至少一个处理器用于执行该程序或指令,以使该装置实现前述第一方面或第一方面任意一种可能的实现方式所述的方法。The at least one processor is configured to execute the program or instruction, so that the device implements the method described in the foregoing first aspect or any possible implementation manner of the first aspect.
本申请实施例第六方面提供了一种通信装置,包括至少一个处理器,该至少一个处理器与存储器耦合;The sixth aspect of the embodiment of the present application provides a communication device, including at least one processor, and the at least one processor is coupled to a memory;
该存储器用于存储程序或指令;The memory is used to store programs or instructions;
该至少一个处理器用于执行该程序或指令,以使该装置实现前述第二方面或第二方面中通信系统内任一节点(包括第一节点、第二节点、第三节点、第四节点或其它节点等)对应的任意一种可能的实现方式所述的方法。The at least one processor is used to execute the program or instructions, so that the device implements the method described in the second aspect or any possible implementation manner corresponding to any node (including the first node, the second node, the third node, the fourth node, or other nodes, etc.) in the communication system in the second aspect.
本申请实施例第七方面提供一种计算机可读存储介质,该存储介质用于存储一个或多个计算机执行指令,当计算机执行指令被处理器执行时,该处理器执行如上述第一方面或第一方面任意一种可能的实现方式所述的方法。The seventh aspect of the embodiments of the present application provides a computer-readable storage medium, where the storage medium is used to store one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the method described in the above-mentioned first aspect or any possible implementation manner of the first aspect.
本申请实施例第八方面提供一种计算机可读存储介质,该存储介质用于存储多份计算机执行指令,该多份计算机执行指令分别对应于前述第二方面或第二方面中通信系统所包含的节点(包括第一节点、第二节点、第三节点、第四节点或其它节点等),当该多份计算机执行指令被处理器执行时,该处理器执行如上述第二方面或第二方面任意一种可能的实现方式所述的方法。The eighth aspect of the embodiment of the present application provides a computer-readable storage medium. The storage medium is used to store multiple computer-executable instructions. The multiple computer-executable instructions correspond to the nodes (including the first node, the second node, the third node, the fourth node, and other nodes, etc.) included in the communication system in the second aspect or the second aspect.
本申请实施例第九方面提供一种计算机程序产品(或称计算机程序),当计算机程序产品被处理器执行时,该处理器执行上述第一方面或第一方面任意一种可能实现方式的方法。A ninth aspect of the embodiments of the present application provides a computer program product (or called a computer program). When the computer program product is executed by a processor, the processor executes the method of the above-mentioned first aspect or any possible implementation manner of the first aspect.
本申请实施例第十方面提供一种计算机程序产品(或称计算机程序),当计算机程序产品被处理器执行时,该处理器执行上述第二方面或第二方面任意一种可能实现方式的方法。The tenth aspect of the embodiments of the present application provides a computer program product (or called a computer program). When the computer program product is executed by a processor, the processor executes the method of the above-mentioned second aspect or any possible implementation manner of the second aspect.
本申请实施例第十一方面提供了一种芯片,该芯片包括至少一个处理器,用于支持第一节点实现上述第一方面或第一方面任意一种可能的实现方式中所涉及的功能。在一种可能的设计中,该芯片系统还可以包括存储器,存储器,用于保存该通信装置必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。可选的,该芯片系统 还包括接口电路,该接口电路为该至少一个处理器提供程序指令和/或数据。The eleventh aspect of the embodiments of the present application provides a chip, where the chip includes at least one processor, configured to support the first node to implement the functions involved in the first aspect or any possible implementation manner of the first aspect. In a possible design, the system-on-a-chip may further include a memory, and the memory is used for storing necessary program instructions and data of the communication device. The system-on-a-chip may consist of chips, or may include chips and other discrete devices. Optionally, the chip system further includes an interface circuit, and the interface circuit provides program instructions and/or data for the at least one processor.
本申请实施例第十二方面提供了一种芯片,该芯片包括至少一个处理器,用于支持通信系统中的节点(包括第一节点、第二节点、第三节点、第四节点或其它节点等)实现上述第二方面或第二方面任意一种可能的实现方式中所涉及的功能。在一种可能的设计中,该芯片系统还可以包括存储器,存储器,用于保存该通信装置必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包含芯片和其他分立器件。可选的,该芯片系统还包括接口电路,该接口电路为该至少一个处理器提供程序指令和/或数据。The twelfth aspect of the embodiment of the present application provides a chip, the chip includes at least one processor, configured to support nodes in the communication system (including the first node, the second node, the third node, the fourth node, or other nodes, etc.) to implement the functions involved in the second aspect or any possible implementation of the second aspect. In a possible design, the system-on-a-chip may further include a memory, and the memory is used for storing necessary program instructions and data of the communication device. The system-on-a-chip may consist of chips, or may include chips and other discrete devices. Optionally, the chip system further includes an interface circuit, and the interface circuit provides program instructions and/or data for the at least one processor.
本申请实施例第十三方面提供了一种通信系统,该通信系统包括上述第三方面及其任一可能实现方式中的通信装置,和/或,该通信系统包括上述第四方面及其任一可能实现方式中的多个通信装置,和/或,该通信系统包括上述第五方面及其任一可能实现方式中的通信装置,和/或,该通信系统包括上述第六方面及其任一可能实现方式中的节点(包括第一节点、第二节点、第三节点,以及可能存在的第四节点或其它节点等)。The thirteenth aspect of the embodiment of the present application provides a communication system, the communication system includes the communication device in the above third aspect and any possible implementation thereof, and/or, the communication system includes multiple communication devices in the fourth aspect and any possible implementation thereof, and/or, the communication system includes the communication device in the fifth aspect and any possible implementation thereof, and/or, the communication system includes the nodes (including the first node, the second node, the third node, and a possible fourth node or other nodes, etc.) in the sixth aspect and any possible implementation thereof.
其中,第三方面至第十三方面中任一种设计方式所带来的技术效果可参见上述第一方面或第二方面中不同实现方式所带来的技术效果,在此不再赘述。Wherein, the technical effects brought about by any one of the design methods from the third aspect to the thirteenth aspect can refer to the technical effects brought about by the different implementation methods in the above-mentioned first aspect or the second aspect, and will not be repeated here.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings that are required in the description of the embodiments or prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other accompanying drawings can also be obtained according to these drawings without paying creative labor.
图1为本申请应用场景的一个示意图;Fig. 1 is a schematic diagram of the application scenario of the present application;
图2为本申请应用场景的另一个示意图;Fig. 2 is another schematic diagram of the application scenario of the present application;
图3为本申请应用场景的另一个示意图;Fig. 3 is another schematic diagram of the application scenario of the present application;
图4为本申请提供的通信方法的一个示意图;Fig. 4 is a schematic diagram of the communication method provided by the present application;
图5为本申请提供的通信方法的另一个示意图;FIG. 5 is another schematic diagram of the communication method provided by the present application;
图6a为本申请应用场景的另一个示意图;Fig. 6a is another schematic diagram of the application scenario of the present application;
图6b为本申请应用场景的另一个示意图;Fig. 6b is another schematic diagram of the application scenario of the present application;
图6c为本申请提供的通信方法的另一个示意图;FIG. 6c is another schematic diagram of the communication method provided by the present application;
图6d为本申请提供的通信方法的另一个示意图;Fig. 6d is another schematic diagram of the communication method provided by the present application;
图6e为本申请提供的通信方法的另一个示意图;FIG. 6e is another schematic diagram of the communication method provided by the present application;
图7a为本申请应用场景的另一个示意图;Fig. 7a is another schematic diagram of the application scenario of the present application;
图7b为本申请应用场景的另一个示意图;Fig. 7b is another schematic diagram of the application scenario of the present application;
图7c为本申请应用场景的另一个示意图;Fig. 7c is another schematic diagram of the application scenario of the present application;
图8为本申请提供的通信方法的另一个示意图;FIG. 8 is another schematic diagram of the communication method provided by the present application;
图9a为本申请应用场景的另一个示意图;Fig. 9a is another schematic diagram of the application scenario of the present application;
图9b为本申请应用场景的另一个示意图;Fig. 9b is another schematic diagram of the application scenario of the present application;
图9c为本申请应用场景的另一个示意图;Fig. 9c is another schematic diagram of the application scenario of the present application;
图9d为本申请应用场景的另一个示意图;Fig. 9d is another schematic diagram of the application scenario of the present application;
图10为本申请提供的通信装置的一个示意图;FIG. 10 is a schematic diagram of a communication device provided by the present application;
图11为本申请提供的通信系统的一个示意图;Fig. 11 is a schematic diagram of the communication system provided by the present application;
图12为本申请提供的通信装置的另一个示意图。Fig. 12 is another schematic diagram of the communication device provided by the present application.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行描述。The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
本申请实施例中的术语“系统”和“网络”可被互换使用。“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A、同时存在A和B、单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如“A,B和C中的至少一个”包括A,B,C,AB,AC,BC或ABC。以及,除非有特别说明,本申请实施例提及“第一”、“第二”等序数词是用于对多个对象进行区分,不用于限定多个对象的顺序、时序、优先级或者重要程度。The terms "system" and "network" in the embodiments of the present application may be used interchangeably. "At least one" means one or more, and "plurality" means two or more. "And/or" describes the association relationship of the associated objects, indicating that there may be three types of relationships, for example, A and/or B, which may indicate: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example "at least one of A, B and C" includes A, B, C, AB, AC, BC or ABC. And, unless otherwise specified, ordinal numerals such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects.
需要说明的是,本申请中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that, in this application, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations. Any embodiment or design described herein as "exemplary" or "for example" is not to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.
参见图1,为本申请实施例提供的通信系统的架构示意图。如图1所示,该系统包括多个网络设备,例如网络设备101、网络设备102、网络设备103、网络设备104和网络设备105,以及可能存在的其他网络设备。在图1所示通信系统中,靠近终端设备的网络设备可以称为用户边缘(customer edge,CE)设备,该CE设备可以是路由器、交换机或其他转发设备。Referring to FIG. 1 , it is a schematic structural diagram of a communication system provided by an embodiment of the present application. As shown in FIG. 1 , the system includes multiple network devices, such as network device 101 , network device 102 , network device 103 , network device 104 and network device 105 , and possibly other network devices. In the communication system shown in FIG. 1, a network device close to a terminal device may be called a customer edge (customer edge, CE) device, and the CE device may be a router, a switch or other forwarding devices.
示例性的,以图1最左侧的网络设备101和最右侧的网络设备102分别连接终端设备1和终端设备2为例,网络设备101和网络设备102作为CE设备。其中,终端设备1与终端设备2进行通信的过程中,需要分别经过网络设备101至网络设备105的转发。例如,终端设备1向网络设备2所发送的报文需要分别经过网络设备101、网络设备103、网络设备105、网络设备104和网络设备102的转发;又如,终端设备2向终端设备1所发送的报文需要分别经过网络设备102、网络设备104、网络设备105、网络设备103和网络设备101的转发。换言之,终端设备可以通过CE设备加入网络。Exemplarily, taking the network device 101 on the leftmost side and the network device 102 on the rightmost side in FIG. 1 connecting terminal device 1 and terminal device 2 respectively as an example, network device 101 and network device 102 serve as CE devices. Wherein, during the communication process between the terminal device 1 and the terminal device 2, forwarding through the network device 101 to the network device 105 is required respectively. For example, the message sent by the terminal device 1 to the network device 2 needs to be forwarded by the network device 101, the network device 103, the network device 105, the network device 104, and the network device 102 respectively; In other words, the terminal device can join the network through the CE device.
需要说明的是,终端设备与CE设备之间可以是直连的方式,也可以通过其它设备中转的方式实现,例如该其他设备可以包括接入点(access point,AP)、基站等,此处不做具体的限定。It should be noted that the connection between the terminal device and the CE device may be in a direct connection mode, or may be implemented in a transfer mode through other devices. For example, the other devices may include an access point (access point, AP), a base station, etc., which are not specifically limited here.
应理解,终端设备,又可以称为用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)、终端等,是一种向用户提供语音和/或数据连通性的设备,或,设置于该设备内的芯片,例如,具有无线连接功能的手持式设备、车载设备等。目前,一些终端设备的举例为:手机、台式电脑、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(mobile internet device,MID)、可穿戴设备,虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial  control)中的无线终端、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端、支持5G加入的家庭网关设备(5G-residential gateway,5G-RG)等。It should be understood that a terminal device, which may also be referred to as a user equipment (UE), a mobile station (MS), a mobile terminal (MT), or a terminal, is a device that provides voice and/or data connectivity to a user, or a chip disposed in the device, for example, a handheld device with a wireless connection function, a vehicle-mounted device, and the like. At present, examples of some terminal devices are: mobile phones, desktop computers, tablet computers, notebook computers, PDAs, mobile internet devices (mobile internet device, MID), wearable devices, virtual reality (virtual reality, VR) devices, augmented reality (augmented reality, AR) devices, wireless terminals in industrial control, wireless terminals in self driving, remote medical Wireless terminals in surgery, wireless terminals in smart grid, wireless terminals in transportation safety, wireless terminals in smart city, wireless terminals in smart home, and home gateway devices (5G-residential gateway, 5G-RG) that support 5G access, etc.
可选的,在图1中,网络设备103、网络设备104和网络设备105是路由器(router)、交换机(switch)、(具备转发能力的)虚拟机等设备。Optionally, in FIG. 1 , the network device 103 , the network device 104 and the network device 105 are routers (routers), switches (switches), virtual machines (capable of forwarding) and other devices.
需要说明的是,当网络设备1和网络设备2作为CE设备的情况下,图1所示CE设备与转发网络中的网络设备(例如CE设备101与网络设备103,或者,CE设备102与网络设备104)之间的连接可以为有线连接/无线连接,且该连接还可以通过其它设备进行中转。例如,该其它设备可以包括无线加入网(radio access network,RAN)节点(或设备),又可以称为基站。目前,一些RAN设备的举例为:5G通信系统中的新一代基站(generation Node B,gNodeB)、传输接收点(transmission reception point,TRP)、演进型节点B(evolved Node B,eNB)、无线网络控制器(radio network controller,RNC)、节点B(Node B,NB)、基站控制器(base station controller,BSC)、基站收发台(base transceiver station,BTS)、家庭基站(例如,home evolved Node B,或home Node B,HNB)、基带单元(base band unit,BBU),或无线保真(wireless fidelity,Wi-Fi)接入点(access point,AP)等。It should be noted that, when network device 1 and network device 2 are used as CE devices, the connection between the CE device shown in FIG. 1 and the network device in the forwarding network (for example, CE device 101 and network device 103, or CE device 102 and network device 104) can be a wired connection/wireless connection, and the connection can also be transferred through other devices. For example, the other device may include a radio access network (radio access network, RAN) node (or device), which may also be called a base station. Currently, some examples of RAN equipment are: generation Node B (gNodeB), transmission reception point (TRP), evolved Node B (evolved Node B, eNB), radio network controller (radio network controller, RNC), node B (Node B, NB), base station controller (base station controller, BSC), base transceiver station in the 5G communication system. (base transceiver station, BTS), home base station (for example, home evolved Node B, or home Node B, HNB), base band unit (base band unit, BBU), or wireless fidelity (wireless fidelity, Wi-Fi) access point (access point, AP), etc.
示例性地,在图1所述系统中,连接于用户边缘设备的网络设备为运营商边缘(provider edge,PE)设备。PE设备用于传输用户边缘设备101和用户边缘设备102之间的消息。例如,在图1中,网络设备103和网络设备104均为PE设备,用户边缘设备101与运营商边缘设备103连接,用户边缘设备102与运营商边缘设备104连接。而其他网络设备包括运营商(provider,P)设备,例如网络设备105。其中,运营商边缘设备103和运营商边缘设备104通过一个或多个运营商(provider,P)设备105连接。Exemplarily, in the system shown in FIG. 1 , the network device connected to the user edge device is a provider edge (provider edge, PE) device. The PE device is used to transmit messages between the user edge device 101 and the user edge device 102 . For example, in FIG. 1 , both the network device 103 and the network device 104 are PE devices, the user edge device 101 is connected to the operator edge device 103 , and the user edge device 102 is connected to the operator edge device 104 . Other network devices include operator (provider, P) devices, such as the network device 105 . Wherein, the provider edge device 103 and the provider edge device 104 are connected through one or more provider (provider, P) devices 105 .
图1所示通信系统中,不同的节点(例如一个或多个网络设备、一个或多个终端设备等)之间所组成的网络拓扑结构可以由多种方式,本申请主要应用于树型的网络拓扑结构。其中,层次化地址,是在树型的网络拓扑场景中使用的一种编址方式,能够减少设备转发表项数量、提升业务收敛性能。In the communication system shown in FIG. 1 , the network topology formed between different nodes (such as one or more network devices, one or more terminal devices, etc.) can be formed in various ways, and this application is mainly applied to a tree-type network topology. Among them, the hierarchical address is an addressing method used in the tree-type network topology scenario, which can reduce the number of device forwarding entries and improve service convergence performance.
需要说明的是,在本申请中,层次化地址为新互联网协议(NewIP)的特性之一,层次化地址也可以称为可变地址、变长IP地址体系下的IP地址、长度可变的地址、灵活的(flexible)地址、flexible IP地址或者其它的名称,此处不做限定。It should be noted that, in this application, the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP), and the hierarchical address can also be called a variable address, an IP address under the variable-length IP address system, a variable-length address, a flexible (flexible) address, a flexible IP address or other names, which are not limited here.
目前,在树型的网络拓扑场景中,包含有两类设备,一类设备是存在下级节点的设备,在实际网络场景中,这一类设备通常为网络设备;另一类是不存在下级节点的设备,在实际网络场景中,这一类设备通常为终端设备。At present, in the tree-type network topology scenario, there are two types of devices. One type of device is a device with lower-level nodes. In actual network scenarios, this type of device is usually a network device; the other type of device does not have a lower-level node. In actual network scenarios, this type of device is usually a terminal device.
示例性的,以图2所示包含有4层设备的网络拓扑场景为例。其中,图2所示网络拓扑场景可以为图1所示通信系统的一部分。例如,图1中网络设备103可以记为图2中的网络设备A,图1中网络设备101可以记为图2中的网络设备B,图1中网络设备101所接入的终端设备1可以记为图2中的终端设备A。此外,图1中网络设备101还可以接入其它的网络设备的情况下,该其它的网络设备还可以进一步接入其它的终端设备,其中,该其它的网络 设备中可以记为图2中的网络设备C,且接入该其它的网络设备的终端设备可以记为图2中的终端设备B。如图2所示,第1层包括网络设备A,第2层包括网络设备B,第三层包括网络设备C以及终端A,第四层包括终端B。并且,网络设备(包括网络设备A、网络设备B和网络设备C等)的地址由手工配置生成。As an example, take the network topology scenario including layer 4 devices shown in FIG. 2 as an example. Wherein, the network topology scenario shown in FIG. 2 may be a part of the communication system shown in FIG. 1 . For example, network device 103 in FIG. 1 can be marked as network device A in FIG. 2 , network device 101 in FIG. 1 can be marked as network device B in FIG. 2 , and terminal device 1 connected to network device 101 in FIG. 1 can be marked as terminal device A in FIG. 2 . In addition, in the case that the network device 101 in FIG. 1 can also access other network devices, the other network devices can further access other terminal devices, wherein the other network devices can be denoted as network device C in FIG. 2 , and the terminal device that accesses the other network devices can be denoted as terminal device B in FIG. 2 . As shown in FIG. 2 , the first layer includes network device A, the second layer includes network device B, the third layer includes network device C and terminal A, and the fourth layer includes terminal B. Moreover, addresses of network devices (including network device A, network device B, and network device C, etc.) are generated by manual configuration.
此外,在图2所示属性网络拓扑场景中,除第一层设备中的网络设备A(由于网络设备A不具备上级节点,因此网络设备A也可以称为根节点)外,每个节点仅有一个直连上级节点(或称为父节点)。并且,层次化地址是指除了根节点之外,每个节点的节点地址包含有上层节点的地址;即每个节点的节点地址可以包括两个部分,一个部分为该节点的父节点的地址(或称为前缀地址),另一个部分为该节点的标识(identifier,ID)。换言之,除了根节点之外,其它节点的节点地址构成可以表示为“前缀地址+ID”。此外,每个节点的地址可以称为该节点的自身地址,又可以称为locator地址等,为便于描述,后文将该节点的地址记为locator地址为例进行说明。In addition, in the attribute network topology scenario shown in Figure 2, except for network device A in the first layer of devices (since network device A does not have a parent node, network device A can also be called the root node), each node has only one directly connected parent node (or parent node). Moreover, the hierarchical address means that in addition to the root node, the node address of each node includes the address of the upper node; that is, the node address of each node can include two parts, one part is the address (or prefix address) of the node's parent node, and the other part is the identifier (identifier, ID) of the node. In other words, except for the root node, the node address composition of other nodes can be expressed as "prefix address+ID". In addition, the address of each node may be called the node's own address or the locator address. For the convenience of description, the address of the node will be recorded as the locator address as an example for illustration.
例如,对于网络设备B而言,表示该网络设备B的locator地址可以记为“1/2”,其中,“1/2”中的“1”为父节点(即网络设备A)的地址,“1/2”中的“2”为网络设备B的ID。又如,对于终端A而言,表示该终端设备A的locator地址可以记为“1/2/2”,其中,“1/2/2”中的“1/2”为父节点(即网络设备B)的地址,“1/2/2”中的最后一位“2”为该终端设备A的ID。For example, for network device B, the locator address representing the network device B can be recorded as "1/2", wherein "1" in "1/2" is the address of the parent node (i.e. network device A), and "2" in "1/2" is the ID of network device B. As another example, for terminal A, it means that the locator address of the terminal device A can be recorded as "1/2/2", wherein "1/2" in "1/2/2" is the address of the parent node (i.e. network device B), and the last digit "2" in "1/2/2" is the ID of the terminal device A.
进一步地,在当前层次化地址的实现过程中,对于网络设备而言,其层次化地址需要手工配置,下面将以图3所示示例进一步说明。Furthermore, in the implementation process of the current hierarchical address, for the network device, its hierarchical address needs to be manually configured, which will be further described below with an example shown in FIG. 3 .
如图3所示,图2中的网络设备A可以为图3中的汇聚交换机(switch,SW),且所包含的千兆以太网(Gigabit Ethernet,ge)接口记为ge0;图2中网络设备B可以为图3中的接入SW,且所包含的北向ge接口记为ge1,所包含的南向ge接口记为ge2和ge3;图2中的网络设备C可以为图3中的接入点(access point,AP)。在图3所示网络拓扑场景中,所有网络设备的层次化地址均为手工配置。此外,作为终端设备(例如终端A和终端B),该终端设备的地址可以由接入的网络设备(例如接入SW或AP)动态分配。As shown in Figure 3, the network device A in Figure 2 can be the convergence switch (switch, SW) in Figure 3, and the included Gigabit Ethernet (Gigabit Ethernet, ge) interface is marked as ge0; The network device B in Figure 2 can be the access SW in Figure 3, and the included northward ge interface is marked as ge1, and the included southward ge interfaces are marked as ge2 and ge3; Network device C in Figure 2 can be an access point (access point, AP) in Figure 3. In the network topology scenario shown in Figure 3, the hierarchical addresses of all network devices are manually configured. In addition, as a terminal device (for example, terminal A and terminal B), the address of the terminal device can be dynamically assigned by an access network device (for example, access SW or AP).
应理解,图2和图3所示网络拓扑场景仅仅为一个实现示例,在实际应用中,以图2为例,图2所示网络设备A还可以接入其它的上级节点,或者,图2所示网络设备A还可以接入不同于网络设备B的其他下级节点,或者,图2所示网络设备B还可以接入不同于网络设备C和终端A的其他下级节点等,此处不做限定。It should be understood that the network topology scenarios shown in FIG. 2 and FIG. 3 are only an implementation example. In practical applications, taking FIG. 2 as an example, the network device A shown in FIG. 2 can also access other upper-level nodes, or the network device A shown in FIG. 2 can also access other lower-level nodes different from network device B, or the network device B shown in FIG.
然而,在上述实现方式中,需要耗费人力进行手工配置。特别的,当网络拓扑发生改变时,例如新增设备或移除设备的情况下,由于设备修改配置工作量大,手工配置的方式也有可能出现配置出错而导致网络瘫痪的情况出现。However, in the above-mentioned implementation manner, manual configuration needs to be laborious. In particular, when the network topology changes, such as adding or removing devices, due to the large workload of device modification and configuration, manual configuration may also cause configuration errors and cause network paralysis.
为此,如何优化树型的网络拓扑场景中的地址分配方式,是一个亟待解决的技术问题。Therefore, how to optimize the address allocation method in the tree-type network topology scene is a technical problem to be solved urgently.
为了解决上述问题,本申请提供了一种通信方法及通信装置,用于在树型的网络拓扑场景中通过上下级节点之间的交互实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。下面将结合附图,对本申请提供的方案进行详细的介绍。In order to solve the above problems, the present application provides a communication method and a communication device, which are used to realize the automatic allocation of hierarchical addresses through the interaction between the upper and lower nodes in the tree-type network topology scene, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network. The solutions provided by the present application will be described in detail below with reference to the accompanying drawings.
请参阅图4,为本申请实施例提供的通信方法100的一个示意图,该方法包括如下步骤。Please refer to FIG. 4 , which is a schematic diagram of a communication method 100 provided by an embodiment of the present application. The method includes the following steps.
示例性的,图4所示通信方法100可以应用于前述图2和图3所示网络拓扑场景中。在该通信方法100中,第一节点可以为网络拓扑中既具备上级节点也具备下级节点的节点,例如图2中的网络设备B或网络设备C,又如图3中的接入SW或AP;第二节点可以为网络拓扑中的根节点或中间节点,例如图2中的网络设备A、网络设备B或网络设备C,又如图3中的汇聚SW、接入SW或AP;第三节点可以为网络拓扑中的叶子节点或中间节点,例如图2中的网络设备B、网络设备C、终端A或终端B,又如图3中的接入SW、AP、终端A或终端B。Exemplarily, the communication method 100 shown in FIG. 4 may be applied to the aforementioned network topology scenarios shown in FIG. 2 and FIG. 3 . In this communication method 100, the first node can be a node that has both upper-level nodes and lower-level nodes in the network topology, such as network device B or network device C in FIG. 2 , and access SW or AP in FIG. C. Terminal A or terminal B, and access SW, AP, terminal A or terminal B as shown in FIG. 3 .
S101.第一节点发送第一发现报文。S101. The first node sends a first discovery packet.
本实施例中,第一节点在步骤S101中发送第一发现报文,相应的,第二节点在步骤S101中接收第一发现报文。其中,该第一发现报文用于请求分配地址。In this embodiment, the first node sends a first discovery message in step S101, and correspondingly, the second node receives the first discovery message in step S101. Wherein, the first discovery message is used to request address allocation.
需要说明的是,本申请实施例中所涉及的发现报文(如步骤S101中的第一发现报文,以及后文的第二发现报文,第三发现报文,第四发现报文等)用于请求分配地址,即该发现报文为该发现报文的发送端不具备地址的情况下所发送的报文。为此,该发送端可以以泛洪的方式发送该发现报文,以期该发现报文能被多个接收端接收并获得该发现报文的响应(即提供报文)。It should be noted that the discovery messages involved in the embodiments of the present application (such as the first discovery message in step S101, and the second discovery message, the third discovery message, the fourth discovery message, etc. below) are used to request address allocation, that is, the discovery message is a message sent when the sender of the discovery message does not have an address. For this reason, the sender may send the discovery message in a flooding manner, hoping that the discovery message can be received by multiple receivers and obtain responses to the discovery message (that is, provide a message).
作为一种实现示例,以图4所示通信方法100应用于图2所示网络拓扑为例,第一节点可以为图2中的网络设备B,第二节点可以为图2中的网络设备A,第三节点可以为图2中的网络设备C。此时,在图2所示网络拓扑中,作为网络设备B的第一节点可以向所连接的所有节点以泛洪的方式发送该发现报文,即网络设备B在步骤S101中向网络设备A、网络设备C和终端A均发送该第一发现报文。As an implementation example, taking the application of the communication method 100 shown in FIG. 4 to the network topology shown in FIG. 2 as an example, the first node may be network device B in FIG. 2 , the second node may be network device A in FIG. 2 , and the third node may be network device C in FIG. 2 . At this time, in the network topology shown in FIG. 2, the first node as network device B can send the discovery message in a flooded manner to all connected nodes, that is, network device B sends the first discovery message to network device A, network device C and terminal A in step S101.
可选地,该发现报文的发送端存在向上级节点通信的接口(可称为北向接口)以及向下级节点通信的接口(可称为南向接口)的情况下,由于一般情况下仅有上级节点具备分配地址的能力,为此,该发现报文也可以为通过向上级节点通信的接口泛洪的方式发送,以节省开销。Optionally, when the sending end of the discovery message has an interface for communicating with the upper node (which may be called a northbound interface) and an interface for communicating with the lower node (which may be called a southbound interface), since generally only the upper node has the ability to allocate addresses, for this reason, the discovery message may also be sent by flooding the interface for communicating with the upper node to save overhead.
示例性的,在上述实现示例中,在图2所示网络拓扑中,作为网络设备B的第一节点可以向所连接的上级节点以选择性泛洪的方式发送该发现报文,即网络设备B在步骤S101中向网络设备A发送该第一发现报文,而不向网络设备C和终端A发送该第一发现报文。Exemplarily, in the above implementation example, in the network topology shown in FIG. 2, the first node as network device B may send the discovery message to the connected upper node in a selective flooding manner, that is, network device B sends the first discovery message to network device A in step S101, but does not send the first discovery message to network device C and terminal A.
可见,发现报文的发送端可以在不同的场景下灵活地选用上述发送方式。例如,在该发送端(由于未经过配置而)无法确定所连接的节点中哪些节点是上级节点的情况下,发送端可以采用全体泛洪的方式发送该发现报文。又如,在该发送端能够感知所连接的节点中哪些节点是上级节点的情况下,可以采用选择性泛洪的方式发送该发现报文,以节省开销。It can be seen that the sender of the discovery message can flexibly select the above sending method in different scenarios. For example, in the case that the sender (due to no configuration) cannot determine which nodes among the connected nodes are upper-level nodes, the sender may send the discovery message in a manner of collective flooding. For another example, when the sender can perceive which nodes among the connected nodes are upper-level nodes, the discovery message may be sent in a selective flooding manner to save overhead.
S102.第二节点发送第一提供报文。S102. The second node sends the first provision message.
本实施例中,第二节点在步骤S102中发送第一提供报文,相应的,第一节点在步骤S102中接收第一提供报文。其中,该第一提供报文包括该第二节点为该第一节点分配的第一地址;该第一地址包括第一字段和第二字段,该第一字段的取值为该第二节点的地址的取值且该第二节点为该第一节点的上级节点,该第二字段的取值为该第一节点的标识。In this embodiment, the second node sends the first provision message in step S102, and correspondingly, the first node receives the first provision message in step S102. Wherein, the first providing message includes the first address allocated by the second node to the first node; the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is the superior node of the first node, and the value of the second field is the identifier of the first node.
在一种可能的实现方式中,图4所示方法可以应用于树形网络,该第二节点为该树形网络的根节点或该树形网络的中间节点。具体地,作为第一节点的上级节点,该第二节点既可以为网络拓扑中的根节点(即仅具备下级节点不具备上级节点),第二节点也可以为网络拓扑 中的中间节点(即具备下级节点且具备上级节点),此处不做限定。In a possible implementation manner, the method shown in FIG. 4 may be applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network. Specifically, as the upper-level node of the first node, the second node can be the root node in the network topology (that is, it only has a lower-level node and does not have a higher-level node), and the second node can also be an intermediate node in the network topology (that is, it has a lower-level node and a higher-level node), which is not limited here.
S103.第三节点发送第二发现报文。S103. The third node sends a second discovery packet.
本实施例中,第三节点在步骤S103中发送第二发现报文,相应的,第一节点在步骤S103中接收第二发现报文。其中,该第二发现报文用于请求分配地址。In this embodiment, the third node sends the second discovery message in step S103, and correspondingly, the first node receives the second discovery message in step S103. Wherein, the second discovery message is used to request address allocation.
在一种可能的实现方式中,该第三节点为叶子节点或中间节点。具体地,作为第一节点的下级节点,该第三节点既可以为网络拓扑中的叶子节点(即仅具备上级节点不具备下级节点),第三节点也可以为网络拓扑中的中间节点(即具备下级节点且具备上级节点),此处不做限定。In a possible implementation manner, the third node is a leaf node or an intermediate node. Specifically, as a lower-level node of the first node, the third node can be a leaf node in the network topology (that is, it only has a higher-level node and does not have a lower-level node), and the third node can also be an intermediate node in the network topology (that is, it has a lower-level node and a higher-level node), which is not limited here.
S104.第一节点发送第二提供报文。S104. The first node sends the second offer message.
本实施例中,第一节点在步骤S104中发送第二提供报文,相应的,第三节点在步骤S104中接收第二提供报文。其中,该第二提供报文包括该第一节点为该第三节点分配的第二地址,该第二地址包括第三字段和第四字段,该第三字段的取值为该第一地址的取值,该第四字段的取值为该第三节点的标识且该第三节点为该第一节点的下级节点。In this embodiment, the first node sends the second provision message in step S104, and correspondingly, the third node receives the second provision message in step S104. Wherein, the second providing message includes the second address assigned by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, the value of the fourth field is the identifier of the third node and the third node is a subordinate node of the first node.
在一种可能的实现方式中,第二节点在步骤S102发送的第一提供报文所携带的第一地址中,该第一字段位于该第二字段之前;和/或,第一节点在步骤S104发送的第二提供报文所携带的第二地址中,该第三字段位于该第四字段之前。In a possible implementation manner, in the first address carried in the first provision message sent by the second node in step S102, the first field is located before the second field; and/or, in the second address carried in the second provision message sent by the first node in step S104, the third field is located before the fourth field.
具体地,在该第一地址中,取值为上级节点(即该第二节点)的地址的取值的第一字段可以位于取值为该第一节点的标识的第二字段之前,以便于基于该第一节点的第一地址明确第一节点的上级节点的地址以及第一节点所在网络的网络拓扑关系。类似地,在该第二地址中,取值为上级节点(即该第一节点)的地址的取值的第三字段可以位于取值为该第三节点的标识的第四字段之前,以便于基于该第三节点的第二地址明确第三节点的上级节点的地址以及第三节点所在网络的网络拓扑关系。Specifically, in the first address, the first field whose value is the address of the upper-level node (that is, the second node) may be located before the second field whose value is the identifier of the first node, so as to clarify based on the first address of the first node the address of the upper-level node of the first node and the network topology relationship of the network where the first node is located. Similarly, in the second address, the third field whose value is the address of the upper-level node (that is, the first node) may be located before the fourth field whose value is the identifier of the third node, so as to clarify the address of the upper-level node of the third node based on the second address of the third node and the network topology relationship of the network where the third node is located.
在一种可能的实现方式中,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为动态主机配置协议DHCP报文。具体地,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为DHCP报文,即该第一发现报文和该第二发现报文可以为DHCP中的动态主机配置协议发现(DHCP discover)报文,该第一提供报文和该第二提供报文可以为DHCP中的动态主机配置协议提供(DHCP offer)报文。使得该实现方式能够复用DHCP的报文处理机制实现层次化地址的自动分配。In a possible implementation manner, the first discovery message, the first offer message, the second discovery message and the second offer message are all dynamic host configuration protocol DHCP messages. Specifically, the first discovery message, the first offer message, the second discovery message and the second offer message are all DHCP messages, that is, the first discovery message and the second discovery message may be DHCP discover (DHCP discover) messages in DHCP, and the first offer message and the second offer message may be dynamic host configuration protocol (DHCP offer) messages in DHCP. This enables the realization method to multiplex the message processing mechanism of DHCP to realize the automatic allocation of hierarchical addresses.
可选地,本申请涉及的其他发现报文(例如后文提及的第三发现报文、第四发现报文、第五发现报文等)都可以为DHCP discover报文,本申请涉及的其他提供报文都可以为DHCP offer报文。类似地,本申请涉及的请求报文(例如后文提及的第一请求报文、第二请求报文等)也可以为DHCP中的动态主机配置协议请求(DHCP request)报文,本申请涉及的确认报文(例如后文提及的第一确认报文、第二确认报文等)也可以为DHCP中的动态主机配置协议确认(DHCP ACK)报文,本申请涉及的非确认报文(例如后文提及的第一非确认报文、第二非确认报文等)也可以为DHCP中的动态主机配置协议非确认(DHCP NAK)报文。Optionally, other discovery messages involved in the present application (such as the third discovery message mentioned later, the fourth discovery message, the fifth discovery message, etc.) can be DHCP discover messages, and other providing messages involved in the present application can be DHCP offer messages. Similarly, the request message involved in the present application (such as the first request message mentioned later, the second request message, etc.) can also be a Dynamic Host Configuration Protocol request (DHCP request) message in DHCP, and the confirmation message involved in this application (such as the first confirmation message mentioned in the following text, the second confirmation message, etc.) confirmation message, etc.) can also be the Dynamic Host Configuration Protocol Non-Acknowledgment (DHCP NAK) message in DHCP.
应理解,层次化地址为新互联网协议(NewIP)的特性之一,为此,上述技术方案也可以表述为通过对DHCP协议的扩展,以支持NewIP协议中层次化地址的自动分配。It should be understood that the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). Therefore, the above technical solution can also be described as extending the DHCP protocol to support the automatic allocation of the hierarchical address in the NewIP protocol.
基于图4所示技术方案,第一节点在步骤S102中接收的来自于第二节点的第一提供报文 包含有第一地址,该第一地址中第一字段的取值为第二节点的地址的取值且该第一地址中第二字段的取值为该第一节点的标识;并且,第一节点在步骤S104中向第三节点发送的第二提供报文包含有第二地址,该第二地址中第三字段的取值为该第一节点的地址的取值且该第二地址中第四字段的取值为第三节点的标识。其中,该第二节点为该第一节点的上级节点且该第三节点为该第一节点的下级节点,即第一节点既能够接收上级节点分配的层次化地址,也能够向下级节点分配层次化地址。换言之,在包含有第二节点、第一节点和第三节点的树型的网络拓扑场景中,第一节点既能作为终端设备接收上级节点的自动分配的层次化地址,也能够作为网络设备自动向下级节点分配层次化地址。从而,在树型的网络拓扑场景中通过上下级节点之间的交互实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。Based on the technical solution shown in Figure 4, the first node provided the first address from the first node in the steps S102 contains the first address. The value of the first field in the first address is the value of the address of the second node and the value of the second field in the first address is the logo of the first node; and the second node provides the second address of the second address in the third address of the third address in the step S104. The value of the address of the first node and the value of the fourth field in the second address is the identification of the third node. Wherein, the second node is a superior node of the first node and the third node is a subordinate node of the first node, that is, the first node can not only receive the hierarchical address assigned by the superior node, but also assign a hierarchical address to the subordinate node. In other words, in a tree-type network topology scenario including the second node, the first node, and the third node, the first node can serve as a terminal device to receive an automatically assigned hierarchical address from a superior node, and can also serve as a network device to automatically assign a hierarchical address to a subordinate node. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
应理解,层次化地址为新互联网协议(NewIP)的特性之一,为此,上述技术效果也可以表述为在树型的网络拓扑场景中通过上下级节点之间的交互实现NewIP协议中层次化地址的自动分配。It should be understood that the hierarchical address is one of the characteristics of the New Internet Protocol (NewIP). For this reason, the above-mentioned technical effect can also be expressed as the automatic allocation of the hierarchical address in the NewIP protocol through the interaction between the upper and lower nodes in the tree-type network topology scene.
需要说明的是,在本申请中,层次化地址也可以称为可变地址、长度可变的地址、灵活的(flexible)地址、flexible IP地址或者其它的名称,此处不做限定。It should be noted that, in this application, a hierarchical address may also be called a variable address, a variable-length address, a flexible (flexible) address, a flexible IP address or other names, which are not limited here.
作为一种实现示例,以图4所示通信方法100应用于图2所示网络拓扑为例,第一节点可以为图2中的网络设备B,第二节点可以为图2中的网络设备A,第三节点可以为图2中的网络设备C。此时,在图2所示网络拓扑中,作为网络设备B的第一节点在步骤S101中向网络设备A发送第一发现报文之后,该网络设备B在步骤S102中接收的来自于该网络设备A的第一提供报文包含有第一地址,该第一地址中第一字段的取值为该网络设备A的地址的取值且该第一地址中第二字段的取值为该该网络设备B的标识;并且,该网络设备B在步骤S104中向该网络设备C发送的第二提供报文包含有第二地址,该第二地址中第三字段的取值为该第一节点的地址的取值且该第二地址中第四字段的取值为该网络设备C的标识。其中,该该网络设备A为该该网络设备B的上级节点且该该网络设备C为该该网络设备B的下级节点,即该网络设备B既能够接收该网络设备A分配的层次化地址,也能够向该网络设备C分配层次化地址。换言之,在图2所示树型的网络拓扑场景中,该网络设备B既能作为终端设备接收该网络设备A的自动分配的层次化地址,也能够作为网络设备自动向该网络设备C分配层次化地址。从而,在树型的网络拓扑场景中通过上下级节点之间的交互实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。As an implementation example, taking the application of the communication method 100 shown in FIG. 4 to the network topology shown in FIG. 2 as an example, the first node may be network device B in FIG. 2 , the second node may be network device A in FIG. 2 , and the third node may be network device C in FIG. 2 . Now, in the network topology shown in FIG. 2, after the first node as network device B sends the first discovery message to network device A in step S101, the network device B receives in step S102 from the network device A. The first provision message contains a first address, the value of the first field in the first address is the value of the address of the network device A and the value of the second field in the first address is the identifier of the network device B; and, the network device B sends the second provision to the network device C in step S104 The message includes a second address, the value of the third field in the second address is the value of the address of the first node, and the value of the fourth field in the second address is the identifier of the network device C. Wherein, the network device A is the upper-level node of the network device B and the network device C is the lower-level node of the network device B, that is, the network device B can receive the hierarchical address assigned by the network device A, and can also assign a hierarchical address to the network device C. In other words, in the tree-type network topology scenario shown in FIG. 2 , the network device B can not only receive the automatically assigned hierarchical address of the network device A as a terminal device, but also can automatically assign a hierarchical address to the network device C as a network device. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
请参阅图5,为本申请实施例提供的通信方法200的一个示意图,该方法包括如下步骤。Please refer to FIG. 5 , which is a schematic diagram of a communication method 200 provided by an embodiment of the present application. The method includes the following steps.
S201.第一节点发送第一发现报文。S201. The first node sends a first discovery packet.
本实施例中,第一节点在步骤S201中发送第一发现报文,相应的,第二节点在步骤S201中接收第一发现报文。其中,该第一发现报文用于请求分配地址。In this embodiment, the first node sends a first discovery message in step S201, and correspondingly, the second node receives the first discovery message in step S201. Wherein, the first discovery message is used to request address allocation.
S202.第二节点发送第一提供报文。S202. The second node sends the first provision message.
本实施例中,第二节点在步骤S202中发送第一提供报文,相应的,第一节点在步骤S202中接收第一提供报文。其中,该第一提供报文包括该第二节点为该第一节点分配的第一地址;该第一地址包括第一字段和第二字段,该第一字段的取值为该第二节点的地址的取值且该第二节点为该第一节点的上级节点,该第二字段的取值为该第一节点的标识。In this embodiment, the second node sends the first provision message in step S202, and correspondingly, the first node receives the first provision message in step S202. Wherein, the first providing message includes the first address allocated by the second node to the first node; the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is the superior node of the first node, and the value of the second field is the identifier of the first node.
需要说明的是,步骤S201和步骤S202的实现过程可以参考步骤S101和步骤S102的实现过程,并实现相应的技术效果,此处不做限定。It should be noted that, the implementation process of step S201 and step S202 can refer to the implementation process of step S101 and step S102, and achieve corresponding technical effects, which are not limited here.
在一种可能的实现方式中,在图5所述实现过程中,在步骤S202之前,该方法还包括步骤S20A和步骤S20B:In a possible implementation, in the implementation process described in FIG. 5, before step S202, the method further includes step S20A and step S20B:
S20A.第三节点发送发现报文。S20A. The third node sends a discovery message.
S20B.第一节点发送非确认报文。S20B. The first node sends a non-confirmation message.
具体地,该第一节点在步骤S202中接收该第一提供报文之前,该第三节点还可以在步骤S20A中发送第四发现报文,该第四发现报文用于请求分配地址;该第一节点在S20A中接收该第四发现报文,该第一节点在步骤S20B中向该第三节点发送第一非确认报文,该第一非确认报文用于指示拒绝分配地址。在该实现过程中,在该第一节点接收来自该第二节点的该第一提供报文之前,即第一节点未收到上级节点分配的地址之前,该第一节点不具备向下级节点分配地址的能力(或称第一节点当前的层次化地址无效)。为此,该第一节点接收用于请求分配地址的第四发现报文之后,该第一节点发送用于指示拒绝分配地址的第一非确认报文,使得该第一非确认报文的接收方明确该第一节点当前不具备分配地址的能力。Specifically, before the first node receives the first provision message in step S202, the third node may also send a fourth discovery message in step S20A, where the fourth discovery message is used to request address allocation; the first node receives the fourth discovery message in S20A, and the first node sends a first non-confirmation message to the third node in step S20B, where the first non-confirmation message is used to indicate refusal to allocate an address. In this implementation process, before the first node receives the first providing message from the second node, that is, before the first node receives the address assigned by the upper-level node, the first node does not have the ability to assign addresses to lower-level nodes (or the current hierarchical address of the first node is invalid). For this reason, after the first node receives the fourth discovery message for requesting address allocation, the first node sends a first non-confirmation message for indicating refusal of address allocation, so that the receiver of the first non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
在一种可能的实现方式中,第一节点在步骤S202中接收第一提供报文之前,该第一节点还有可能接收来自该第三节点的第二非确认报文,该第二非确认报文用于指示拒绝分配地址。具体地,在该第一节点接收第一提供报文之前,即第一节点未收到上级节点分配的地址之前,第一节点并不明确自身的地址,相应的,第一节点的下级节点(例如第三节点)也不明确自身的地址。其中,第一节点所发送第一发现报文的数量可以为多个,某个第一发现报文被第三节点接收之后,由于该第三节点不具备分配地址的能力(或称第三节点当前的层次化地址无效),该第三节点会向该第一节点发送用于指示拒绝分配地址的第二非确认报文,使得第一节点基于该第二非确认报文明确第三节点当前不具备分配地址的能力。In a possible implementation manner, before the first node receives the first provision message in step S202, the first node may also receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address. Specifically, before the first node receives the first provision message, that is, before the first node receives the address assigned by the superior node, the first node does not know its own address, and correspondingly, the subordinate nodes (such as the third node) of the first node do not know its own address. Wherein, the number of the first discovery message sent by the first node may be multiple. After a certain first discovery message is received by the third node, because the third node does not have the ability to allocate addresses (or the current hierarchical address of the third node is invalid), the third node will send to the first node a second non-confirmation message for indicating refusal to allocate addresses, so that the first node determines based on the second non-confirmation message that the third node currently does not have the ability to allocate addresses.
S203.第一节点发送第一请求报文。S203. The first node sends a first request message.
本实施例中,第一节点在步骤S203中发送第一请求报文,相应的,第二节点在步骤S203中接收第一请求报文。其中,该第一请求报文用于请求使用该第一地址。In this embodiment, the first node sends the first request message in step S203, and correspondingly, the second node receives the first request message in step S203. Wherein, the first request message is used to request to use the first address.
S204.第二节点发送第一确认报文。S204. The second node sends a first confirmation message.
本实施例中,第二节点在步骤S204中发送第一确认报文,相应的,第一节点在步骤S204中接收第一确认报文。其中,该第一确认报文用于指示允许使用该第一地址。In this embodiment, the second node sends the first confirmation message in step S204, and correspondingly, the first node receives the first confirmation message in step S204. Wherein, the first confirmation message is used to indicate that the first address is allowed to be used.
具体地,在第一节点在步骤S203中接收第一提供报文之后,该第一节点还可以在步骤S203中向第二节点发送第一请求报文,该第一请求报文用于指示请求使用该第一地址;该第二节点在步骤S203中接收该第一请求报文,该第二节点在步骤S204中向该第一节点发送第一确认报文,该第一确认报文用于指示允许使用该第一地址;使得该第一节点在步骤S204中接收该第一确认报文。Specifically, after receiving the first message in the first node in the step S203, the first node can also send the first request message to the second node in the step S203. The first request message is used to indicate the request to use the first address; the second node receives the first request message in the step S203. The second node sends the first confirmation message to the first node in the step S204. Allow the first address; the first node receives the first confirmation message in step S204.
具体地,在该第一节点接收来自该第二节点的第一提供报文之后,该第一节点向该第二节点发送用于指示请求使用该第一地址的第一请求报文,并接收来自该第二节点的用于指示允许使用该第一地址的第一确认报文。使得第一节点基于该第一确认报文明确能够基于该第一地址分配地址的情况下,该第一节点向该第三节点发送包含有基于该第一地址所分配的第二地址的第二提供报文。Specifically, after the first node receives the first provision message from the second node, the first node sends to the second node a first request message indicating that the first address is requested to be used, and receives a first confirmation message from the second node indicating that the first address is allowed to be used. In the case that the first node can clearly allocate an address based on the first address based on the first confirmation message, the first node sends a second offer message including the second address allocated based on the first address to the third node.
此外,第二节点可能存在多个下级节点,而该多个下级节点都有可能向该第二节点发送用于请求分配地址的发现报文,而第二节点有可能不止将该第一地址分配给第一节点,还可能将该第一地址分配给其它下级节点。为此,第一节点可以通过该第一请求报文以及第一确认报文的交互,以明确该第二节点允许该第一节点使用该第一地址,即明确该第一节点之外的其他节点未被允许使用该第一地址,以避免地址分配冲突。In addition, the second node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the second node for requesting address allocation, and the second node may not only allocate the first address to the first node, but may also allocate the first address to other lower-level nodes. For this reason, the first node may clarify that the second node allows the first node to use the first address through the interaction of the first request message and the first confirmation message, that is, it is clear that other nodes other than the first node are not allowed to use the first address, so as to avoid address allocation conflicts.
作为一种实现示例,以图5所示通信方法200应用于图2所示网络拓扑为例,第一节点可以为图2中的网络设备B,第二节点可以为图2中的网络设备A,第三节点可以为图2中的网络设备C。由于网络设备A的下级节点包括作为第一节点的网络设备B之外,还可能包括其它的节点(例如终端C),使得网络设备A也可能将该第一地址分配给该终端C使用,为此,作为第一节点的网络设备B可以通过步骤S203和步骤S204的交互过程明确该网络设备A允许该网络设备B使用该第一地址,即明确该网络设备B之外的其他节点(例如终端C)未被允许使用该第一地址,以避免地址分配冲突。As an implementation example, taking the application of the communication method 200 shown in FIG. 5 to the network topology shown in FIG. 2 as an example, the first node may be network device B in FIG. 2 , the second node may be network device A in FIG. 2 , and the third node may be network device C in FIG. 2 . Since the lower-level nodes of network device A include network device B as the first node, it may also include other nodes (such as terminal C), so that network device A may also assign the first address to terminal C. Therefore, network device B as the first node can clarify that network device A allows network device B to use the first address through the interactive process of step S203 and step S204, that is, it is clear that other nodes other than network device B (such as terminal C) are not allowed to use the first address, so as to avoid address allocation conflicts.
在一种可能的实现方式中,在图5所述实现过程中,在步骤S204之前,该方法还包括步骤S20C和步骤S20D:In a possible implementation, in the implementation process described in FIG. 5, before step S204, the method further includes step S20C and step S20D:
S20C.第三节点发送发现报文。S20C. The third node sends a discovery message.
S20D.第一节点发送非确认报文。S20D. The first node sends a non-confirmation message.
具体地,第一节点在步骤S204中接收第一确认报文之前,该第三节点还可以在步骤S20C中发送第五发现报文,该第五发现报文用于请求分配地址;该第一节点在步骤S20C中接收该第五发现报文,该第一节点在步骤S20D中向该第三节点发送第三非确认报文,该第三非确认报文用于指示拒绝分配地址;该第三节点接收该第三非确认报文。在该实现过程中,在该第一节点接收来自该第二节点的该第一确认报文之前,由于第一节点并不明确第二节点是否允许该第一节点使用该第一地址,即第一节点并不明确第一节点是否能够基于该第一地址为下级节点分配地址。为此,该第一节点接收用于请求分配地址的第五发现报文之后,该第一节点发送用于指示拒绝分配地址的第三非确认报文,以使得该第三非确认报文的接收方明确该第一节点当前不具备分配地址的能力。Specifically, before the first node receives the first confirmation message in step S204, the third node may also send a fifth discovery message in step S20C, where the fifth discovery message is used to request address allocation; the first node receives the fifth discovery message in step S20C, and the first node sends a third non-confirmation message to the third node in step S20D, where the third non-confirmation message is used to indicate refusal to allocate an address; the third node receives the third non-confirmation message. In this implementation process, before the first node receives the first confirmation message from the second node, since the first node does not know whether the second node allows the first node to use the first address, that is, the first node does not know whether the first node can assign addresses to subordinate nodes based on the first address. For this reason, after the first node receives the fifth discovery message for requesting address allocation, the first node sends a third non-confirmation message for indicating refusal of address allocation, so that the recipient of the third non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
此外,在上述用于指示拒绝分配地址的非确认报文(包括步骤S20B中的非确认报文、步骤S20D中的非确认报文,以及后文可能出现的第三非确认报文、第四非确认报文和第五非确认报文等)为基于发现报文所反馈的报文。其中,发现报文的发送端所发送的发现报文可以是以泛洪(全体泛洪或选择性的泛洪)的方式发送的。为此,发现报文的接收端在多种情况下都有可能接收到该发现报文。其中,在该发现报文的接收端尚未接收到来自上级节点分配的地址(即该接收端不具备地址分配能力,或称该接收端的当前层次化地址无效)的情况下,在接收到发现报文之后,该接收端反馈的报文为用于指示拒绝分配地址的非确认报文;而在该发现报文的接收端确定已接收到来自上级节点分配的地址(即该接收端具备地址分配能力,或称该接收端的当前层次化地址有效)的情况下,在接收到发现报文之后,该接收端反馈的报文为用于分配地址的提供报文。从而,对于任一上级节点而言,该上级节点当前的层次化地址无效的情况下会基于接收到的发现报文反馈非确认报文,该上级节点当前的层次化地址有效的情况下会基于接收到的发现报文反馈提供报文,即该上级节点的层次化地址有效之后才会为下级节点分配地址以使得该下级节点的层次化地址有效。从而,基于该非确认报文和 提供报文的反馈,在树形网络中通过从上级节点到下级节点的按序分配地址的方式,实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。In addition, the above-mentioned non-confirmation message used to indicate refusal to allocate an address (including the non-confirmation message in step S20B, the non-confirmation message in step S20D, and the third non-confirmation message, fourth non-confirmation message, and fifth non-confirmation message that may appear later) are messages based on the feedback of the discovery message. Wherein, the discovery message sent by the sender of the discovery message may be sent in a manner of flooding (full flooding or selective flooding). For this reason, the receiving end of the discovery message may receive the discovery message in various situations. Wherein, in the case where the receiving end of the discovery message has not received the address assigned by the upper-level node (that is, the receiving end does not have the address allocation capability, or the current hierarchical address of the receiving end is invalid), after receiving the discovery message, the message fed back by the receiving end is a non-confirmation message for indicating that the address is rejected; After the discovery message, the message fed back by the receiving end is an offer message for address allocation. Therefore, for any upper-level node, if the current hierarchical address of the upper-level node is invalid, it will feed back a non-confirmation message based on the received discovery message. Therefore, based on the non-confirmation message and the feedback of the provided message, in the tree network, the automatic allocation of hierarchical addresses is realized by sequentially allocating addresses from upper-level nodes to lower-level nodes, so as to avoid network paralysis caused by manual configuration errors and improve network stability.
S205.第三节点发送第二发现报文。S205. The third node sends a second discovery packet.
本实施例中,第三节点在步骤S205中发送第二发现报文,相应的,第一节点在步骤S205中接收第二发现报文。其中,该第二发现报文用于请求分配地址。In this embodiment, the third node sends the second discovery message in step S205, and correspondingly, the first node receives the second discovery message in step S205. Wherein, the second discovery message is used to request address allocation.
S206.第一节点发送第二提供报文。S206. The first node sends the second offer message.
本实施例中,第一节点在步骤S206中发送第二提供报文,相应的,第三节点在步骤S206中接收第二提供报文。其中,该第二提供报文包括该第一节点为该第三节点分配的第二地址,该第二地址包括第三字段和第四字段,该第三字段的取值为该第一地址的取值,该第四字段的取值为该第三节点的标识且该第三节点为该第一节点的下级节点。In this embodiment, the first node sends the second provision message in step S206, and correspondingly, the third node receives the second provision message in step S206. Wherein, the second providing message includes the second address assigned by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, the value of the fourth field is the identifier of the third node and the third node is a subordinate node of the first node.
需要说明的是,步骤S205和步骤S206的实现过程可以参考步骤S103和步骤S104的实现过程,并实现相应的技术效果,此处不做限定。It should be noted that, the implementation process of step S205 and step S206 can refer to the implementation process of step S103 and step S104, and achieve corresponding technical effects, which are not limited here.
S207.第三节点发送第二请求报文。S207. The third node sends a second request message.
本实施例中,第三节点在步骤S207中发送第二请求报文,相应的,第一节点在步骤S207中接收第二请求报文。其中,该第二请求报文用于请求使用该第二地址。In this embodiment, the third node sends the second request message in step S207, and correspondingly, the first node receives the second request message in step S207. Wherein, the second request message is used to request to use the second address.
S208.第一节点发送第二确认报文。S208. The first node sends a second confirmation message.
本实施例中,第一节点在步骤S208中发送第二确认报文,相应的,第三节点在步骤S208中接收第二确认报文。其中,该第二确认报文用于指示允许使用该第二地址。In this embodiment, the first node sends the second confirmation message in step S208, and correspondingly, the third node receives the second confirmation message in step S208. Wherein, the second confirmation message is used to indicate that the second address is allowed to be used.
基于上述技术方案,第一节点在步骤S206中发送第二提供报文之后,该第三节点还可以在步骤S207中发送第二请求报文,该第二请求报文用于指示请求使用该第二地址;该第一节点在步骤S207中接收该第二请求报文,该第一节点在步骤S208中向该第三节点发送第二确认报文,该第二确认报文用于指示允许使用该第二地址;使得该第三节点在步骤S208中接收该第二确认报文,使得第三节点基于该第二确认报文能够明确该第二地址为允许使用的地址。Based on the above technical solution, after the first node sends the second provision message in step S206, the third node may also send a second request message in step S207, the second request message is used to indicate the request to use the second address; the first node receives the second request message in step S207, the first node sends a second confirmation message to the third node in step S208, the second confirmation message is used to indicate permission to use the second address; the third node receives the second confirmation message in step S208, so that the third node Based on the second confirmation message, the node can determine that the second address is an address allowed to be used.
此外,第一节点可能存在多个下级节点,而该多个下级节点都有可能向该第一节点发送用于请求分配地址的发现报文,而第一节点有可能不止将该第二地址分配给第三节点,还可能将该第二地址分配给其它下级节点。为此,第二节点可以通过该第二请求报文以及第二确认报文的交互,以明确该第一节点允许该第二节点使用该第二地址,即明确该第二节点之外的其他节点未被允许使用该第二地址,以避免地址分配冲突。In addition, the first node may have multiple lower-level nodes, and the multiple lower-level nodes may all send discovery messages to the first node to request address allocation, and the first node may not only allocate the second address to the third node, but may also allocate the second address to other lower-level nodes. For this reason, the second node can clarify that the first node allows the second node to use the second address through the interaction of the second request message and the second confirmation message, that is, it is clear that other nodes other than the second node are not allowed to use the second address, so as to avoid address allocation conflicts.
作为一种实现示例,以图5所示通信方法200应用于图2所示网络拓扑为例,第一节点可以为图2中的网络设备B,第二节点可以为图2中的网络设备A,第三节点可以为图2中的网络设备C。由于网络设备B的下级节点包括作为第三节点的网络设备C之外,还包括终端A,使得网络设备B也可能将该第二地址分配给该终端A使用,为此,作为第三节点的网络设备C可以通过步骤S207和步骤S208的交互过程明确该网络设备B允许该网络设备C使用该第二地址,即明确该网络设备C之外的其他节点(例如终端A)未被允许使用该第二地址,以避免地址分配冲突。As an implementation example, taking the application of the communication method 200 shown in FIG. 5 to the network topology shown in FIG. 2 as an example, the first node may be network device B in FIG. 2 , the second node may be network device A in FIG. 2 , and the third node may be network device C in FIG. 2 . Since the subordinate nodes of the network device B include not only the network device C as the third node, but also the terminal A, the network device B may also assign the second address to the terminal A. For this reason, the network device C as the third node can make it clear that the network device B allows the network device C to use the second address through the interactive process of steps S207 and S208, that is, it is clear that other nodes (such as terminal A) other than the network device C are not allowed to use the second address, so as to avoid address allocation conflicts.
应理解,该第三节点可以为树形网络拓扑场景中的中间节点,即该第三节点有可能还存在下级节点。类似于前述步骤S20A至步骤S20D的实现过程,在步骤S206或步骤S208之前, 第三节点也可能接收到来自第三节点的下级节点发送的“发现报文”,由于该第三节点尚未具备分配地址的能力(或称第三节点当前的层次化地址无效),该第三节点可以回复“非确认报文”用以指示该第三节点当前不具备分配地址的能力。此外,在步骤S206或步骤S208之后,即该第三节点获取该第二地址或第三节点确定第一节点允许该第三节点使用该第二地址的情况下,该第三节点若再次接收到下级节点的“发送报文”,则该第三节点可以基于该第二地址进一步为该第三节点的下级节点分配地址。类似的,第三节点所分配的地址可以包括两个字段,一个字段的取值为该第三节点的地址,另一个字段的取值为该第三节点的下级节点的ID。It should be understood that the third node may be an intermediate node in a tree network topology scenario, that is, the third node may also have subordinate nodes. Similar to the implementation process of the aforementioned steps S20A to S20D, before step S206 or step S208, the third node may also receive a "discovery message" sent from a subordinate node of the third node. Since the third node does not yet have the ability to allocate addresses (or the current hierarchical address of the third node is invalid), the third node may reply with a "non-confirmation message" to indicate that the third node currently does not have the ability to allocate addresses. In addition, after step S206 or step S208, that is, when the third node obtains the second address or the third node determines that the first node allows the third node to use the second address, if the third node receives the "send message" from the subordinate node again, the third node can further assign an address to the subordinate node of the third node based on the second address. Similarly, the address assigned by the third node may include two fields, one field is the address of the third node, and the other field is the ID of the subordinate node of the third node.
下面将结合更多的附图,对图4和图5所描述的实施例的实现过程进行示例性描述。The implementation process of the embodiment described in FIG. 4 and FIG. 5 will be described exemplarily below in conjunction with more drawings.
应理解,下述示例中,以不同节点之间基于DHCP相关报文实现为例进行说明,在实际应用中,还可以使用其它的报文,例如BOOTP、私有化的地址分配协议,或者其它协议。It should be understood that, in the following examples, the implementation of DHCP-related messages between different nodes is taken as an example for illustration. In practical applications, other messages, such as BOOTP, a private address allocation protocol, or other protocols may also be used.
前述图3所示不同节点的网络拓扑场景可以应用前述图4和图5所描述的实施例,实现过程可以如图6a所示。The network topology scenarios of different nodes shown in FIG. 3 above can be applied to the embodiments described in FIG. 4 and FIG. 5 , and the implementation process can be shown in FIG. 6 a .
在图6a中,网络设备A可以为汇聚交换机(switch,SW),且所包含的千兆以太网(Gigabit Ethernet,ge)接口记为ge0,并且,网络设备A可以作为述图4和图5所描述的实施例中的第二节点;网络设备B可以为接入SW,且所包含的北向ge接口记为ge1,所包含的南向ge接口记为ge2和ge3,并且,网络设备B可以作为述图4和图5所描述的实施例中的第一节点;网络设备C可以为接入点(access point,AP),并且网络设备C和终端A中的任意一个都可以作为述图4和图5所描述的实施例中的第三节点。In Fig. 6 a, network device A can be a convergence switch (switch, SW), and the included Gigabit Ethernet (Gigabit Ethernet, ge) interface is marked as ge0, and network device A can be used as the second node in the embodiment described in Fig. 4 and Fig. 5; The first node in; the network device C can be an access point (access point, AP), and any one of the network device C and the terminal A can be used as the third node in the embodiment described in FIG. 4 and FIG. 5 .
如图6a所示,除了网络设备A(即根节点)之外,各个节点均处于locator无效(invalid)的初始状态,各个节点可以通过通信接口向其它设备发送用于请求地址的dhcp dicover报文,即图4和图5所描述的实施例中发现报文(包括第一发现报文、第二发现报文等)的收发过程。在dhcp dicover报文发送之后,各个节点的实现过程如图6b所示。As shown in Figure 6a, except network device A (being the root node), each node is in the initial state of locator invalid (invalid), and each node can send a dhcp discover message for requesting an address to other devices through the communication interface, that is, the sending and receiving process of the discovery message (comprising the first discovery message, the second discovery message, etc.) in the embodiment described in Figures 4 and 5. After the dhcp discover message is sent, the implementation process of each node is shown in Figure 6b.
如图6b所示,由于网络设备A已预配置地址(记为“locator 1”),使得网络设备A具备分配地址的能力,使得该网络设备A接收到网络设备B的dhcp dicover报文,向网络设备B发送携带有网络设备B(被网络设备A分配)的地址(记为“1/2”)的dhcp offer报文,即图4和图5所描述的实施例中发现报文(包括第一提供报文等)的收发过程。As shown in Figure 6b, since the network device A has pre-configured the address (marked as "locator 1"), the network device A has the ability to allocate addresses, so that the network device A receives the dhcp discover message of the network device B, and sends to the network device B a dhcp offer message carrying the address (marked as "1/2") of the network device B (distributed by the network device A), that is, the sending and receiving process of discovering messages (including the first providing message, etc.) in the embodiments described in Fig. 4 and Fig. 5 .
而对于网络设备B而言,网络设备B在图6a所示过程中以泛洪的方式发送dhcp dicover报文之后,在网络设备B并未在图6b中接收到网络设备A分配的地址之前,在网络设备B接收来自下级节点(包括网络设备C和终端A)的dhcp dicover报文之后,则网络设备B会向下级节点(包括网络设备C和终端A)发送dhcp nak报文,用以指示下级节点当前该网络设备B并不具备分配地址的能力(或称网络设备B当前的层次化地址无效)。类似地,由于网络设备C并未接收到网络设备分配的地址,则网络设备C会向下级节点(包括终端B)发送dhcp nak报文,用以指示下级节点当前该网络设备C并不具备分配地址的能力(或称网络设备C当前的层次化地址无效)。即,图4和图5所描述的实施例中非确认报文(包括第一非确认报文、第二非确认报文等)的收发过程。For network device B, after network device B sends a dhcp discover message in a flooding manner in the process shown in Figure 6a, before network device B receives the address assigned by network device A in Figure 6b, after network device B receives a dhcp discover message from a lower-level node (including network device C and terminal A), then network device B will send a dhcp nak message to the lower-level node (including network device C and terminal A) to indicate that the lower-level node is currently the network device B It does not have the ability to assign addresses (or the current hierarchical address of network device B is invalid). Similarly, since the network device C has not received the address assigned by the network device, the network device C will send a dhcp nak message to the lower-level nodes (including the terminal B) to indicate that the lower-level node currently does not have the ability to assign addresses to the network device C (or the current hierarchical address of the network device C is invalid). That is, the sending and receiving process of non-confirmation messages (including the first non-confirmation message, the second non-confirmation message, etc.) in the embodiment described in FIG. 4 and FIG. 5 .
需要说明的是,网络设备A作为根节点,可以通过多种方式获取该预配置的地址,例如外接服务器的方式中接收服务器的指令以获取该预配置的地址,手工配置的方式获取该预配置的地址,或者其它的实现方式,此处不做限定。It should be noted that network device A, as the root node, can obtain the pre-configured address in a variety of ways, such as receiving instructions from the server to obtain the pre-configured address in the way of an external server, obtaining the pre-configured address by manual configuration, or other implementation methods, which are not limited here.
在一种可能的实现过程中,网络设备A(图6c和图6e中记为设备A)、网络设备B(图6c和图6e中记为设备B)、网络设备C(图6c和图6e中记为设备C)、终端A(图6c和图6e中记为终端a)的交互过程还可以参考图6c至图6e所示实现方式。In a possible implementation process, the interaction process of network device A (denoted as device A in FIG. 6c and FIG. 6e ), network device B (denoted as device B in FIG. 6c and FIG. 6e ), network device C (denoted as device C in FIG. 6c and FIG. 6e), and terminal A (denoted as terminal a in FIG. 6c and FIG.
前述图6a和图6b中,网络设备A和网络设备B的交互过程可以如图6c所示。网络设备B首先向网络设备A发送用于请求地址的dhcp dicover报文,网络设备A收到dhcp dicover报文之后向该网络设备B发送携带有网络设备B(被分配)的地址(记为“1/2”)的dhcp offer报文;此后,网络设备B向网络设备A发送请求使用该网络设备B的地址的dhcp request报文,网络设备A收到dhcp request报文之后,向该网络设备B发送允许使用该地址的dhcp ack报文。In the aforementioned FIG. 6a and FIG. 6b , the interaction process between network device A and network device B may be as shown in FIG. 6c . Network device B first sends to network device A a dhcp discover message for requesting an address. After network device A receives the dhcp request message, it sends a dhcp offer message carrying the address (referred to as "1/2") of network device B (assigned) to network device B; B sends a dhcp ack message allowing the use of this address.
进一步可选地,网络设备A和网络设备B的交互过程中,网络设备C也可以参与其中,如图6c所示。网络设备C可在收到dhcp offer报文之前可以向上级节点(即网络设备B)多次发送dhcp discover报文。其中,在网络设备B尚未具备分配地址能力(即网络设备B接收dhcp ack报文或dhcp offer报文)之前,网络设备B可以向网络设备C发送用于指示拒绝分配地址的dhcp nak报文;而在网络设备B具备分配地址能力(即网络设备B接收dhcp ack报文或dhcp offer报文)之后,网络设备B可以向网络设备C发送用于携带有网络设备C(被分配)的地址(记为“1/2/2”)的dhcp offer报文。Further optionally, during the interaction process between network device A and network device B, network device C may also participate in it, as shown in FIG. 6c. Network device C can send a dhcp discover message to the upper node (ie, network device B) multiple times before receiving the dhcp offer message. Among them, before the network device B has the ability to assign addresses (that is, the network device B receives the dhcp ack message or the dhcp offer message), the network device B can send to the network device C a dhcp nak message for indicating that the address is rejected; and after the network device B has the ability to allocate addresses (that is, the network device B receives the dhcp ack message or the dhcp offer message), the network device B can send to the network device C. /2") dhcp offer message.
进一步可选地,图6a和图6b所示场景中,各个节点之间的通信过程的报文交互可以参考图6e所示方式实现。在图6e中,以各个设备确定本地层次化地址有效并为下级节点分配地址的过程记为“OP”过程,以各个设备确定本地层次化地址无效并拒绝为下级节点分配地址的过程记为“loop”过程。Further optionally, in the scenarios shown in FIG. 6a and FIG. 6b , message exchange in the communication process between various nodes may be implemented by referring to the manner shown in FIG. 6e . In Fig. 6e, the process in which each device determines that the local hierarchical address is valid and assigns an address to a lower-level node is marked as an "OP" process, and the process in which each device determines that a local hierarchical address is invalid and refuses to assign an address to a lower-level node is marked as a "loop" process.
需要说明的是,对于图6e的具备上级节点的任一节点(例如设备B、设备C和终端a)而言,该节点需要执行图6e中的“OP”过程获取来自上级节点所分配的地址,而在该节点执行图6e中的“OP”过程之前,该节点由于未获取到本地地址,则该节点可以在任意时刻之前执行与上级节点的“loop”过程或该节点可以在任意时刻之前执行与下级节点的“loop”过程。以图6e中的设备C为例,该设备C在执行与设备B之间的“OP”过程之前,在设备B基于设备A与设备B之间的“OP”过程之前该设备B并不具备分配地址的能力,为此,该设备B收到设备C的dhcp discover报文之后会执行设备B与设备C之间的“loop”过程;并且,该设备C在执行与设备B之间的“OP”过程之前,该设备C并不具备分配地址的能力,为此,该设备C收到终端a的dhcp discover报文之后会执行设备C与终端a之间的“loop”过程。It should be noted that, for any node (such as device B, device C and terminal a) with a superior node in Figure 6e, the node needs to execute the "OP" process in Figure 6e to obtain the address assigned by the superior node, and before the node executes the "OP" process in Figure 6e, since the node has not obtained a local address, the node can execute the "loop" process with the superior node before any time or the node can perform the "loop" process with the subordinate node before any time. Taking the device C in Figure 6e as an example, before the device C performs the "OP" process with the device B, the device B does not have the ability to assign addresses before the "OP" process between the device A and the device B. Therefore, the device B will execute the "loop" process between the device B and the device C after receiving the dhcp discover message from the device C; and before the device C performs the "OP" process with the device B, the device C does not have the ability to assign addresses. Therefore, the device C receives the terminal After the dhcp discover message of a, the "loop" process between device C and terminal a will be executed.
此外,对于图6e的具备上级节点的任一节点(例如设备B、设备C和终端a)而言,该节点需要执行图6e中的“OP”过程获取来自上级节点所分配的地址,而在该节点执行图6e中的“OP”过程之后,该节点由于已获取到本地地址,则该节点无需再执行dhcp discover报文的发送,即该节点(确定与上级节点断开连接之前)不会再与上级节点或下级节点执行执行“loop”过程或“OP”过程。In addition, for any node (such as device B, device C, and terminal a) with a superior node in Figure 6e, the node needs to execute the "OP" process in Figure 6e to obtain the address assigned by the superior node, and after the node executes the "OP" process in Figure 6e, since the node has obtained a local address, the node does not need to execute the sending of the dhcp discover message, that is, the node (before it is determined to be disconnected from the superior node) will not perform "loop" with the superior node or the subordinate node process or "OP" process.
示例性的,网络设备A和网络设备B之间的“OP”过程可以参考前述图6c中网络设备A和网络设备B的交互过程,网络设备B与网络设备C之间的“loop”过程可以参考前述图6c中网络设备B和网络设备C的交互过程。Exemplarily, the "OP" process between network device A and network device B can refer to the interaction process between network device A and network device B in Figure 6c, and the "loop" process between network device B and network device C can refer to the interaction process between network device B and network device C in Figure 6c.
应理解,在上述示例中,由于网络设备B和网络设备C分别具备各自的上级节点和下级 节点,即网络设备B和网络设备C都可以作为网络中DHCP服务器(Server)和DHCP终端(Client)的角色,使得网络设备B和网络设备C均可以作为第一节点执行前述图4和图5所示实施例。特别的,在该示例中,由于图6e中终端设备A由于是叶子节点且不具备作为DHCP服务器(Server)的能力,终端设备A在接收dhcp discover报文之后,忽略该dhcp discover报文不作处理。It should be understood that, in the above example, since network device B and network device C have respective upper-level nodes and lower-level nodes, that is, both network device B and network device C can serve as DHCP server (Server) and DHCP terminal (Client) roles in the network, so that both network device B and network device C can be used as the first node to execute the aforementioned embodiments shown in FIG. 4 and FIG. 5 . Particularly, in this example, since the terminal device A in FIG. 6e is a leaf node and does not have the capability of being a DHCP server (Server), after receiving the dhcp discover message, the terminal device A ignores the dhcp discover message and does not process it.
需要说明的是,网络设备、网络设备A和网络设备C分别作为第二节点、第一节点和第三节点的情况下,图6c至图6e所示实现过程还可以参考前述图5中步骤S201至步骤S209的实现过程,并实现相应的技术效果,此处不做赘述。It should be noted that, when the network device, network device A, and network device C are respectively used as the second node, the first node, and the third node, the implementation process shown in Figure 6c to Figure 6e can also refer to the implementation process of steps S201 to S209 in Figure 5 above, and achieve corresponding technical effects, which will not be repeated here.
在一种可能的实现方式中,图6a和图6b所示场景中各个节点的层次化地址分配之后,还可以基于图4和图5所示实施例实现网络拓扑中新增节点的实现过程,下面将结合图7a至图7c所示场景进行示例性描述。In a possible implementation manner, after the hierarchical address allocation of each node in the scenarios shown in FIG. 6a and FIG. 6b, the implementation process of adding nodes in the network topology can also be implemented based on the embodiments shown in FIG. 4 and FIG.
如图7a至图7c所示,网络设备D意图通过网络设备B接入网络,网络设备D可以作为图4和图5所示实施例中的第一节点执行响应的过程。As shown in FIGS. 7a to 7c, network device D intends to access the network through network device B, and network device D may act as the first node in the embodiments shown in FIGS. 4 and 5 to perform a response process.
在图7a中,网络设备D向网络设备B发送用于请求地址的dhcp dicover报文(应理解,由于网络设备B的本地层次化地址有效,所以网络设备B不会向网络设备D发送dhcp dicover报文);In Fig. 7a, network device D sends a dhcp discover message for requesting an address to network device B (it should be understood that because the local hierarchical address of network device B is valid, network device B will not send a dhcp discover message to network device D);
在图7b中,由于网络设备B的本地层次化地址有效,则网络设备B执行地址分配过程,即网络设备B向网络设备D发送携带有网络设备D的地址“记为1/2/3”的dhcp offer报文;In FIG. 7b, since the local hierarchical address of network device B is valid, network device B performs an address assignment process, that is, network device B sends to network device D a dhcp offer message carrying the address of network device D "marked as 1/2/3";
在图7c中,网络设备D进一步接收dhcp ack报文(图中省略了网络设备D发送dhcp request报文的过程)之后,网络设备D的地址生效,并具备向该网络设备D的下级节点分配地址的能力。In Fig. 7c, after the network device D further receives the dhcp ack message (the process of sending the dhcp request message by the network device D is omitted in the figure), the address of the network device D becomes effective, and possesses the ability to assign addresses to the subordinate nodes of the network device D.
基于图6c至图6e,以及图7a至图7c所示报文的交互过程可知,网络设备B在接收dhcp ack报文(或接收dhcp offer报文)之前,网络设备处于locater invalid状态,而在网络设备B接收dhcp ack报文(或接收dhcp offer报文)之后,明确该网络设备B的地址为“1/2”,并确定该网络设备B具备向网络设备B的下级节点分配地址的能力;此外,网络设备B还可以为网络拓扑中新增的网络设备D分配地址,并使得网络设备D具备基于所分配的地址进一步向网络设备D的下级节点分配地址的能力。从而,在树型的网络拓扑场景中通过上下级节点之间的交互实现层次化地址的自动分配,以避免由于手工配置出错而导致网络瘫痪的情况出现,提升网络的稳定性。Based on Figures 6c to 6e, and the interaction process of the messages shown in Figures 7a to 7c, it can be seen that before network device B receives the dhcp ack message (or receives the dhcp offer message), the network device is in the locater invalid state, and after network device B receives the dhcp ack message (or receives the dhcp offer message), it is clear that the address of the network device B is "1/2", and it is determined that the network device B has the ability to assign addresses to the lower-level nodes of the network device B In addition, the network device B can also assign addresses to the newly added network device D in the network topology, and enable the network device D to have the ability to further assign addresses to the lower-level nodes of the network device D based on the assigned addresses. Therefore, in the tree-type network topology scene, the automatic allocation of hierarchical addresses is realized through the interaction between the upper and lower nodes, so as to avoid the occurrence of network paralysis due to manual configuration errors and improve the stability of the network.
在网络的长时间运行过程中,难以避免会出现某两个节点之间的链路故障或者某个节点发生故障,或者是需要将某个节点从当前网络中移除,或者是出于节能的目的需要对网络中某个节点下达休眠/唤醒的指令,这都可能导致网络中其它节点感知到该节点的断开连接。本申请提供的通信方法也能支持在某个节点断开的场景下的地址动态分配的过程,下面将结合更多的实施例进行说明。During the long-term operation of the network, it is inevitable that there will be a link failure between two nodes or a node failure, or a node needs to be removed from the current network, or a node in the network needs to be sleep/wake up for energy saving purposes, which may cause other nodes in the network to perceive the disconnection of the node. The communication method provided by the present application can also support the process of dynamic address allocation in a scenario where a certain node is disconnected, which will be described in conjunction with more embodiments below.
请参阅图8,为本申请实施例提供的通信方法300的一个示意图,该方法包括如下步骤。Please refer to FIG. 8 , which is a schematic diagram of a communication method 300 provided by an embodiment of the present application, and the method includes the following steps.
S301.第一节点发送第一发现报文。S301. The first node sends a first discovery packet.
本实施例中,第一节点在步骤S301中发送第一发现报文,相应的,第二节点在步骤S301中接收第一发现报文。其中,该第一发现报文用于请求分配地址。In this embodiment, the first node sends a first discovery message in step S301, and correspondingly, the second node receives the first discovery message in step S301. Wherein, the first discovery message is used to request address allocation.
S302.第二节点发送第一提供报文。S302. The second node sends the first provision message.
本实施例中,第二节点在步骤S302中发送第一提供报文,相应的,第一节点在步骤S302中接收第一提供报文。其中,该第一提供报文包括该第二节点为该第一节点分配的第一地址;该第一地址包括第一字段和第二字段,该第一字段的取值为该第二节点的地址的取值且该第二节点为该第一节点的上级节点,该第二字段的取值为该第一节点的标识。In this embodiment, the second node sends the first provision message in step S302, and correspondingly, the first node receives the first provision message in step S302. Wherein, the first providing message includes the first address allocated by the second node to the first node; the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is the superior node of the first node, and the value of the second field is the identifier of the first node.
S303.第一节点发送第一请求报文。S303. The first node sends a first request packet.
本实施例中,第一节点在步骤S303中发送第一请求报文,相应的,第二节点在步骤S303中接收第一请求报文。其中,该第一请求报文用于请求使用该第一地址。In this embodiment, the first node sends the first request message in step S303, and correspondingly, the second node receives the first request message in step S303. Wherein, the first request message is used to request to use the first address.
S304.第二节点发送第一确认报文。S304. The second node sends a first confirmation message.
本实施例中,第二节点在步骤S304中发送第一确认报文,相应的,第一节点在步骤S304中接收第一确认报文。其中,该第一确认报文用于指示允许使用该第一地址。In this embodiment, the second node sends the first confirmation message in step S304, and correspondingly, the first node receives the first confirmation message in step S304. Wherein, the first confirmation message is used to indicate that the first address is allowed to be used.
需要说明的是,步骤S301至步骤S304的实现过程可以参考步骤S201至步骤S204的实现过程,并实现相应的技术效果,此处不做限定。It should be noted that the implementation process of steps S301 to S304 can refer to the implementation process of steps S201 to S204, and achieve corresponding technical effects, which are not limited here.
S305.第一节点确定与第二节点断开连接。S305. The first node determines to disconnect from the second node.
应理解,第一节点与该第二节点断开连接,可以包括该第一节点与第二节点之间的链路断开,也可以包括该第一节点与该第二节点之间的链路休眠,还可以包括第二节点(或第二节点的上级节点)故障等,此处不做限定。It should be understood that the disconnection between the first node and the second node may include disconnection of the link between the first node and the second node, may also include dormancy of the link between the first node and the second node, and may also include failure of the second node (or a superior node of the second node), etc., which are not limited herein.
在一种可能的实现方式中,第一节点在步骤S302中向该第三节点发送第二提供报文之后(或在步骤S304中向该第三节点发送第二确认报文之后),该方法还包括:该第一节点在步骤S305中确定与该第二节点断开连接之后,该第一节点向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址;该第三节点接收该第一变更报文,并清除该第二地址。In a possible implementation manner, after the first node sends the second offer message to the third node in step S302 (or after sending the second confirmation message to the third node in step S304), the method further includes: after the first node determines to disconnect from the second node in step S305, the first node sends a first change message to the third node to instruct the third node to clear the second address; the third node receives the first change message and clears the second address.
具体地,在该第一节点确定与该第二节点断开连接的情况下,第一节点确定该第二节点为该第一节点分配的第一地址失效且第一节点基于该第一地址分配的第二地址失效。为此,该第一节点向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址,使得第三节点明确该第二地址失效并清除该第二地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商实现层次化地址的动态更新。Specifically, when the first node determines to be disconnected from the second node, the first node determines that the first address allocated by the second node to the first node is invalid and the second address allocated by the first node based on the first address is invalid. To this end, the first node sends a first change message to the third node to instruct the third node to clear the second address, so that the third node knows that the second address is invalid and clears the second address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
可选地,该第一节点在步骤S205中确定与该第二节点断开连接之后,该第一节点确定第二节点为该第一节点所分配的第一地址将会失效。为此,该第一节点可以在本地清除该第一地址,后续可以通过发现报文向上级节点获取新的地址。Optionally, after the first node determines to disconnect from the second node in step S205, the first node determines that the first address allocated by the second node to the first node will become invalid. For this reason, the first node may clear the first address locally, and then obtain a new address from the upper node through a discovery message.
进一步可选地,在第三节点还包含有下级节点的情况下,在第三节点接收该第一变更报文之后,第三节点还可以向该第三节点的下级节点发送该第一变更报文,以指示该第三节点的下级节点清除该第三节点所分配的地址,使得第三节点的下级节点明确所分配的地址失效并清除该地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商,在多层网络拓扑中实现层次化地址的动态更新。Further optionally, in the case where the third node also includes subordinate nodes, after the third node receives the first change message, the third node may also send the first change message to the subordinate nodes of the third node to instruct the subordinate nodes of the third node to clear the address allocated by the third node, so that the subordinate nodes of the third node clearly invalidate the allocated address and clear the address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized in the multi-layer network topology through negotiation among different nodes.
在一种可能的实现方式中,在步骤S305中,该第一节点确定与该第二节点断开连接包括以下至少一项:该第一节点确定与该第二节点之间的端口状态为故障down;或,该第一节点确定该第一地址续租超时;或,该第一节点接收来自该第二节点的第二变更报文,以指示该第一节点清除该第一地址。基于上述技术方案,对于第一节点而言,第一节点可以通过上述 多种方式明确第一节点与第二节点断开连接,并进一步明确该第二节点为该第一节点分配的第一地址失效。In a possible implementation, in step S305, the first node determining to disconnect from the second node includes at least one of the following: the first node determines that the port status with the second node is down; or, the first node determines that the lease renewal of the first address has timed out; or, the first node receives a second change message from the second node to instruct the first node to clear the first address. Based on the above technical solution, for the first node, the first node can confirm that the first node is disconnected from the second node through the above-mentioned various methods, and further clarify that the first address allocated by the second node to the first node is invalid.
需要说明的是,当图8所示不同节点之间所应用的协议为DHCP的情况下,变更报文(包括第一变更报文、第二变更报文等)可以为DHCP的扩展报文,例如记为dhcp变更(change)报文。It should be noted that, when the protocol applied between the different nodes shown in Figure 8 is DHCP, the change message (including the first change message, the second change message, etc.) can be an extended message of DHCP, for example, it is recorded as a dhcp change (change) message.
S306.第一节点发送第三发现报文。S306. The first node sends a third discovery packet.
本实施例中,第一节点在步骤S306中发送第三发现报文,相应的,第四节点在步骤S306中接收第三发现报文。其中,该第三发现报文用于请求分配地址。In this embodiment, the first node sends the third discovery message in step S306, and correspondingly, the fourth node receives the third discovery message in step S306. Wherein, the third discovery message is used to request address allocation.
S307.第四节点发送第三提供报文。S307. The fourth node sends a third provision message.
本实施例中,第四节点在步骤S307中发送第二提供报文,相应的,第一节点在步骤S307中接收第三提供报文。其中,该第三提供报文包括该第四节点为该第一节点分配的第三地址;其中,该第三地址包括第五字段和第六字段,该第五字段的取值为第四节点的地址的取值,该第六字段的取值为该第一节点的标识。In this embodiment, the fourth node sends the second provision message in step S307, and correspondingly, the first node receives the third provision message in step S307. Wherein, the third providing message includes a third address assigned by the fourth node to the first node; wherein, the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, and the value of the sixth field is the identifier of the first node.
具体地,该第一节点所在的通信系统还包括第四节点且该第四节点为该第一节点的上级节点;该第一节点在步骤S305中确定与该第二节点断开连接之后,该第一节点还可以在步骤S306中发送第三发现报文,该第三发现报文用于请求分配地址;该第四节点在步骤S306中接收该第三发现报文,该第四节点在步骤S307中向该第一节点发送第三提供报文,该第三提供报文包括该第四节点为该第一节点分配的第三地址;其中,该第三地址包括第五字段和第六字段,该第五字段的取值为第四节点的地址的取值,该第六字段的取值为该第一节点的标识;该第一节点接收该第三提供报文。其中,在该第一节点确定与该第二节点断开连接的情况下,第一节点确定该第二节点为该第一节点分配的第一地址失效。为此,该第一节点可以向该其它上级节点(例如第四节点)发送用于请求分配地址的第三发现报文,并获取来自该第四节点为该第一节点分配的第三地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商实现层次化地址的动态更新。Specifically, the communication system where the first node is located also includes a fourth node and the fourth node is the upper node of the first node; after the first node determines to disconnect from the second node in step S305, the first node may also send a third discovery message in step S306, and the third discovery message is used to request an address allocation; A third address assigned by the first node; wherein the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, and the value of the sixth field is the identifier of the first node; the first node receives the third providing message. Wherein, when the first node determines to be disconnected from the second node, the first node determines that the first address allocated by the second node to the first node is invalid. To this end, the first node may send a third discovery message for requesting address allocation to the other superior node (for example, the fourth node), and obtain the third address allocated to the first node from the fourth node. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
在一种可能的实现方式中,该方法还包括:该第三节点接收该第三发现报文;该第三节点向该第一节点发送第四非确认报文,该第四非确认报文用于指示拒绝分配地址。具体地,该第一节点在步骤S307中接收来自该第四节点的该第三提供报文之前,即第一节点未收到上级节点分配的地址之前,该第一节点不具备向下级节点分配地址的能力。为此,该第一节点接收用于请求分配地址的第四发现报文之后,该第一节点发送用于指示拒绝分配地址的第四非确认报文,使得该第四非确认报文的接收方明确该第一节点当前不具备分配地址的能力。In a possible implementation manner, the method further includes: the third node receiving the third discovery message; the third node sending a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address. Specifically, before the first node receives the third providing message from the fourth node in step S307, that is, before the first node receives the address assigned by the upper node, the first node does not have the ability to assign addresses to lower nodes. For this reason, after the first node receives the fourth discovery message for requesting address allocation, the first node sends a fourth non-confirmation message for indicating refusal of address allocation, so that the receiver of the fourth non-confirmation message knows that the first node currently does not have the ability to allocate addresses.
S308.第一节点发送第三请求报文。S308. The first node sends a third request message.
本实施例中,第一节点在步骤S308中发送第三请求报文,相应的,第四节点在步骤S308中接收第三请求报文。其中,该第三请求报文用于请求使用该第三地址。In this embodiment, the first node sends the third request message in step S308, and correspondingly, the fourth node receives the third request message in step S308. Wherein, the third request message is used to request to use the third address.
S309.第四节点发送第三确认报文。S309. The fourth node sends a third confirmation message.
本实施例中,第四节点在步骤S309中发送第三确认报文,相应的,第一节点在步骤S309中接收第三确认报文。其中,该第三确认报文用于指示允许使用该第三地址。In this embodiment, the fourth node sends the third confirmation message in step S309, and correspondingly, the first node receives the third confirmation message in step S309. Wherein, the third confirmation message is used to indicate that the third address is allowed to be used.
需要说明的是,步骤S308和步骤S309为可选步骤,第一节点可以不执行。It should be noted that step S308 and step S309 are optional steps, and the first node may not execute them.
下面将结合更多的附图,对图8所描述的实施例的实现过程进行示例性描述。The implementation process of the embodiment described in FIG. 8 will be described exemplarily below in conjunction with more drawings.
应理解,下述示例中,以不同节点之间基于DHCP相关报文实现为例进行说明,在实际应用中,还可以使用其它的报文,例如BOOTP、私有化的地址分配协议,或者其它协议。It should be understood that, in the following examples, the implementation of DHCP-related messages between different nodes is taken as an example for illustration. In practical applications, other messages, such as BOOTP, a private address allocation protocol, or other protocols may also be used.
前述图7a至图7c所示不同节点的网络拓扑场景可以应用图8所描述的实施例,实现过程可以如图9a至图9d所示,如图9a至图9d所示,网络设备D可以作为第一节点执行前述图8所描述的实施例。The above-mentioned network topology scenarios of different nodes shown in FIG. 7a to FIG. 7c can apply the embodiment described in FIG. 8, and the implementation process can be as shown in FIG. 9a to FIG. 9d. As shown in FIG. 9a to FIG.
在图9a中,由于网络设备B将与网络设备D之间的通信端口回收(或网络设备B故障,或网络设备与网络设备D之间的链路故障等),导致网络设备D检测到上级节点(即网络设备B)不可达。在这种情况下,网络设备D将会清除网络设备B为该网络设备D所分配的地址,并且,网络设备D若存在其它的下级节点时,该网络设备D还会向该下级节点(如果存在的话)下发dhcp change报文,使得该下级节点基于该dhcp change报文清除本地的层次化地址并进一步将dhcp change报文发送给在下一级节点(如果存在的话),直到网络拓扑中的叶子节点为止。In FIG. 9a, because network device B recycles the communication port with network device D (or network device B fails, or the link between network device and network device D fails, etc.), network device D detects that the upper node (i.e. network device B) is unreachable. In this case, the network device D will clear the address assigned by the network device B to the network device D, and if there are other lower-level nodes in the network device D, the network device D will also send a dhcp change message to the lower-level node (if it exists), so that the lower-level node will clear the local hierarchical address based on the dhcp change message and further send the dhcp change message to the next-level node (if it exists), until the leaf node in the network topology.
在图9b中,网络设备D向上级节点(例如图9b中的网络设备F)发送用于请求地址的dhcp discover报文。In FIG. 9b, network device D sends a dhcp discover message for requesting an address to an upper node (for example, network device F in FIG. 9b).
在图9c中,在网络设备D接收dhcp offer报文之前,网络设备D的下级节点(如果存在的话)与网络设备D之间还会交互dhcp discover报文和dhcp nak报文。In FIG. 9c, before the network device D receives the dhcp offer message, a dhcp discover message and a dhcp nak message will be exchanged between the lower-level node of the network device D (if it exists) and the network device D.
在图9d中,网络设备F与网络设备D之间交互dhcp ack报文,以实现为该网络设备D分配地址的过程,其中,为网络设备D所分配的地址可以记为“2/1/1”。类似地,网络设备D在该过程中也会持续与下级节点(如果存在的话)交互dhcp discover报文和dhcp nak报文。In FIG. 9d, network device F and network device D exchange dhcp ack messages to realize the process of allocating addresses for network device D, wherein the address allocated for network device D can be recorded as "2/1/1". Similarly, network device D will also continue to exchange dhcp discover messages and dhcp nak messages with lower-level nodes (if they exist) during this process.
在图9d之后,网络设备D基于网络设备F下发的dhcp offer报文(或dhcp ack报文)获取地址之后,网络设备D可以进一步为网络设备D的下级节点分配地址。After Figure 9d, after the network device D obtains the address based on the dhcp offer message (or dhcp ack message) issued by the network device F, the network device D can further assign addresses to the lower-level nodes of the network device D.
需要说明的是,网络设备D在上述图9b中与网络设备F之间的交互过程,还可以参考前述实施例中网络设备D与网络设备B在图7a至图7c所示实施例中的交互过程的描述,并实现响应的技术效果,此处不做赘述。It should be noted that, for the interaction process between network device D and network device F in FIG. 9b above, you can also refer to the description of the interaction process between network device D and network device B in the embodiments shown in FIGS.
基于上述技术方案可知,在树形的网络拓扑场景中,某个节点在离开原上级节点之后,挂接在该节点下的其它设备也需要更新本地层次化地址;并且,该节点还可以再次连接至上级节点,从上级节点处获取地址并基于所获取的地址进一步向下级节点分配地址。从而,在网络拓扑发生改变(例如第一节点与第二节点断开连接)时,通过不同节点之间的协商实现层次化地址的动态更新。Based on the above technical solution, it can be seen that in a tree-shaped network topology scenario, after a node leaves the original upper-level node, other devices attached to the node also need to update the local hierarchical address; moreover, the node can also connect to the upper-level node again, obtain an address from the upper-level node and further assign an address to the lower-level node based on the obtained address. Therefore, when the network topology changes (for example, the first node is disconnected from the second node), the dynamic update of the hierarchical addresses is realized through negotiation among different nodes.
上面从方法的角度对本申请实施例进行了介绍,下面从装置的角度对本申请实施例提供的通信装置进行说明。The above describes the embodiment of the present application from the perspective of the method, and the following describes the communication device provided by the embodiment of the present application from the perspective of the device.
请参阅图10,本申请实施例提供了一种通信装置,该通信装置1000可以实现上述方法实施例中通信装置(包括第一节点、第二节点、第三节点、第四节点或其它节点)的功能,因此也能实现上述方法实施例所具备的有益效果。Please refer to FIG. 10 , the embodiment of the present application provides a communication device, the communication device 1000 can realize the function of the communication device (including the first node, the second node, the third node, the fourth node or other nodes) in the above method embodiment, so it can also realize the beneficial effects of the above method embodiment.
如图10所示,该通信装置1000包括接收单元1001和发送单元1002。As shown in FIG. 10 , the communication device 1000 includes a receiving unit 1001 and a sending unit 1002 .
可选地,该通信装置1000还包括处理单元1003。Optionally, the communication device 1000 further includes a processing unit 1003 .
在该通信装置1000用于实现前述实施例中第一节点的功能的情况下,该通信装置1000 包括如下实现过程。In the case where the communication device 1000 is used to implement the function of the first node in the foregoing embodiments, the communication device 1000 includes the following implementation process.
该发送单元1002用于发送第一发现报文,该第一发现报文用于请求分配地址;该接收单元1001用于接收来自第二节点的第一提供报文,该第一提供报文包括该第二节点为该第一节点分配的第一地址;其中,该第一地址包括第一字段和第二字段,该第一字段的取值为该第二节点的地址的取值且该第二节点为该第一节点的上级节点,该第二字段的取值为该第一节点的标识;该接收单元1001还用于接收来自该第三节点的第二发现报文,该第二发现报文用于请求分配地址;该发送单元1002还用于向该第三节点发送第二提供报文,该第二提供报文包括该第一节点为该第三节点分配的第二地址,该第二地址包括第三字段和第四字段,该第三字段的取值为该第一地址的取值,该第四字段的取值为该第三节点的标识且该第三节点为该第一节点的下级节点。The sending unit 1002 is used to send a first discovery message, and the first discovery message is used to request an address allocation; the receiving unit 1001 is used to receive a first provision message from a second node, and the first provision message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node and the second node is a superior node of the first node, and the value of the second field is an identifier of the first node; The second discovery message of the third node, the second discovery message is used to request address allocation; the sending unit 1002 is also used to send a second provision message to the third node, the second provision message includes the second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, the value of the fourth field is the identifier of the third node and the third node is a subordinate node of the first node.
在一种可能的实现方式中,该装置还包括处理单元1003;该发送单元1002还用于在该处理单元1003确定与该第二节点断开连接之后,向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址。In a possible implementation manner, the apparatus further includes a processing unit 1003; the sending unit 1002 is further configured to, after the processing unit 1003 determines to disconnect from the second node, send a first change message to the third node to instruct the third node to clear the second address.
在一种可能的实现方式中,在该处理单元1003确定与该第二节点断开连接之后,该发送单元1002还用于发送第三发现报文,该第三发现报文用于请求分配地址;该接收单元1001还用于接收来自第四节点的第三提供报文,该第三提供报文包括该第四节点为该第一节点分配的第三地址;其中,该第三地址包括第五字段和第六字段,该第五字段的取值为该第四节点的地址的取值且该第四节点为该第一节点的上级节点,该第六字段的取值为该第一节点的标识。In a possible implementation, after the processing unit 1003 determines to disconnect from the second node, the sending unit 1002 is further configured to send a third discovery message, where the third discovery message is used to request an address allocation; the receiving unit 1001 is also configured to receive a third offer message from the fourth node, the third offer message includes a third address allocated by the fourth node to the first node; wherein, the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node and the fourth node is the address of the first node For a superior node, the value of the sixth field is the identifier of the first node.
在一种可能的实现方式中,在该处理单元1003确定与该第二节点断开连接之后,该处理单元1003还用于清除该第一地址。In a possible implementation manner, after the processing unit 1003 determines to disconnect from the second node, the processing unit 1003 is further configured to clear the first address.
在一种可能的实现方式中,该处理单元1003确定与该第二节点断开连接包括以下至少一项:In a possible implementation manner, the processing unit 1003 determining to disconnect from the second node includes at least one of the following:
该处理单元1003确定与该第二节点之间的端口状态为故障(down);或,The processing unit 1003 determines that the state of the port with the second node is down; or,
该处理单元1003确定该第一地址续租超时;或,The processing unit 1003 determines that the lease renewal of the first address is timed out; or,
该处理单元1003确定该接收单元1001接收来自该第二节点的第二变更报文,以指示该第一节点清除该第一地址。The processing unit 1003 determines that the receiving unit 1001 receives the second change message from the second node, so as to instruct the first node to delete the first address.
在一种可能的实现方式中,该接收单元1001还用于接收第四发现报文,该第四发现报文用于请求分配地址;该发送单元1002还用于发送第一非确认报文,该第一非确认报文用于指示拒绝分配地址。In a possible implementation manner, the receiving unit 1001 is further configured to receive a fourth discovery message, where the fourth discovery message is used to request address allocation; the sending unit 1002 is also configured to send a first non-confirmation message, where the first non-confirmation message is used to indicate refusal to allocate an address.
在一种可能的实现方式中,该接收单元1001还用于接收来自该第三节点的第二非确认报文,该第二非确认报文用于指示拒绝分配地址。In a possible implementation manner, the receiving unit 1001 is further configured to receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
在一种可能的实现方式中,该发送单元1002还用于向该第二节点发送第一请求报文,该第一请求报文用于指示请求使用该第一地址;该接收单元1001还用于接收来自该第二节点的第一确认报文,该第一确认报文用于指示允许使用该第一地址。In a possible implementation manner, the sending unit 1002 is further configured to send a first request message to the second node, where the first request message is used to indicate that the first address is requested to be used; the receiving unit 1001 is also used to receive a first confirmation message from the second node, where the first confirmation message is used to indicate that the first address is allowed to be used.
在一种可能的实现方式中,该接收单元1001还用于接收第五发现报文,该第五发现报文用于请求分配地址;该发送单元1002还用于发送第三非确认报文,该第三非确认报文用于指示拒绝分配地址。In a possible implementation manner, the receiving unit 1001 is further configured to receive a fifth discovery message, where the fifth discovery message is used to request address allocation; the sending unit 1002 is also configured to send a third non-confirmation message, where the third non-confirmation message is used to indicate refusal to allocate an address.
在一种可能的实现方式中,该接收单元1001还用于接收来自该第三节点的第二请求报文,该第二请求报文用于指示请求使用该第二地址;该发送单元1002还用于向该第三节点发送第二确认报文,该第二确认报文用于指示允许使用该第二地址。In a possible implementation manner, the receiving unit 1001 is further configured to receive a second request message from the third node, where the second request message is used to indicate that the second address is requested to be used; the sending unit 1002 is also used to send a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used.
在一种可能的实现方式中,该第一地址和该第二地址均为NewIP地址。In a possible implementation manner, both the first address and the second address are NewIP addresses.
在一种可能的实现方式中,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为动态主机配置协议DHCP报文。In a possible implementation manner, the first discovery message, the first offer message, the second discovery message and the second offer message are all dynamic host configuration protocol DHCP messages.
在一种可能的实现方式中,在该第一地址中,该第一字段位于该第二字段之前;和/或,在该第二地址中,该第三字段位于该第四字段之前。In a possible implementation manner, in the first address, the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
在一种可能的实现方式中,该装置应用于树形网络,该第二节点为该树形网络的根节点或该树形网络的中间节点。In a possible implementation manner, the apparatus is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
在一种可能的实现方式中,该装置应用于树形网络,该第三节点为该树形网络的叶子节点或该树形网络的中间节点。In a possible implementation manner, the apparatus is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
需要说明的是,上述通信装置1000的各单元的信息执行过程等内容,具体可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that, details such as the information execution process of each unit of the communication device 1000 may refer to the description in the foregoing method embodiment of the present application, and details are not repeated here.
本申请实施例还提供了一种通信系统,前述任一实施例提供的通信方法可以应用于图11所示通信系统中。如图11所示,该系统包括多个通信装置,且该多个通信装置分别对应于不同的节点(包括第一节点、第二节点、第三节点等,且该第二节点为该第一节点的上级节点且该第三节点为该第一节点的下级节点)。An embodiment of the present application also provides a communication system, and the communication method provided in any of the foregoing embodiments may be applied to the communication system shown in FIG. 11 . As shown in FIG. 11 , the system includes a plurality of communication devices, and the plurality of communication devices respectively correspond to different nodes (including a first node, a second node, a third node, etc., and the second node is a superior node of the first node and the third node is a subordinate node of the first node).
在图11所示通信系统中,在箭头指向之前的网络拓扑中,第二节点位于网络拓扑中的第n(n为自然数)层,第一节点位于网络拓扑中的第n+1层,第三节点位于网络拓扑中的第n+2层。在箭头指向之后的网络拓扑中,第二节点和第四节点位于网络拓扑中的第n(n为自然数)层,第一节点位于网络拓扑中的第n+1层,第三节点位于网络拓扑中的第n+2层。图11所示的箭头指向指示的场景为,第一节点确定与该第二节点断开连接之后,该第一节点连接至第四节点。In the communication system shown in Figure 11, in the network topology before the arrow points to it, the second node is located at the nth layer (n is a natural number) in the network topology, the first node is located at the n+1th layer in the network topology, and the third node is located at the n+2th layer in the network topology. In the network topology after the arrow points, the second node and the fourth node are located at the nth (n is a natural number) layer in the network topology, the first node is located at the n+1th layer in the network topology, and the third node is located at the n+2th layer in the network topology. The scenario indicated by the arrows in FIG. 11 is that, after the first node determines to be disconnected from the second node, the first node is connected to the fourth node.
可选地,网络拓扑中的第n+1层、第n+2层以及第n+3层中还存在其它节点,或者不存在其它节点,此处不做限定。Optionally, there are other nodes in layer n+1, layer n+2, and layer n+3 in the network topology, or there are no other nodes, which is not limited here.
可选地,第四节点和第二节点均可以为根节点(n取值为0)或中间节点(n取值大于0)。Optionally, both the fourth node and the second node may be a root node (n takes a value of 0) or an intermediate node (n takes a value greater than 0).
进一步可选地,当n取值大于0的情况下,第四节点和第二节点可以连接至相同的上级节点,或连接至不同的上级节点,此处不做限定。Further optionally, when n is greater than 0, the fourth node and the second node may be connected to the same upper-level node, or to different upper-level nodes, which is not limited here.
在该通信系统中,对于该多个通信装置的任一通信装置而言,该任一通信装置均可以通过图10所示方式实现,即该任一通信装置均包括接收单元1001和发送单元1002。In the communication system, for any communication device of the plurality of communication devices, the any communication device can be implemented in the manner shown in FIG. 10 , that is, any communication device includes a receiving unit 1001 and a sending unit 1002 .
可选地,该任一通信装置还包括处理单元1003。Optionally, any communication device further includes a processing unit 1003 .
在该通信系统中,该第一节点的发送单元用于发送第一发现报文,该第一发现报文用于请求分配地址;该第二节点的接收单元用于接收该第一发现报文,该第二节点的发送单元用于向该第一节点发送第一提供报文,该第一提供报文包括该第二节点为该第一节点分配的第一地址;其中,该第一地址包括第一字段和第二字段,该第一字段的取值为第二节点的地址的取值且该第二节点为该第一节点的上级节点,该第二字段的取值为该第一节点的标识;该第一节点的接收单元用于接收该第一提供报文;该第三节点的发送单元用于发送第二发现报 文,该第二发现报文用于请求分配地址;该第一节点的接收单元还用于接收该第二发现报文,该第一节点的发送单元还用于向该第三节点发送第二提供报文,该第二提供报文包括该第一节点为该第三节点分配的第二地址,该第二地址包括第三字段和第四字段,该第三字段的取值为该第一地址的取值,该第四字段的取值为该第三节点的标识且该第三节点为该第一节点的下级节点;该第三节点的接收单元用于接收该第二提供报文。In the communication system, the sending unit of the first node is used to send a first discovery message, and the first discovery message is used to request an address allocation; the receiving unit of the second node is used to receive the first discovery message, and the sending unit of the second node is used to send a first offer message to the first node, and the first offer message includes a first address allocated by the second node to the first node; wherein, the first address includes a first field and a second field, and the value of the first field is the value of the address of the second node and the second node is a superior node of the first node, and the value of the second field is The identification of the first node; the receiving unit of the first node is used to receive the first provision message; the sending unit of the third node is used to send a second discovery message, and the second discovery message is used to request an address assignment; the receiving unit of the first node is also used to receive the second discovery message, and the sending unit of the first node is also used to send a second provision message to the third node, the second provision message includes the second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field The value is an identifier of the third node and the third node is a subordinate node of the first node; the receiving unit of the third node is configured to receive the second providing message.
在一种可能的实现方式中,该第一节点还包括处理单元;在该第一节点的处理单元确定与该第二节点断开连接之后,该第一节点的发送单元还用于向该第三节点发送第一变更报文,以指示该第三节点清除该第二地址;该第三节点的接收单元还用于接收该第一变更报文,并清除该第二地址。In a possible implementation manner, the first node further includes a processing unit; after the processing unit of the first node determines to disconnect from the second node, the sending unit of the first node is further configured to send a first change message to the third node to instruct the third node to clear the second address; the receiving unit of the third node is also configured to receive the first change message and clear the second address.
在一种可能的实现方式中,该第三节点的发送单元还用于向该第三节点的下级节点发送该第一变更报文。In a possible implementation manner, the sending unit of the third node is further configured to send the first change message to a subordinate node of the third node.
在一种可能的实现方式中,该系统还包括第四节点且该第四节点为该第一节点的上级节点;在该第一节点的处理单元确定与该第二节点断开连接之后,该第一节点的发送单元还用于发送第三发现报文,该第三发现报文用于请求分配地址;该第四节点的接收单元用于接收该第三发现报文,该第四节点的发送单元用于向该第一节点发送第三提供报文,该第三提供报文包括该第四节点为该第一节点分配的第三地址;其中,该第三地址包括第五字段和第六字段,该第五字段的取值为第四节点的地址的取值,该第六字段的取值为该第一节点的标识;该第一节点的接收单元还用于接收该第三提供报文。In a possible implementation manner, the system further includes a fourth node, and the fourth node is an upper-level node of the first node; after the processing unit of the first node determines to disconnect from the second node, the sending unit of the first node is further configured to send a third discovery message, and the third discovery message is used to request an address assignment; the receiving unit of the fourth node is used to receive the third discovery message, and the sending unit of the fourth node is used to send a third providing message to the first node, and the third providing message includes a third address allocated by the fourth node to the first node; The fifth field and the sixth field, the value of the fifth field is the value of the address of the fourth node, the value of the sixth field is the identifier of the first node; the receiving unit of the first node is also used to receive the third providing message.
在一种可能的实现方式中,该第三节点的接收单元还用于接收该第三发现报文;该第三节点的发送单元还用于向该第一节点发送第四非确认报文,该第四非确认报文用于指示拒绝分配地址。In a possible implementation manner, the receiving unit of the third node is further configured to receive the third discovery message; the sending unit of the third node is further configured to send a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address.
在一种可能的实现方式中,在该第一节点的处理单元确定与该第二节点断开连接之后,该第一节点的处理单元还用于清除该第一地址。In a possible implementation manner, after the processing unit of the first node determines to disconnect from the second node, the processing unit of the first node is further configured to clear the first address.
在一种可能的实现方式中,该第一节点的处理单元确定与该第二节点断开连接包括以下至少一项:In a possible implementation manner, the determination by the processing unit of the first node to disconnect from the second node includes at least one of the following:
该第一节点的处理单元确定与该第二节点之间的端口状态为故障down;或,The processing unit of the first node determines that the state of the port with the second node is down; or,
该第一节点的处理单元确定该第一地址续租超时;或,The processing unit of the first node determines that the lease renewal of the first address is timed out; or,
该第一节点的处理单元确定该第一节点的接收单元接收来自该第二节点的第二变更报文,以指示该第一节点清除该第一地址。The processing unit of the first node determines that the receiving unit of the first node receives the second change message from the second node, so as to instruct the first node to clear the first address.
在一种可能的实现方式中,该第三节点的发送单元还用于发送第四发现报文,该第四发现报文用于请求分配地址;该第一节点的接收单元还用于接收该第四发现报文,并向该第三节点发送第一非确认报文,该第一非确认报文用于指示拒绝分配地址。In a possible implementation manner, the sending unit of the third node is further configured to send a fourth discovery message, where the fourth discovery message is used to request address allocation; the receiving unit of the first node is also used to receive the fourth discovery message, and send a first non-confirmation message to the third node, where the first non-confirmation message is used to indicate refusal to allocate an address.
在一种可能的实现方式中,该第一节点的接收单元还用于接收来自该第三节点的第二非确认报文,该第二非确认报文用于指示拒绝分配地址。In a possible implementation manner, the receiving unit of the first node is further configured to receive a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
在一种可能的实现方式中,该第一节点的发送单元还用于发送第一请求报文,该第一请求报文用于指示请求使用该第一地址;该第二节点的接收单元还用于接收该第一请求报文,并向该第一节点发送第一确认报文,该第一确认报文用于指示允许使用该第一地址;该第一节点的接收单元还用于接收该第一确认报文。In a possible implementation manner, the sending unit of the first node is further configured to send a first request message, where the first request message is used to indicate that the first address is requested to be used; the receiving unit of the second node is also used to receive the first request message, and send a first confirmation message to the first node, where the first confirmation message is used to indicate that the first address is allowed to be used; the receiving unit of the first node is also used to receive the first confirmation message.
在一种可能的实现方式中,该第三节点的发送单元还用于发送第五发现报文,该第五发现报文用于请求分配地址;该第一节点的接收单元还用于接收该第五发现报文,并向该第三节点发送第三非确认报文,该第三非确认报文用于指示拒绝分配地址;该第三节点的接收单元还用于接收该第三非确认报文。In a possible implementation manner, the sending unit of the third node is further configured to send a fifth discovery message, where the fifth discovery message is used to request address allocation; the receiving unit of the first node is also used to receive the fifth discovery message, and send a third non-confirmation message to the third node, where the third non-confirmation message is used to indicate refusal to allocate an address; the receiving unit of the third node is also used to receive the third non-confirmation message.
在一种可能的实现方式中,该第三节点的发送单元还用于发送第二请求报文,该第二请求报文用于指示请求使用该第二地址;该第一节点的接收单元还用于接收该第二请求报文,该第一节点的发送单元还用于向该第三节点发送第二确认报文,该第二确认报文用于指示允许使用该第二地址;该第三节点的接收单元还用于接收该第二确认报文。In a possible implementation manner, the sending unit of the third node is further configured to send a second request message, where the second request message is used to indicate that the second address is requested to be used; the receiving unit of the first node is also used to receive the second request message, and the sending unit of the first node is also used to send a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used; the receiving unit of the third node is also used to receive the second confirmation message.
在一种可能的实现方式中,该第一地址和该第二地址均为NewIP地址。In a possible implementation manner, both the first address and the second address are NewIP addresses.
在一种可能的实现方式中,该第一发现报文、该第一提供报文、该第二发现报文和该第二提供报文均为动态主机配置协议DHCP报文。In a possible implementation manner, the first discovery message, the first offer message, the second discovery message and the second offer message are all dynamic host configuration protocol DHCP messages.
在一种可能的实现方式中,在该第一地址中,该第一字段位于该第二字段之前;和/或,在该第二地址中,该第三字段位于该第四字段之前。In a possible implementation manner, in the first address, the first field is located before the second field; and/or, in the second address, the third field is located before the fourth field.
在一种可能的实现方式中,该通信系统应用于树形网络,该第二节点为该树形网络的根节点或该树形网络的中间节点。In a possible implementation manner, the communication system is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
在一种可能的实现方式中,该通信系统应用于树形网络,该第三节点为该树形网络的叶子节点或该树形网络的中间节点。In a possible implementation manner, the communication system is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
需要说明的是,该通信系统中各个通信装置的执行过程等内容,具体可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that, for details such as the execution process of each communication device in the communication system, refer to the description in the foregoing method embodiments of the present application, and details are not repeated here.
本申请实施例还提供了一种通信装置1200,参见图12所示,图12为本申请实施例提供的一种通信装置1200的结构示意图。The embodiment of the present application also provides a communication device 1200 , as shown in FIG. 12 , which is a schematic structural diagram of the communication device 1200 provided in the embodiment of the present application.
可选的,该通信装置1200执行前述任一实施例中通信装置(例如图4或图5所示实现方式中第一节点,第二节点和第三节点等)的功能。Optionally, the communication device 1200 executes functions of the communication device in any of the foregoing embodiments (for example, the first node, the second node, and the third node in the implementation manner shown in FIG. 4 or FIG. 5 ).
可选地,图12中通信装置1300可以用于执行其它通信装置的功能。例如,当通信装置1200为第一节点的情况下,通信装置1300可以用于执行第二节点的功能,通信装置1400可以用于执行第三节点的功能;又如,当通信装置1200为第三节点的情况下,通信装置1300可以用于执行第一节点的功能,通信装置1300可以用于执行第三节点的下级节点的功能。Optionally, the communication device 1300 in FIG. 12 may be used to perform functions of other communication devices. For example, when the communication device 1200 is the first node, the communication device 1300 can be used to perform the function of the second node, and the communication device 1400 can be used to perform the function of the third node; for another example, when the communication device 1200 is the third node, the communication device 1300 can be used to perform the function of the first node, and the communication device 1300 can be used to perform the function of the subordinate node of the third node.
附图12所示通信装置1200包括存储器1202和至少一个处理器1201。The communication device 1200 shown in FIG. 12 includes a memory 1202 and at least one processor 1201 .
可选地,处理器1201通过读取存储器1202中保存的指令实现上述实施例中的方法,或者,处理器1201也可以通过内部存储的指令实现上述实施例中的方法。在处理器1201通过读取存储器1202中保存的指令实现上述实施例中的方法的情况下,存储器1202中保存实现本申请上述实施例提供的方法的指令。Optionally, the processor 1201 implements the methods in the foregoing embodiments by reading instructions stored in the memory 1202, or, the processor 1201 may implement the methods in the foregoing embodiments through internally stored instructions. In the case that the processor 1201 implements the methods in the above embodiments by reading the instructions stored in the memory 1202, the memory 1202 stores the instructions for implementing the methods provided in the above embodiments of the present application.
可选地,至少一个处理器1201是一个或多个CPU,或者是单核CPU,也可以是多核CPU。Optionally, at least one processor 1201 is one or more CPUs, or a single-core CPU, or a multi-core CPU.
存储器1202包括但不限于是RAM、ROM、EPROM、快闪存储器、或光存储器等。存储器1202中保存有操作系统的指令。The memory 1202 includes, but is not limited to, RAM, ROM, EPROM, flash memory, or optical memory. Instructions of the operating system are stored in the memory 1202 .
存储器1202中存储的程序指令被所述至少一个处理器1201读取后,通信装置执行前述实施例中对应的操作。After the program instructions stored in the memory 1202 are read by the at least one processor 1201, the communication device executes corresponding operations in the foregoing embodiments.
可选地,附图12所示的通信装置还包括网络接口1203。网络接口1203可以是有线接口, 例如FDDI,GE接口;网络接口1203也可以是无线接口。网络接口1203用于在前述实施例中接收接收/发送数据。Optionally, the communication device shown in FIG. 12 further includes a network interface 1203 . The network interface 1203 may be a wired interface, such as FDDI or GE interface; the network interface 1203 may also be a wireless interface. The network interface 1203 is used to receive/transmit data in the foregoing embodiments.
处理器1201读取存储器1202中的程序指令后,通信装置1200能够执行的其他功能请参照前面各个方法实施例中的描述。After the processor 1201 reads the program instructions in the memory 1202, for other functions that the communication device 1200 can perform, please refer to the descriptions in the foregoing method embodiments.
可选地,通信装置1200还包括总线1204,上述处理器1201、存储器1202通常通过总线1204相互连接,也可以采用其他方式相互连接。Optionally, the communication device 1200 further includes a bus 1204, and the processor 1201 and the memory 1202 are usually connected to each other through the bus 1204, and may also be connected to each other in other ways.
可选地,通信装置1200还包括输入输出接口1205,输入输出接口1205用于与输入设备连接,接收用户、或者与通信装置1200能够联动的其他设备通过输入设备输入的相关配置信息(如m的取值、n的取值、第三时域位置对应的时域长度、第四时域位置对应的时域长度等)。输入设备包括但不限于键盘、触摸屏、麦克风等等。Optionally, the communication device 1200 further includes an input and output interface 1205, and the input and output interface 1205 is used to connect to an input device and receive relevant configuration information (such as the value of m, the value of n, the time domain length corresponding to the third time domain position, the time domain length corresponding to the fourth time domain position, etc.) Input devices include, but are not limited to, keyboards, touch screens, microphones, and the like.
本申请实施例提供的通信装置1200用于执行上述各个方法实施例提供的通信装置执行的方法,并实现对应的有益效果。The communication device 1200 provided in the embodiments of the present application is configured to execute the methods performed by the communication device provided in the foregoing method embodiments, and achieve corresponding beneficial effects.
图12所示通信装置1200的具体实现方式,均可以参考前述的各个方法实施例中的叙述,并实现相应的技术效果,此处不再一一赘述。For the specific implementation manner of the communication device 1200 shown in FIG. 12 , reference may be made to the descriptions in the foregoing method embodiments, and corresponding technical effects may be achieved, so details will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the various embodiments of the application.

Claims (36)

  1. 一种通信方法,其特征在于,包括:A communication method, characterized in that, comprising:
    第一节点发送第一发现报文,所述第一发现报文用于请求分配地址;The first node sends a first discovery message, where the first discovery message is used to request address allocation;
    所述第一节点接收来自第二节点的第一提供报文,所述第一提供报文包括所述第二节点为所述第一节点分配的第一地址;其中,所述第二节点为所述第一节点的上级节点,所述第一地址包括第一字段和第二字段,所述第一字段的取值为所述第二节点的地址的取值,所述第二字段的取值为所述第一节点的标识;The first node receives a first provision message from a second node, the first provision message includes a first address assigned by the second node to the first node; wherein, the second node is a superior node of the first node, the first address includes a first field and a second field, the value of the first field is the value of the address of the second node, and the value of the second field is an identifier of the first node;
    所述第一节点接收来自第三节点的第二发现报文,所述第二发现报文用于请求分配地址,所述第三节点为所述第一节点的下级节点;The first node receives a second discovery message from a third node, the second discovery message is used to request address allocation, and the third node is a subordinate node of the first node;
    所述第一节点向所述第三节点发送第二提供报文,所述第二提供报文包括所述第一节点为所述第三节点分配的第二地址,所述第二地址包括第三字段和第四字段,所述第三字段的取值为所述第一地址的取值,所述第四字段的取值为所述第三节点的标识。The first node sends a second providing message to the third node, the second providing message includes a second address assigned by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field is an identifier of the third node.
  2. 根据权利要求1所述的方法,其特征在于,在所述第一节点向所述第三节点发送第二提供报文之后,所述方法还包括:The method according to claim 1, wherein after the first node sends the second provision message to the third node, the method further comprises:
    在确定与所述第二节点断开连接之后,所述第一节点向所述第三节点发送第一变更报文,以指示所述第三节点清除所述第二地址。After determining to disconnect from the second node, the first node sends a first change message to the third node to instruct the third node to clear the second address.
  3. 根据权利要求1或2所述的方法,其特征在于,在所述第一节点向所述第三节点发送所述第二提供报文之后,所述方法还包括:The method according to claim 1 or 2, wherein after the first node sends the second provision message to the third node, the method further comprises:
    在确定与所述第二节点断开连接之后,所述第一节点发送第三发现报文,所述第三发现报文用于请求分配地址;After determining to disconnect from the second node, the first node sends a third discovery message, where the third discovery message is used to request address allocation;
    所述第一节点接收来自第四节点的第三提供报文,所述第三提供报文包括所述第四节点为所述第一节点分配的第三地址;其中,所述第四节点为所述第一节点的上级节点,所述第三地址包括第五字段和第六字段,所述第五字段的取值为所述第四节点的地址的取值,所述第六字段的取值为所述第一节点的标识。The first node receives a third providing message from a fourth node, the third providing message includes a third address allocated by the fourth node to the first node; wherein the fourth node is a superior node of the first node, and the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, and the value of the sixth field is an identifier of the first node.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,在所述第一节点接收来自所述第二节点的所述第一提供报文之后,所述方法还包括:The method according to any one of claims 1 to 3, wherein after the first node receives the first providing message from the second node, the method further comprises:
    在确定与所述第二节点断开连接之后,所述第一节点清除所述第一地址。After determining to disconnect from the second node, the first node clears the first address.
  5. 根据权利要求2至4任一项所述的方法,其特征在于,所述确定与所述第二节点断开连接包括以下至少一项:The method according to any one of claims 2 to 4, wherein the determining to disconnect from the second node includes at least one of the following:
    确定与所述第二节点之间的端口状态为故障down;或,determining that the state of the port with the second node is down; or,
    确定所述第一地址续租超时;或,determining that the lease renewal of the first address has timed out; or,
    所述第一节点接收来自所述第二节点的第二变更报文,以指示所述第一节点清除所述第一地址。The first node receives a second change message from the second node to instruct the first node to clear the first address.
  6. 根据权利要求1至5任一项所述的方法,其特征在于,在所述第一节点接收来自所述第二节点的所述第一提供报文之前,所述方法还包括:The method according to any one of claims 1 to 5, wherein before the first node receives the first providing message from the second node, the method further comprises:
    所述第一节点接收第四发现报文,所述第四发现报文用于请求分配地址;The first node receives a fourth discovery message, where the fourth discovery message is used to request address allocation;
    所述第一节点发送第一非确认报文,所述第一非确认报文用于指示拒绝分配地址。The first node sends a first non-confirmation message, where the first non-confirmation message is used to indicate refusal to allocate an address.
  7. 根据权利要求1至6任一项所述的方法,其特征在于,在所述第一节点接收来自所述第二节点的第一提供报文之前,所述方法还包括:The method according to any one of claims 1 to 6, wherein before the first node receives the first providing message from the second node, the method further comprises:
    所述第一节点接收来自所述第三节点的第二非确认报文,所述第二非确认报文用于指示拒绝分配地址。The first node receives a second non-confirmation message from the third node, where the second non-confirmation message is used to indicate refusal to allocate an address.
  8. 根据权利要求1至7任一项所述的方法,其特征在于,在所述第一节点接收来自所述第二节点的第一提供报文之后且在所述第一节点向所述第三节点发送所述第二提供报文之前,所述方法还包括:The method according to any one of claims 1 to 7, wherein after the first node receives the first offer message from the second node and before the first node sends the second offer message to the third node, the method further comprises:
    所述第一节点向所述第二节点发送第一请求报文,所述第一请求报文用于指示请求使用所述第一地址;The first node sends a first request message to the second node, where the first request message is used to indicate a request to use the first address;
    所述第一节点接收来自所述第二节点的第一确认报文,所述第一确认报文用于指示允许使用所述第一地址。The first node receives a first confirmation message from the second node, where the first confirmation message is used to indicate that the first address is allowed to be used.
  9. 根据权利要求8所述的方法,其特征在于,在所述第一节点接收来自所述第二节点的所述第一确认报文之前,所述方法还包括:The method according to claim 8, wherein before the first node receives the first confirmation message from the second node, the method further comprises:
    所述第一节点接收第五发现报文,所述第五发现报文用于请求分配地址;The first node receives a fifth discovery message, where the fifth discovery message is used to request address allocation;
    所述第一节点发送第三非确认报文,所述第三非确认报文用于指示拒绝分配地址。The first node sends a third non-confirmation message, where the third non-confirmation message is used to indicate refusal to allocate an address.
  10. 根据权利要求1至9任一项所述的方法,其特征在于,在所述第一节点向所述第三节点发送第二提供报文之后,所述方法还包括:The method according to any one of claims 1 to 9, wherein after the first node sends the second providing message to the third node, the method further comprises:
    所述第一节点接收来自所述第三节点的第二请求报文,所述第二请求报文用于指示请求使用所述第二地址;The first node receives a second request message from the third node, where the second request message is used to indicate a request to use the second address;
    所述第一节点向所述第三节点发送第二确认报文,所述第二确认报文用于指示允许使用所述第二地址。The first node sends a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used.
  11. 根据权利要求1至10任一项所述的方法,其特征在于,The method according to any one of claims 1 to 10, characterized in that,
    所述第一发现报文、所述第一提供报文、所述第二发现报文和所述第二提供报文均为动态主机配置协议DHCP报文。The first discovery message, the first offer message, the second discovery message and the second offer message are all dynamic host configuration protocol DHCP messages.
  12. 根据权利要求1至10任一项所述的方法,其特征在于,The method according to any one of claims 1 to 10, characterized in that,
    所述第一地址和所述第二地址均为新互联网协议NewIP地址。Both the first address and the second address are New IP addresses.
  13. 根据权利要求1至12任一项所述的方法,其特征在于,The method according to any one of claims 1 to 12, characterized in that,
    在所述第一地址中,所述第一字段位于所述第二字段之前;In the first address, the first field precedes the second field;
    和/或,and / or,
    在所述第二地址中,所述第三字段位于所述第四字段之前。In the second address, the third field is located before the fourth field.
  14. 根据权利要求1至13任一项所述的方法,其特征在于,所述方法应用于树形网络,所述第二节点为所述树形网络的根节点或所述树形网络的中间节点。The method according to any one of claims 1 to 13, wherein the method is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
  15. 根据权利要求1至14任一项所述的方法,其特征在于,所述方法应用于树形网络,所述第三节点为所述树形网络的叶子节点或所述树形网络的中间节点。The method according to any one of claims 1 to 14, wherein the method is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
  16. 一种通信方法,其特征在于,所述方法应用于包含有第一节点、第二节点和第三节点的通信系统,所述第二节点为所述第一节点的上级节点且所述第三节点为所述第一节点的下级节点;A communication method, wherein the method is applied to a communication system including a first node, a second node and a third node, the second node is a superior node of the first node and the third node is a subordinate node of the first node;
    所述方法包括:The methods include:
    所述第一节点发送第一发现报文,所述第一发现报文用于请求分配地址;The first node sends a first discovery message, where the first discovery message is used to request address allocation;
    所述第二节点接收所述第一发现报文,并向所述第一节点发送第一提供报文,所述第一提供报文包括所述第二节点为所述第一节点分配的第一地址;其中,所述第一地址包括第一字段和第二字段,所述第一字段的取值为第二节点的地址的取值,所述第二字段的取值为所述第一节点的标识;The second node receives the first discovery message, and sends a first provision message to the first node, the first provision message includes a first address allocated by the second node to the first node; wherein the first address includes a first field and a second field, the value of the first field is the value of the address of the second node, and the value of the second field is the identifier of the first node;
    所述第一节点接收所述第一提供报文;The first node receives the first offer message;
    所述第三节点发送第二发现报文,所述第二发现报文用于请求分配地址;The third node sends a second discovery message, where the second discovery message is used to request address allocation;
    所述第一节点接收所述第二发现报文,并向所述第三节点发送第二提供报文,所述第二提供报文包括所述第一节点为所述第三节点分配的第二地址,所述第二地址包括第三字段和第四字段,所述第三字段的取值为所述第一地址的取值,所述第四字段的取值为所述第三节点的标识;The first node receives the second discovery message, and sends a second provision message to the third node, the second provision message includes a second address allocated by the first node to the third node, the second address includes a third field and a fourth field, the value of the third field is the value of the first address, and the value of the fourth field is an identifier of the third node;
    所述第三节点接收所述第二提供报文。The third node receives the second offer message.
  17. 根据权利要求16所述的方法,其特征在于,在所述第一节点向所述第三节点发送第二提供报文之后,所述方法还包括:The method according to claim 16, wherein after the first node sends the second offer message to the third node, the method further comprises:
    在确定与所述第二节点断开连接之后,所述第一节点向所述第三节点发送第一变更报文,以指示所述第三节点清除所述第二地址;After determining to disconnect from the second node, the first node sends a first change message to the third node to instruct the third node to clear the second address;
    所述第三节点接收所述第一变更报文,并清除所述第二地址。The third node receives the first change message, and clears the second address.
  18. 根据权利要求17所述的方法,其特征在于,所述方法还包括:The method according to claim 17, further comprising:
    所述第三节点向所述第三节点的下级节点发送所述第一变更报文。The third node sends the first change message to a subordinate node of the third node.
  19. 根据权利要求16至18任一项所述的方法,其特征在于,所述系统还包括第四节点,所述第四节点为所述第一节点的上级节点;在所述第一节点向所述第三节点发送所述第二提 供报文之后,所述方法还包括:The method according to any one of claims 16 to 18, wherein the system further includes a fourth node, and the fourth node is a superior node of the first node; after the first node sends the second providing message to the third node, the method further includes:
    在确定与所述第二节点断开连接之后,所述第一节点发送第三发现报文,所述第三发现报文用于请求分配地址;After determining to disconnect from the second node, the first node sends a third discovery message, where the third discovery message is used to request address allocation;
    所述第四节点接收所述第三发现报文,并向所述第一节点发送第三提供报文,所述第三提供报文包括所述第四节点为所述第一节点分配的第三地址;其中,所述第三地址包括第五字段和第六字段,所述第五字段的取值为第四节点的地址的取值,所述第六字段的取值为所述第一节点的标识;The fourth node receives the third discovery message, and sends a third provision message to the first node, the third provision message includes a third address allocated by the fourth node to the first node; wherein, the third address includes a fifth field and a sixth field, the value of the fifth field is the value of the address of the fourth node, and the value of the sixth field is the identifier of the first node;
    所述第一节点接收所述第三提供报文。The first node receives the third offer message.
  20. 根据权利要求19所述的方法,其特征在于,所述方法还包括:The method according to claim 19, further comprising:
    所述第三节点接收所述第三发现报文;The third node receives the third discovery message;
    所述第三节点向所述第一节点发送第四非确认报文,所述第四非确认报文用于指示拒绝分配地址;The third node sends a fourth non-confirmation message to the first node, where the fourth non-confirmation message is used to indicate refusal to allocate an address;
    所述第一节点接收所述第四非确认报文。The first node receives the fourth non-confirmation message.
  21. 根据权利要求16至20任一项所述的方法,其特征在于,在所述第一节点接收来自所述第二节点的所述第一提供报文之后,所述方法还包括:The method according to any one of claims 16 to 20, wherein after the first node receives the first providing message from the second node, the method further comprises:
    在确定与所述第二节点断开连接之后,所述第一节点清除所述第一地址。After determining to disconnect from the second node, the first node clears the first address.
  22. 根据权利要求17至21任一项所述的方法,其特征在于,所述确定与所述第二节点断开连接包括以下至少一项:The method according to any one of claims 17 to 21, wherein the determining to disconnect from the second node includes at least one of the following:
    确定与所述第二节点之间的端口状态为故障down;或,determining that the state of the port with the second node is down; or,
    确定所述第一地址续租超时;或,determining that the lease renewal of the first address has timed out; or,
    所述第一节点接收来自所述第二节点的第二变更报文,以指示所述第一节点清除所述第一地址。The first node receives a second change message from the second node to instruct the first node to clear the first address.
  23. 根据权利要求16至22任一项所述的方法,其特征在于,在所述第一节点接收所述第一提供报文之前,所述方法还包括:The method according to any one of claims 16 to 22, wherein before the first node receives the first provision message, the method further comprises:
    所述第三节点发送第四发现报文,所述第四发现报文用于请求分配地址;The third node sends a fourth discovery message, where the fourth discovery message is used to request address allocation;
    所述第一节点接收所述第四发现报文,并向所述第三节点发送第一非确认报文,所述第一非确认报文用于指示拒绝分配地址;The first node receives the fourth discovery message, and sends a first non-confirmation message to the third node, where the first non-confirmation message is used to indicate refusal to allocate an address;
    所述第三节点接收所述第一非确认报文。The third node receives the first non-confirmation message.
  24. 根据权利要求16至23任一项所述的方法,其特征在于,在所述第一节点接收所述第一提供报文之前,所述方法还包括:The method according to any one of claims 16 to 23, wherein before the first node receives the first provision message, the method further comprises:
    所述第三节点接收所述第一发现报文;The third node receives the first discovery packet;
    所述第三节点向所述第一节点发送第二非确认报文,所述第二非确认报文用于指示拒绝分配地址;The third node sends a second non-confirmation message to the first node, where the second non-confirmation message is used to indicate refusal to allocate an address;
    所述第一节点接收所述第二非确认报文。The first node receives the second non-confirmation message.
  25. 根据权利要求16至24任一项所述的方法,其特征在于,在所述第一节点接收第一提供报文之后且在所述第一节点发送所述第二提供报文之前,所述方法还包括:The method according to any one of claims 16 to 24, wherein after the first node receives the first offer message and before the first node sends the second offer message, the method further comprises:
    所述第一节点发送第一请求报文,所述第一请求报文用于指示请求使用所述第一地址;The first node sends a first request message, where the first request message is used to indicate a request to use the first address;
    所述第二节点接收所述第一请求报文,并向所述第一节点发送第一确认报文,所述第一确认报文用于指示允许使用所述第一地址;The second node receives the first request message, and sends a first confirmation message to the first node, where the first confirmation message is used to indicate that the first address is allowed to be used;
    所述第一节点接收所述第一确认报文。The first node receives the first confirmation message.
  26. 根据权利要求25所述的方法,其特征在于,在所述第一节点接收第一确认报文之前,所述方法还包括:The method according to claim 25, wherein, before the first node receives the first confirmation message, the method further comprises:
    所述第三节点发送第五发现报文,所述第五发现报文用于请求分配地址;The third node sends a fifth discovery message, where the fifth discovery message is used to request address allocation;
    所述第一节点接收所述第五发现报文,并向所述第三节点发送第三非确认报文,所述第三非确认报文用于指示拒绝分配地址;The first node receives the fifth discovery message, and sends a third non-confirmation message to the third node, where the third non-confirmation message is used to indicate refusal to allocate an address;
    所述第三节点接收所述第三非确认报文。The third node receives the third non-confirmation message.
  27. 根据权利要求16至26任一项所述的方法,其特征在于,在所述第一节点发送第二提供报文之后,所述方法还包括:The method according to any one of claims 16 to 26, wherein after the first node sends the second offer message, the method further comprises:
    所述第三节点发送第二请求报文,所述第二请求报文用于指示请求使用所述第二地址;The third node sends a second request message, where the second request message is used to indicate a request to use the second address;
    所述第一节点接收所述第二请求报文,并向所述第三节点发送第二确认报文,所述第二确认报文用于指示允许使用所述第二地址;The first node receives the second request message, and sends a second confirmation message to the third node, where the second confirmation message is used to indicate that the second address is allowed to be used;
    所述第三节点接收所述第二确认报文。The third node receives the second confirmation message.
  28. 根据权利要求16至27任一项所述的方法,其特征在于,A method according to any one of claims 16 to 27, wherein,
    所述第一发现报文、所述第一提供报文、所述第二发现报文和所述第二提供报文均为动态主机配置协议DHCP报文。The first discovery message, the first offer message, the second discovery message and the second offer message are all dynamic host configuration protocol DHCP messages.
  29. 根据权利要求16至28任一项所述的方法,其特征在于,A method according to any one of claims 16 to 28, wherein
    所述第一地址和所述第二地址均为新互联网协议NewIP地址。Both the first address and the second address are New IP addresses.
  30. 根据权利要求16至29任一项所述的方法,其特征在于,A method according to any one of claims 16 to 29, wherein
    在所述第一地址中,所述第一字段位于所述第二字段之前;In the first address, the first field precedes the second field;
    和/或,and / or,
    在所述第二地址中,所述第三字段位于所述第四字段之前。In the second address, the third field is located before the fourth field.
  31. 根据权利要求16至30任一项所述的方法,其特征在于,所述方法应用于树形网络,所述第二节点为所述树形网络的根节点或所述树形网络的中间节点。The method according to any one of claims 16 to 30, wherein the method is applied to a tree network, and the second node is a root node of the tree network or an intermediate node of the tree network.
  32. 根据权利要求16至31任一项所述的方法,其特征在于,所述方法应用于树形网络,所述第三节点为所述树形网络的叶子节点或所述树形网络的中间节点。The method according to any one of claims 16 to 31, wherein the method is applied to a tree network, and the third node is a leaf node of the tree network or an intermediate node of the tree network.
  33. 一种通信装置,其特征在于,包括接收单元和发送单元,所述接收单元和所述发送单元用于执行如权利要求1至15任一项所述的方法。A communication device, characterized by comprising a receiving unit and a sending unit, the receiving unit and the sending unit are configured to execute the method according to any one of claims 1 to 15.
  34. 一种通信装置,其特征在于,包括至少一个处理器,以及与所述至少一个处理器耦合的存储器;A communication device, characterized by comprising at least one processor, and a memory coupled to the at least one processor;
    所述存储器用于存储程序或指令;The memory is used to store programs or instructions;
    所述至少一个处理器用于执行所述程序或指令,以使所述通信装置实现如权利要求1至15任一项所述的方法。The at least one processor is configured to execute the program or instructions, so that the communication device implements the method according to any one of claims 1 to 15.
  35. 一种通信系统,其特征在于,包括第一节点、第二节点和第三节点,其中,所述第二节点为所述第一节点的上级节点且所述第三节点为所述第一节点的下级节点;A communication system, characterized by comprising a first node, a second node and a third node, wherein the second node is a superior node of the first node and the third node is a subordinate node of the first node;
    所述通信系统用于实现如权利要求16至32任一项所述的方法。The communication system is used to implement the method according to any one of claims 16-32.
  36. 一种计算机可读存储介质,其特征在于,包括程序或指令,当所述程序或指令在计算机上运行时,使得如权利要求1至32中任一项所述的方法被执行。A computer-readable storage medium, which is characterized by including programs or instructions, and when the programs or instructions are run on a computer, the method according to any one of claims 1 to 32 is executed.
PCT/CN2022/137884 2022-01-24 2022-12-09 Communication method and communication apparatus WO2023138256A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202210082179.4 2022-01-24
CN202210082179 2022-01-24
CN202210327033.1 2022-03-30
CN202210327033.1A CN116527579A (en) 2022-01-24 2022-03-30 Communication method and communication device

Publications (1)

Publication Number Publication Date
WO2023138256A1 true WO2023138256A1 (en) 2023-07-27

Family

ID=87347777

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/137884 WO2023138256A1 (en) 2022-01-24 2022-12-09 Communication method and communication apparatus

Country Status (1)

Country Link
WO (1) WO2023138256A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859436A (en) * 2005-08-04 2006-11-08 上海华为技术有限公司 Method for distributing address in cascade group net
CN103532741A (en) * 2013-09-27 2014-01-22 瑞斯康达科技发展股份有限公司 Access level network topology management method and system
US20160378706A1 (en) * 2015-06-29 2016-12-29 Futurewei Technologies, Inc. Method and system for aggregation-friendly address assignment to pcie devices
CN107360266A (en) * 2017-06-16 2017-11-17 北京星网锐捷网络技术有限公司 A kind of method and system that terminal STA roaming is realized in big double layer network
CN110445889A (en) * 2019-09-20 2019-11-12 中国海洋大学 Switch ip address management method and system under a kind of ethernet environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859436A (en) * 2005-08-04 2006-11-08 上海华为技术有限公司 Method for distributing address in cascade group net
CN103532741A (en) * 2013-09-27 2014-01-22 瑞斯康达科技发展股份有限公司 Access level network topology management method and system
US20160378706A1 (en) * 2015-06-29 2016-12-29 Futurewei Technologies, Inc. Method and system for aggregation-friendly address assignment to pcie devices
CN107360266A (en) * 2017-06-16 2017-11-17 北京星网锐捷网络技术有限公司 A kind of method and system that terminal STA roaming is realized in big double layer network
CN110445889A (en) * 2019-09-20 2019-11-12 中国海洋大学 Switch ip address management method and system under a kind of ethernet environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HUAWEI: "Routing Address Design and Configuration", 3GPP DRAFT; R3-190493 ROUTING ADDRESS DESIGN AND CONFIGURATION, 3RD GENERATION PARTNERSHIP PROJECT (3GPP), MOBILE COMPETENCE CENTRE ; 650, ROUTE DES LUCIOLES ; F-06921 SOPHIA-ANTIPOLIS CEDEX ; FRANCE, vol. RAN WG3, no. Athens; 20180225 - 20180301, 15 February 2019 (2019-02-15), Mobile Competence Centre ; 650, route des Lucioles ; F-06921 Sophia-Antipolis Cedex ; France , XP051604433 *

Similar Documents

Publication Publication Date Title
US11909652B2 (en) Method, device and storage medium for quality of service (QoS) flow management of time sensitive data for transmission of ethernet packet filter sets
EP3627773B1 (en) Bras system-based message encapsulation method and device
JP5465785B2 (en) Wireless remote unit link self-adaptive method and apparatus
CN101459536B (en) Port configuration method and switching device
JP2011508551A (en) Apparatus and method for simultaneously accessing multiple wireless networks
WO2007052913A1 (en) Method of generating and managing connection identifiers for supporting multicast for each group in ipv6-based wireless network and network interface using the method
WO2021027858A1 (en) Method and device for determining rlc channel
WO2014010183A1 (en) Gateway device, network system, and communication method
US12068952B2 (en) Routing information publishing method, apparatus, and system
JP2012104970A (en) Communication apparatus, and control method thereof
US20220094572A1 (en) Gateway selection method, device, and system
KR20170076064A (en) Method, apparatus and computer program for subnetting of software defined network
WO2011153870A1 (en) System, method and base station for implementing local switching transmission
WO2023138256A1 (en) Communication method and communication apparatus
WO2018053895A1 (en) Type-based uplink data encryption control method and device for internet-of-things access point
WO2021102694A1 (en) Ble mesh device access method and apparatus, device and storage medium
WO2022087795A1 (en) Resource mapping method and apparatus, device, and storage medium
CN113873554B (en) Method and system for synchronous configuration acquisition and transmission of Mesh networking
WO2012132180A1 (en) Transfer control device, integrated circuit thereof, transfer control method, and transfer control system
CN116527579A (en) Communication method and communication device
CN115428415A (en) System and method for forwarding packets in a hierarchical network architecture using variable length addresses
WO2022087796A1 (en) Zigbee device attribute subscription method and apparatus, and device
WO2022126399A1 (en) Communication method and communication apparatus
WO2022160982A1 (en) Ipv6 address configuration method and routing device
WO2022228293A1 (en) Packet sending method, packet processing method, and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22921680

Country of ref document: EP

Kind code of ref document: A1