Skip to content

Instantly share code, notes, and snippets.

@trozet
trozet / geneve_ofproto.txt
Created August 18, 2022 14:51
ofproto trace geneve ovn
So, for the trace, I have:
# oc get pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod1 1/1 Running 0 34s 10.244.0.6 ovn-control-plane <none> <none>
pod2 1/1 Running 0 10s 10.244.2.3 ovn-worker2 <none> <none>
And:
# oc get pods -o wide -n ovn-kubernetes | grep ovn-worker2 | grep ovnkube
ovnkube-node-9pvtz 3/3 Running 0 23m 10.89.0.3 ovn-worker2 <none> <none>
Get the source node IP:
# oc get node -o wide | grep control-plane
cookie=0x0, duration=24278.292s, table=0, n_packets=4605464, n_bytes=3810236725, priority=200,ip,in_port=vxlan0,nw_src=10.128.0.0/14 actions=move:NXM_NX_TUN_ID[0..31]->NXM_NX_REG0[],goto_table:10
cookie=0x4adb2585, duration=24230.264s, table=10, n_packets=3507503, n_bytes=3192818262, priority=100,tun_src=10.0.128.4 actions=goto_table:30
cookie=0x0, duration=24345.718s, table=30, n_packets=2949611, n_bytes=568092816, priority=100,ct_state=-rpl,ip,nw_src=10.128.0.0/14,nw_dst=10.128.0.0/14 actions=ct(commit,table=31)
cookie=0x0, duration=23886.708s, table=31, n_packets=830185, n_bytes=91590384, priority=200,ip,nw_dst=10.131.0.0/23 actions=goto_table:70
cookie=0x0, duration=11165.071s, table=70, n_packets=3579197, n_bytes=6267036840, priority=100,ip,nw_dst=10.131.0.26 actions=load:0xd61a9f->NXM_NX_REG1[],load:0x1b->NXM_NX_REG2[],goto_table:80
[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.
[root@ovn-worker ~]# ovs-appctl ofproto/trace br-int in_port=2,dl_src=02:42:ac:12:00:02,dl_dst=02:42:ac:12:00:03,tcp,nw_src=172.18.0.2,nw_dst=172.18.0.3,nw_ttl=64,tp_src=80,tp_dst=9999 --ct-next 'trk,est,rpl' --ct-next 'trk,est,rpl' --ct-next 'trk,est,rpl' --ct-next 'trk,est,rpl' --ct-next 'trk,est,rpl'
Flow: tcp,in_port=2,vlan_tci=0x0000,dl_src=02:42:ac:12:00:02,dl_dst=02:42:ac:12:00:03,nw_src=172.18.0.2,nw_dst=172.18.0.3,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=9999,tcp_flags=0
bridge("br-int")
----------------
0. in_port=2, priority 100, cookie 0x68790a6
set_field:0xa->reg13
set_field:0x6->reg11
set_field:0x8->reg12
set_field:0x4->metadata
[root@ovn-control-plane ~]# ovn-trace --ct new ovn-worker 'inport == "default_pod2" && eth.src ==0a:58:0a:f4:01:06 && eth.dst==0a:58:0a:f4:01:01 && ip4 && ip.ttl==64 && ip4.src==10.244.1.6 && ip4.dst==10.96.19.89 && tcp && tcp.src == 55594 && tcp.dst ==80' --lb-dst 10.96.19.89:80
2022-03-15T15:11:15Z|00001|ovntrace|WARN|reg0[8] == 1 && (inport==stor-ovn-worker): parsing expression failed (Syntax error at `stor' expecting constant.)
2022-03-15T15:11:15Z|00002|ovntrace|WARN|reg0[7] == 1 && (inport==stor-ovn-worker): parsing expression failed (Syntax error at `stor' expecting constant.)
# tcp,reg14=0x6,vlan_tci=0x0000,dl_src=0a:58:0a:f4:01:06,dl_dst=0a:58:0a:f4:01:01,nw_src=10.244.1.6,nw_dst=10.96.19.89,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=55594,tp_dst=80,tcp_flags=0
ingress(dp="ovn-worker", inport="default_pod2")
-----------------------------------------------
0. ls_in_port_sec_l2 (northd.c:5503): inport == "default_pod2" && eth.src == {0a:58:0a:f4:01:06}, priority 50, uuid 97a8e2fd
next;
1. ls_in_port_se
[root@ovn-worker ~]# ovs-ofctl dump-flows br-int table=44
cookie=0x165ca917, duration=1341.200s, table=44, n_packets=71, n_bytes=5387, priority=0,metadata=0x4 actions=resubmit(,45)
cookie=0x609f11b6, duration=1341.114s, table=44, n_packets=140, n_bytes=16805, priority=0,metadata=0x1 actions=resubmit(,45)
cookie=0x609f11b6, duration=1341.113s, table=44, n_packets=192, n_bytes=27789, priority=0,metadata=0x5 actions=resubmit(,45)
cookie=0xb252e8dd, duration=1341.111s, table=44, n_packets=4953, n_bytes=5639519, priority=65535,metadata=0x6 actions=resubmit(,45)
cookie=0x165ca917, duration=1187.379s, table=44, n_packets=108, n_bytes=12957, priority=0,metadata=0x2 actions=resubmit(,45)
cookie=0x1bf13966, duration=1341.200s, table=44, n_packets=0, n_bytes=0, priority=65532,icmp6,metadata=0x4,ipv6_src=fe80::/10,icmp_type=132 actions=resubmit(,45)
cookie=0x1bf13966, duration=1341.200s, table=44, n_packets=0, n_bytes=0, priority=65532,icmp6,metadata=0x4,ipv6_src=fe80::/10,icmp_type=130 actions=resubmit(,45)
coo
[root@ovn-worker ~]# ovs-appctl ofproto/trace br-int in_port=4,dl_src=0a:58:0a:f4:01:03,dl_dst=0a:58:0a:f4:01:01,tcp,tp_dst=80,nw_dst=8.8.8.8,nw_src=10.244.1.3,nw_ttl=254
Flow: tcp,in_port=4,vlan_tci=0x0000,dl_src=0a:58:0a:f4:01:03,dl_dst=0a:58:0a:f4:01:01,nw_src=10.244.1.3,nw_dst=8.8.8.8,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=0,tp_dst=80,tcp_flags=0
bridge("br-int")
----------------
0. in_port=4, priority 100, cookie 0x6deecb21
set_field:0x3->reg13
set_field:0x4->reg11
set_field:0x8->reg12
set_field:0x4->metadata
@trozet
trozet / sctp_ovn_steps
Created March 1, 2022 18:35
sctp reproducer with OVN
1. Pull https://github.com/trozet/ovn-kubernetes/tree/fix_delete_sctp_ct
2. ./kind.sh -wk 1
3. Create ovn networked pod:
[trozet@fedora ovn-kubernetes]$ cat ~/basic.yaml
---
apiVersion: v1
kind: Pod
metadata:
name: trozet3
labels:
[trozet@fedora go-controller]$ go test -v ./pkg/ovn/subnetallocator -run TestTrozet
=== RUN TestTrozet
trozet after subnet allocator created
10.102.0.0/24
10.102.1.0/24
10.102.2.0/24
10.102.3.0/24
10.102.4.0/24
10.102.5.0/24
10.102.6.0/24
func (t *Transaction) Wait(database, table string, timeout *int, where []ovsdb.Condition, columns []string, until string, rows []ovsdb.Row) ovsdb.OperationResult {
start := time.Now()
if until != "!=" || until != "==" {
e := ovsdb.NotSupported{}
return ovsdb.OperationResult{Error: e.Error()}
}
dbModel := t.Model