Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] kubectl-ko: add option --ovs to ovn-trace subcommand #4691

Open
zhangzujian opened this issue Nov 4, 2024 · 0 comments
Open
Labels
feature New network feature

Comments

@zhangzujian
Copy link
Member

Description

Similar to subcommand ovn-trace, but:

  1. Run ovn-trace on the node where the trace target is running;
  2. Add ovn-trace option --db=tcp:[SB_LEADER_IP]:6642 to connect to the sb database;
  3. Add ovn-trace option --ovs to display the OpenFlow flows that correspond to each OVN logical flow.

Example display:

$ kubectl ko ovn-trace --ovs kube-system/kube-ovn-pinger-8k2h7 10.16.0.1 icmp
Using the logical gateway mac address as destination
+ kubectl exec ovn-central-6845747f5b-sfbvp -n kube-system -c ovn-central -- ovn-trace --db=tcp:[172.18.0.3]:6642 --ovs ovn-default 'inport == "kube-ovn-pinger-8k2h7.kube-system" && ip.ttl == 64 && icmp && eth.src == 02:33:03:14:b1:cc && ip4.src == 10.16.0.9 && eth.dst == 36:fc:f7:35:6e:73 && ip4.dst == 10.16.0.1 && ct.new'
# ct_state=new|trk,icmp,reg14=0x9,vlan_tci=0x0000,dl_src=02:33:03:14:b1:cc,dl_dst=36:fc:f7:35:6e:73,nw_src=10.16.0.9,nw_dst=10.16.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,nw_frag=no,icmp_type=0,icmp_code=0

ingress(dp="ovn-default", inport="kube-ovn-pinger-8k2h7.kube-system")
---------------------------------------------------------------------
 0. ls_in_check_port_sec (northd.c:8991): 1, priority 50, uuid 16a8f8f4
    cookie=0x16a8f8f4, duration=20949.186s, table=8, n_packets=28368, n_bytes=1858870, idle_age=2, priority=50,metadata=0x2 actions=set_field:0/0x1000->reg10,resubmit(,74),move:NXM_NX_REG10[12]->NXM_NX_XXREG0[111],resubmit(,9)
    cookie=0x16a8f8f4, duration=20869.971s, table=8, n_packets=152, n_bytes=9592, idle_age=781, priority=50,metadata=0x4 actions=set_field:0/0x1000->reg10,resubmit(,74),move:NXM_NX_REG10[12]->NXM_NX_XXREG0[111],resubmit(,9)
    cookie=0x16a8f8f4, duration=20886.921s, table=8, n_packets=22625, n_bytes=1480724, idle_age=1, priority=50,metadata=0x5 actions=set_field:0/0x1000->reg10,resubmit(,74),move:NXM_NX_REG10[12]->NXM_NX_XXREG0[111],resubmit(,9)
    cookie=0x16a8f8f4, duration=20949.184s, table=8, n_packets=149240, n_bytes=13030095, idle_age=3, priority=50,metadata=0x3 actions=set_field:0/0x1000->reg10,resubmit(,74),move:NXM_NX_REG10[12]->NXM_NX_XXREG0[111],resubmit(,9)
    reg0[15] = check_in_port_sec();
    next;
 5. ls_in_pre_lb (northd.c:6231): ip, priority 100, uuid 4d861d97
    cookie=0x4d861d97, duration=20946.240s, table=13, n_packets=0, n_bytes=0, idle_age=20946, priority=100,ipv6,metadata=0x3 actions=set_field:0x4000000000000000000000000/0x4000000000000000000000000->xxreg0,resubmit(,14)
    cookie=0x4d861d97, duration=20869.969s, table=13, n_packets=70, n_bytes=4620, idle_age=19395, priority=100,ip,metadata=0x4 actions=set_field:0x4000000000000000000000000/0x4000000000000000000000000->xxreg0,resubmit(,14)
    cookie=0x4d861d97, duration=20869.969s, table=13, n_packets=0, n_bytes=0, idle_age=20869, priority=100,ipv6,metadata=0x4 actions=set_field:0x4000000000000000000000000/0x4000000000000000000000000->xxreg0,resubmit(,14)
    cookie=0x4d861d97, duration=20886.919s, table=13, n_packets=22075, n_bytes=1456950, idle_age=1, priority=100,ip,metadata=0x5 actions=set_field:0x4000000000000000000000000/0x4000000000000000000000000->xxreg0,resubmit(,14)
    cookie=0x4d861d97, duration=20886.919s, table=13, n_packets=0, n_bytes=0, idle_age=20886, priority=100,ipv6,metadata=0x5 actions=set_field:0x4000000000000000000000000/0x4000000000000000000000000->xxreg0,resubmit(,14)
    cookie=0x4d861d97, duration=20946.240s, table=13, n_packets=148638, n_bytes=13004027, idle_age=3, priority=100,ip,metadata=0x3 actions=set_field:0x4000000000000000000000000/0x4000000000000000000000000->xxreg0,resubmit(,14)
    reg0[2] = 1;
    next;
...

Who will benefit from this feature?

No response

Anything else?

No response

@zhangzujian zhangzujian added the feature New network feature label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New network feature
Projects
None yet
Development

No branches or pull requests

1 participant