カーネル スタック

About Kernel Stack

Kernel Stack (kstack) uses well known Linux APIs to manage the routes and front panel ports.

Open Containers, like the Guest Shell, are Linux environments that are decoupled from the host software. You can install or modify software within that environment without impacting the host software packages.

Kernel Stack has the following features:

注意事項と制約事項

  • ゲストシェル、Docker コンテナ、およびホスト Bash シェルは、カーネルスタック(kstack)を使用します。

  • ゲストシェルとホスト Bash シェルは、デフォルトのネットワーク名前空間で開始されます。Docker コンテナは、デフォルトで管理ネットワークの名前空間で開始されます。

    • 他のネットワーク名前空間には、setns システム コールを使用してアクセスできます。

    • nsenter および ip netns exec ユーティリティは、異なるネットワーク名前空間のコンテキスト内で実行するために使用できます。

  • インターフェイスの状態は、/proc/net/dev から読み取るか、ip ifconfig 、または netstat などの他の一般的な Linux ユーティリティを使用して取得できます。カウンタは、スイッチで開始または終了したパケットに関するものです。

  • ethtool –S は、インターフェイスを介してスイッチングされるパケットを含む、ネットデバイスから拡張統計情報を取得するために使用できます。

  • tcpdump などのパケット キャプチャ アプリケーションは、スイッチで開始または終了するパケットをキャプチャできます。

  • ゲストシェルからのネットワーク状態の変更(インターフェイスの作成または削除、IP アドレスの構成、MTU の変更など)はサポートされていません。

  • IPv4 と IPv6 がサポートされます。

  • Raw PF_PACKET がサポートされています。

  • ネットワーク名前空間に関係なく、一度に 1 つのスタック(Netstack または kstack)でのみ、ウェルノウンポート(0 ~ 15000)を使用できます。

  • 同じスイッチ上でも、Nestack を使用するアプリケーションと kstack を実行するアプリケーションの間に IP 接続はありません。この制限は、kstack アプリケーションがホスト Bash シェルから実行されているか、コンテナ内で実行されているかに関係なく当てはまります。

  • ゲスト シェル内のアプリケーションは、ライン カードまたはスタンバイ Sup との通信のために、イーサネット アウトオブバンド チャネル(EOBC)インターフェイスを介してパケットを直接送信することはできません。

  • 管理インターフェイス(mgmt0)は、カーネル ネットデバイスで eth1 として表されます。

  • カーネル スタックを使用するアプリケーションでは、VXLAN オーバーレイ インターフェイス(NVE x)の使用はサポートされていません。CLI コマンドを含む NX-OS 機能は、netstack を介してこのインターフェイスを使用できます。

    NVE インターフェイスの詳細については、Cisco Nexus 9000 シリーズ NX-OS VXLAN 構成ガイドを参照してください。

Changing the Port Range

Netstack and kstack divide the port range between them. The default port ranges are as follows:

  • Kstack—15001 to 58000

  • Netstack—58001 to 65535


    Note


    Within this range 63536 to 65535 are reserved for NAT.



Note


The ports configured with nxapi use-vrf management uses kstack and are accessible.


SUMMARY STEPS

  1. [no] sockets local-port-range start-port end-port

DETAILED STEPS

Command or Action Purpose

[no] sockets local-port-range start-port end-port

This command modifies the port range for kstack. This command does not modify the Netstack range.

Example

The following example sets the kstack port range:

switch# sockets local-port-range 15001 25000

What to do next

After you have entered the command, be aware of the following issues:

  • Reload the switch after entering the command.

  • Leave a minimum of 7000 ports unallocated which are used by Netstack.

  • Specify the start-port as 15001 or the end-port as 65535 to avoid holes in the port range.

About VXLAN with kstack

Starting with NX-OS 9.2(1), VXLAN EVPN is supported with kstack to be leveraged by third-party applications. This functionality is supported on the Cisco Nexus 9000 ToR switches.

Setting Up VXLAN for kstack

No additional configuration is required to make the interfaces or network namespaces for VXLAN EVPN accessible to the third-party applications. The VXLAN EVPN routes are programmed automatically in the kernel based on the NX-OS VXLAN EVPN configuration. For more information, see the "Configuring VXLAN BGP EVPN" chapter in the Cisco Nexus 9000 Series NX-OS VXLAN Configuration Guide.

Troubleshooting VXLAN with kstack

To troubleshoot VXLAN issues, enter the following command to list several critical pieces of information to be collected:

switch(config)# show tech-support kstack

  • Run the ip route show command:

    root@switch(config)# run bash sudo su-
    root@switch# ip netns exec evpn-tenant-kk1 ip route show
    
    

    Output similar to the following appears:

    10.160.1.0/24 dev Vlan1601 proto kernel scope link src 10.160.1.254
    10.160.1.1 dev veth1-3 proto static scope link metric 51
    10.160.2.0/24 dev Vlan1602 proto kernel scope link src 10.160.2.253
    127.250.250.1 dev veth1-3 proto static scope link metric 51
    
    

    Verify that all EVPN routes for the corresponding VRF are present in the kernel.

  • Run the ip neigh show command:

    root@switch(config)# run bash sudo su-
    root@switch# ip netns exec evpn-tenant-kk1 ip neigh show
    
    

    Output similar to the following appears:

    10.160.1.1 dev veth1-3 lladdr 0c:75:bd:07:b4:33 PERMANENT
    127.250.250.1 devveth1-3 lladdr0c:75:bd:07:b4:33 PERMANENT
    
    

Netdevice Property Changes

Starting with the NX-OS 9.2(2) release, netdevices representing the front channel port interfaces are always in the ADMIN UP state. The final, effective state is determined by the link carrier state.

The following example shows the following interfaces in NX-OS, where eth1/17 is shown as up and eth1/1 is shown as down:

root@kstack-switch# sh int ethernet 1/17 brief
Eth1/17       --      eth  routed up      none                       1000(D) –

root@kstack-switch# sh int ethernet 1/1 brief
Eth1/1        --      eth  routed down    Link not connected         auto(D) –

The following example shows these same interfaces, but this time as shown in the Bash shell using the ip link show command:

bash-4.3# ip link show Eth1-17
49: Eth1-17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 100
    link/ether 00:42:68:58:f8:eb brd ff:ff:ff:ff:ff:ff

bash-4.3# ip link show Eth1-1
33: Eth1-1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 100
    link/ether 00:42:68:58:f8:eb brd ff:ff:ff:ff:ff:ff

In this example, Eth1-1 is shown as being UP, but is shown as NO-CARRIER and state DOWN.

The following example shows these same interfaces, but this time as shown in the Bash shell using the ifconfig command:

bash-4.3# ifconfig Eth1-17
Eth1-17   Link encap:Ethernet  HWaddr 00:42:68:58:f8:eb
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7388 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 B)  TX bytes:1869164 (1.7 MiB)

bash-4.3# ifconfig Eth1-1
Eth1-1    Link encap:Ethernet  HWaddr 00:42:68:58:f8:eb
          inet addr:99.1.1.1  Bcast:99.1.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

The output from the ifconfig command provides different information, where the RUNNING keyword is used to represent the final state. By default, all netdevices show the keyword UP, which represents the ADMIN state of the netdevice in the kernel.

Following are the changes that are part of the NX-OS 9.2(2) release:

  • IPv4 address on netdevices — Before the NX-OS 9.2(2) release, the IPv4 address would be plumbed to the netdevice in the kernel even when the corresponding interface in NX-OS was in the DOWN state. Starting with the NX-OS 9.2(2) release, the IPv4 address are plumbed to the kernel space only when the interface is in the UP state. Once plumbed, the IPv4 address continues to stay with the netdevice in the kernel even if the interface goes DOWN. It will be removed only after you have entered the following CLI command to explicitly remove the IP address from the NX-OS interface:
    Interface Eth1/1
                no ip address IP-address
    
    
  • IPv6 address on netdevices — Before the NX-OS 9.2(2) release, the IPv6 address would get flushed from the netdevices in the kernel when the interface was DOWN. Starting with the NX-OS 9.2(2) release, the netdevices are always in the admin UP state, so the IPv6 addresses will not get flushed from the kernel when the interface goes down.