LLDP-based IP dynamic planning allocation method
By using the LLDP-based IP dynamic planning method, and leveraging the dcn net id attribute and customized TLV messages, neighbor discovery and primary/standby election between devices are achieved. This solves the problem of manual intervention required for IP address planning in existing technologies, and realizes automatic coordination between devices and dynamic planning of IP addresses across the entire network.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- THE 34TH RES INST OF CHINA ELECTRONICS TECH CORP
- Filing Date
- 2023-05-19
- Publication Date
- 2026-05-01
AI Technical Summary
Existing IP address planning requires manual intervention and the allocation method is inflexible, making it impossible to achieve automatic coordination between devices and dynamic planning of IP addresses across the entire network.
The IP dynamic programming method based on LLDP is adopted. By setting the dcn net id attribute in network devices, the customized TLV message of the LLDP protocol is used to realize neighbor discovery and primary/standby election between devices, dynamically allocate IP addresses, and ensure the uniqueness and automatic coordination of IP addresses across the entire network.
It enables automatic IP address allocation without human intervention, ensures consistency between devices, guarantees the uniqueness and flexibility of IP addresses, and simplifies network management.
Smart Images

Figure CN116436898B_ABST
Abstract
Description
A Dynamic Programming IP Allocation Method Based on LLDP Technical Field
[0001] This invention relates to the field of computer network technology, specifically to an IP dynamic programming allocation method based on LLDP. Background Technology
[0002] LLDP (Link Discovery Protocol) is a data link layer protocol. Network devices use LLDP messages to notify other devices of their own status. It is a link layer protocol that enables network devices in the network to discover, notify, and exchange information with each other.
[0003] In the past, IP address planning required users to apply to the server for a specified range of IP addresses. The server would then allocate the IP addresses and subnet masks. The range of IP addresses allocated by the server was fixed and required unified management and configuration by the administrator. Summary of the Invention
[0004] The purpose of this invention is to address the shortcomings of existing technologies by providing an IP dynamic planning and allocation method based on LLDP. This method requires no manual intervention in IP allocation, and the IP allocation is in a one-to-many manner, i.e., it is uniformly allocated by a central server, enabling automatic dynamic planning and allocation of IP addresses across the entire network through coordination among devices.
[0005] The technical solution to achieve the objective of this invention is:
[0006] A dynamic programming method for IP allocation based on LLDP includes the following steps:
[0007] 1) Determine the DCN net id attribute for a network element: Provide a DCN net id attribute for a packet transmission network device (i.e., a network element) in the network to represent the network element performing this function. This attribute is represented in the same way as an IP address. The composition of the IP address allocated by DI is shown in Table 1. The network element ID must guarantee the uniqueness of bits 31-16 across the entire network; otherwise, it will lead to network IP address conflicts. The high 16 bits are determined by the DCN net id attribute. The network element ID can be manually set by the user. If the user does not configure a network element ID but configures a loopback0 IP, then the network element ID is the loopback0 IP. Table 1 shows:
[0008] Table 1. Explanation of IP Address Composition
[0009]
[0010] Dynamic IP addresses are generated based on the following principles:
[0011] 1-1) The network address of the IP address can be set according to the actual deployment requirements. By default, it is represented by 23 bits, that is, the IP address mask is 23 bits.
[0012] 1-2) The components of an IP address are: ABCD, where AB is the network element ID, the high 7 bits of C represent the network element port number, and the low 1 bit of C and the 9 bits of D represent the network element host number. The host number is used to ensure that the IP addresses of various network element devices in the subnet do not conflict.
[0013] 1-3) When dynamically allocating IP addresses, the DI device is fixedly assigned host number 2, and the IP addresses of other devices in the subnet increment from 3 onwards;
[0014] 1-4) The uniqueness of the IP address of all network element devices is guaranteed by the net id of each device (ABCD).
[0015] 2) Dynamic IP Address Planning: Dynamic IP address planning requires the election of DI and BDI (primary / backup) ports within the subnet. The elected DI, i.e., the primary / backup device in the primary / backup election, assigns IP addresses to all ports in the network. The port performing the election selects valid DI and BDI ports based on neighbor information collected by the LLDP protocol and according to the election rules, including:
[0016] 2-1) The neighbor discovery process relies on the LLDP protocol. Standard LLDP messages cannot complete DCN election. To complete DI and BDI election, a private TLV needs to be added to the standard LLDP protocol messages. The standard LLDP protocol message format is as follows:
[0017] DA(6)SA(6)ETH-TYPE(2)PDUFCS(4) surface
[0018] In this case, ETH-TYPT is set to 0x88cc, and the LLDP PDU encapsulates the data in TLV format.
[0019] ChassisID TLVPortID TLVTTL TLVOption TLV…End of PDU TLV surface
[0020] Among them, the four TLVs, ChassisID, PortID, TTL (Time To Live), and End of PDU, must be encapsulated. Each TLV contains three parts: Tag Length Value.
[0021] Tag (7 bits) Length (9 bits) Value surface
[0022] Based on the standard message, the standard LLDP reserved TLV is customized, and four optional TLVs are selected to define the announcement content required in this document. The specific definitions are shown in Table 2:
[0023] Table 2 Customized LLDP Private TLV
[0024]
[0025] 2-2) Run the LLDP protocol to perform link state discovery on the network elements of the access network, and obtain the interconnection port information of the neighboring devices connected to the current port, specifically:
[0026] 2-2-1) When the physical port state changes to UP, the LLDP protocol starts the neighbor discovery process and sends a broadcast message to the neighbor. At this time, the port discovers the neighbor for the first time. There is no information about the neighbor, DI, or BDI locally. The message does not contain the three TLVs: DI, BDI, and neighbor list. The LLDP message must contain the Special Attribution TLV to perform DI election.
[0027] 2-2-2) When the port receives an LLDP message from a neighbor on the network, if the neighbor information is not available locally, the neighbor is added to the local neighbor list. If the neighbor information exists locally, the local neighbor information is updated, including DI, BDI, neighbor list, and neighbor attributes. The ChassisID data in the LLDP message is saved as the local neighbor MAC address. The MAC address will be used as an indicator for the election rules of DI and BDI.
[0028] 2-2-3) After receiving a packet, the port checks whether it exists in the neighbor list according to the neighbor list TLV carried in the packet. When it finds that its own MAC is in the neighbor list, it means that a bidirectional link has been established, the neighbor status is updated to bidirectional link, and DI election is performed.
[0029] 2-2-4) Extract the DI and BDI fields from the message. This field represents the neighbor's current local DI and BDI. When a port receives the neighbor's DI and BDI information, it first determines whether the local port has DI information. If it does not have DI information, it directly uses the neighbor's DI information as the local port's DI information and decides whether to process the IP request or send the request based on the port's role, i.e., DI or other factors. If the local port has DI information, it checks the election results of the local port and the neighbor's port. If the election results meet the rules, it does not re-elect; otherwise, it clears the local DI or BDI information and re-elects.
[0030] 2-2-5) After the neighbor relationship is established, the port determines whether the neighbor status is active based on the periodic LLDP messages. If the neighbor status is inactive, the neighbor information stored locally is deleted and the neighbor status is updated.
[0031] 2-3) After receiving the neighbor information from step 2-2), the primary / standby election process for the current port is initiated: The concept of port priority is introduced. Users configure port priorities according to network planning. The default value of the priority is 1. The interface priority and MAC address together determine whether the port can become a DI or BDI, as detailed below:
[0032] 2-3-1) The candidate list for DI and BDI is determined by the following criteria: the neighbor port priority is not 0, the neighbor status is bidirectional connection, the interface type is broadcast, and the IP address type is a neighbor that needs to be automatically assigned an IP address.
[0033] 2-3-2) Electing a BDI: First, exclude ports that have declared themselves as DI from the candidate list. Then, select the port with the highest priority from the ports that claim to be BDI. If the priorities are the same, select the port with the largest MAC address as BDI. If no port recommends itself as BDI, select the port with the highest priority from the candidate list as BDI. If the priorities are the same, select the port with the largest MAC address as BDI.
[0034] 2-3-3) Electing a DI: First, select ports that claim to be the DI from the candidate list, and select the port with the highest priority as the DI. If the priorities are the same, the port with the largest MAC address becomes the DI. If no port recommends itself as the DI, the BDI is promoted to the DI.
[0035] 2-3-4) If the current port becomes a new DI or BDI, or is no longer a DI or BDI, repeat the election steps for BDI and DI to ensure that the port does not claim to be both DI and BDI at the same time.
[0036] 3) Network element updates local DI and BDI information: After the primary / standby election is completed, the network element updates its local DI and BDI information. When the LLDP protocol sends LLDP messages to other ports in the network, it carries the updated DI and BDI information. The port that becomes the DI enters the address allocation state and first allocates an IP address for itself. After the port is finally elected as the BDI interface, it requests an IP address by sending a PPPoE message to the DI, i.e., a maintenance message. Non-DI ports construct PPPoE messages and send them to the DI. The IP address in the message is 0 or a currently existing IP address. If the interface does not currently have an IP address, it needs to send a request to the DI to allocate an IP address, setting the IP address in the message to 0.0.0.0 and waiting for the DI to allocate it. If the port currently has an IP address, it fills the IP address into the message and waits for the DI to confirm the validity of the IP address. The IP address dynamically allocated by the DI consists of the three parts in Table 3 below:
[0037] Table 3. IP Address Representation
[0038]
[0039]
[0040] When a port requests an IP address allocation, DI will combine the current state of the local IP address pool to allocate segment 3 and segment 4 to the requested port, according to the following rules:
[0041] 3-1) DI self-check: If this address allocation is DI, and it is not the first time to apply for an IP for itself, and the current DI IP address is marked as occupied in the local IP address pool, then the subsequent allocation process is not required, and this IP allocation ends.
[0042] 3-2) The IP request for this allocation is sent from a non-DI port. DI checks the local neighbor information. If a valid IP address has already been allocated to the neighbor, the subsequent allocation process will not continue, and the IP allocation ends.
[0043] 3-3) If the IP address carried in this non-DI port request is not 0, and the segment1 and segment2 of the requested IP address are inconsistent with the segment1 and segment2 of the current DI IP address, then DI will initiate an allocation process to reallocate the IP address of the requested port. After the allocation is completed, the DI port will send a reply message with the newly allocated IP address to the requesting port.
[0044] 3-4) The IP address carried in this non-DI port request is not 0. DI allocates a valid segment3 for the request source. Segment3 is obtained by mapping the port number. If the segment3 of the request source IP address is inconsistent with the segment3 allocated by DI, the DI port will carry a reply message with the newly allocated IP address to the request port.
[0045] 3-5) If the IP address carried in this non-DI port request is not 0, and the segment 4 of this IP address is inconsistent with the valid host number assigned to it by DI, then the DI port will carry a reply message with the newly assigned IP address to the requesting port.
[0046] 3-6) Combine the high 16 bits of the DI's dcn net id attribute, the 7 bits obtained by mapping the requesting device port number, and the 8 bits of the DI-assigned host number to form a valid IP address.
[0047] This method of IP allocation does not require manual intervention and is a one-to-many IP allocation method, that is, the central server allocates IPs uniformly, which enables devices to coordinate with each other to allocate IPs and automatically and dynamically plan the allocation of IP addresses across the entire network. Attached Figure Description
[0048] Figure 1 is a schematic diagram of the network topology of two interconnected ports in the embodiment. Detailed Implementation
[0049] The present invention will be further described below with reference to the accompanying drawings and embodiments, but this is not intended to limit the scope of the invention.
[0050] Example:
[0051] A dynamic programming method for IP allocation based on LLDP includes the following steps:
[0052] 1) Determine the DCN net id attribute for a network element: Provide a DCN net id attribute for a packet transmission network device (i.e., a network element) in the network to represent the network element performing this function. This attribute is represented in the same way as an IP address. The composition of the IP address allocated by DI is shown in Table 1. The network element ID must guarantee the uniqueness of bits 31-16 across the entire network; otherwise, it will lead to network IP address conflicts. The high 16 bits are determined by the DCN net id attribute. The network element ID can be manually set by the user. If the user does not configure a network element ID but configures a loopback0 IP, then the network element ID is the loopback0 IP. Table 1 shows:
[0053] Table 1. Explanation of IP Address Composition
[0054]
[0055]
[0056] Dynamic IP addresses are generated based on the following principles:
[0057] 1-1) The network address of the IP address can be set according to the actual deployment requirements. By default, it is represented by 23 bits, that is, the IP address mask is 23 bits.
[0058] 1-2) The components of an IP address are: ABCD, where AB is the network element ID, the high 7 bits of C represent the network element port number, and the low 1 bit of C and the 9 bits of D represent the network element host number. The host number is used to ensure that the IP addresses of various network element devices in the subnet do not conflict.
[0059] 1-3) When dynamically allocating IP addresses, the DI device is fixedly assigned host number 2, and the IP addresses of other devices in the subnet increment from 3 onwards;
[0060] 1-4) The uniqueness of the IP address of all network element devices is guaranteed by the net id of each device (ABCD).
[0061] In this example, as shown in Figure 1, the dcn net id of network device A is configured as 7.228.0.1, and the dcn net id of network device B is configured as 7.229.0.1;
[0062] 2) Dynamic IP Address Planning: Dynamic IP address planning requires the election of DI and BDI (primary / backup) ports within the subnet. The elected DI, i.e., the primary / backup device in the primary / backup election, assigns IP addresses to all ports in the network. The port performing the election selects valid DI and BDI ports based on neighbor information collected by the LLDP protocol and according to the election rules, including:
[0063] 2-1) The neighbor discovery process relies on the LLDP protocol. Standard LLDP messages cannot complete DCN election. To complete DI and BDI election, a private TLV needs to be added to the standard LLDP protocol messages. The standard LLDP protocol message format is as follows:
[0064] DA(6)SA(6)ETH-TYPE(2)PDUFCS(4) surface
[0065] In this case, ETH-TYPT is set to 0x88cc, and the LLDP PDU encapsulates the data in TLV format.
[0066] ChassisID TLVPortID TLVTTL TLVOption TLV…End of PDU TLV surface
[0067] Among them, the four TLVs, ChassisID, PortID, TTL (Time To Live), and End of PDU, must be encapsulated. Each TLV contains three parts: Tag Length Value.
[0068] Tag (7 bits) Length (9 bits) Value surface
[0069] Based on the standard message, the standard LLDP reserved TLV is customized, and four optional TLVs are selected to define the announcement content required in this document. The specific definitions are shown in Table 2:
[0070] Table 2 Customized LLDP Private TLV
[0071]
[0072]
[0073] 2-2) Run the LLDP protocol to perform link state discovery on the network elements of the access network, and obtain the interconnection port information of the neighboring devices connected to the current port, specifically:
[0074] 2-2-1) When the physical port state changes to UP, the LLDP protocol starts the neighbor discovery process and sends a broadcast message to the neighbor. At this time, the port discovers the neighbor for the first time. There is no information about the neighbor, DI, or BDI locally. The message does not contain the three TLVs: DI, BDI, and neighbor list. The LLDP message must contain the Special Attribution TLV to perform DI election.
[0075] 2-2-2) When the port receives an LLDP message from a neighbor on the network, if the neighbor information is not available locally, the neighbor is added to the local neighbor list. If the neighbor information exists locally, the local neighbor information is updated, including DI, BDI, neighbor list, and neighbor attributes. The ChassisID data in the LLDP message is saved as the local neighbor MAC address. The MAC address will be used as an indicator for the election rules of DI and BDI.
[0076] 2-2-3) After receiving a packet, the port checks whether it exists in the neighbor list according to the neighbor list TLV carried in the packet. When it finds that its own MAC is in the neighbor list, it means that a bidirectional link has been established, the neighbor status is updated to bidirectional link, and DI election is performed.
[0077] 2-2-4) Extract the DI and BDI fields from the message. This field represents the neighbor's current local DI and BDI. When a port receives the neighbor's DI and BDI information, it first determines whether the local port has DI information. If it does not have DI information, it directly uses the neighbor's DI information as the local port's DI information and decides whether to process the IP request or send the request based on the port's role, i.e., DI or other factors. If the local port has DI information, it checks the election results of the local port and the neighbor's port. If the election results meet the rules, it does not re-elect; otherwise, it clears the local DI or BDI information and re-elects.
[0078] 2-2-5) After the neighbor relationship is established, the port determines whether the neighbor status is active based on the periodic LLDP messages. If the neighbor status is inactive, the neighbor information stored locally is deleted and the neighbor status is updated.
[0079] 2-3) After receiving the neighbor information from step 2-2), the primary / standby election process for the current port is initiated: The concept of port priority is introduced. Users configure port priorities according to network planning. The default value of the priority is 1. The interface priority and MAC address together determine whether the port can become a DI or BDI, as detailed below:
[0080] 2-3-1) The candidate list for DI and BDI is determined by the following criteria: the neighbor port priority is not 0, the neighbor status is bidirectional connection, the interface type is broadcast, and the IP address type is a neighbor that needs to be automatically assigned an IP address.
[0081] 2-3-2) Electing a BDI: First, exclude ports that have declared themselves as DI from the candidate list. Then, select the port with the highest priority from the ports that claim to be BDI. If the priorities are the same, select the port with the largest MAC address as BDI. If no port recommends itself as BDI, select the port with the highest priority from the candidate list as BDI. If the priorities are the same, select the port with the largest MAC address as BDI.
[0082] 2-3-3) Electing a DI: First, select ports that claim to be the DI from the candidate list, and select the port with the highest priority as the DI. If the priorities are the same, the port with the largest MAC address becomes the DI. If no port recommends itself as the DI, the BDI is promoted to the DI.
[0083] 2-3-4) If the current port becomes a DI or BDI, or is no longer a DI or BDI, then repeat the BDI and DI election steps to ensure that the port does not simultaneously claim to be both a DI and a BDI. In this example:
[0084] As shown in Figure 1, the MAC address of network device A is 34:08:01:03:08:00, and the priority of port eth-0-1 is 1. The MAC address of network device B is 00:34:08:00:48:00, and the priority of port eth-0-1 is also 1. According to the election rules, when the priorities are the same, the port with the larger MAC address is elected as the DI. Therefore, port eth-0-1 of network device A is the DI, and port eth-0-1 of network device B is the BDI. The IP address of port eth-0-1 of network device A is assigned to port eth-0-1 of network device B.
[0085] 3) Network element updates local DI and BDI information: After the primary / standby election is completed, the network element updates its local DI and BDI information. When the LLDP protocol sends LLDP messages to other ports in the network, it carries the updated DI and BDI information. The port that becomes the DI enters the address allocation state and first allocates an IP address for itself. After the port is finally elected as the BDI interface, it requests an IP address by sending a PPPoE message to the DI, i.e., a maintenance message. Non-DI ports construct PPPoE messages and send them to the DI. The IP address in the message is 0 or a currently existing IP address. If the interface does not currently have an IP address, it needs to send a request to the DI to allocate an IP address, setting the IP address in the message to 0.0.0.0 and waiting for the DI to allocate it. If the port currently has an IP address, it fills the IP address into the message and waits for the DI to confirm the validity of the IP address. The IP address dynamically allocated by the DI consists of the three parts in Table 3 below:
[0086] Table 3. IP Address Representation
[0087]
[0088] When a port requests an IP address allocation, DI will combine the current state of the local IP address pool to allocate segment 3 and segment 4 to the requested port, according to the following rules:
[0089] 3-1) DI self-check: If this address allocation is DI, and it is not the first time to apply for an IP for itself, and the current DI IP address is marked as occupied in the local IP address pool, then the subsequent allocation process is not required, and this IP allocation ends.
[0090] 3-2) The IP request for this allocation is sent from a non-DI port. DI checks the local neighbor information. If a valid IP address has already been allocated to the neighbor, the subsequent allocation process will not continue, and the IP allocation ends.
[0091] 3-3) The IP address carried in this non-DI port request is not 0, and the segment1 and segment2 of the requested IP address are not the same as the segment1 and segment2 of the current DI IP address. one If the request is received, the DI will initiate an allocation process to reallocate an IP address to the requested port. After the allocation is completed, the DI port will send a reply message with the newly allocated IP address to the requesting port.
[0092] 3-4) The IP address carried in this non-DI port request is not 0. DI allocates a valid segment3 for the request source. Segment3 is obtained by mapping the port number. If the segment3 of the request source IP address is inconsistent with the segment3 allocated by DI, the DI port will carry a reply message with the newly allocated IP address to the request port.
[0093] 3-5) If the IP address carried in this non-DI port request is not 0, and the segment 4 of this IP address is inconsistent with the valid host number assigned to it by DI, then the DI port will carry a reply message with the newly assigned IP address to the requesting port.
[0094] 3-6) Combine the high 16 bits of the DI's dcn net id attribute, the 7 bits obtained by mapping the requesting device port number, and the 9 bits of the DI-assigned host number to form a valid IP address.
[0095] In this example, after the primary / standby election is completed, network devices A and B update their local DI and BDI information. When the LLDP protocol sends LLDP packets to other ports in the network, it carries the updated DI and BDI information. The port that becomes the DI enters the address allocation state and first allocates an IP address for itself. As shown in Figure 1, network device A allocates the IP address 7.228.14.2 / 23 to its port eth-0-1. After network device B's port eth-0-1 is finally elected as the BDI interface, it requests an IP address by sending a PPPoE packet (maintenance packet for this function) to the DI. Based on the high 16 bits of the dcn net id attribute of network device A, the 7 bits obtained by mapping the port number of network device B, and the 9 bits of the host number allocated by the DI, a valid IP address 7.228.14.3 is formed. Network device A replies with this IP address to network device B, and device B configures port eth-0-1 with 7.228.14.3 and a subnet mask of 23. The dynamic IP address allocation process ends.
Claims
1. A dynamic programming method for IP allocation based on LLDP, characterized in that, The steps include: 1) Determining the dcn net id attribute of the network element: A dcn net id attribute is provided for a packet transmission network device (i.e., a network element) in the network to represent the network element running this function. The representation of this attribute is the same as that of the IP address. The composition of the IP address allocated by DI is shown in Table 1. The network element ID must ensure that the 16th to 31st bits are unique across the entire network. The position count starts from the 0th bit, and the high 16 bits are determined by the dcn net id attribute. The network element ID can be manually set by the user. If the user does not configure the network element ID but configures the loopback0 IP, then the network element ID is the loopback0 IP. Table 1 is as follows: Table 1 IP Address Composition Description Dynamic IP addresses are generated based on the following principles: 1-1) The network address of the IP address can be set according to actual deployment requirements, and is represented by 23 bits by default, i.e., the IP address mask is 23 bits; 1-2) The components of the IP address are: ABCD, where AB is the network element ID, the high 7 bits of C represent the network element port number, and the lowest bit of C and the 9 bits of D represent the network element host number. The host number is used to ensure that the IP addresses of various network element devices within the subnet do not conflict; 1-3) When dynamically allocating IP addresses, the DI device is fixedly assigned a host number of 2, and the IP addresses of other devices within the subnet increment from 3; 1-4) The uniqueness of the IP address of all network element devices in the network is determined by the net address of each device. 1) ID guarantees ABCD; 2) Dynamic IP address planning: Dynamic IP address planning requires the election of DI and BDI in the subnet, i.e., primary and backup election. The elected DI, i.e., the primary device in the primary and backup election, assigns IP addresses to all ports in the network. The port that performs the election selects valid DI and BDI ports according to the neighbor information collected by the LLDP protocol and the election rules, including: 2-1) The neighbor discovery process relies on the LLDP protocol. The standard LLDP message cannot complete the election of DCN. A private TLV is added to the standard LLDP protocol message. The standard LLDP protocol message format is as follows: In this case, ETH-TYPT is set to 0x88cc, and the LLDP PDU encapsulates the data in TLV format. Among them, the four TLVs, ChassisID, PortID, TTL (Time To Live), and End of PDU, must be encapsulated. Each TLV contains three parts: Tag Length Value. Based on the standard message, the standard LLDP reserved TLVs are customized, and four optional TLVs are defined, as shown in Table 2: Table 2 Customized LLDP Private TLVs 2-2) The LLDP protocol is used to perform link state discovery on network elements in the access network and obtain the interconnection port information of neighboring devices connected to the current port. Specifically: 2-2-1) When the physical port state changes to UP, the LLDP protocol starts the neighbor discovery process and sends a broadcast message to the neighbor. At this time, the port discovers the neighbor for the first time. There is no information about the neighbor, DI, or BDI locally. The message does not contain the three TLVs: DI, BDI, and neighbor list. The LLDP message must contain the Special Attribution. DI election can only be performed using the TLV; 2-2-2) When a port receives an LLDP message from a neighbor on the network, if the neighbor information is not yet available locally, it adds the neighbor to the local neighbor list. If the neighbor information already exists locally, the local neighbor information is updated, including DI, BDI, neighbor list, and neighbor attributes. The ChassisID data in the LLDP message is saved as the local neighbor's MAC address. The MAC address is used for DI and BDI election, and the device with the larger MAC address becomes the DI; 2-2-3) After receiving the message, the port checks whether it exists in the neighbor list according to the neighbor list TLV carried in the message. If the port finds that its own MAC address exists in the neighbor list, it means that a bidirectional link has been established, the neighbor status is updated to bidirectional link, and DI election is performed; 2-2-4) The DI and BDI fields in the message are extracted. This field represents the neighbor's current local DI and BDI. When the port receives the neighbor's DI and BDI information, it first determines whether the DI information exists locally. If it does not exist, the neighbor's DI information is directly used as the local DI information, and the port's role (DI) is determined accordingly. I or other decisions determine whether to process IP requests or send requests; if DI information exists locally, check the election results of the local and neighboring ports. If the election results meet the rules, no re-election is required; otherwise, clear the local DI or BDI information and re-elect; 2-2-5) After the neighbor relationship is established, the port determines whether the neighbor status is active based on the periodic LLDP messages. If the neighbor status is inactive, delete the neighbor information stored locally and update the neighbor status; 2-3) After receiving the neighbor information in step 2-2), start the primary / backup election process of the current port: Introduce the concept of port priority. The user configures the port priority according to the network plan. The default value of the priority is 1. The interface priority and MAC address together determine whether the port can become a DI or BDI, as follows: 2-3-1) The port determines the candidate list of DI and BDI. The basis for determination is that the neighbor port priority is not 0, the neighbor status is bidirectional connection, the interface type is broadcast type, and the IP address type is a neighbor that needs to be automatically assigned an IP address. These can be added to the candidate list as candidate DI and BDI.2-3-2) Electing the BDI: First, exclude ports that claim to be the DI from the candidate list. Then, select the port with the highest priority from among those claiming to be the BDI. If the priorities are the same, elect the port with the largest MAC address as the BDI. If no port volunteered to be the BDI, select the port with the highest priority from the candidate list. If the priorities are all the same, select the port with the largest MAC address as the BDI. 2-3-3) Electing the DI: First, filter the ports that claim to be the DI from the candidate list, selecting the port with the highest priority. If the priorities are the same, select the port with the largest MAC address as the DI. If no port volunteered to be the DI... Then BDI is upgraded to DI; 2-3-4) If the current port becomes a new DI or BDI, or is no longer a DI or BDI, then the election steps for BDI and DI are repeated to ensure that the port does not simultaneously claim to be both DI and BDI; 3) Network element updates local DI and BDI information: After the primary / backup election is completed, the network element updates its local DI and BDI information. When the LLDP protocol sends LLDP messages to other ports in the network, it carries the updated DI and BDI information. The port that has become a new DI enters the address allocation state, first allocating an IP address for itself. After the port is finally elected as a BDI interface, it requests an IP address by sending a PPPoE message to the DI, i.e., a maintenance message. Non-DI ports construct PPPoE messages and send them to DI. The IP address in the message is 0 or a currently existing IP address. If the interface does not currently have an IP address, it needs to send a request to DI to allocate an IP address, setting the IP address in the message to 0.0.0.0 and waiting for DI to allocate it. If the port currently has an IP address, it fills the IP address into the message and waits for DI to confirm the validity of the IP address. The IP address dynamically allocated by DI consists of the three parts in Table 3 below: Table 3 IP address representation; When a port requests an IP address allocation, DI, based on the current state of its local IP address pool, allocates segment 3 and segment 4 to the requested port. The specific rules are as follows: 3-1) DI self-check: If this address allocation is for DI, and it's not the first time requesting an IP address for itself, and the current DI IP address is marked as occupied in the local IP address pool, then the subsequent allocation process is not continued, and this IP allocation ends; 3-2) If the IP request originates from a non-DI port, DI checks its local neighbor information. If a valid IP address has already been allocated to that neighbor, then the subsequent allocation process is not continued, and this IP allocation ends; 3-3) If the IP address carried in this non-DI port request is not 0, and the requested IP address's segment 1 and segment 2 match the segment 4 of DI's current IP address... If segment 1 and segment 2 are inconsistent, DI initiates an allocation process to reallocate an IP address to the requested port. After allocation, the DI port will send a reply message with the newly allocated IP address to the requesting port. 3-4) If the IP address carried in this non-DI port request is not 0, DI allocates a valid segment 3 for the requesting source. Segment 3 is mapped from the port number. If segment 3 of the requesting source IP address is inconsistent with segment 3 allocated by DI, the DI port will send a reply message with the newly allocated IP address to the requesting port. 3-5) If the IP address carried in this non-DI port request is not 0, and segment 4 of this IP address is inconsistent with the valid host number allocated by DI, the DI port will send a reply message with the newly allocated IP address to the requesting port. 3-6) A valid IP address is formed by combining the high 16 bits of the DI's dcn net id attribute, the 7 bits obtained by mapping the requesting device port number, and the 8 bits of the DI-allocated host number.
Citation Information
Patent Citations
Topology discovery method and device
CN102136928A
DCN network self-connection method based on dynamic programming
CN110086684A