Skip to content

[dhcpmon] Monitor Mgmt Interface For DHCP Packets#5317

Merged
tahmed-dev merged 4 commits intosonic-net:masterfrom
tahmed-dev:taahme/dhcpmon-monitor-mgmt-interface
Sep 10, 2020
Merged

[dhcpmon] Monitor Mgmt Interface For DHCP Packets#5317
tahmed-dev merged 4 commits intosonic-net:masterfrom
tahmed-dev:taahme/dhcpmon-monitor-mgmt-interface

Conversation

@tahmed-dev
Copy link
Copy Markdown
Contributor

@tahmed-dev tahmed-dev commented Sep 4, 2020

When BGP routes are missing, DHCP packets get relayed over mgmt
interface. This results in dhcpmon alerting that DHCP packets are
not being relayed. This is PR include mgmt interface as uplink
device, and so, if DHCP packet gets relayed over mgmt interface,
regular dhcpmon alert will not be issues. Instead, dhcpmon will
check the mgmt interface counts and issue a separate alert regarding
packets travelling through mgmt network.

In addition, this PR include the following enhancements:

  1. Add SIGUSR1 handler that prints out current packet counts
  2. Increase alert grace window to 3 minutes from current 2 min
  3. Time is not computed more accurately
  4. Print vlan name before counters

signed-off-by: Tamer Ahmed tamer.ahmed@microsoft.com

- Why I did it
DHCP Monitor is alerting when DHCP packets got over mgmt network

- How I did it

  1. Monitored mgmt interface
    Also, Added
  2. Add SIGUSR1 handler that prints out current packet counts
  3. Increase alert grace window to 3 minutes from currently 2 minutes
  4. Time is now computed more accurately
  5. Print vlan name before counters

- How to verify it
Bring down BGP session, and noticed no dhcpmon alert get triggered. Instead the following trigger is observed:

Sep  6 07:21:35.928763 str-s6000-acs-14 ALERT dhcp_relay#dhcpmon[43]: dhcpmon detected DHCP packets traveling through mgmt interface (please check BGP routes.) Duration: 234 (sec) for intf: 'eth0'
Sep  6 07:21:35.928763 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [            eth0] DHCP Discover rx/tx:          0/       288, Offer rx/tx:          0/         0, Request rx/tx:          0/         0, ACK rx/tx:          0/         0
Sep  6 07:22:29.927983 str-s6000-acs-14 ALERT dhcp_relay#dhcpmon[43]: dhcpmon detected DHCP packets traveling through mgmt interface (please check BGP routes.) Duration: 288 (sec) for intf: 'eth0'
Sep  6 07:22:29.927983 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [            eth0] DHCP Discover rx/tx:          0/       336, Offer rx/tx:          0/         0, Request rx/tx:          0/         0, ACK rx/tx:          0/         0

New signal handler for SIGUSR1

Sep  6 07:21:48.670477 str-s6000-acs-14 ALERT dhcp_relay#dhcpmon[43]: Received signal: 'User defined signal 1'
Sep  6 07:21:48.670477 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [            eth0] DHCP Discover rx/tx:          0/       288, Offer rx/tx:          0/         0, Request rx/tx:          0/         0, ACK rx/tx:          0/         0
Sep  6 07:21:48.670477 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [ PortChannel0004] DHCP Discover rx/tx:          0/        55, Offer rx/tx:          0/         0, Request rx/tx:          0/        55, ACK rx/tx:          0/         0
Sep  6 07:21:48.670477 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [ PortChannel0003] DHCP Discover rx/tx:          0/        40, Offer rx/tx:          0/         0, Request rx/tx:          0/        40, ACK rx/tx:          0/         0
Sep  6 07:21:48.670477 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [ PortChannel0002] DHCP Discover rx/tx:          0/        70, Offer rx/tx:          5/         0, Request rx/tx:          0/        70, ACK rx/tx:          5/         0
Sep  6 07:21:48.670477 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [ PortChannel0001] DHCP Discover rx/tx:          0/        75, Offer rx/tx:          0/         0, Request rx/tx:          0/        75, ACK rx/tx:          0/         0
Sep  6 07:21:48.670477 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [        Vlan1000] DHCP Discover rx/tx:         11/         0, Offer rx/tx:          0/         5, Request rx/tx:          5/         0, ACK rx/tx:          0/         5
Sep  6 07:21:48.670477 str-s6000-acs-14 NOTICE dhcp_relay#dhcpmon[43]: [    Agg-Vlan1000] DHCP Discover rx/tx:         11/       528, Offer rx/tx:          5/         5, Request rx/tx:          5/       240, ACK rx/tx:          5/         5

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@tahmed-dev tahmed-dev force-pushed the taahme/dhcpmon-monitor-mgmt-interface branch 2 times, most recently from bd4d0e1 to aa66b10 Compare September 4, 2020 23:21
@tahmed-dev tahmed-dev marked this pull request as ready for review September 4, 2020 23:27
@tahmed-dev tahmed-dev force-pushed the taahme/dhcpmon-monitor-mgmt-interface branch 7 times, most recently from cfa9cef to c9ebc1a Compare September 5, 2020 14:47
yxieca
yxieca previously approved these changes Sep 5, 2020
Copy link
Copy Markdown
Contributor

@yxieca yxieca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor suggestions.

@tahmed-dev tahmed-dev requested a review from yxieca September 6, 2020 20:08
yxieca
yxieca previously approved these changes Sep 8, 2020
When BGP routes are missing, DHCP packets get relayed over mgmt
interface. This results in dhcpmon alerting that DHCP packets are
not being relayed. This is PR include mgmt interface as uplink
device, and so, if DHCP packet gets relayed over mgmt interface,
regular dhcpmon alert will not be issues. Instead, dhcpmon will
check the mgmt interface counts and issue a separate alert regarding
packets travelling through mgmt network.

In addition, this PR inlcude the following enhancements:
1. Add SIGUSR1 handler that prints out current packet counts
2. Increase alert grace window to 3 minutes from currently 2 minutes
3. Time is now computed more accurately
4. Print vlan name before counters

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
@tahmed-dev tahmed-dev force-pushed the taahme/dhcpmon-monitor-mgmt-interface branch from e0fb762 to fed12f3 Compare September 9, 2020 17:12
@tahmed-dev tahmed-dev requested a review from jleveque September 9, 2020 17:15
@tahmed-dev tahmed-dev merged commit 1bf6fdc into sonic-net:master Sep 10, 2020
yxieca pushed a commit that referenced this pull request Sep 14, 2020
When BGP routes are missing, DHCP packets get relayed over mgmt
interface. This results in dhcpmon alerting that DHCP packets are
not being relayed. This is PR include mgmt interface as uplink
device, and so, if DHCP packet gets relayed over mgmt interface,
regular dhcpmon alert will not be issues. Instead, dhcpmon will
check the mgmt interface counts and issue a separate alert regarding
packets travelling through mgmt network.

In addition, this PR includes the following enhancements:
1. Add SIGUSR1 handler that prints out current packet counts
2. Increase alert grace window to 3 minutes from currently 2 minutes
3. Time is now computed more accurately
4. Print vlan name before counters

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
yxieca added a commit that referenced this pull request Sep 14, 2020
tahmed-dev added a commit to tahmed-dev/sonic-buildimage that referenced this pull request Sep 15, 2020
When BGP routes are missing, DHCP packets get relayed over mgmt
interface. This results in dhcpmon alerting that DHCP packets are
not being relayed. This is PR include mgmt interface as uplink
device, and so, if DHCP packet gets relayed over mgmt interface,
regular dhcpmon alert will not be issues. Instead, dhcpmon will
check the mgmt interface counts and issue a separate alert regarding
packets travelling through mgmt network.

In addition, this PR includes the following enhancements:
1. Add SIGUSR1 handler that prints out current packet counts
2. Increase alert grace window to 3 minutes from currently 2 minutes
3. Time is now computed more accurately
4. Print vlan name before counters

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
tahmed-dev added a commit that referenced this pull request Sep 16, 2020
When BGP routes are missing, DHCP packets get relayed over mgmt
interface. This results in dhcpmon alerting that DHCP packets are
not being relayed. This is PR include mgmt interface as uplink
device, and so, if DHCP packet gets relayed over mgmt interface,
regular dhcpmon alert will not be issues. Instead, dhcpmon will
check the mgmt interface counts and issue a separate alert regarding
packets travelling through mgmt network.

In addition, this PR includes the following enhancements:
1. Add SIGUSR1 handler that prints out current packet counts
2. Increase alert grace window to 3 minutes from currently 2 minutes
3. Time is now computed more accurately
4. Print vlan name before counters

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
abdosi pushed a commit that referenced this pull request Sep 19, 2020
When BGP routes are missing, DHCP packets get relayed over mgmt
interface. This results in dhcpmon alerting that DHCP packets are
not being relayed. This is PR include mgmt interface as uplink
device, and so, if DHCP packet gets relayed over mgmt interface,
regular dhcpmon alert will not be issues. Instead, dhcpmon will
check the mgmt interface counts and issue a separate alert regarding
packets travelling through mgmt network.

In addition, this PR includes the following enhancements:
1. Add SIGUSR1 handler that prints out current packet counts
2. Increase alert grace window to 3 minutes from currently 2 minutes
3. Time is now computed more accurately
4. Print vlan name before counters

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
When BGP routes are missing, DHCP packets get relayed over mgmt
interface. This results in dhcpmon alerting that DHCP packets are
not being relayed. This is PR include mgmt interface as uplink
device, and so, if DHCP packet gets relayed over mgmt interface,
regular dhcpmon alert will not be issues. Instead, dhcpmon will
check the mgmt interface counts and issue a separate alert regarding
packets travelling through mgmt network.

In addition, this PR includes the following enhancements:
1. Add SIGUSR1 handler that prints out current packet counts
2. Increase alert grace window to 3 minutes from currently 2 minutes
3. Time is now computed more accurately
4. Print vlan name before counters

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants