6.9. OVN 논리 흐름 모니터링
OVN은 우선 순위, 일치 및 작업이 있는 흐름 테이블에 해당하는 논리 흐름을 사용합니다. 이러한 논리 흐름은 각 RHOSP(Red Hat Openstack Platform) 컴퓨팅 노드에서 실행 중인 ovn-controller
에 배포됩니다. 컨트롤러 노드에서 ovn-sbctl lflow-list
명령을 사용하여 전체 논리 흐름 세트를 확인합니다.
사전 요구 사항
- ML2/OVN을 Networking 서비스(neutron) 기본 메커니즘 드라이버로 사용하는 RHOSP 배포.
OVN 데이터베이스 명령의 별칭 파일을 생성합니다.
6.8절. “OVN 문제 해결 명령에 대한 별칭 생성” 에서 참조하십시오.
절차
OVN 컨테이너에 액세스하는 데 필요한 권한이 있는 사용자로 컨트롤러 호스트에 로그인합니다.
예제
$ ssh heat-admin@controller-0.ctlplane
OVN 데이터베이스 명령의 별칭 파일을 가져옵니다.
자세한 내용은 6.8절. “OVN 문제 해결 명령에 대한 별칭 생성”의 내용을 참조하십시오.
예제
source ~/ovn-alias.sh
논리 흐름 보기:
$ ovn-sbctl lflow-list
출력을 검사합니다.
샘플 출력
Datapath: "sw0" (d7bf4a7b-e915-4502-8f9d-5995d33f5d10) Pipeline: ingress table=0 (ls_in_port_sec_l2 ), priority=100 , match=(eth.src[40]), action=(drop;) table=0 (ls_in_port_sec_l2 ), priority=100 , match=(vlan.present), action=(drop;) table=0 (ls_in_port_sec_l2 ), priority=50 , match=(inport == "sw0-port1" && eth.src == {00:00:00:00:00:01}), action=(next;) table=0 (ls_in_port_sec_l2 ), priority=50 , match=(inport == "sw0-port2" && eth.src == {00:00:00:00:00:02}), action=(next;) table=1 (ls_in_port_sec_ip ), priority=0 , match=(1), action=(next;) table=2 (ls_in_port_sec_nd ), priority=90 , match=(inport == "sw0-port1" && eth.src == 00:00:00:00:00:01 && arp.sha == 00:00:00:00:00:01), action=(next;) table=2 (ls_in_port_sec_nd ), priority=90 , match=(inport == "sw0-port1" && eth.src == 00:00:00:00:00:01 && ip6 && nd && ((nd.sll == 00:00:00:00:00:00 || nd.sll == 00:00:00:00:00:01) || ((nd.tll == 00:00:00:00:00:00 || nd.tll == 00:00:00:00:00:01)))), action=(next;) table=2 (ls_in_port_sec_nd ), priority=90 , match=(inport == "sw0-port2" && eth.src == 00:00:00:00:00:02 && arp.sha == 00:00:00:00:00:02), action=(next;) table=2 (ls_in_port_sec_nd ), priority=90 , match=(inport == "sw0-port2" && eth.src == 00:00:00:00:00:02 && ip6 && nd && ((nd.sll == 00:00:00:00:00:00 || nd.sll == 00:00:00:00:00:02) || ((nd.tll == 00:00:00:00:00:00 || nd.tll == 00:00:00:00:00:02)))), action=(next;) table=2 (ls_in_port_sec_nd ), priority=80 , match=(inport == "sw0-port1" && (arp || nd)), action=(drop;) table=2 (ls_in_port_sec_nd ), priority=80 , match=(inport == "sw0-port2" && (arp || nd)), action=(drop;) table=2 (ls_in_port_sec_nd ), priority=0 , match=(1), action=(next;) table=3 (ls_in_pre_acl ), priority=0, match=(1), action=(next;) table=4 (ls_in_pre_lb ), priority=0 , match=(1), action=(next;) table=5 (ls_in_pre_stateful ), priority=100 , match=(reg0[0] == 1), action=(ct_next;) table=5 (ls_in_pre_stateful ), priority=0 , match=(1), action=(next;) table=6 (ls_in_acl ), priority=0 , match=(1), action=(next;) table=7 (ls_in_qos_mark ), priority=0 , match=(1), action=(next;) table=8 (ls_in_lb ), priority=0 , match=(1), action=(next;) table=9 (ls_in_stateful ), priority=100 , match=(reg0[1] == 1), action=(ct_commit(ct_label=0/1); next;) table=9 (ls_in_stateful ), priority=100 , match=(reg0[2] == 1), action=(ct_lb;) table=9 (ls_in_stateful ), priority=0 , match=(1), action=(next;) table=10(ls_in_arp_rsp ), priority=0 , match=(1), action=(next;) table=11(ls_in_dhcp_options ), priority=0 , match=(1), action=(next;) table=12(ls_in_dhcp_response), priority=0 , match=(1), action=(next;) table=13(ls_in_l2_lkup ), priority=100 , match=(eth.mcast), action=(outport = "_MC_flood"; output;) table=13(ls_in_l2_lkup ), priority=50 , match=(eth.dst == 00:00:00:00:00:01), action=(outport = "sw0-port1"; output;) table=13(ls_in_l2_lkup ), priority=50 , match=(eth.dst == 00:00:00:00:00:02), action=(outport = "sw0-port2"; output;) Datapath: "sw0" (d7bf4a7b-e915-4502-8f9d-5995d33f5d10) Pipeline: egress table=0 (ls_out_pre_lb ), priority=0 , match=(1), action=(next;) table=1 (ls_out_pre_acl ), priority=0 , match=(1), action=(next;) table=2 (ls_out_pre_stateful), priority=100 , match=(reg0[0] == 1), action=(ct_next;) table=2 (ls_out_pre_stateful), priority=0 , match=(1), action=(next;) table=3 (ls_out_lb ), priority=0 , match=(1), action=(next;) table=4 (ls_out_acl ), priority=0 , match=(1), action=(next;) table=5 (ls_out_qos_mark ), priority=0 , match=(1), action=(next;) table=6 (ls_out_stateful ), priority=100 , match=(reg0[1] == 1), action=(ct_commit(ct_label=0/1); next;) table=6 (ls_out_stateful ), priority=100 , match=(reg0[2] == 1), action=(ct_lb;) table=6 (ls_out_stateful ), priority=0 , match=(1), action=(next;) table=7 (ls_out_port_sec_ip ), priority=0 , match=(1), action=(next;) table=8 (ls_out_port_sec_l2 ), priority=100 , match=(eth.mcast), action=(output;) table=8 (ls_out_port_sec_l2 ), priority=50 , match=(outport == "sw0-port1" && eth.dst == {00:00:00:00:00:01}), action=(output;) table=8 (ls_out_port_sec_l2 ), priority=50 , match=(outport == "sw0-port2" && eth.dst == {00:00:00:00:00:02}), action=(output;)
OVN과 OpenFlow의 주요 차이점은 다음과 같습니다.
- OVN 포트는 단일 스위치의 물리적 포트가 아닌 네트워크에 있는 논리적 엔티티입니다.
- OVN은 파이프라인의 각 테이블에 해당 번호 외에 이름을 제공합니다. 이름은 파이프라인에서 해당 단계의 목적을 설명합니다.
- OVN 일치 구문은 복잡한 부울 표현식을 지원합니다.
- OVN 논리 흐름에서 지원되는 작업은 OpenFlow를 초과하여 확장합니다. OVN 논리 흐름 구문에서 DHCP와 같은 고급 기능을 구현할 수 있습니다.
OVN 추적을 실행합니다.
ovn-trace
명령은 패킷이 OVN 논리 흐름을 통해 이동하는 방식을 시뮬레이션하거나 패킷이 삭제되는 이유를 확인할 수 있습니다. 다음 매개변수를 사용하여ovn-trace
명령을 제공합니다.- DATAPATH
- 시뮬레이션된 패킷이 시작되는 논리 스위치 또는 논리 라우터입니다.
- MICROFLOW
ovn-sb
데이터베이스에서 사용하는 구문에서 시뮬레이션된 패킷.예제
이 예에서는 시뮬레이션된 패킷의
--minimal
출력 옵션을 표시하고 패킷이 대상에 도달했음을 보여줍니다.$ ovn-trace --minimal sw0 'inport == "sw0-port1" && eth.src == 00:00:00:00:00:01 && eth.dst == 00:00:00:00:00:02'
샘플 출력
# reg14=0x1,vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,dl_type=0x0000 output("sw0-port2");
예제
보다 상세하게는, 이 동일한 시뮬레이션된 패킷에 대한
--summary
출력은 전체 실행 파이프라인을 보여줍니다.$ ovn-trace --summary sw0 'inport == "sw0-port1" && eth.src == 00:00:00:00:00:01 && eth.dst == 00:00:00:00:00:02'
샘플 출력
샘플 출력에는 다음이 표시됩니다.
-
패킷은
sw
네트워크에 들어가고 Ingress 파이프라인을 실행합니다.0-port1 포트에서 sw
0 -
outport
변수는 이 패킷의 의도한 대상이sw0-port2
임을 나타내는sw0-port2
로 설정됩니다. -
패킷이 수신 파이프라인의 출력이며,
outport
변수가sw0-port2
로 설정된 상태에서sw0
의 송신 파이프라인으로 가져옵니다. 출력 작업은 출력 파이프라인에서 실행되며, 이 파이프라인은 패킷을
sw0-port2
인outport
변수의 현재 값으로 출력합니다.# reg14=0x1,vlan_tci=0x0000,dl_src=00:00:00:00:00:01,dl_dst=00:00:00:00:00:02,dl_type=0x0000 ingress(dp="sw0", inport="sw0-port1") { outport = "sw0-port2"; output; egress(dp="sw0", inport="sw0-port1", outport="sw0-port2") { output; /* output to "sw0-port2", type "" */; }; };
-
패킷은
추가 리소스
- 6.8절. “OVN 문제 해결 명령에 대한 별칭 생성”
-
ovn-sbctl --help
command -
OVN-trace --help
명령