Skip to content

Commit 1ac4656

Browse files
pavel-shirshovShuotian Cheng
authored and
Shuotian Cheng
committed
[doc]: Update swss-schema.md (sonic-net#223)
1 parent 1210c45 commit 1ac4656

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

doc/swss-schema.md

+46-46
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
Schema data is defined in ABNF [RFC5234](https://tools.ietf.org/html/rfc5234) syntax.
1+
Schema data is defined in ABNF [RFC5234](https://tools.ietf.org/html/rfc5234) syntax.
22

3-
###Definitions of common tokens
3+
### Definitions of common tokens
44
name = 1*DIGIT/1*ALPHA
55
ref_hash_key_reference = "[" hash_key "]" ;The token is a refernce to another valid DB key.
66
hash_key = name ; a valid key name (i.e. exists in DB)
77

88

9-
###PORT_TABLE
9+
### PORT_TABLE
1010
Stores information for physical switch ports managed by the switch chip. device_names are defined in [port_config.ini](../portsyncd/port_config.ini). Ports to the CPU (ie: management port) and logical ports (loopback) are not declared in the PORT_TABLE. See INTF_TABLE.
1111

1212
;Defines layer 2 ports
@@ -17,13 +17,13 @@ Stores information for physical switch ports managed by the switch chip. device
1717
admin_status = BIT ; is the port enabled (1) or disabled (0)
1818
oper_status = BIT ; physical status up (1) or down (0) of the link attached to this port
1919
lanes = list of lanes ; (need format spec???)
20-
ifname = 1*64VCHAR ; name of the port, must be unique
21-
mac = 12HEXDIG ;
20+
ifname = 1*64VCHAR ; name of the port, must be unique
21+
mac = 12HEXDIG ;
2222

2323
;QOS Mappings
2424
map_dscp_to_tc = ref_hash_key_reference
2525
map_tc_to_queue = ref_hash_key_reference
26-
26+
2727
Example:
2828
127.0.0.1:6379> hgetall PORT_TABLE:ETHERNET4
2929
1) "dscp_to_tc_map"
@@ -32,18 +32,18 @@ Stores information for physical switch ports managed by the switch chip. device
3232
4) "[TC_TO_QUEUE_MAP_TABLE:AZURE]"
3333

3434
---------------------------------------------
35-
###INTF_TABLE
35+
### INTF_TABLE
3636
intfsyncd manages this table. In SONiC, CPU (management) and logical ports (vlan, loopback, LAG) are declared in /etc/network/interface and loaded into the INTF_TABLE.
3737

3838
IP prefixes are formatted according to [RFC5954](https://tools.ietf.org/html/rfc5954) with a prefix length appended to the end
3939

40-
;defines logical network interfaces, an attachment to a PORT and list of 0 or more
40+
;defines logical network interfaces, an attachment to a PORT and list of 0 or more
4141
;ip prefixes
4242
;
4343
;Status: stable
4444
key = INTF_TABLE:ifname:IPprefix ; an instance of this key will be repeated for each prefix
4545
IPprefix = IPv4prefix / IPv6prefix ; an instance of this key/value pair will be repeated for each prefix
46-
scope = "global" / "local" ; local is an interface visible on this localhost only
46+
scope = "global" / "local" ; local is an interface visible on this localhost only
4747
if_mtu = 1*4DIGIT ; MTU for the interface
4848
family = "IPv4" / "IPv6" ; address family
4949

@@ -60,7 +60,7 @@ IP prefixes are formatted according to [RFC5954](https://tools.ietf.org/html/rfc
6060
h16 = 1*4HEXDIG
6161
ls32 = ( h16 ":" h16 ) / IPv4address
6262

63-
IPv4prefix = dec-octet "." dec-octet "." dec-octet "." dec-octet “/” %d1-32
63+
IPv4prefix = dec-octet "." dec-octet "." dec-octet "." dec-octet “/” %d1-32
6464

6565
dec-octet = DIGIT ; 0-9
6666
/ %x31-39 DIGIT ; 10-99
@@ -98,7 +98,7 @@ For example (reorder output)
9898
8) "65536"
9999

100100
---------------------------------------------
101-
###VLAN_TABLE
101+
### VLAN_TABLE
102102
;Defines VLANs and the interfaces which are members of the vlan
103103
;Status: work in progress
104104
key = VLAN_TABLE:"vlan"vlanid ; DIGIT 0-4095 with prefix "Vlan"
@@ -111,7 +111,7 @@ For example (reorder output)
111111

112112

113113
---------------------------------------------
114-
###LAG_TABLE
114+
### LAG_TABLE
115115
;a logical, link aggregation group interface (802.3ad) made of one or more ports
116116
;In SONiC, data is loaded by teamsyncd
117117
;Status: work in progress
@@ -150,27 +150,27 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
150150
6) "half"
151151

152152
---------------------------------------------
153-
###ROUTE_TABLE
153+
### ROUTE_TABLE
154154
;Stores a list of routes
155155
;Status: Mandatory
156156
key = ROUTE_TABLE:prefix
157157
nexthop = *prefix, ;IP addresses separated “,” (empty indicates no gateway)
158158
intf = ifindex? PORT_TABLE.key ; zero or more separated by “,” (zero indicates no interface)
159159
blackhole = BIT ; Set to 1 if this route is a blackhole (or null0)
160-
160+
161161
---------------------------------------------
162-
###NEIGH_TABLE
163-
; Stores the neighbors or next hop IP address and output port or
162+
### NEIGH_TABLE
163+
; Stores the neighbors or next hop IP address and output port or
164164
; interface for routes
165-
; Note: neighbor_sync process will resolve mac addr for neighbors
165+
; Note: neighbor_sync process will resolve mac addr for neighbors
166166
; using libnl to get neighbor table
167167
;Status: Mandatory
168168
key = prefix PORT_TABLE.name / VLAN_INTF_TABLE.name / LAG_INTF_TABLE.name = macaddress ; (may be empty)
169-
neigh = 12HEXDIG ; mac address of the neighbor
169+
neigh = 12HEXDIG ; mac address of the neighbor
170170
family = "IPv4" / "IPv6" ; address family
171171

172172
---------------------------------------------
173-
###FDB_TABLE
173+
### FDB_TABLE
174174

175175
; Stores FDB entries which were inserted into SAI state manually
176176
; Notes:
@@ -188,7 +188,7 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
188188
4) "static"
189189

190190
---------------------------------------------
191-
###QUEUE_TABLE
191+
### QUEUE_TABLE
192192

193193
; QUEUE table. Defines port queue.
194194
; SAI mapping - port queue.
@@ -210,37 +210,37 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
210210
4) "[WRED_PROFILE_TABLE:AZURE]"
211211

212212
---------------------------------------------
213-
###TC\_TO\_QUEUE\_MAP\_TABLE
213+
### TC\_TO\_QUEUE\_MAP\_TABLE
214214
; TC to queue map
215215
;SAI mapping - qos_map with SAI_QOS_MAP_ATTR_TYPE == SAI_QOS_MAP_TC_TO_QUEUE. See saiqosmaps.h
216216
key = "TC_TO_QUEUE_MAP_TABLE:"name
217217
;field
218218
tc_num = 1*DIGIT
219219
;values
220220
queue = 1*DIGIT; queue index
221-
221+
222222
Example:
223223
27.0.0.1:6379> hgetall TC_TO_QUEUE_MAP_TABLE:AZURE
224224
1) "5" ;tc
225225
2) "1" ;queue index
226-
3) "6"
227-
4) "1"
226+
3) "6"
227+
4) "1"
228228

229229
---------------------------------------------
230-
###DSCP\_TO\_TC\_MAP\_TABLE
230+
### DSCP\_TO\_TC\_MAP\_TABLE
231231
; dscp to TC map
232232
;SAI mapping - qos_map object with SAI_QOS_MAP_ATTR_TYPE == sai_qos_map_type_t::SAI_QOS_MAP_DSCP_TO_TC
233233
key = "DSCP_TO_TC_MAP_TABLE:"name
234234
;field value
235235
dscp_value = 1*DIGIT
236236
tc_value = 1*DIGIT
237-
237+
238238
Example:
239239
127.0.0.1:6379> hgetall "DSCP_TO_TC_MAP_TABLE:AZURE"
240240
1) "3" ;dscp
241241
2) "3" ;tc
242-
3) "6"
243-
4) "5"
242+
3) "6"
243+
4) "5"
244244
5) "7"
245245
6) "5"
246246
7) "8"
@@ -249,15 +249,15 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
249249
10) "8"
250250

251251
---------------------------------------------
252-
###SCHEDULER_TABLE
252+
### SCHEDULER_TABLE
253253
; Scheduler table
254254
; SAI mapping - saicheduler.h
255255
key = "SCHEDULER_TABLE":name
256256
; field value
257257
type = "DWRR"/"WRR"/"PRIORITY"
258258
weight = 1*DIGIT
259259
priority = 1*DIGIT
260-
260+
261261
Example:
262262
127.0.0.1:6379> hgetall SCHEDULER_TABLE:BEST_EFFORT
263263
1) "type"
@@ -271,7 +271,7 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
271271
4) "35"
272272

273273
---------------------------------------------
274-
###WRED\_PROFILE\_TABLE
274+
### WRED\_PROFILE\_TABLE
275275
; WRED profile
276276
; SAI mapping - saiwred.h
277277
key = "WRED_PROFILE_TABLE:"name
@@ -280,7 +280,7 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
280280
green_max_threshold = byte_count
281281
red_max_threshold = byte_count
282282
byte_count = 1*DIGIT
283-
ecn = "ecn_none" / "ecn_green" / "ecn_yellow" / "ecn_red" / "ecn_green_yellow" / "ecn_green_red" / "ecn_yellow_red" / "ecn_all"
283+
ecn = "ecn_none" / "ecn_green" / "ecn_yellow" / "ecn_red" / "ecn_green_yellow" / "ecn_green_red" / "ecn_yellow_red" / "ecn_all"
284284
wred_green_enable = "true" / "false"
285285
wred_yellow_enable = "true" / "false"
286286
wred_red_enable = "true" / "false"
@@ -304,7 +304,7 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
304304

