SONiC配置数据库手册

原文:https://github.com/Azure/sonic-swss/blob/master/doc/Configuration.md

Table of Contents

Introduction

本文档列出了在SONiC eco系统中应用的配置命令模式。所有这些命令都与收集系统信息、分析甚至故障排除相关。所有命令都分类在相关主题下,并附有相应的示例。

Configuration

SONiC在一个真实的来源中管理配置—我们称之为ConfigDB的redisDB实例。应用程序订阅ConfigDB并相应地生成它们的运行配置。
(2017年9月之前,我们使用了一个名为 minigraph.xml配置SONiC设备。有关历史文档,请参阅配置(Configuration with Minigraph)

Config Load and Save

在SONiC的当前版本中,ConfigDB实现为本地redis的数据库4。当系统启动时,配置将从/etc/sonic/config_db.json加载文件到redis。请注意,ConfigDB内容不会写回/etc/sonic/config_db.json自动归档。为此,需要从CLI手动执行config save命令。类似地,config load会触发将json文件强制加载到DB中。通常,/etc/sonic/config_db.json中的内容可以认为是启动配置,而redisDB中的内容正在运行配置。
我们保留了一种从minigraph加载配置并写入ConfigDB以实现向后兼容性的方法。为此,运行config load_minigraph。

增量配置
ConfigDB的设计支持增量配置—应用程序可以订阅ConfigDB中的更改并做出相应的响应。然而,这个特性还没有被所有的应用程序实现。到2017年9月,唯一支持增量配置的应用是BGP(docker fpm quagga)。对于其他应用程序,在ConfigDB中更改配置后需要手动重新启动。

Redis and Json Schema

Redis和Json模式
ConfigDB使用与AppDB和config_db.json类似的table-object 架构是DB的直接序列化。例如,以下片段可以是redis和json中与BGP相关的配置:
Redis format

127.0.0.1:6379[4]> keys BGP_NEIGHBOR:*

1) "BGP_NEIGHBOR:10.0.0.31"
2) "BGP_NEIGHBOR:10.0.0.39"
3) "BGP_NEIGHBOR:10.0.0.11"
4) "BGP_NEIGHBOR:10.0.0.7"

...

127.0.0.1:6379[4]> hgetall BGP_NEIGHBOR:10.0.0.3

1) "admin_status"
2) "up"
3) "peer_addr"
4) "10.0.0.2"
5) "asn"
6) "65200"
7) "name"
8) "ARISTA07T2"

Json format

"BGP_NEIGHBOR": {
	"10.0.0.57": {
		"rrclient": "0", 
		"name": "ARISTA01T1", 
		"local_addr": "10.0.0.56", 
		"nhopself": "0", 
		"holdtime": "10", 
		"asn": "64600", 
		"keepalive": "3"
	}, 
    "10.0.0.59": {
        "rrclient": "0", 
        "name": "ARISTA02T1", 
        "local_addr": "10.0.0.58", 
        "nhopself": "0", 
        "holdtime": "10", 
        "asn": "64600", 
        "keepalive": "3"
	},
}

ACL and Mirroring

ACL和mirroring 相关配置在MIRROR_SESSION、ACL_TABLE和ACL_RULE tables中定义。这些表正在从APPDB迁移。请参考APPDB中的模式和迁移计划。

{
"MIRROR_SESSION": {
        "everflow0": {
                "src_ip": "10.1.0.32",
                "dst_ip": "2.2.2.2"
        }
    },

"ACL_TABLE": {
        "DATAACL": {
                "policy_desc" : "data_acl",
                "type": "l3",
                "ports": [
                        "Ethernet0",
                        "Ethernet4",
                        "Ethernet8",
                        "Ethernet12"
                ]
        }
    }
}

Below ACL table added as per the mail

{
"ACL_TABLE": {
        "aaa": {
                "type": "L3",
                "ports": "Ethernet0"
        }
   },
"ACL_RULE": {
        "aaa|rule_0": {
        "PRIORITY": "55",
        "PACKET_ACTION": "DROP",
        "L4_SRC_PORT": "0"
        },
        "aaa|rule_1": {
        "PRIORITY": "55",
        "PACKET_ACTION": "DROP",
        "L4_SRC_PORT": "1"
        }
   }
}

Below ACL table added by comparig minigraph.xml & config_db.json

