[dhcp-relay]: Add DHCP Relay Monitor#3886
Conversation
pavel-shirshov
left a comment
There was a problem hiding this comment.
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 |
jleveque
left a comment
There was a problem hiding this comment.
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? |
tahmed-dev
left a comment
There was a problem hiding this comment.
@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. |
pavel-shirshov
left a comment
There was a problem hiding this comment.
Good work!
Please check my comments.
Also check latest Joe's comments.
pavel-shirshov
left a comment
There was a problem hiding this comment.
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 <tamer.ahmed@microsoft.com>
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 <tamer.ahmed@microsoft.com>
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 <tamer.ahmed@microsoft.com>
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 <tamer.ahmed@microsoft.com>
* [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 <tamer.ahmed@microsoft.com> * 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 <tamer.ahmed@microsoft.com>
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 <tamer.ahmed@microsoft.com>
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 <tamer.ahmed@microsoft.com>
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 <tamer.ahmed@microsoft.com>
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 tamer.ahmed@microsoft.com
- 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)