305305

306306
----------------------------------------------
307-
###TUNNEL_DECAP_TABLE
307+
### TUNNEL_DECAP_TABLE
308308
; Stores tunnel decap rules
309309
key = TUNNEL_DECAP_TABLE:name
310310
;field value
@@ -327,11 +327,11 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
327327
7) "ttl_mode"
328328
8) "uniform"
329329
9) "tunnel_type"
330-
10) "IPINIP"
330+
10) "IPINIP"
331331

332332
---------------------------------------------
333333

334-
###LLDP_ENTRY_TABLE
334+
### LLDP_ENTRY_TABLE
335335
; current LLDP neighbor information.
336336
port_table_key = LLDP_ENTRY_TABLE:ifname ; .1.0.8802.1.1.2.1
337337
; field value
@@ -350,10 +350,10 @@ and reflects the LAG ports into the redis under: `LAG_TABLE:<team0>:port`
350350
6) "Ethernet7"
351351
7) "lldp_rem_sys_desc"
352352
8) "Debian - SONiC v2"
353-
353+
354354
---------------------------------------------
355355

356-
###COPP_TABLE
356+
### COPP_TABLE
357357
Control plane policing configuration table.
358358
The settings in this table configure trap group, which is assigned a list of trap IDs (protocols), priority of CPU queue priority, and a policer.
359359
The CPU queue priority is strict priority.
@@ -366,7 +366,7 @@ packet_action = "drop" | "forward" | "copy" | "copy_cancel" | "trap" | "log" | "
366366
queue = number; strict queue priority. Higher number means higher priority.
367367
trap_ids = name_list; Acceptable values: bgp, lacp, arp, lldp, snmp, ssh, ttl error, ip2me
368368
trap_action = packet_action; trap action which will be applied to all trap_ids.
369-
369+
370370
;Settings for embedded policer. NOTE - if no policer settings are specified, then no policer is created.
371371
meter_type = "packets" | "bytes"
372372
mode = "sr_tcm" | "tr_tcm" | "storm"
@@ -375,7 +375,7 @@ packet_action = "drop" | "forward" | "copy" | "copy_cancel" | "trap" | "log" | "
375375
cir = number ;packets or bytes depending on the meter_type value
376376
pbs = number ;packets or bytes depending on the meter_type value
377377
pir = number ;packets or bytes depending on the meter_type value
378-
378+
379379
green_action = packet_action
380380
yellow_action = packet_action
381381
red_action = packet_action
@@ -405,11 +405,11 @@ packet_action = "drop" | "forward" | "copy" | "copy_cancel" | "trap" | "log" | "
405405
127.0.0.1:6379>
406406

407407
Note: The configuration will be created as json file to be consumed by swssconfig tool, which will place the table into the redis database.
408-
It's possible to create separate configuration files for different ASIC platforms.
408+
It's possible to create separate configuration files for different ASIC platforms.
409409

410410
----------------------------------------------
411411

412-
###ACL\_TABLE
412+
### ACL\_TABLE
413413
Stores information about ACL tables on the switch. Port names are defined in [port_config.ini](../portsyncd/port_config.ini).
414414

415415
key = ACL_TABLE:name ; acl_table_name must be unique
@@ -426,7 +426,7 @@ Stores information about ACL tables on the switch. Port names are defined in [p
426426

427427

428428

429-
###ACL\_RULE\_TABLE
429+
### ACL\_RULE\_TABLE
430430
Stores rules associated with a specific ACL table on the switch.
431431

432432
key: ACL_RULE_TABLE:table_name:rule_name ; key of the rule entry in the table,
@@ -548,7 +548,7 @@ Equivalent RedisDB entry:
548548

549549
----------------------------------------------
550550

551-
###PORT\_MIRROR\_TABLE
551+
### PORT\_MIRROR\_TABLE
552552
Stores information about mirroring session and its properties.
553553

554554
key = PORT_MIRROR_TABLE:mirror_session_name ; mirror_session_name is
@@ -608,10 +608,10 @@ Equivalent RedisDB entry:
608608
12) "0"
609609
127.0.0.1:6379>
610610

611-
###Configuration files
612-
What configuration files should we have? Do apps, orch agent each need separate files?
611+
### Configuration files
612+
What configuration files should we have? Do apps, orch agent each need separate files?
613613

614-
[port_config.ini](https://github.com/stcheng/swss/blob/mock/portsyncd/port_config.ini) - defines physical port information
614+
[port_config.ini](https://github.com/stcheng/swss/blob/mock/portsyncd/port_config.ini) - defines physical port information
615615

616616
portsyncd reads from port_config.ini and updates PORT_TABLE in APP_DB
617617

0 commit comments

Comments
 (0)