sonic-net / sonic-swss

SONiC Switch State Service (SwSS)
https://azure.github.io/SONiC
Other
176 stars 529 forks source link

COPP trap id map for DHCP #1684

Open viclin-ec opened 3 years ago

viclin-ec commented 3 years ago
In copporch.cpp  there uses below two trap id map for dhcp , should we use  DHCP L2 trap instead 

(https://github.com/opencomputeproject/SAI/pull/1118) for dhcp relay support ? Thanks

{"dhcp", SAI_HOSTIF_TRAP_TYPE_DHCP},
{"dhcpv6", SAI_HOSTIF_TRAP_TYPE_DHCPV6},
anshuv-mfst commented 3 years ago

@vic-lin-accton - Please elaborate on the issue/question. (Please add more details)

viclin-ec commented 3 years ago

In (https://github.com/opencomputeproject/SAI/pull/1118 "Add DHCP L2 trap" ) there added two more DHCP Trap types SAI_HOSTIF_TRAP_TYPE_DHCP_L2 /SAI_HOSTIF_TRAP_TYPE_DHCPV6_L2 .

I assume these DHCP L2 traps are used trap DHCP packets including those DHCP client L2 broadcast packets ( like DHCP discover) and for "SAI_HOSTIF_TRAP_TYPE_DHCP" is used for trap DHCP L3 packet as it is "L3 broadcast or unicast to local router IP address" as in saihostif.h says.

Since for dhcp relay it needs also to trap those DHCP L2 packets from DHCP client to CPU, that is why wonder it needs to change 'SAI_HOSTIF_TRAP_TYPE_DHCP' to 'SAI_HOSTIF_TRAP_TYPE_DHCP_L2' in the copporch.cpp trap_id_map<>.

Thanks

anshuv-mfst commented 3 years ago

@abdosi - can you please provide input.

zhangyanzhao commented 3 years ago

@abdosi kind reminder to provide input

eddyk-nvidia commented 2 years ago

Is there any progress with this change ?

It looks like DHCP L2 trap should be configured to have DHCP Relay and ZTP features work. For DHCP Relay the DHCP Discover sent to broadcast L2 addresses and for ZTP the DHCP Offer also sent to broadcast L2 address are expected to be received. So, both traps are not sent to the local router IP and they should be supported by COPP Orch Agent