[Enterprise SONiC] SFLOW (sampled flow) Follow
SFLOW(sampled flow), Network packet information is acquired by sampling so that the network administrator can understand the operation status of the network.
Tested model & firmware version:
- Switch model name:
AS7326-56X
AS4630-54PE
- Edgecore SONiC version:
202006.4
202012.2
Restriction:
- It only supports two sFlow collectors.
- Default
- Default SFLOW is disabled
- Default polling interval is 20 s
- Default sample rate is one-tenth of port speed
- Default agent id is eth0
- Default UDP port is 6343
- The sFlow flow sampling is not taken effect unless you set the COPP rule correctly.Since 202006.1, there is the COPP rule configuration by default.
Topology:
Procedure:
Step 1: Make sure the COPP rule is correct in the SWSS container.
Access the SWSS container.
admin@sonic:~$ docker exec -it swss bash
root@sonic:/#
Checking the copp.json.j2, this file is at /usr/share/sonic/templates.
[
omitted...
{
"COPP_TABLE:trap.group.sflow": {
"trap_ids": "sample_packet",
"trap_action":"trap",
"trap_priority":"1",
"queue": "2",
"meter_type":"packets",
"mode":"sr_tcm",
"cir":"1000",
"cbs":"1000",
"red_action":"drop",
"genetlink_name":"psample",
"genetlink_mcgrp_name":"packets"
},
"OP": "SET"
}
]
Caution:
- If you modify the copp.json.j2, please reboot the switch to activate it.
- After 202006.1, please skip this step.
Step 2: Configure the IP address on the Ethernet0 ( refer to Management IP address)
Step 3: Enable the sFlow.
admin@sonic:~$ sudo config sflow enable
Step 4: Add the sFlow collector.
admin@sonic:~$ sudo config sflow collector add test 192.168.2.2
Result
admin@sonic:~$ show sflow sFlow Global Information: sFlow Admin State: up sFlow Polling Interval: default sFlow AgentID: default 1 Collectors configured: Name: test IP addr: 192.168.2.2UDP port: 6343 admin@sonic:~$ show sflow interface sFlow interface configurations +-------------+---------------+-----------------+ | Interface | Admin State | Sampling Rate | +=============+===============+=================+ | Ethernet0 | up | 2500 | +-------------+---------------+-----------------+ omitted... +-------------+---------------+-----------------+ | Ethernet76 | up | 10000 | +-------------+---------------+-----------------+ admin@sonic:~$ show interfaces status Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC ----------- --------------- ------- ----- ----- ------- ------ ------ ------- --------------- ---------- Ethernet0 3 25G 9100 none Eth5/3 routed down up N/A N/A omitted... Ethernet76 125,126,127,128 100G 9100 none Eth56/1 routed down up N/A N/A
Comments
0 comments
Please sign in to leave a comment.