Systems and methods for ensuring redundancy between relay agents
A computer-implemented method for ensuring consistency between redundant DHCP peers may include establishing, by a first relay agent over a TCP connection, a peer relationship with a second relay agent. The method may also include synchronizing, by the first relay agent, subscriber information with the second relay agent for a subscriber group. The method may then include periodically calculating, by the first relay agent, a checksum for all subscribers in the subscriber group. Additionally, the method may include exchanging, by the first relay agent, the checksum from the first relay agent with a second checksum from the second relay agent via periodic TCP keepalive messages. Furthermore, the method may include detecting, by the first relay agent, a mismatch between the checksums. Finally, the method may include resolving an inconsistency in subscriber information in response to detecting the checksum mismatch. Various other methods, systems, and computer-readable media are also disclosed.
1 . A computer-implemented method comprising:
establishing, by a first relay agent over a Transmission Control Protocol (TCP) connection, a peer relationship with a second relay agent;
synchronizing, by the first relay agent, subscriber information with the second relay agent for a subscriber group;
periodically calculating, by the first relay agent, a checksum for all subscribers in the subscriber group, wherein the checksum is calculated during an inactive period of the TCP connection prior to a TCP keepalive message;
exchanging, by the first relay agent, the checksum from the first relay agent with a second checksum from the second relay agent via periodic TCP keepalive messages, wherein the second checksum is calculated during the inactive period of the TCP connection;
detecting, by the first relay agent, a mismatch between the checksums; and
resolving an inconsistency in subscriber information in response to detecting the checksum mismatch.
2 . The method of claim 1 , wherein:
at least one of the first relay agent or the second relay agent is a primary relay agent for the subscriber group; and
at least one of the first relay agent or the second relay agent is a backup relay agent for the subscriber group.
3 . The method of claim 1 , wherein synchronizing the subscriber information comprises:
initiating a bulk leasequery (BLQ) message to a Dynamic Host Configuration Protocol (DHCP) peer;
receiving the subscriber information for the subscriber group; and
storing the subscriber information at the first relay agent, wherein the second relay agent also stores the subscriber information.
4 . The method of claim 1 , wherein the subscriber information comprises, for each subscriber in the subscriber group, at least one of:
a subscriber state;
binding information for a subscriber; and
lease information for the subscriber.
5 . The method of claim 1 , wherein the periodic TCP keepalive messages comprise messages sent between the first relay agent and the second relay agent at predetermined intervals to maintain the TCP connection during inactive periods.
6 . The method of claim 1 , wherein resolving the inconsistency comprises:
initiating a new BLQ message to query all subscribers in the subscriber group;
receiving updated subscriber information for the subscriber group; and
storing the updated subscriber information at the first relay agent, wherein the second relay agent also stores the updated subscriber information.
7 . The method of claim 1 , further comprising:
tracking a number of consecutive checksum mismatches; and
delaying resolving the inconsistency in subscriber information until the number of consecutive checksum mismatches meets a threshold.
8 . The method of claim 1 , further comprising:
detecting, by the first relay agent, a change in the subscriber information for the subscriber group; and
initiating an active leasequery (ALQ) message to the second relay agent to update the subscriber information based on the change.
9 . The method of claim 8 , further comprising:
receiving, by the first relay agent, the ALQ message from the second relay agent based on the change in the subscriber information for the subscriber group; and
updating the subscriber information stored by the first relay agent based on the ALQ message.
10 . The method of claim 1 , further comprising:
identifying, based on the inconsistency, a failure in a primary router for a primary relay agent; and
switching to a backup router for a backup relay agent.
11 . The method of claim 1 , further comprising:
establishing, by the first relay agent over the TCP connection, an additional peer relationship with an additional relay agent for an additional subscriber group;
synchronizing, by the first relay agent, additional subscriber information with the additional relay agent for the additional subscriber group;
periodically calculating, by the first relay agent, an additional checksum for all subscribers in the additional subscriber group;
exchanging, by the first relay agent, the additional checksum from the first relay agent with an additional second checksum from the additional relay agent via additional periodic TCP keepalive messages;
detecting, by the first relay agent, an additional mismatch between the additional checksums; and
resolving an additional inconsistency in the additional subscriber information in response to detecting the additional checksum mismatch.
12 . A system comprising:
an establishment module, stored in memory, that establishes, by a first relay agent over a Transmission Control Protocol (TCP) connection, a peer relationship with a second relay agent;
a synchronization module, stored in memory, that synchronizes, by the first relay agent, subscriber information with the second relay agent for a subscriber group;
a calculation module, stored in memory, that periodically calculates, by the first relay agent, a checksum for all subscribers in the subscriber group, wherein the checksum is calculated during an inactive period of the TCP connection prior to a TCP keepalive message;
an exchange module, stored in memory, that exchanges, by the first relay agent, the checksum from the first relay agent with a second checksum from the second relay agent via periodic TCP keepalive messages, wherein the second checksum is calculated during the inactive period of the TCP connection;
a detection module, stored in memory, that detects, by the first relay agent, a mismatch between the checksums;
a resolution module, stored in memory, that resolves an inconsistency in subscriber information in response to detecting the checksum mismatch; and
at least one processor that executes the establishment module, the synchronization module, the calculation module, the exchange module, the detection module, and the resolution module.
13 . The system of claim 12 , wherein:
at least one of the first relay agent or the second relay agent is a primary relay agent for the subscriber group; and
at least one of the first relay agent or the second relay agent is a backup relay agent for the subscriber group.
14 . The system of claim 12 , wherein the synchronization module synchronizes the subscriber information by:
initiating a bulk leasequery (BLQ) message to a Dynamic Host Configuration Protocol (DHCP) peer;
receiving the subscriber information for the subscriber group; and
storing the subscriber information at the first relay agent, wherein the second relay agent also stores the subscriber information.
15 . The system of claim 12 , wherein the subscriber information comprises, for each subscriber in the subscriber group, at least one of:
a subscriber state;
binding information for a subscriber; and
lease information for the subscriber.
16 . The system of claim 12 , wherein the periodic TCP keepalive messages comprise messages sent between the first relay agent and the second relay agent at predetermined intervals to maintain the TCP connection during inactive periods.
17 . The system of claim 12 , wherein the resolution module resolves the inconsistency by:
initiating a new BLQ message to query all subscribers in the subscriber group;
receiving updated subscriber information for the subscriber group; and
storing the updated subscriber information at the first relay agent, wherein the second relay agent also stores the updated subscriber information.
18 . The system of claim 12 , further comprising:
a tracking module that tracks a number of consecutive checksum mismatches; and
the resolution module that delays resolving the inconsistency in subscriber information until the number of consecutive checksum mismatches meets a threshold.
19 . The system of claim 12 , further comprising:
the detection module that detects, by the first relay agent, a change in the subscriber information for the subscriber group; and
an update module that initiates an active leasequery (ALQ) message to the second relay agent to update the subscriber information based on the change.
20 . A non-transitory computer-readable medium comprising one or more computer-executable instructions that, when executed by at least one processor of a computing device, cause the computing device to:
establish, by a first relay agent over a Transmission Control Protocol (TCP) connection, a peer relationship with a second relay agent;
synchronize, by the first relay agent, subscriber information with the second relay agent for a subscriber group;
periodically calculate, by the first relay agent, a checksum for all subscribers in the subscriber group, wherein the checksum is calculated during an inactive period of the TCP connection prior to a TCP keepalive message;
exchange, by the first relay agent, the checksum from the first relay agent with a second checksum from the second relay agent via periodic TCP keepalive messages, wherein the second checksum is calculated during the inactive period of the TCP connection;
detect, by the first relay agent, a mismatch between the checksums; and
resolve an inconsistency in subscriber information in response to detecting the checksum mismatch.