Skip to content

Instantly share code, notes, and snippets.

@trozet
Created March 22, 2022 19:43
Show Gist options
  • Save trozet/489efb9f744b31881f51f9e877e85172 to your computer and use it in GitHub Desktop.
Save trozet/489efb9f744b31881f51f9e877e85172 to your computer and use it in GitHub Desktop.
sdn icmp trace
[root@dvossel-test241-d2qgs-worker-d-dn5lt /]# ovs-appctl -t /var/run/openvswitch/ovs-vswitchd.1224.ctl ofproto/trace br0 in_port=2,dl_src=86:d0:6e:68:6c:39,dl_dst=0a:58:0a:83:00:1a,icmp,icmp_type=8,nw_src=10.129.2.1,nw_dst=10.131.0.26
Flow: icmp,in_port=2,vlan_tci=0x0000,dl_src=86:d0:6e:68:6c:39,dl_dst=0a:58:0a:83:00:1a,nw_src=10.129.2.1,nw_dst=10.131.0.26,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
bridge("br0")
-------------
0. ct_state=-trk,ip, priority 1000
ct(table=0)
drop
-> A clone of the packet is forked to recirculate. The forked pipeline will be resumed at table 0.
-> Sets the packet to an untracked state, and clears all the conntrack fields.
Final flow: unchanged
Megaflow: recirc_id=0,ct_state=-trk,eth,ip,in_port=2,nw_frag=no
Datapath actions: ct,recirc(0x2f97)
===============================================================================
recirc(0x2f97) - resume conntrack with default ct_state=trk|new (use --ct-next to customize)
===============================================================================
Flow: recirc_id=0x2f97,ct_state=new|trk,eth,icmp,in_port=2,vlan_tci=0x0000,dl_src=86:d0:6e:68:6c:39,dl_dst=0a:58:0a:83:00:1a,nw_src=10.129.2.1,nw_dst=10.131.0.26,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
bridge("br0")
-------------
thaw
Resuming from table 0
0. ip,in_port=2,nw_src=10.129.2.1, priority 400
goto_table:30
30. ct_state=-rpl,ip,nw_src=10.128.0.0/14,nw_dst=10.128.0.0/14, priority 100
ct(commit,table=31)
drop
-> A clone of the packet is forked to recirculate. The forked pipeline will be resumed at table 31.
-> Sets the packet to an untracked state, and clears all the conntrack fields.
Final flow: recirc_id=0x2f97,eth,icmp,in_port=2,vlan_tci=0x0000,dl_src=86:d0:6e:68:6c:39,dl_dst=0a:58:0a:83:00:1a,nw_src=10.129.2.1,nw_dst=10.131.0.26,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
Megaflow: recirc_id=0x2f97,ct_state=-rpl+trk,eth,ip,in_port=2,nw_src=10.129.2.1,nw_dst=10.128.0.0/14,nw_frag=no
Datapath actions: ct(commit),recirc(0xf)
===============================================================================
recirc(0xf) - resume conntrack with default ct_state=trk|new (use --ct-next to customize)
===============================================================================
Flow: recirc_id=0xf,ct_state=new|trk,eth,icmp,in_port=2,vlan_tci=0x0000,dl_src=86:d0:6e:68:6c:39,dl_dst=0a:58:0a:83:00:1a,nw_src=10.129.2.1,nw_dst=10.131.0.26,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
bridge("br0")
-------------
thaw
Resuming from table 31
31. ip,nw_dst=10.128.0.0/14, priority 100
goto_table:90
90. ip,nw_dst=10.131.0.0/23, priority 100, cookie 0x1817c590
move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31]
-> NXM_NX_TUN_ID[0..31] is now 0
set_field:10.0.128.2->tun_dst
output:1
-> output to kernel tunnel
Final flow: recirc_id=0xf,ct_state=new|trk,eth,icmp,tun_src=0.0.0.0,tun_dst=10.0.128.2,tun_ipv6_src=::,tun_ipv6_dst=::,tun_gbp_id=0,tun_gbp_flags=0,tun_tos=0,tun_ttl=0,tun_erspan_ver=0,gtpu_flags=0,gtpu_msgtype=0,tun_flags=0,in_port=2,vlan_tci=0x0000,dl_src=86:d0:6e:68:6c:39,dl_dst=0a:58:0a:83:00:1a,nw_src=10.129.2.1,nw_dst=10.131.0.26,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=8,icmp_code=0
Megaflow: recirc_id=0xf,ct_state=-rpl,eth,ip,tun_id=0/0xffffffff,tun_dst=0.0.0.0,in_port=2,nw_dst=10.131.0.0/23,nw_ecn=0,nw_frag=no
Datapath actions: set(tunnel(tun_id=0x0,dst=10.0.128.2,ttl=64,tp_dst=4789,flags(df|key))),2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment