JCNR-vRouter
この章では、JCNR DPDKベースの転送プレーンであるJCNR-vRouterについて理解を深めます。
JCNR vRouterのメリット
-
JCNR-vRouterへのDPDKの統合:
-
フォワーディングプレーンは、カーネルベースのフォワーディングよりも高速なフォワーディング機能を提供します
-
フォワーディングプレーンは、カーネルベースのフォワーディングよりも拡張性が高い
-
次の NIC のサポート:
-
Intel E810(コロンビアビル)とIntel Adapter Virtual Function (IAVF) および Dynamic Device Personalization (DDP)
-
Intel XL710 (Fortville) with Intel Adapter Virtual Function (IAVF)
メモ:動的デバイス・パーソナライゼーション (DDP) は、インテル XL710 NIC ではサポートされていません。
-
-
インテル XL710 NIC での次のドライバーのサポート:
-
インテル アダプター仮想関数 (IAVF)
-
リナックスベースドライバi40E
-
-
-
インターフェイスサポート:
-
virtio を使用したポッドインターフェイス
これらの DPDK 対応の vhost ベースのユーザー ソケット インターフェイスを、ワークロード インターフェイスとして
values.yaml
ファイル内で定義します。システムは、このタイプのすべてのアクティブ・インターフェースのソケット詳細をワークロード・コンテナーの /dpdk ディレクトリーに保持します。通常、このタイプのポッドインターフェイスは、アクセスインターフェイスではなくトランクインターフェイスとして定義します。 -
カーネル
veth
ペアを使用したポッドインターフェイスファイル内の
values.yaml
カーネル veth ペアを持つポッド インターフェイスをアクセス インターフェイスとして定義すると、ポッドは DPDK を使用するのではなく、カーネルを介してトラフィックを渡すことができます。 -
DPDK 仮想機能(VF)ワークロード インターフェイス
DPDK VF ファブリック トランク インターフェイスは、vRouter の導入で使用される values.yaml ファイルで定義します。これにより、JCNR はインターフェースの名前、その MAC アドレス、および PCI スロット ID を認識できます。
-
DPDK VFファブリック トランク インターフェイス
DPDK VF ファブリック トランク インターフェイスは、vRouter の導入で使用される values.yaml ファイルで定義します。これにより、JCNR はインターフェースの名前、その MAC アドレス、および PCI スロット ID を認識できます。トラフィックフローを管理しやすくするために、物理インターフェイスにVLANフィルタリングを適用します。クラウドネイティブルーターで使用するためにVLANを設定すると、設定されたVLANのみが物理インターフェイスを通過できます。
-
物理機能(PF)ワークロード・インターフェース
PF ワークロードインターフェイスは values_l3.yaml ファイルで定義します。システムは、各 PF ワークロード・インターフェースに 1 つの受信キューと 1 つの送信キューのみを装備します。システムは、1 つの転送 CPU コアを、トラフィックのインターフェイスをポーリングするタスクに割り当てます。
-
PF ファブリック インターフェイス
PF ファブリック インターフェイスは、 values.yaml ファイルで定義します。システムは、ポーリングを処理する転送CPUコアを割り当てた数の受信キューと送信キューを各PFファブリックインターフェイスに装備します。たとえば、3 つの転送 CPU コアを PF ファブリック インターフェイスに割り当てると、システムは 3 つの受信キューと 3 つの送信キューを PF ファブリック インターフェイスに割り当てます。
-
L2 モードで実行した場合、インターフェイスなし
vhost0
vRouter-agent は values.yaml で L2 モードを検出するため、インターフェイスが起動するのを
vhost0
待たずにインストールが完了します。仮想ホスト インターフェイス追加メッセージは送信されないため、vRouter はインターフェイスを作成しvhost0
ません。
-
-
インターフェイスボンディング
DPDK vRouter は、DPDK VF ファブリック インターフェイス上でのアクティブ/スタンバイ モードでのインターフェイス ボンディングをサポートします。 values.yaml ファイルは、インターフェイス名、モード値、およびプライマリおよびセカンダリ インターフェイスの指定を指定します。DPDKには、ボンディングに使用する独自のボンディングドライバを持つライブラリが含まれています。動作中、vRouter はプライマリ インターフェイスを使用してトラフィックを渡します。プライマリリンクがダウンした場合、ペアのセカンダリインターフェイスは、プライマリインターフェイスが再接続するまでトラフィックを渡します。
-
ポッドDPDKインターフェイス
JCNR-vRouter は、POD アプリケーションへの virtio 通信をサポートします。JCNR-CNIは、ポッドアプリケーションとvRouterに渡す一意のソケットディレクトリを割り当てます。JCNR-CNIは、仮想ホストソケットとポッドボリュームマウントを分離することで、あるポッドが別のポッドのリソースにアクセスできないようにします。
-
ポッドカーネルインターフェイス
JCNR は、Linux カーネルのネットワークスタックを使用するポッドアプリケーションと通信するために、 veth インターフェイスタイプをサポートしています。
vRouter CLI へのアクセス
kubectl get pods -n contrail
コマンドの出力は次のようになります。
NAME READY STATUS RESTARTS AGE contrail-vrouter-masters-97v8z 3/3 Running 0 6d1h
vRouter-agent CLI にアクセスするには、次のコマンドでシステムから完全なポッド名を使用します。
kubectl exec -n contrail -it contrail-vrouter-masters-97v8z -- bash
コマンドの出力は次のようになります。 Defaulted container "contrail-vrouter-agent" out of: contrail-vrouter-agent, contrail-vrouter-agent-dpdk, contrail-vrouter-telemetry-exporter, contrail-init (init), contrail-vrouter-kernel-init-dpdk (init)
vRouter CLI にアクセスした後、システムの監視とトラブルシューティングのために実行できるコマンドがいくつかあります。使用可能なコマンドの一部については、「 CLI コマンドによる vRouter の監視」で説明します。
vRouter の L2 モード パケット フロー
スイッチまたはルーターを理解するには、通過するパケットに何が起こるかを知る必要があります。このセクションでは、L2 モードで導入された場合の vRouter でのパケットの存続期間について説明します。このセクションでは、vRouter MAC およびブリッジ ドメイン(BD)テーブルにデータがどのように入力されるかを示し、vRouter のさまざまな部分を内部から表示するために使用できる CLI コマンドの一部を紹介します。
図 1 のフローチャートは、クラウドネイティブ ルーターを介して考えられる 1 つの汎用パケット フローを示しています。パケットとの可能なすべての相互作用を網羅しているわけではありません。
vRouter は、パケットが正しく処理されるように、受信したパケットについて多くの決定を行います。vRouter がパケットに対してどのような処理を行うかを見てみましょう。 図 1 を見ると、VLAN または BD に基づいていくつかの選択肢があることがわかります。vRouter が転送の決定を行う際に参照するテーブルの 1 つが テーブル 1 です。
VLAN | ID(キー)インターフェイスIDリスト(値) |
---|---|
1024 | 2,3,4 |
1042 | 4,5 |
1022 | 1 |
1044 | 6 |
BD テーブルは、特定の VLAN ID を持つトラフィックを伝送できるインターフェイスを vRouter に指示します。したがって、VLAN ID はテーブルのキーとして機能し、インターフェイス ID リストは各エントリの値として機能します。
表 2 は、BD テーブルと密接に関連しています。MAC テーブルは、MAC アドレスと VLAN ID をキー ペアとして使用します。次に、このセクションに示すように、インターフェイス ID とヒット カウントがテーブル内の各エントリの値として機能します。
MAC アドレス | 、VLAN ID インターフェイス | ID | ヒット カウント |
---|---|---|---|
00:11:22:33:44:55 | 1024 | 2 | 123234 |
00:22:33:44:55:66 | 1042 | 4 | 823948 |
00:33:44:55:66:77 | 1022 | 1 | 45980 |
00:44:55:66:77:88 | 1044 | 6 | 86578 |
MAC テーブルの主な目的は、どのインターフェイスを介してどの MAC アドレスに到達できるかをマッピングすることです。vRouter は、パケットの処理中に MAC テーブルにエントリを作成し、参照します。
CLI コマンドによる vRouter の監視
vRouter では、CLI コマンドはトラブルシューティングやモニタリングに便利です。 「vRouter CLI へのアクセス」で説明したように、vRouter の CLI にアクセスできます。その CLI でコマンドを実行することで、実行中の vRouter のさまざまな側面について学習できます。次の例では、vRouter CLI にすでに接続していることを前提としています。このセクションに示すコマンドはコマンドプロンプトを表示しないため、独自のvRouterにコピーして貼り付けることができます。
この設定のほとんどの例では、 purel2cli コマンドを使用します。このコマンドには、例で示すよりも多くのオプションがあります。さらに、 purel2cli には、使用可能なオプションを確認するために使用できるヘルプコマンドがあります。
The purel2cli Command
To see all the options of the purel2cli command in the vRouter CLI, execute the command with the --help option.
purel2cli --help
Usage: purel2cli [--mac show] [--vlan show] [--vlan get <VLAN_ID>] [--acl show <VLAN_ID>] [--acl reset-counters <VLAN_ID>] [--l2stats get <VIF_ID> <VLAN_ID>] [--clear VLAN_ID] [--sock-dir <sock dir>] [--help]
See the Current Status of Your Running vRouter
To see the status of the vRouter, enter the following command in the vRouter CLI:
ps -eaf|grep dpdk
The output from the command above looks like: root 127 93 99 Jul29 ? 82-20:31:49 /contrail-vrouter-dpdk --no-daemon --socket-mem=1024 1024 --allow=0000:01:10.1 --allow=0000:01:10.0 --l2_table_size=10240 --yield_option 0 --ddp --l2_mode
The output contains several elements.
Flag | Meaning |
---|---|
--l2_mode |
The vRouter is running in L2 mode. |
--l2_table_size |
The current number of entries in the MAC table. The default size is 10240 entries. |
--allow=<PCI Id> |
The PCI ID of fabric and fabric workload interfaces. More than one ID can appear in the output. These IDs serve as an allowlist. |
--ddp |
Enable Intel DDP support. We enable DDP by default in the values.yaml file in the vRouter.
Note:
The Intel XL710 NIC does not support DDP. |
Show MAC Table
The following command shows the MAC addresses that the vRouter has dynamically learned.
purel2cli --mac show
The output from the above command looks like:
================================================== || MAC vlan port hit_count|| ================================================== 00:01:01:01:01:03 1221 2 1101892 00:01:01:01:01:02 1221 2 1101819 00:01:01:01:01:04 1221 2 1101863 00:01:01:01:01:01 1221 2 1101879 5a:4c:4c:75:90:fe 1250 5 12 Total Mac entries 5
Show Bridge Domain Table
The following command shows the VLAN to port mapping in the vRouter.
purel2cli --vlan show
The output from the above command looks like:
VLAN PORT =============== 1201 1,2,3,4, 1202 1,2,3,4, 1203 1,2,3,4, 1204 1,2,3,4, 1205 1,2,3,4,
You can use the following form of the purel2cli command to see the bridge domain table entry for a specific VLAN: purel2cli --vlan get <vlan-id>
Show L2 Statistics
There are several variations of the purel2cli command that allow you to display and filter L2 statistics in the vRouter. The base form of the command is: purel2cli -- l2stats get <virtual_interface_ID> <VLAN_ID>
. The table Table 4 shows the available command options and what they do. This section also provides a sample output using one of the options.
Sample Command | Function |
---|---|
purel2cli --l2stats get '*' '*' |
Get statistics for all virtual interfaces (vif) and all VLAN IDs. |
purel2cli --l2stats get '*' 100 |
Get statistics for all vif that are part of VLAN 100 |
purel2cli --l2stats get 1 '*' |
Get statistics for all VLANs for which interface 1 is a member |
purel2cli --l2stats get 1 100 |
Get statistics for interface 1 and VLAN 100 |
The following command is an example of the L2 statistics for interface 2 and VLAN 1221:
purel2cli --l2stats get 2 1221
Vlan id count: 1 -------------------------------------------------------------------------------- Statistics for vif 2 vlan 1221 -------------------------------------------------------------------------------- Rx Pkts Rx Bytes Tx Pkts Tx Bytes Unicast 245344824 48152682842 835552 1667761792 Broadcast 0 0 0 0 Multicast 0 0 0 0 Flood 0 0 0 0 --------------------------------------------------------------------------------
Clear L2 Statistics
The following example shows commands that allow you to clear L2 statistics information from the vRouter.
You can clear the statistics from the vRouter with the purel2cli command in the form: purel2cli --clear <VLAN_ID>
.
purel2cli --clear '*'
purel2cli --clear 100
ドロップスタッツコマンド
vRouter は、ドロップしたパケットを追跡し、それらをドロップした理由を含めます。 表 5に、vRouter がパケットをドロップする一般的な理由を示します。 dropstats コマンドを実行するときに、そのカウンターのカウントが 0 の場合、vRouter はカウンターを表示しません。
カウンター名 | の意味 |
---|---|
L2 bd table drop |
ブリッジ ドメインにインターフェイスがありません |
L2 untag pkt drop |
タグなしパケットがトランクまたはサブインターフェイスに到着する |
L2 Invalid Vlan |
パケット VLAN がインターフェイス VLAN と一致しません |
L2 Mac Table Full |
MAC テーブルに使用可能なエントリがこれ以上ありません |
L2 ACL drop |
パケット一致ファイアウォールフィルター(ACL)ドロップルール |
L2 Src Mac lookup fail |
送信元MACアドレスを一致(または学習)できない |
dropstats コマンドの出力例は次のようになります。
dropstats
L2 bd table Drop 43 L2 untag pkt drop 716 L2 Invalid Vlan 7288253 Rate limit exceeded 673179706 L2 Mac Table Full 41398787 L2 ACL drop 8937037 L2 Src Mac lookup fail 247046
dpdkinfo コマンド
dpdkinfo コマンドは、DPDK の状況と統計に関する洞察を提供します。dpdkinfo コマンドには多くのオプションがあります。以下のセクションでは、使用可能なオプションと dpdkinfo コマンドの出力例について説明します。dpdkinfo コマンドは、vRouter-agent CLI 内からのみ実行できます。
dpdkinfo Command Usage
dpdkinfo
Usage: dpdkinfo [--help] --version|-v Show DPDK Version --bond|-b Show Master/Slave bond information --lacp|-l <all/conf> Show LACP information from DPDK --mempool|-m <all/<mempool-name>> Show Mempool information --stats|-n <vif index value> Show Stats information --xstats|-x <vif index value> Show Extended Stats information --lcore|-c Show Lcore information --app|-a Show App information --ddp|-d <list> <list-flow> Show DDP information for X710 NIC --rx_vlan|-z <value> Show VLan information Optional: --buffsz <value> Send output buffer size (less than 1000Mb)
dpdkinfo Lcore Information
This command shows the Lcores assigned to DPDK VF fabric interfaces and the queue ID for each interface.
dpdkinfo -c
No. of forwarding lcores: 4 Lcore 10: Interface: 0000:18:01.1 Queue ID: 0 Interface: 0000:18:0d.1 Queue ID: 0 Interface: 0000:86:00.0 Queue ID: 0 Lcore 11: Interface: 0000:18:01.1 Queue ID: 1 Interface: 0000:18:0d.1 Queue ID: 1 Interface: 0000:86:00.0 Queue ID: 1 Lcore 12: Interface: 0000:18:01.1 Queue ID: 2 Interface: 0000:18:0d.1 Queue ID: 2 Interface: 0000:86:00.0 Queue ID: 2 Lcore 13: Interface: 0000:18:01.1 Queue ID: 3 Interface: 0000:18:0d.1 Queue ID: 3 Interface: 0000:86:00.0 Queue ID: 3
dpdkinfo Memory Pool Information
This command shows all of the memory pool information.
dpdkinfo -m all
--------------------------------------------------- Name Size Used Available --------------------------------------------------- rss_mempool 16384 1549 14835 frag_direct_mempool 4096 0 4096 frag_indirect_mempool 4096 0 4096 packet_mbuf_pool 8192 2 8190
dpdkinfo Statistics Information
This command displays statistical information for a specific interface.
dpdkinfo -n 3
Interface Info(0000:18:0d.1): RX Device Packets:6710, Bytes:1367533, Errors:0, Nombufs:0 Dropped RX Packets:0 TX Device Packets:0, Bytes:0, Errors:0 Queue Rx: Tx: Rx Bytes: Tx Bytes: Errors:
dpdkinfo Extended Statistics Information
This command displays extended statistical information for a specific interface.
dpdkinfo -x 3
Driver Name:net_iavf Interface Info:0000:18:0d.1 Rx Packets: rx_good_packets: 6701 rx_unicast_packets: 0 rx_multicast_packets: 2987 rx_broadcast_packets: 3714 rx_dropped_packets: 0 Tx Packets: tx_good_packets: 0 tx_unicast_packets: 0 tx_multicast_packets: 0 tx_broadcast_packets: 0 tx_dropped_packets: 0 Rx Bytes: rx_good_bytes: 1365696 Tx Bytes: tx_good_bytes: 0 Errors: rx_missed_errors: 0 rx_errors: 0 tx_errors: 0 rx_mbuf_allocation_errors: 0 inline_ipsec_crypto_ierrors: 0 inline_ipsec_crypto_ierrors_sad_lookup: 0 inline_ipsec_crypto_ierrors_not_processed: 0 inline_ipsec_crypto_ierrors_icv_fail: 0 inline_ipsec_crypto_ierrors_length: 0 Others: inline_ipsec_crypto_ipackets: 0 ---------------------------------------------------------------------
vRouterのトラブルシューティング
vRouterエージェントのデバッグには、Introspectを使用します。イントロスペクトデータには、 http://<ホストサーバーIP>:8085でアクセスできます。 表 6 に、Introspect データのサンプルを示します。
表、表6は、グループ化された出力を示す。クラウドネイティブルーターは、稼働中のシステムでの出力をグループ化またはソートしません。
http://host server IP address:8085 ページには、HTML リンクのリストのみが表示されます。
リンク | と説明 |
---|---|
agent.xml |
エージェントの運用データを表示します。このイントロスペクトを使用すると、インターフェイス、VM、VN、VRF、セキュリティグループ、ACL、ミラー設定のリストを確認できます。 |
agent_ksync.xml |
インターフェイスやブリッジポートなどのデータオブジェクトのエージェントksyncレイヤーを表示します。 |
agent_profile.xml |
エージェントの operDB、タスク、フロー、統計情報の概要を表示します。 |
agent_stats_interval.xml |
統計の収集期間を表示および設定します。 |
controller.xml |
jcnrコントローラ(cRPD)の接続状態を表示します |
cpuinfo.xml |
計算ノードの CPU 負荷とメモリ使用量を示します。 |
ifmap_agent.xml |
ifmap から受信した現在の設定データを表示します。 |
kstate.xml |
vRouter データ パスに設定されたデータを表示します。 |
mac_learning.xml |
vRouterエージェントMAC学習テーブルのエントリーを表示します。 |
sandesh_trace.xml |
oper、ksync、mac 学習、grpc などのさまざまなエージェントモジュールのトレースを提供します。 |
sandesh_uve.xml |
vRouterエージェント内のすべてのユーザー可視密度(UVE)を一覧表示します。UVE は、分析とテレメトリに使用されます。 |
stats.xml |
エラー パケット、トラップされたパケット、デバッグ統計などの vRouter Agent のスロー パス統計情報を表示します。 |
task.xml |
vRouterエージェントワーカータスクの詳細を表示します。 |