Skip to content

Instantly share code, notes, and snippets.

@trozet
Created September 6, 2020 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trozet/de1e1ffd0311fefc720f616e3f73fd6a to your computer and use it in GitHub Desktop.
Save trozet/de1e1ffd0311fefc720f616e3f73fd6a to your computer and use it in GitHub Desktop.
ovn packet_in GR packets
##################ovs trace on control plane 3 (colocated with sbdb)
[root@ovn-control-plane3 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 22:9c:5a:2e:ac:d1 brd ff:ff:ff:ff:ff:ff
3: br-int: <BROADCAST,MULTICAST> mtu 1400 qdisc noop state DOWN group default qlen 1000
link/ether 56:4c:f8:3e:a1:45 brd ff:ff:ff:ff:ff:ff
4: genev_sys_6081: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65000 qdisc noqueue master ovs-system state UNKNOWN group default qlen 1000
link/ether 76:8d:f1:00:aa:7b brd ff:ff:ff:ff:ff:ff
5: breth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether 02:42:ac:12:00:05 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.5/16 brd 172.18.255.255 scope global breth0
name : "patch-br-int-to-breth0_ovn-control-plane3"
ofport : 5
ovs-appctl ofproto/trace br-int in_port=5,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,tcp,tcp_dst=6443,nw_dst=172.18.0.5,nw_src=172.18.0.4,nw_ttl=64
[root@ovn-control-plane3 ~]# ovs-appctl ofproto/trace br-int in_port=5,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,tcp,tcp_dst=6443,nw_dst=172.18.0.5,nw_src=172.18.0.4,nw_ttl=64
Flow: tcp,in_port=5,vlan_tci=0x0000,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,nw_src=172.18.0.4,nw_dst=172.18.0.5,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=6443,tcp_flags=0
bridge("br-int")
----------------
0. in_port=5,vlan_tci=0x0000/0x1000, priority 100, cookie 0xcf689b04
set_field:0x18->reg13
set_field:0x1c->reg11
set_field:0x1a->reg12
set_field:0xd->metadata
set_field:0x1->reg14
resubmit(,8)
8. reg14=0x1,metadata=0xd, priority 50, cookie 0xde5bff5c
resubmit(,9)
9. metadata=0xd, priority 0, cookie 0x506418aa
resubmit(,10)
10. metadata=0xd, priority 0, cookie 0x5ca4d19b
resubmit(,11)
11. metadata=0xd, priority 0, cookie 0xf751c144
resubmit(,12)
12. ip,reg14=0x1,metadata=0xd, priority 110, cookie 0xc80e767c
resubmit(,13)
13. metadata=0xd, priority 0, cookie 0xec139689
resubmit(,14)
14. metadata=0xd, priority 0, cookie 0x52efe4f1
resubmit(,15)
15. metadata=0xd, priority 0, cookie 0x156ddc9b
resubmit(,16)
16. metadata=0xd, priority 0, cookie 0x4bbb138d
resubmit(,17)
17. metadata=0xd, priority 0, cookie 0x60e8e68
resubmit(,18)
18. metadata=0xd, priority 0, cookie 0x55bbec60
resubmit(,19)
19. metadata=0xd, priority 0, cookie 0x3f021d27
resubmit(,20)
20. metadata=0xd, priority 0, cookie 0xa7c53ef3
resubmit(,21)
21. reg14=0x1,metadata=0xd, priority 100, cookie 0xde905217
resubmit(,22)
22. metadata=0xd, priority 0, cookie 0xdf68634c
resubmit(,23)
23. metadata=0xd, priority 0, cookie 0xdeb59931
resubmit(,24)
24. metadata=0xd, priority 0, cookie 0x729dd703
resubmit(,25)
25. metadata=0xd, priority 0, cookie 0x55497003
resubmit(,26)
26. metadata=0xd, priority 0, cookie 0x9cfbc6f1
resubmit(,27)
27. metadata=0xd,dl_dst=02:42:ac:12:00:05, priority 50, cookie 0x6bff66d3
set_field:0x2->reg15
resubmit(,32)
32. priority 0
resubmit(,33)
33. reg15=0x2,metadata=0xd, priority 100
set_field:0x1b->reg13
set_field:0x1c->reg11
set_field:0x1a->reg12
resubmit(,34)
34. priority 0
set_field:0->reg0
set_field:0->reg1
set_field:0->reg2
set_field:0->reg3
set_field:0->reg4
set_field:0->reg5
set_field:0->reg6
set_field:0->reg7
set_field:0->reg8
set_field:0->reg9
resubmit(,40)
40. ip,reg15=0x2,metadata=0xd, priority 110, cookie 0x4d1ef7f
resubmit(,41)
41. metadata=0xd, priority 0, cookie 0xb501c22e
resubmit(,42)
42. metadata=0xd, priority 0, cookie 0x29c0401e
resubmit(,43)
43. metadata=0xd, priority 0, cookie 0xf22fb3ed
resubmit(,44)
44. metadata=0xd, priority 0, cookie 0x4d4efda5
resubmit(,45)
45. metadata=0xd, priority 0, cookie 0x373ad319
resubmit(,46)
46. metadata=0xd, priority 0, cookie 0xe1adca78
resubmit(,47)
47. metadata=0xd, priority 0, cookie 0xab241682
resubmit(,48)
48. metadata=0xd, priority 0, cookie 0xaf75d01
resubmit(,49)
49. reg15=0x2,metadata=0xd, priority 50, cookie 0xc3acad95
resubmit(,64)
64. priority 0
resubmit(,65)
65. reg15=0x2,metadata=0xd, priority 100, cookie 0xb40bcb32
clone(ct_clear,set_field:0->reg11,set_field:0->reg12,set_field:0->reg13,set_field:0x19->reg13,set_field:0xf->reg11,set_field:0xd->reg12,set_field:0x7->metadata,set_field:0x2->reg14,set_field:0->reg10,set_field:0->reg15,set_field:0->reg0,set_field:0->reg1,set_field:0->reg2,set_field:0->reg3,set_field:0->reg4,set_field:0->reg5,set_field:0->reg6,set_field:0->reg7,set_field:0->reg8,set_field:0->reg9,resubmit(,8))
ct_clear
set_field:0->reg11
set_field:0->reg12
set_field:0->reg13
set_field:0x19->reg13
set_field:0xf->reg11
set_field:0xd->reg12
set_field:0x7->metadata
set_field:0x2->reg14
set_field:0->reg10
set_field:0->reg15
set_field:0->reg0
set_field:0->reg1
set_field:0->reg2
set_field:0->reg3
set_field:0->reg4
set_field:0->reg5
set_field:0->reg6
set_field:0->reg7
set_field:0->reg8
set_field:0->reg9
resubmit(,8)
8. reg14=0x2,metadata=0x7,dl_dst=02:42:ac:12:00:05, priority 50, cookie 0x4ee2215a
set_field:0x242ac1200050000000000000000/0xffffffffffff0000000000000000->xxreg0
resubmit(,9)
9. metadata=0x7, priority 0, cookie 0x49500abb
set_field:0x4/0x4->xreg4
resubmit(,10)
10. reg9=0x4/0x4,metadata=0x7, priority 100, cookie 0xd1de9890
resubmit(,11)
11. metadata=0x7, priority 0, cookie 0x1456464e
resubmit(,12)
12. metadata=0x7, priority 0, cookie 0xeef9fb82
resubmit(,13)
13. ip,metadata=0x7,nw_dst=172.18.0.5, priority 90, cookie 0x9af6ba20
ct(table=14,zone=NXM_NX_REG12[0..15],nat)
nat
-> A clone of the packet is forked to recirculate. The forked pipeline will be resumed at table 14.
-> Sets the packet to an untracked state, and clears all the conntrack fields.
Final flow: tcp,reg11=0x1c,reg12=0x1a,reg13=0x1b,reg14=0x1,reg15=0x2,metadata=0xd,in_port=5,vlan_tci=0x0000,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,nw_src=172.18.0.4,nw_dst=172.18.0.5,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=6443,tcp_flags=0
Megaflow: recirc_id=0,ct_state=-new-est-rel-rpl-inv-trk,ct_label=0/0x3,eth,tcp,in_port=5,vlan_tci=0x0000/0x1fff,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,nw_src=172.18.0.4,nw_dst=172.18.0.5,nw_ttl=64,nw_frag=no
Datapath actions: ct_clear,ct(zone=13,nat),recirc(0x4c)
===============================================================================
recirc(0x4c) - resume conntrack with default ct_state=trk|new (use --ct-next to customize)
===============================================================================
Flow: recirc_id=0x4c,ct_state=new|trk,ct_zone=13,eth,tcp,reg0=0x242,reg1=0xac120005,reg9=0x4,reg11=0xf,reg12=0xd,reg13=0x19,reg14=0x2,metadata=0x7,in_port=5,vlan_tci=0x0000,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,nw_src=172.18.0.4,nw_dst=172.18.0.5,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=6443,tcp_flags=0
bridge("br-int")
----------------
thaw
Resuming from table 14
14. ip,metadata=0x7, priority 50, cookie 0xbb2207f4
set_field:0x1/0x1->reg10
ct(table=15,zone=NXM_NX_REG11[0..15],nat)
nat
-> A clone of the packet is forked to recirculate. The forked pipeline will be resumed at table 15.
-> Sets the packet to an untracked state, and clears all the conntrack fields.
Final flow: recirc_id=0x4c,eth,tcp,reg0=0x242,reg1=0xac120005,reg9=0x4,reg10=0x1,reg11=0xf,reg12=0xd,reg13=0x19,reg14=0x2,metadata=0x7,in_port=5,vlan_tci=0x0000,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,nw_src=172.18.0.4,nw_dst=172.18.0.5,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=6443,tcp_flags=0
Megaflow: recirc_id=0x4c,ct_state=+new-est-rel-rpl-inv+trk,ct_label=0/0x1,eth,ip,in_port=5,nw_frag=no
Datapath actions: ct(zone=15,nat),recirc(0x4d)
===============================================================================
recirc(0x4d) - resume conntrack with default ct_state=trk|new (use --ct-next to customize)
===============================================================================
Flow: recirc_id=0x4d,ct_state=new|trk,ct_zone=15,eth,tcp,reg0=0x242,reg1=0xac120005,reg9=0x4,reg10=0x1,reg11=0xf,reg12=0xd,reg13=0x19,reg14=0x2,metadata=0x7,in_port=5,vlan_tci=0x0000,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,nw_src=172.18.0.4,nw_dst=172.18.0.5,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=0,tp_dst=6443,tcp_flags=0
bridge("br-int")
----------------
thaw
Resuming from table 15
15. metadata=0x7, priority 0, cookie 0x8d787bec
resubmit(,16)
16. metadata=0x7, priority 0, cookie 0x63822cff
resubmit(,17)
17. metadata=0x7, priority 0, cookie 0xdefb4e0d
resubmit(,18)
18. ip,metadata=0x7,nw_dst=172.18.0.0/16, priority 33, cookie 0x208b857f
dec_ttl()
set_field:0/0xffff00000000->xreg4
move:NXM_OF_IP_DST[]->NXM_NX_XXREG0[96..127]
-> NXM_NX_XXREG0[96..127] is now 0xac120005
set_field:0xac1200050000000000000000/0xffffffff0000000000000000->xxreg0
set_field:02:42:ac:12:00:05->eth_src
set_field:0x2->reg15
set_field:0x1/0x1->reg10
resubmit(,19)
19. reg8=0/0xffff,metadata=0x7, priority 150, cookie 0xe854f308
resubmit(,20)
20. metadata=0x7, priority 0, cookie 0x53666540
resubmit(,21)
21. ip,metadata=0x7, priority 0, cookie 0x82637a92
push:NXM_NX_REG0[]
push:NXM_NX_XXREG0[96..127]
pop:NXM_NX_REG0[]
-> NXM_NX_REG0[] is now 0xac120005
set_field:00:00:00:00:00:00->eth_dst
resubmit(,66)
66. No match.
drop
pop:NXM_NX_REG0[]
-> NXM_NX_REG0[] is now 0xac120005
resubmit(,22)
22. metadata=0x7, priority 0, cookie 0x24a3deac
resubmit(,23)
23. metadata=0x7, priority 0, cookie 0xbc99699d
resubmit(,24)
24. metadata=0x7, priority 0, cookie 0xb40247ed
resubmit(,25)
25. ip,metadata=0x7,dl_dst=00:00:00:00:00:00, priority 100, cookie 0xbbd00eb2
controller(userdata=00.00.00.00.00.00.00.00.00.19.00.10.80.00.06.06.ff.ff.ff.ff.ff.ff.00.00.00.1c.00.18.00.20.00.40.00.00.00.00.00.01.de.10.80.00.2c.04.00.00.00.00.00.1c.00.18.00.20.00.60.00.00.00.00.00.01.de.10.80.00.2e.04.00.00.00.00.00.19.00.10.80.00.2a.02.00.01.00.00.00.00.00.00.ff.ff.00.10.00.00.23.20.00.0e.ff.f8.20.00.00.00)
Final flow: recirc_id=0x4d,ct_state=new|trk,ct_zone=15,eth,tcp,reg0=0xac120005,reg1=0xac120005,reg9=0x4,reg10=0x1,reg11=0xf,reg12=0xd,reg13=0x19,reg14=0x2,reg15=0x2,metadata=0x7,in_port=5,vlan_tci=0x0000,dl_src=02:42:ac:12:00:05,dl_dst=00:00:00:00:00:00,nw_src=172.18.0.4,nw_dst=172.18.0.5,nw_tos=0,nw_ecn=0,nw_ttl=63,tp_src=0,tp_dst=6443,tcp_flags=0
Megaflow: recirc_id=0x4d,ct_state=+new-est-rel-inv+trk,ct_label=0/0x2,eth,ip,in_port=5,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,nw_dst=172.18.0.5,nw_ttl=64,nw_frag=no
Datapath actions: set(eth(src=02:42:ac:12:00:05,dst=00:00:00:00:00:00)),set(ipv4(ttl=63)),userspace(pid=2555081466,controller(reason=1,dont_send=1,continuation=0,recirc_id=75,rule_cookie=0xbbd00eb2,controller_id=0,max_len=65535))
#########ovn-trace###
ovn-trace --ct new --ovs ext_ovn-control-plane3 'inport == "breth0_ovn-control-plane3" && eth.src ==02:42:ac:12:00:04 && eth.dst==02:42:ac:12:00:05 && ip4 && ip.ttl==64 && ip4.src==172.18.0.4 && ip4.dst==172.18.0.5 && tcp && tcp.src == 5555 && tcp.dst ==6443'
[root@ovn-control-plane3 ~]# ovn-trace --detailed --ct new --ovs ext_ovn-control-plane3 'inport == "breth0_ovn-control-plane3" && eth.src ==02:42:ac:12:00:04 && eth.dst==02:42:ac:12:00:05 && ip4 && ip.ttl==64 && ip4.src==172.18.0.4 && ip4.dst==172.18.0.5 && tcp && tcp.src == 5555 && tcp.dst ==6443'
# tcp,reg14=0x1,vlan_tci=0x0000,dl_src=02:42:ac:12:00:04,dl_dst=02:42:ac:12:00:05,nw_src=172.18.0.4,nw_dst=172.18.0.5,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=5555,tp_dst=6443,tcp_flags=0
ingress(dp="ext_ovn-control-plane3", inport="breth0_ovn-control-plane3")
------------------------------------------------------------------------
0. ls_in_port_sec_l2 (ovn-northd.c:4755): inport == "breth0_ovn-control-plane3", priority 50, uuid de5bff5c
cookie=0xde5bff5c, duration=1795.057s, table=8, n_packets=2145, n_bytes=176106, idle_age=0, priority=50,reg14=0x1,metadata=0xd actions=resubmit(,9)
next;
4. ls_in_pre_lb (ovn-northd.c:4872): ip && inport == "breth0_ovn-control-plane3", priority 110, uuid c80e767c
cookie=0xc80e767c, duration=1795.057s, table=12, n_packets=1694, n_bytes=156332, idle_age=0, priority=110,ip,reg14=0x1,metadata=0xd actions=resubmit(,13)
cookie=0xc80e767c, duration=1795.057s, table=12, n_packets=4, n_bytes=720, idle_age=942, priority=110,ipv6,reg14=0x1,metadata=0xd actions=resubmit(,13)
next;
13. ls_in_arp_rsp (ovn-northd.c:6672): inport == "breth0_ovn-control-plane3", priority 100, uuid de905217
cookie=0xde905217, duration=1795.057s, table=21, n_packets=2145, n_bytes=176106, idle_age=0, priority=100,reg14=0x1,metadata=0xd actions=resubmit(,22)
next;
19. ls_in_l2_lkup (ovn-northd.c:7185): eth.dst == 02:42:ac:12:00:05, priority 50, uuid 6bff66d3
cookie=0x6bff66d3, duration=1795.057s, table=27, n_packets=1634, n_bytes=143434, idle_age=0, priority=50,metadata=0xd,dl_dst=02:42:ac:12:00:05 actions=set_field:0x2->reg15,resubmit(,32)
outport = "etor-GR_ovn-control-plane3";
output;
egress(dp="ext_ovn-control-plane3", inport="breth0_ovn-control-plane3", outport="etor-GR_ovn-control-plane3")
-------------------------------------------------------------------------------------------------------------
0. ls_out_pre_lb (ovn-northd.c:4875): ip && outport == "etor-GR_ovn-control-plane3", priority 110, uuid 04d1ef7f
cookie=0x4d1ef7f, duration=1795.057s, table=40, n_packets=4, n_bytes=720, idle_age=942, priority=110,ipv6,reg15=0x2,metadata=0xd actions=resubmit(,41)
cookie=0x4d1ef7f, duration=1795.057s, table=40, n_packets=1694, n_bytes=156332, idle_age=0, priority=110,ip,reg15=0x2,metadata=0xd actions=resubmit(,41)
next;
9. ls_out_port_sec_l2 (ovn-northd.c:4821): outport == "etor-GR_ovn-control-plane3", priority 50, uuid c3acad95
cookie=0xc3acad95, duration=1795.057s, table=49, n_packets=1665, n_bytes=144736, idle_age=0, priority=50,reg15=0x2,metadata=0xd actions=resubmit(,64)
output;
/* output to "etor-GR_ovn-control-plane3", type "l3gateway" */
ingress(dp="GR_ovn-control-plane3", inport="rtoe-GR_ovn-control-plane3")
------------------------------------------------------------------------
0. lr_in_admission (ovn-northd.c:8484): eth.dst == 02:42:ac:12:00:05 && inport == "rtoe-GR_ovn-control-plane3", priority 50, uuid 4ee2215a
cookie=0x4ee2215a, duration=1795.103s, table=8, n_packets=1665, n_bytes=144736, idle_age=0, priority=50,reg14=0x2,metadata=0x7,dl_dst=02:42:ac:12:00:05 actions=set_field:0x242ac1200050000000000000000/0xffffffffffff0000000000000000->xxreg0,resubmit(,9)
xreg0[0..47] = 02:42:ac:12:00:05;
next;
1. lr_in_lookup_neighbor (ovn-northd.c:8560): 1, priority 0, uuid 49500abb
cookie=0x49500abb, duration=1795.618s, table=9, n_packets=3919, n_bytes=289222, idle_age=0, priority=0,metadata=0x7 actions=set_field:0x4/0x4->xreg4,resubmit(,10)
reg9[2] = 1;
next;
2. lr_in_learn_neighbor (ovn-northd.c:8569): reg9[2] == 1, priority 100, uuid d1de9890
cookie=0xd1de9890, duration=1795.618s, table=10, n_packets=4353, n_bytes=307450, idle_age=0, priority=100,reg9=0x4/0x4,metadata=0x7 actions=resubmit(,11)
next;
5. lr_in_unsnat (ovn-northd.c:9438): ip && ip4.dst == 172.18.0.5, priority 90, uuid 9af6ba20
cookie=0x9af6ba20, duration=1794.961s, table=13, n_packets=1633, n_bytes=143392, idle_age=0, priority=90,ip,metadata=0x7,nw_dst=172.18.0.5 actions=ct(table=14,zone=NXM_NX_REG12[0..15],nat)
ct_snat;
##lflows:
table=17(lr_in_arp_request ), priority=100 , match=(eth.dst == 00:00:00:00:00:00 && ip4), action=(arp { eth.dst = ff:ff:ff:ff:ff:ff; arp.spa = reg1; arp.tpa = reg0; arp.op = 1; output; };)
table=25 ip,metadata=0x7,dl_dst=00:00:00:00:00:00 actions=controller(userdata=00.00.00.00.00.00.00.00.00.19.00.10.80.00.06.06.ff.ff.ff.ff.ff.ff.00.00.00.1c.00.18.00.20.00.40.00.00.00.00.00.01.de.10.80.00.2c.04.00.00.00.00.00.1c.00.18.00.20.00.60.00.00.00.00.00.01.de.10.80.00.2e.04.00.00.00.00.00.19.00.10.80.00.2a.02.00.01.00.00.00.00.00.00.ff.ff.00.10.00.00.23.20.00.0e.ff.f8.20.00.00.00)
table=17(lr_in_arp_request ), priority=100 , match=(eth.dst == 00:00:00:00:00:00 && ip4), action=(arp { eth.dst = ff:ff:ff:ff:ff:ff; arp.spa = reg1; arp.tpa = reg0; arp.op = 1; output; };)
table=25 ip,metadata=0x1,dl_dst=00:00:00:00:00:00 actions=controller(userdata=00.00.00.00.00.00.00.00.00.19.00.10.80.00.06.06.ff.ff.ff.ff.ff.ff.00.00.00.1c.00.18.00.20.00.40.00.00.00.00.00.01.de.10.80.00.2c.04.00.00.00.00.00.1c.00.18.00.20.00.60.00.00.00 .00.00.01.de.10.80.00.2e.04.00.00.00.00.00.19.00.10.80.00.2a.02.00.01.00.00.00.00.00.00.ff.ff.00.10.00.00.23.20.00.0e.ff.f8.20.00.00.00)
##############
[root@ovn-control-plane3 ~]# rpm -qa | grep ovn
ovn-20.06.2-3.fc31.x86_64
ovn-host-20.06.2-3.fc31.x86_64
ovn-central-20.06.2-3.fc31.x86_64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment