-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dhcp-relay]: Add DHCP Relay Monitor #3886
[dhcp-relay]: Add DHCP Relay Monitor #3886
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thank you!
I left some comments. I'll reread all *.c code in a few days. It's huge
Can you please update your description with DORA explanation? |
|
Put "DORA is acronym for Discover/Offer/Request/ACK DHCP messages. what happen in succession for a successful transaction." in the first post here. This would be enough. You can skip using libpcap at all. Check here: The filter compiled by tcpdump |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per comments. This PR is large, so like Pavel, I have just performed a cursory review. I plan to do more detailed review(s) in the coming days.
dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2
Outdated
Show resolved
Hide resolved
Just curious to know the motivation behind this DHCP relay monitor? Why do we need a separate monitor application to see if DHCP relay is working or not? Instead, can we add statistics support to DHCP relay itself? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@santoshdoke The motivation is to alert whenever DHCP relay is not healthy. There were situation where DHCP relay failed to forward DORA message. This is a mid-term solution to enable monitoring of DHCP Relay. In the meantime, we consider adding statistics to the relay agent as a long-term solution.
Just curious to know the motivation behind this DHCP relay monitor? Why do we need a separate monitor application to see if DHCP relay is working or not? Instead, can we add statistics support to DHCP relay itself?
@santoshdoke: Ultimately, we want to push these statistics to the State DB. Our DB connector is written in C++ but the relay agent is written in C. Adding patches of this nature to the relay agent code would be tedious and ugly and could cause more issues in the long run. Since this is a separate utility, we can easily convert it to C++ and not need to patch an existing open-source project. Plus, a utility cannot properly monitor itself. It makes more sense to have a standalone monitor application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work!
Please check my comments.
Also check latest Joe's comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address Joe's comment
retest broadcom please |
Retest vsimage please |
a60840f
to
bbaf62b
Compare
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. DORA is acronym for Discover/Offer/Request/ACK DHCP messages which happen in succession for a successful DHCP transaction. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. This patch addresses code comments from pull request. pull-request: sonic-net#3886 signed-off-by: Tamer Ahmed <[email protected]>
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. DORA is acronym for Discover/Offer/Request/ACK DHCP messages which happen in succession for a successful DHCP transaction. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. This patch replaces libpcap packet interworking packet capture with raw sockets and libevent. Also, the program now executes as a single thread. pull-request: sonic-net#3886 signed-off-by: Tamer Ahmed <[email protected]>
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. DORA is acronym for Discover/Offer/Request/ACK DHCP messages which happen in succession for a successful DHCP transaction. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. In this patch: 1. Address outstanding PR comments - Remove explicit package installation int the docker base image - Parameterize the compiler usage - Remove empty line 2. Update dhcpmon package dependencies 3. Remove MSG_TRUNC flag from raw socket recv as we dont report any packet truncation pull-request: sonic-net#3886 signed-off-by: Tamer Ahmed <[email protected]>
address code comments, also updated some comment to refer to libevent instead of libpcap.
19c24bc
4e5e616
to
19c24bc
Compare
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. pull-request: sonic-net#3886 signed-off-by: Tamer Ahmed <[email protected]>
* [dhcp-relay]: Add DHCP Relay Monitor (#3886) DHCP relay MONitor (dhcpmon) keeps track of DORA messages. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. pull-request: #3886 signed-off-by: Tamer Ahmed <[email protected]> * Eliminate dependency on libexplain * Remove dependency on libexplain
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. pull-request: #3886 signed-off-by: Tamer Ahmed <[email protected]>
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. pull-request: sonic-net#3886 signed-off-by: Tamer Ahmed <[email protected]>
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. pull-request: sonic-net#3886 signed-off-by: Tamer Ahmed <[email protected]>
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. If DHCP Relay is detected to be not forwarding DORA message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps counts of clients DR messages, forwarded DR messages, DHCP server OA messages, and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if counts are monotonically increasing and record snapshot of those counters. dhcpmon will report discrepancies when detected between current counters and snapshot counters. pull-request: sonic-net/sonic-buildimage#3886 signed-off-by: Tamer Ahmed <[email protected]>
DHCP relay MONitor (dhcpmon) keeps track of DORA messages. DORA is acronym for
Discover/Offer/Request/ACK DHCP messages which happen in succession for a
successful DHCP transaction. If DHCP Relay is detected to be not forwarding DORA
message, dhcpmon will log such event to syslog. Under the hood dhcpmon keeps
counts of clients DR messages, forwarded DR messages, DHCP server OA messages,
and forwarded OA messages. dhcpmon will check every 12 sec (configurable) if
counts are monotonically increasing and record snapshot of those counters.
dhcpmon will report discrepancies when detected between current counters and
snapshot counters.
pull-request: #3886
signed-off-by: Tamer Ahmed [email protected]
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)