sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
194 stars 711 forks source link

[Snappi]: Require support in Snappi to have filters for PCAP for selective packet capturing #13304

Open amitpawar12 opened 3 months ago

amitpawar12 commented 3 months ago

Issue Description

Snappi should support creating filters to be added for packet capturing so that specific captures are captured on the port and analyzed further.

Results you see

The scenario is for ECN marking of the packets with lossless prio3 and background lossy prio0. With current scenario, there is no way to filter out lossy traffic and just capture the lossless prio3 traffic.

Current workaround is to set the different packet-size for prio3 and prio0 traffic and then set filter on packet-size via IxNetwork GUI.

We should have some way to add filters before starting the PCAP so that specific packets are captured and analyzed.

@kamalsahu0001

Results you expected to see

IP parameter level filters in Snappi capture functionality to capture specific packets.

Is it platform specific

generic

Relevant log output

No response

Output of show version

No response

Attach files (if any)

No response

kamalsahu0001 commented 3 months ago

@amitpawar12 you can set it by using custom pattern. Select the offset of the field and set the inverse mask for that field to match the value.

kamalsahu0001 commented 2 months ago

This support is not available in web UI. Feature needs to be first implemented in Web UI and then in snappi. Currently no timeline when this feature will be implemented.

sdszhang commented 2 months ago

Leave it open until the REST script is working.

amitpawar12 commented 2 months ago

We require this support (even restpy is fine) for new additional PFC testcases.

One of the ECN testcases involves, sending lossless + lossy priority traffic and induce storm on egress. Once the storm is stopped, the IXIA receiver captures the packets and check for the ECN marking.

Currently IXIA has limitation to capture only 1024 packets in normal mode and around 16k packets in slicing-mode. Capturing the packets at the line-rate without filters will surely cross the 16k packet capture limit. Hence the selective filters to capture the Priority 3 packets is required.

Thanks,

sdszhang commented 1 month ago

@developfast to comment.

developfast commented 1 month ago

@amitpawar12 this is where we do filtering after we have captured the pcap file so I am not sure about your specific use case - https://github.com/sonic-net/sonic-mgmt/blob/c779345964a949bdb0be173aaa2aabdbbaf39782/tests/common/snappi_tests/read_pcap.py#L15