Decentralized network device system, method, network cloud packet forwarder, and readable storage medium
Embodiments of this application disclose a decentralized network device system, method, network cloud packet forwarder, and readable storage medium. The system includes: one or more network cloud packet forwarders NCPs, including one or more candidate management NCPs and a primary management NCP, where the one or more candidate management NCPs are determined by the one or more NCPs based on received configuration packets, the primary management NCP is determined from the one or more candidate management NCPs through an election algorithm, and the primary management NCP is configured to centrally process management service packets of the system; and one or more network cloud fabrics NCFs, configured to receive and forward packets from the one or more NCPs, the packets including packets notifying results of the election algorithm and management service packets.
1 . A decentralized network device system comprising:
one or more network cloud packet forwarders (NCPs), comprising one or more candidate management NCPs and a primary management NCP, wherein the one or more candidate management NCPs are determined by the one or more NCPs based on received configuration packets, the primary management NCP is determined from the one or more candidate management NCPs through an election algorithm, and the primary management NCP is configured to centrally process a management service packet of the system for maintenance and management of the system; and
one or more network cloud fabrics (NCFs), configured to receive and forward a packet from the one or more NCPs, wherein the packet comprises a packet notifying results of the election algorithm and a management service packet;
wherein the decentralized network device system is provided without a network cloud controller (NCC);
wherein the one or more NCPs are further configured, respectively, to:
process a control service packet for the one or more NCPs in a distributed manner, wherein the control service packet is a packet for configuring protocols and/or controlling the one or more NCFs and the one or more NCPs in the decentralized network device system.
2 . The system according to claim 1 , wherein the one or more NCPs further comprise a backup management NCP, the backup management NCP is determined from the one or more candidate management NCPs through the election algorithm and is different from the primary management NCP, and the primary management NCP is further configured to:
back up management data for managing the one or more NCFs and the one or more NCPs to the backup management NCP.
3 . The system according to claim 2 , wherein the backup management NCP is further configured to:
receive the management data from the primary management NCP for backup; and
switch to become a new primary management NCP upon determining a failure occurrence of the primary management NCP.
4 . The system according to claim 3 , wherein the backup management NCP is further configured to:
send a re-election packet to the one or more candidate management NCPs via an NCF connected to the backup management NCP upon determining a failure occurrence of the primary management NCP, so that the one or more candidate management NCPs determine a new backup management NCP from the one or more candidate management NCPs through the election algorithm.
5 . The system according to claim 3 , wherein the primary management NCP is further configured to:
update a correspondence between an IP address corresponding to the primary management NCP and the primary management NCP to a mapping table of IP addresses and NCPs after being determined as the primary management NCP from the one or more candidate management NCPs; and
update a correspondence between an IP address corresponding to the new primary management NCP and the new primary management NCP to the mapping table of IP addresses and NCPs after the backup management NCP is switched to become the new primary management NCP.
6 . The system according to claim 1 , wherein the management service packet comprise configuration information of the one or more NCFs and the one or more NCPs, and the primary management NCP is further configured to:
acquire configuration information of the one or more NCFs and the one or more NCPs in the system; and
distribute the configuration information to a new NCP or NCF after determining that the new NCP or NCF has joined.
7 . The system according to claim 1 , wherein the management service packet comprises version files for the one or more NCFs and the one or more NCPs, and the primary management NCP is further configured to:
receive the version files and send the version files to an NCP to be upgraded and/or an NCF to be upgraded, wherein the NCP to be upgraded is at least one of the one or more NCPs, and the NCF to be upgraded is at least one of the one or more NCFs.
8 . The system according to claim 1 , wherein the one or more NCPs comprise a first NCP, and the first NCP is further configured to:
receive an incoming packet and determine whether to process the incoming packet by querying a mapping table of IP addresses and NCPs based on a destination internet protocol IP address of the incoming packet; and
send the incoming packet to an NCP corresponding to a destination IP address for processing when the NCP corresponding to the destination IP address of the incoming packet is determined not to be the first NCP.
9 . The system according to claim 1 , wherein a quantity of the one or more candidate management NCPs is less than a quantity of the one or more NCPs.
10 . The system according to claim 1 , wherein the management service packet is a packet for configuration distribution, fault diagnosis, system upgrades, or managing NCFs and NCPs in the system.
11 . A decentralized network construction method, applied to a network cloud packet forwarder (NCP) of one or more NCPs of a decentralized network device system further comprising one or more network cloud fabrics (NCFs), the method comprising:
receiving a configuration packet and determining a primary management NCP among one or more candidate management NCPs through an election algorithm upon determining, based on the configuration packet, that the NCP itself belongs to the candidate management NCPs; and
acquiring an election result and centrally processing management service packets of the system for maintenance and management of the system upon determining, based on the election result, that the NCP itself belongs to the primary management NCP;
wherein the decentralized network device system is provided without a network cloud controller (NCC);
wherein the method comprises:
processing a control service packet for the one or more NCPs in a distributed manner, wherein the control service packet is a packet for configuring protocols and/or controlling the one or more NCFs and the one or more NCPs in the decentralized network device system.
12 . The method according to claim 11 , further comprising:
acquiring configuration information of one or more network cloud fabrics (NCFs) and one or more NCPs in the system;
distributing the configuration information to a new NCP or NCF after determining that the new NCP or NCF has joined; and
backing up management data for managing the one or more NCFs and the one or more NCPs in the system to a backup management NCP, wherein the backup management NCP is elected from the one or more candidate management NCPs.
13 . The method according to claim 12 , further comprising:
updating a correspondence between an IP address of the primary management NCP and the primary management NCP to a mapping table of IP addresses and NCPs after being determined as the primary management NCP from the one or more candidate management NCPs; and
updating a correspondence between an IP address corresponding to a new primary management NCP and the new primary management NCP to the mapping table of IP addresses and NCPs after the backup management NCP is switched to become the new primary management NCP.
14 . The method according to claim 11 , further comprising:
determining a backup management NCP among multiple candidate management NCPs through an election algorithm upon determining, based on the configuration packet from a management server, that the NCP itself belongs to the candidate management NCPs; and
receiving the management data from the primary management NCP for backup upon determining, based on the election result, that the NCP itself belongs to the backup management NCP; and switching to become a new primary management NCP upon determining a failure occurrence of the primary management NCP.
15 . The method according to claim 14 , further comprising:
sending a re-election packet to the one or more candidate management NCPs via an NCF corresponding to the NCP itself upon determining a failure occurrence of the primary management NCP, so that the one or more candidate management NCPs determine a new backup management NCP from the one or more candidate management NCPs through the election algorithm.
16 . The method according to claim 11 , further comprising:
receiving version files of the one or more NCFs and the one or more NCPs and sending the version files to the corresponding NCPs or NCFs, so that the one or more NCPs or the one or more NCFs complete an upgrade operation based on the version files.
17 . The method according to claim 11 , further comprising:
receiving an incoming packet and determining whether to process the incoming packet by querying a mapping table of IP addresses and NCPs based on a destination IP address of the incoming packet; and
sending the incoming packet to an NCP corresponding to the destination IP address for processing when the NCP corresponding to the destination IP address of the incoming packet is determined not to be this NCP.
18 . A network cloud packet forwarder NCP comprising:
a processor and a memory;
wherein the memory is configured to store instructions executable by the processor; and
the processor is configured to execute the instructions to implement the decentralized network construction method according to claim 11 .
19 . A non-transitory computer-readable storage medium, wherein a computer program executable by a computer is stored therein, and when the program runs on the computer, the computer executes the method according to claim 11 .