{
"ACL_TABLE": {
		"EVERFLOW": {
		"type": "MIRROR",
		"policy_desc": "EVERFLOW",
		"ports": [
		  "PortChannel0001",
		  "PortChannel0002",
		  "PortChannel0003",
		  "PortChannel0004"
		]
	  },
		"EVERFLOWV6": {
        "type": "MIRRORV6",
        "policy_desc": "EVERFLOWV6",
        "ports": [
          "PortChannel0001",
          "PortChannel0002",
          "PortChannel0003",
          "PortChannel0004"
        ]
      },
        "SNMP_ACL": {
          "services": [
            "SNMP"
        ],
        "type": "CTRLPLANE",
        "policy_desc": "SNMP_ACL"
      },
        "SSH_ONLY": {
          "services": [
            "SSH"
          ],
          "type": "CTRLPLANE",
          "policy_desc": "SSH_ONLY"
      }
   },

"ACL_RULE": {
        "SNMP_ACL|DEFAULT_RULE": {
            "PRIORITY": "1",
            "PACKET_ACTION": "DROP",
            "ETHER_TYPE": "2048"
        },
        "SNMP_ACL|RULE_1": {
            "PRIORITY": "9999",
            "PACKET_ACTION": "ACCEPT",
            "SRC_IP": "1.1.1.1/32",
            "IP_PROTOCOL": "17"
        },
        "SNMP_ACL|RULE_2": {
            "PRIORITY": "9998",
            "PACKET_ACTION": "ACCEPT",
            "SRC_IP": "2.2.2.2/32",
            "IP_PROTOCOL": "17"
        },
        "SSH_ONLY|DEFAULT_RULE": {
            "PRIORITY": "1",
            "PACKET_ACTION": "DROP",
            "ETHER_TYPE": "2048"
        },
        "SSH_ONLY|RULE_1": {
            "PRIORITY": "9999",
            "PACKET_ACTION": "ACCEPT",
            "SRC_IP": "4.4.4.4/8",
            "IP_PROTOCOL": "6"
        }
    }
}

BGP Sessions

BGP会话配置在BGP_NEIGHBOR表中定义。BGP neighbor address is used as key of bgp neighbor objects. Object attributes include remote AS number, neighbor router name, and local peering address. Dynamic neighbor is also supported by defining peer group name and IP ranges in BGP_PEER_RANGE table.

