Skip to content

[dhcpmon] Filter DHCP O/A Messages of Neighboring Vlans#4469

Merged
tahmed-dev merged 10 commits intosonic-net:masterfrom
tahmed-dev:taahme/fix-dhcpmon-OA-packet-count
Apr 28, 2020
Merged

[dhcpmon] Filter DHCP O/A Messages of Neighboring Vlans#4469
tahmed-dev merged 10 commits intosonic-net:masterfrom
tahmed-dev:taahme/fix-dhcpmon-OA-packet-count

Conversation

@tahmed-dev
Copy link
Copy Markdown
Contributor

@tahmed-dev tahmed-dev commented Apr 23, 2020

- Why I did it

  1. This code fixes a bug where two or more vlans exist. Cross contamination
    happens for DHCP packets Offer/Ack when received on shared northbound links.
    The code filters out those packet based on dst IP equal Vlan loopback IP.

  2. Also, Fixed a bug where libevent event id was being printed instead of signal id.

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

- How to verify it
pytest test_dhcp_relay.py --testbed=testbed --inventory=../ansible/str --testbed_file=../ansible/testbed.csv --host-pattern=all --module-path=../ansible/library

***-Using single Vlan
logs from syslog:
Apr 23 04:52:59.710434 str-s6100-acs-2 NOTICE dhcp_relay#dhcpmon[52]: DHCP Discover rx: 2, tx:96, Offer rx: 2, tx:2, Request rx: 2, tx:96, ACK rx: 2, tx:2

Apr 23 04:54:25.390030 str-s6100-acs-2 NOTICE dhcp_relay#dhcpmon[51]: DHCP Discover rx: 1, tx:48, Offer rx: 1, tx:1, Request rx: 1, tx:48, ACK rx: 1, tx:1

***-Using two vlans:
ansible-playbook config_sonic_basedon_testbed.yml -i str -l str-s6100-acs-2 -e testbed_name=vms7-t0-s6100 --vault-password-file=../.vault-file -e deploy=true -e vlan_config=two_vlan_a

Apr 23 08:05:35.444937 str-s6100-acs-2 ALERT dhcp_relay#dhcpmon[58]: Received signal Terminated
Apr 23 08:05:35.444937 str-s6100-acs-2 NOTICE dhcp_relay#dhcpmon[58]: DHCP Discover rx: 2, tx:96, Offer rx: 2, tx:2, Request rx: 2, tx:96, ACK rx: 2, tx:2
Apr 23 08:05:35.444937 str-s6100-acs-2 ALERT dhcp_relay#dhcpmon[57]: Received signal Terminated
Apr 23 08:05:35.444937 str-s6100-acs-2 NOTICE dhcp_relay#dhcpmon[57]: DHCP Discover rx: 2, tx:96, Offer rx: 2, tx:2, Request rx: 2, tx:96, ACK rx: 2, tx:2

- Description for the changelog

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

This code fixes a bug where two or more vlans exist. Cross contamination
happens for DHCP packets Offer/Ack when received on shared northbound links.
The code filters out those packet based on dst IP equal Vlan loopback IP.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
@tahmed-dev tahmed-dev requested a review from lguohan April 23, 2020 21:56
@tahmed-dev tahmed-dev requested a review from jleveque April 25, 2020 20:47
jleveque
jleveque previously approved these changes Apr 28, 2020
Copy link
Copy Markdown
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

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

Can you please add comments into the function?

pavel-shirshov
pavel-shirshov previously approved these changes Apr 28, 2020
pavel-shirshov
pavel-shirshov previously approved these changes Apr 28, 2020
Copy link
Copy Markdown
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

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

looks good to me

jleveque
jleveque previously approved these changes Apr 28, 2020
Copy link
Copy Markdown
Contributor

@jleveque jleveque 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 suggestion.

@tahmed-dev tahmed-dev dismissed stale reviews from jleveque and pavel-shirshov via 640219a April 28, 2020 01:40
@tahmed-dev tahmed-dev requested a review from jleveque April 28, 2020 01:40
@tahmed-dev tahmed-dev merged commit a60a203 into sonic-net:master Apr 28, 2020
yxieca pushed a commit that referenced this pull request Apr 28, 2020
* [dhcpmon] Filter DHCP O/A Messages of Neighboring Vlans

This code fixes a bug where two or more vlans exist. Cross contamination
happens for DHCP packets Offer/Ack when received on shared northbound links.
The code filters out those packet based on dst IP equal Vlan loopback IP.

signed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
abdosi pushed a commit that referenced this pull request May 1, 2020
* [dhcpmon] Filter DHCP O/A Messages of Neighboring Vlans

This code fixes a bug where two or more vlans exist. Cross contamination
happens for DHCP packets Offer/Ack when received on shared northbound links.
The code filters out those packet based on dst IP equal Vlan loopback IP.

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.

6 participants