Efficient high availability within a network device
A network device is provided. During operation, the network device receives, from a first hardware unit of the network device, a message indicating an operation to be performed at the network device. Here, the first hardware unit includes processing resources distinct from the processing resources of the network device. The network device performs the operation at the network device based on information in the message. The network device sends an output of the operation to a second hardware unit of the network device that operates as a standby for the first hardware unit for facilitating high availability. The network device then updates the second hardware unit with the output of the operation to synchronize between the first and second hardware units via the processing resources of the network device. Subsequently, the network device provides, to the first hardware unit, an acknowledgment of the completion of the operation.
1 . A method, comprising:
receiving, by a processing resource of a network device from a first hardware unit within the network device, a message indicating an operation to be performed at the network device, wherein the first hardware unit includes a first processing resource distinct from the processing resource of the network device;
performing the operation at the processing resource of the network device based on information in the message;
sending an output of the operation to a second hardware unit within the network device that operates as a standby for the first hardware unit for facilitating high availability, wherein the second hardware unit includes a second processing resource distinct from the processing resource of the network device;
updating the second hardware unit with the output of the operation to synchronize between the first and second hardware units via the processing resource of the network device; and providing, to the first hardware unit from the processing resource of the network device, an acknowledgment of completion of the operation.
2 . The method of claim 1 , wherein receiving the message comprises:
receiving a first trigger from the first hardware unit;
in response to the first trigger, obtaining, from an entry in a data structure in a memory device of the network device, information associated with the message;
determining a location of the message in the memory device based on the information in the entry; and
obtaining the message from the location of the memory device.
3 . The method of claim 2 , further comprising determining that an ownership of the entry is changed from the first hardware unit to the network device, wherein the changing of the ownership allows the network device to modify the entry.
4 . The method of claim 2 , further comprising:
changing an acknowledgment flag in the entry to provide the acknowledgment to the first hardware unit; and
issuing a second trigger to the first hardware unit.
5 . The method of claim 2 , further comprising:
determining, based on a response flag in the entry, whether to generate a response;
storing, in the memory device, the response associated with the operation; and
indicating, in the entry, that a response has been generated.
6 . The method of claim 5 , wherein the information associated with the message includes a protocol port number via which one or more applications running on the first hardware unit of the network device synchronize with the second hardware unit.
7 . The method of claim 1 , wherein performing the operation at the processing resource of the network device comprises:
scheduling the operation at the processing resource of the network device; and executing, by the processing resource of the network device, the operation at a scheduled time.
8 . The method of claim 1 , wherein the operation comprises a configuration change of hardware of the network device; and
wherein updating the second hardware unit with the output of the operation comprises updating a state of the second hardware unit to correspond to the configuration change of the hardware of the network device.
9 . The method of claim 1 , wherein the operation comprises synchronizing an update to a first database of the first hardware unit with a second database of the second hardware unit; and wherein updating the second hardware unit comprises updating the second database of the second hardware unit with the update.
10 . A non-transitory computer-readable storage medium storing instructions that when executed by a processing resource of a network device cause the processing resource to perform a method, the method comprising:
receiving, by the processing resource of the network device from a first hardware unit within the network device, a message indicating an operation to be performed at the network device, wherein the first hardware unit includes a first processing resource distinct from the processing resource of the network device;
performing the operation at the processing resource of the network device based on information in the message;
sending an output of the operation to a second hardware unit within the network device that operates as a standby for the first hardware unit for facilitating high availability, wherein the second hardware unit includes a second processing resource distinct from the processing resource of the network device;
updating the second hardware unit with the output of the operation to synchronize between the first and second hardware units via the processing resource of the network device; and
providing, to the first hardware unit from the processing resource of the network device, an acknowledgment of completion of the operation.
11 . The non-transitory computer-readable storage medium of claim 10 , wherein receiving the message comprises:
receiving a first trigger from the first hardware unit;
in response to the first trigger, obtaining, from an entry in a data structure in a memory device of the network device, information associated with the message;
determining a location of the message in the memory device based on the information in the entry; and
obtaining the message from the location of the memory device.
12 . The non-transitory computer-readable storage medium of claim 11 , wherein the method further comprises determining that an ownership of the entry is changed from the first hardware unit to the network device, wherein the changing of the ownership allows the network device to modify the entry.
13 . The non-transitory computer-readable storage medium of claim 11 , wherein the method further comprises:
determining, based on a response flag in the entry, whether to generate a response;
storing, in the memory device, the response associated with the operation; and
indicating, in the entry, that a response has been generated.