{
"BGP_NEIGHBOR": {
        "10.0.0.61": {
                "local_addr": "10.0.0.60",
                "asn": 64015,
                "name": "ARISTA15T0"
        },
        "10.0.0.49": {
                "local_addr": "10.0.0.48",
                "asn": 64009,
                "name": "ARISTA09T0"
        },
 
        "10.0.0.63": {
                "rrclient": "0", 
				"name": "ARISTA04T1", 
				"local_addr": "10.0.0.62", 
				"nhopself": "0", 
				"holdtime": "10", 
				"asn": "64600", 
				"keepalive": "3"
        }
		
"BGP_PEER_RANGE": {
    "BGPSLBPassive": {
        "name": "BGPSLBPassive",
        "ip_range": [
            "10.250.0.0/27"
        ]
    },
    "BGPVac": {
        "name": "BGPVac",
        "ip_range": [
            "10.2.0.0/16"
        ]
    }
  }
}

BUFFER_PG

When the system is running in traditional buffer model, profiles needs to explicitly configured:

{
"BUFFER_PG": {
    "Ethernet0|3-4": {
        "profile": "[BUFFER_PROFILE|pg_lossless_40000_5m_profile]"
    },
    "Ethernet1|3-4": {
        "profile": "[BUFFER_PROFILE|pg_lossless_40000_5m_profile]"
    },
    "Ethernet2|3-4": {
        "profile": "[BUFFER_PROFILE|pg_lossless_40000_5m_profile]"
    }
  }
}

当系统在动态缓冲区模型中运行时,配置文件可以是:

  • 或者根据端口配置动态计算,只配置为“NULL”;
  • 或显式配置。
{
"BUFFER_PG": {
    "Ethernet0|3-4": {
        "profile": "NULL"
    },
    "Ethernet1|3-4": {
        "profile": "NULL"
    },
    "Ethernet2|3-4": {
        "profile": "[BUFFER_PROFILE|static_profile]"
    }
  }
}

Buffer pool

当系统在传统的缓冲模式下运行时,需要显式地配置所有缓冲池的大小和 xoff of ingress_lossless_pool 。

{
"BUFFER_POOL": {
    "egress_lossless_pool": {
        "type": "egress",
        "mode": "static",
        "size": "15982720"
    },
    "egress_lossy_pool": {
        "type": "egress",
        "mode": "dynamic",
        "size": "9243812"
    },
    "ingress_lossless_pool": {
        "xoff": "4194112",
        "type": "ingress",
        "mode": "dynamic",
        "size": "10875072"
    }
  }
}

当系统在动态缓冲区模型中运行时,可以省略一些缓冲池的大小,并动态计算它们的大小。

{
"BUFFER_POOL": {
    "egress_lossless_pool": {
        "type": "egress",
        "mode": "static",
        "size": "15982720"
    },
    "egress_lossy_pool": {
        "type": "egress",
        "mode": "dynamic",
    },
    "ingress_lossless_pool": {
        "type": "ingress",
        "mode": "dynamic",
    }
  }
}

Buffer profile

缓冲区配置文件

{
"BUFFER_PROFILE": {
    "egress_lossless_profile": {
        "static_th": "3995680",
        "pool": "[BUFFER_POOL|egress_lossless_pool]",
        "size": "1518"
    },
    "egress_lossy_profile": {
        "dynamic_th": "3",
        "pool": "[BUFFER_POOL|egress_lossy_pool]",
        "size": "1518"
    },
    "ingress_lossy_profile": {
        "dynamic_th": "3",
        "pool": "[BUFFER_POOL|ingress_lossless_pool]",
        "size": "0"
    },
    "pg_lossless_40000_5m_profile": {
        "xon_offset": "2288",
        "dynamic_th": "-3",
        "xon": "2288",
        "xoff": "66560",
        "pool": "[BUFFER_POOL|ingress_lossless_pool]",
        "size": "1248"
    },
    "pg_lossless_40000_40m_profile": {
        "xon_offset": "2288",
        "dynamic_th": "-3",
        "xon": "2288",
        "xoff": "71552",
        "pool": "[BUFFER_POOL|ingress_lossless_pool]",
        "size": "1248"
    }
  }
}

当系统运行在动态缓冲区模型中,且净空类型为动态时,只需配置动态值,其余字段可以省略。这种配置文件将由缓冲区管理器处理,不会应用于SAI。

{
  {
    "non_default_dynamic_th_profile": {
        "dynamic_th": 1,
        "headroom_type": "dynamic"
    }
  }
}

Buffer queue

{
"BUFFER_QUEUE": {
    "Ethernet50,Ethernet52,Ethernet54,Ethernet56|0-2": {
        "profile": "[BUFFER_PROFILE|egress_lossy_profile]"
    },
    "Ethernet50,Ethernet52,Ethernet54,Ethernet56|3-4": {
        "profile": "[BUFFER_PROFILE|egress_lossless_profile]"
    },
    "Ethernet50,Ethernet52,Ethernet54,Ethernet56|5-6": {
        "profile": "[BUFFER_PROFILE|egress_lossy_profile]"
    }
  }
}

Cable length

电缆

{
"CABLE_LENGTH": {
    "AZURE": {
        "Ethernet8": "5m",
        "Ethernet9": "5m",
        "Ethernet2": "5m",
        "Ethernet58": "5m",
        "Ethernet59": "5m",
        "Ethernet50": "40m",
        "Ethernet51": "5m",
        "Ethernet52": "40m",
        "Ethernet53": "5m",
        "Ethernet54": "40m",
        "Ethernet55": "5m",
        "Ethernet56": "40m"
    }
  }
}

COPP_TABLE

{
"COPP_TABLE": {
     "default": {
         "cbs": "600",
         "cir": "600",
	 "meter_type": "packets",
	 "mode": "sr_tcm",
	 "queue": "0",
	 "red_action": "drop"
     },
   
     "trap.group.arp": {
         "cbs": "600",
         "cir": "600",
	 "meter_type": "packets",
	 "mode": "sr_tcm",
	 "queue": "4",
	 "red_action": "drop",
	 "trap_action": "trap",
	 "trap_ids": "arp_req,arp_resp,neigh_discovery",
	 "trap_priority": "4"
      },
    
     "trap.group.lldp.dhcp.udld": {
         "queue": "4",
         "trap_action": "trap",
	 "trap_ids": "lldp,dhcp,udld",
	 "trap_priority": "4"
      },
    
     "trap.group.bgp.lacp": {
         "queue": "4",
         "trap_action": "trap",
	 "trap_ids": "bgp,bgpv6,lacp",
	 "trap_priority": "4"
      },
   
     "trap.group.ip2me": {
         "cbs": "600",
         "cir": "600",
	 "meter_type": "packets",
	 "mode": "sr_tcm",
	 "queue": "1",
	 "red_action": "drop",
	 "trap_action": "trap",
	 "trap_ids": "ip2me",
	 "trap_priority": "1"
      }
    }
}

CRM

{
"CRM": {
    "Config": {
        "acl_table_threshold_type": "percentage",
        "nexthop_group_threshold_type": "percentage",
        "fdb_entry_high_threshold": "85",
        "acl_entry_threshold_type": "percentage",
        "ipv6_neighbor_low_threshold": "70",
        "nexthop_group_member_low_threshold": "70",
        "acl_group_high_threshold": "85",
        "ipv4_route_high_threshold": "85",
        "acl_counter_high_threshold": "85",
        "ipv4_route_low_threshold": "70",
        "ipv4_route_threshold_type": "percentage",
        "ipv4_neighbor_low_threshold": "70",
        "acl_group_threshold_type": "percentage",
        "ipv4_nexthop_high_threshold": "85",
        "ipv6_route_threshold_type": "percentage",
        "snat_entry_threshold_type": "percentage",
        "snat_entry_high_threshold": "85",
        "snat_entry_low_threshold": "70",
        "dnat_entry_threshold_type": "percentage",
        "dnat_entry_high_threshold": "85",
        "dnat_entry_low_threshold": "70",
        "ipmc_entry_threshold_type": "percentage",
        "ipmc_entry_high_threshold": "85",
        "ipmc_entry_low_threshold": "70"
    }
  }
}

Data Plane L3 Interfaces

数据平面的IP配置在 INTERFACEPORTCHANNEL_INTERFACE, and VLAN_INTERFACE表中定义。所有三个表中的对象都具有IP地址作为一级键值附加到的接口(可以是物理端口、端口通道或vlan),IP前缀作为第二级键值。IP接口对象没有任何属性。

{
"INTERFACE": {
        "Ethernet0|10.0.0.0/31": {},
        "Ethernet4|10.0.0.2/31": {},
        "Ethernet8|10.0.0.4/31": {}
		...
    },
	
"PORTCHANNEL_INTERFACE": {
        "PortChannel01|10.0.0.56/31": {},
        "PortChannel01|FC00::71/126": {},
        "PortChannel02|10.0.0.58/31": {},
        "PortChannel02|FC00::75/126": {}
		...
    },
"VLAN_INTERFACE": {
        "Vlan1000|192.168.0.1/27": {}
    }
}

DEFAULT_LOSSLESS_BUFFER_PARAMETER

此表存储用于动态缓冲区计算的默认无损缓冲区参数。

{
    "DEFAULT_LOSSLESS_BUFFER_PARAMETER": {
        "AZURE": {
            "default_dynamic_th": "0",
            "over_subscribe_ratio": "2"
        }
    }
}

Device Metadata

设备元数据

设备元数据只包含一个名为localhost的对象。在此表中,指定了主机名、hwsku、部署环境id和部署类型等设备元数据。此表中还指定了BGP local AS编号,因为SONiC仅支持当前单个BGP实例。

{
"DEVICE_METADATA": {
        "localhost": {
        "hwsku": "Force10-S6100",
        "default_bgp_status": "up",
        "docker_routing_config_mode": "unified",
        "hostname": "sonic-s6100-01",
        "platform": "x86_64-dell_s6100_c2538-r0",
        "mac": "4c:76:25:f4:70:82",
        "default_pfcwd_status": "disable",
        "bgp_asn": "65100",
        "deployment_id": "1",
        "type": "ToRRouter",
        "buffer_model": "traditional"
    }
  }
}

Device neighbor metada

{
"DEVICE_NEIGHBOR_METADATA": {
    "ARISTA01T1": {
        "lo_addr": "None",
        "mgmt_addr": "10.11.150.45",
        "hwsku": "Arista-VM",
        "type": "LeafRouter"
    },
    "ARISTA02T1": {
        "lo_addr": "None",
        "mgmt_addr": "10.11.150.46",
        "hwsku": "Arista-VM",
        "type": "LeafRouter"
    }
  }
}

DSCP_TO_TC_MAP

{
"DSCP_TO_TC_MAP": {
    "AZURE": {
        "1": "1",
        "0": "1",
        "3": "3",
        "2": "1",
        "5": "2",
        "4": "4",
        "7": "1",
        "6": "1",
        "9": "1",
        "8": "0"
    }
  }
}

FLEX_COUNTER_TABLE

{
"FLEX_COUNTER_TABLE": {
    "PFCWD": {
        "FLEX_COUNTER_STATUS": "enable"
    },
    "PORT": {
        "FLEX_COUNTER_STATUS": "enable"
    },
    "QUEUE": {
        "FLEX_COUNTER_STATUS": "enable"
    }
  }
}

L2 Neighbors


L2邻居和连接信息可以在DEVICE_NEIGHBOR 表中配置。这些信息主要用于LLDP。虽然强制字段包括充当对象密钥的邻居名称和属性中的远程端口/本地端口信息,但也可以定义关于邻居设备的可选信息,例如设备类型、hwsku、管理地址和环回地址。

{
"DEVICE_NEIGHBOR": {
        "ARISTA04T1": {
                "mgmt_addr": "10.20.0.163",
                "hwsku": "Arista",
                "lo_addr": null,
                "local_port": "Ethernet124",
                "type": "LeafRouter",
                "port": "Ethernet1"
        },
        "ARISTA03T1": {
                "mgmt_addr": "10.20.0.162",
                "hwsku": "Arista",
                "lo_addr": null,
                "local_port": "Ethernet120",
                "type": "LeafRouter",
                "port": "Ethernet1"
        },
        "ARISTA02T1": {
                "mgmt_addr": "10.20.0.161",
                "hwsku": "Arista",
                "lo_addr": null,
                "local_port": "Ethernet116",
                "type": "LeafRouter",
                "port": "Ethernet1"
        },
        "ARISTA01T1": {
                "mgmt_addr": "10.20.0.160",
                "hwsku": "Arista",
                "lo_addr": null,
                "local_port": "Ethernet112",
                "type": "LeafRouter",
                "port": "Ethernet1"
        }
    }
}

Loopback Interface

环回接口配置在LOOPBACK_INTERFACE 表中,与数据平面接口具有相似的模式。环回设备名称和环回IP前缀用作环回接口对象的多级密钥。

{
"LOOPBACK_INTERFACE": {
        "Loopback0|10.1.0.32/32": {},
        "Loopback0|FC00:1::32/128": {}
  }
}

LOSSLESS_TRAFFIC_PATTERN

无损流量模式表存储与无损流量相关的参数,用于动态缓冲区计算

{
    "LOSSLESS_TRAFFIC_PATTERN": {
        "AZURE": {
            "mtu": "1024",
            "small_packet_percentage": "100"
        }
    }
}

Management Interface

管理接口在MGMT_INTERFACE 表中定义。对象密钥由管理接口名称和IP前缀组成。属性gwaddr指定前缀的网关地址。forced_mgmt_routes 属性可用于指定强制通过管理网络而不是数据网络的地址/前缀流量。

{
"MGMT_INTERFACE": {
        "eth0|10.11.150.11/16": {
        "gwaddr": "10.11.0.1"
    },
    "eth0|FC00:2::32/64": {
        "forced_mgmt_routes": [
            "10.0.0.100/31",
            "10.250.0.8",
                "10.255.0.0/28"
        ],
        "gwaddr": "fc00:2::1"
    }
  }
}

Management port

{
"MGMT_PORT": {
    "eth0": {
        "alias": "eth0",
        "admin_status": "up"
    }
  }
}

Management VRF

{
"MGMT_VRF_CONFIG": {
    "vrf_global": {
        "mgmtVrfEnabled": "true"
     }
  }
}

MAP_PFC_PRIORITY_TO_QUEUE

{
"MAP_PFC_PRIORITY_TO_QUEUE": {
    "AZURE": {
        "1": "1",
        "0": "0",
        "3": "3",
        "2": "2",
        "5": "5",
        "4": "4",
        "7": "7",
        "6": "6"
    }
  }
}

NTP and SYSLOG servers

这些信息在各个表中配置。服务器的域名或IP地址用作对象密钥。当前这些对象中没有属性。

NTP server

{
"NTP_SERVER": {
        "2.debian.pool.ntp.org": {},
        "1.debian.pool.ntp.org": {},
        "3.debian.pool.ntp.org": {},
        "0.debian.pool.ntp.org": {}
    },

"NTP_SERVER": {
    "23.92.29.245": {},
    "204.2.134.164": {}
    }
}

Syslogserver

{
"SYSLOG_SERVER": {
    "10.0.0.5": {},
    "10.0.0.6": {},
    "10.11.150.5": {}
    }
}

Port

在此表中定义了物理端口配置。每个对象都将端口名作为其键,端口名别名和端口速度作为可选属性。

{
"PORT": {
        "Ethernet0": {
            "index": "0",
            "lanes": "101,102",
            "description": "fortyGigE1/1/1",
            "mtu": "9100",
            "alias": "fortyGigE1/1/1",
            "speed": "40000"
        },
        "Ethernet1": {
            "index": "1",
            "lanes": "103,104",
            "description": "fortyGigE1/1/2",
            "mtu": "9100",
            "alias": "fortyGigE1/1/2",
            "admin_status": "up",
            "speed": "40000"
        },
		"Ethernet63": {
            "index": "63",
            "lanes": "87,88",
            "description": "fortyGigE1/4/16",
            "mtu": "9100",
            "alias": "fortyGigE1/4/16",
            "speed": "40000"
        }
    }
}

Port Channel

端口通道在PORTCHANNEL表中定义,端口通道名称作为对象键,成员列表作为属性。

{
"PORTCHANNEL": {
        "PortChannel0003": {
                "admin_status": "up",
        "min_links": "1",
        "members": [
            "Ethernet54"
        ],
        "mtu": "9100"
    },
    "PortChannel0004": {
        "admin_status": "up",
        "min_links": "1",
        "members": [
            "Ethernet56"
        ],
        "mtu": "9100"
    }
  }
}

Portchannel member

{
"PORTCHANNEL_MEMBER": {
    "PortChannel0001|Ethernet50": {}, 
    "PortChannel0002|Ethernet52": {}, 
    "PortChannel0003|Ethernet54": {}, 
    "PortChannel0004|Ethernet56": {}
  }
}

Scheduler

{
"SCHEDULER": {
    "scheduler.0": {
        "type": "STRICT"
    },
    "scheduler.1": {
        "type": "WRR"
        "weight": "1",
        "meter_type": "bytes",
        "pir": "1250000000",
        "pbs": "8192"
    },
    "scheduler.port": {
        "meter_type": "bytes",
        "pir": "1000000000",
        "pbs": "8192"
    }
  }
}

Port QoS Map

{
"PORT_QOS_MAP": {
    "Ethernet50,Ethernet52,Ethernet54,Ethernet56": {
        "tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", 
        "tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]", 
        "pfc_enable": "3,4", 
        "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", 
        "dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]",
        "scheduler": "[SCHEDULER|scheduler.port]"
    }
  }
}  

Queue

{
"QUEUE": {
	"Ethernet56|4": {
        "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]", 
        "scheduler": "[SCHEDULER|scheduler.1]"
    }, 
    "Ethernet56|5": {
        "scheduler": "[SCHEDULER|scheduler.0]"
    }, 
    "Ethernet56|6": {
        "scheduler": "[SCHEDULER|scheduler.0]"
    }
  }
}

Tacplus Server

{
"TACPLUS_SERVER": {
    "10.0.0.8": {
        "priority": "1", 
        "tcp_port": "49"
    }, 
    "10.0.0.9": {
        "priority": "1", 
        "tcp_port": "49"
    }
  }
}

TC to Priority group map

{
"TC_TO_PRIORITY_GROUP_MAP": {
    "AZURE": {
        "1": "1", 
        "0": "0", 
        "3": "3", 
        "2": "2", 
        "5": "5", 
        "4": "4", 
        "7": "7", 
        "6": "6"
    }
  }
}  

TC to Queue map

{
"TC_TO_QUEUE_MAP": {
    "AZURE": {
        "1": "1", 
        "0": "0", 
        "3": "3", 
        "2": "2", 
        "5": "5", 
        "4": "4", 
        "7": "7", 
        "6": "6"
    }
  }
}  

Versions

This table is where the curret version of the software is recorded.

{
    "VERSIONS": {
        "DATABASE": {
            "VERSION": "version_1_0_1"
        }
    }
}

VLAN

此表是定义VLAN的地方。VLAN名称被用作对象键,成员列表和整数id被定义为属性。如果此VLAN需要DHCP中继,则必须为该VLAN指定DHCP服务器属性,该属性的值是必须包含一个或多个DHCP服务器的域名或IP地址的列表。

{
"VLAN": {
	"Vlan1000": {
		"dhcp_servers": [
			"192.0.0.1",
			"192.0.0.2",
			"192.0.0.3",
			"192.0.0.4"
		],
		"members": [
			"Ethernet0",
			"Ethernet4",
			"Ethernet8",
			"Ethernet12"
		],
		"vlanid": "1000"
	}
  }
}

VLAN_MEMBER

VLAN成员表将VLAN名称与物理端口或端口通道名称一起作为对象键,将标记模式作为属性。

{
"VLAN_MEMBER": {
	"Vlan1000|PortChannel47": {
		"tagging_mode": "untagged"
	},
	"Vlan1000|Ethernet8": {
		"tagging_mode": "untagged"
	},
	"Vlan2000|PortChannel47": {
		"tagging_mode": "tagged"
	}
  }
}

Virtual router

虚拟路由器表允许插入或更新新的虚拟路由器实例。实例的关键是它的名称。表中的属性允许更改虚拟路由器的属性。属性:

  • 'v4' 包含布尔值“true”或“false”。在虚拟路由器中启用或禁用IPv4
  • 'v6' 包含布尔值“true”或“false”。在虚拟路由器中启用或禁用IPv6
  • 'src_mac' 包含MAC地址。将使用什么源MAC地址从虚拟路由器中导出数据包
  • 'ttl_action' 包含数据包操作。定义TTL==0或TTL==1的数据包的操作
  • 'ip_opt_action' 包含数据包操作。定义具有IP选项的数据包的操作
  • 'l3_mc_action' 包含数据包操作。定义未知L3多播数据包的操作

The packet action could be:

  • 'drop'
  • 'forward'
  • 'copy'
  • 'copy_cancel'
  • 'trap'
  • 'log'
  • 'deny'
  • 'transit'

TBD

'VRF:rid1': {
	'v4': 'true',
	'v6': 'false',
	'src_mac': '02:04:05:06:07:08',
	'ttl_action': 'copy',
	'ip_opt_action': 'deny',
	'l3_mc_action': 'drop'
}

WRED_PROFILE

{
"WRED_PROFILE": {
    "AZURE_LOSSLESS": {
        "red_max_threshold": "2097152", 
        "wred_green_enable": "true", 
        "ecn": "ecn_all", 
        "green_min_threshold": "1048576", 
        "red_min_threshold": "1048576", 
        "wred_yellow_enable": "true", 
        "yellow_min_threshold": "1048576", 
        "green_max_threshold": "2097152", 
        "green_drop_probability": "5", 
        "yellow_max_threshold": "2097152", 
        "wred_red_enable": "true", 
        "yellow_drop_probability": "5", 
        "red_drop_probability": "5"
    }
  }
}

BREAKOUT_CFG

此表作为动态端口转接(DPB)功能的一部分介绍。它显示所有端口(根端口)的当前分支模式。根端口、所有可能的转接模式和默认转接模式的列表从平台.json以及hwsku.json文件文件夹。

"BREAKOUT_CFG": {
    "Ethernet0": {
        "brkout_mode": "4x25G[10G]"
    },
    "Ethernet4": {
        "brkout_mode": "4x25G[10G]"
    },
    "Ethernet8": {
        "brkout_mode": "4x25G[10G]"
    },

        ......

    "Ethernet116": {
        "brkout_mode": "2x50G"
    },
    "Ethernet120": {
        "brkout_mode": "2x50G"
    },
    "Ethernet124": {
        "brkout_mode": "2x50G"
    }
}

 

对于开发者
通过Jinja2模板生成应用程序配置
待补充。
通过订阅ConfigDB进行增量配置
添加详细说明。在这个PR中可以找到一个为BGP实现动态配置的示例。

猜你喜欢

转载自blog.csdn.net/weixin_39094034/article/details/114881146