Skip to content

Commit 86b5e99

Browse files
authored
[mirrororch] Port Mirroring implementation (sonic-net#1314)
Signed-off-by: Rupesh Kumar <[email protected]>
1 parent c05601c commit 86b5e99

11 files changed

+1616
-66
lines changed

doc/swss-schema.md

+69-1
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,10 @@ Stores information about mirror sessions and their properties.
595595
ttl = h8 ; Session TTL
596596
queue = h8 ; Session output queue
597597
policer = policer_name ; Session policer name
598+
dst_port = PORT_TABLE|ifname ; Session destination PORT
599+
src_port = PORT_TABLE|ifname ; Session source PORT/LAG list
600+
direction = "RX"/"TX"/"BOTH" ; Session direction
601+
type = "SPAN"/"ERSPAN" ; Session type. Default is ERSPAN
598602

599603
;value annotations
600604
mirror_session_name = 1*255VCHAR
@@ -623,6 +627,37 @@ Example:
623627
}
624628
]
625629

630+
[
631+
{
632+
"MIRROR_SESSION_TABLE:session_2": {
633+
"src_ip": "1.1.1.1",
634+
"dst_ip": "2.2.2.2",
635+
"gre_type": "0x6558",
636+
"dscp": "50",
637+
"ttl": "64",
638+
"queue": "0"
639+
"src_port": "Ethernet0,PortChannel001"
640+
"direction": "BOTH"
641+
"type": "ERSPAN"
642+
},
643+
"OP": "SET"
644+
}
645+
]
646+
647+
[
648+
{
649+
"MIRROR_SESSION_TABLE:session_3": {
650+
"type": "SPAN"
651+
"dst_port": "Ethernet0"
652+
"src_port": "Ethernet4,PortChannel002"
653+
"direction": "BOTH"
654+
},
655+
"OP": "SET"
656+
}
657+
]
658+
659+
660+
626661
Equivalent RedisDB entry:
627662

628663
127.0.0.1:6379> KEYS *MIRROR*
@@ -631,7 +666,7 @@ Equivalent RedisDB entry:
631666
1) "src_ip"
632667
2) "1.1.1.1"
633668
3) "dst_ip"
634-
4) "2.2.2.2
669+
4) "2.2.2.2"
635670
5) "gre_type"
636671
6) "0x6558"
637672
7) "dscp"
@@ -641,6 +676,39 @@ Equivalent RedisDB entry:
641676
11) "queue"
642677
12) "0"
643678

679+
127.0.0.1:6379> KEYS *MIRROR*
680+
1) "MIRROR_SESSION_TABLE:session_2"
681+
127.0.0.1:6379> HGETALL MIRROR_SESSION_TABLE:session_2
682+
1) "src_ip"
683+
2) "1.1.1.1"
684+
3) "dst_ip"
685+
4) "2.2.2.2"
686+
5) "gre_type"
687+
6) "0x6558"
688+
7) "dscp"
689+
8) "50"
690+
9) "ttl"
691+
10) "64"
692+
11) "queue"
693+
12) "0"
694+
13) "src_port"
695+
14) "Ethernet0,PortChannel001"
696+
15) "direction"
697+
16) "BOTH"
698+
17) "type"
699+
18) "ERSPAN"
700+
701+
127.0.0.1:6379> KEYS *MIRROR*
702+
1) "MIRROR_SESSION_TABLE:session_1"
703+
127.0.0.1:6379> HGETALL MIRROR_SESSION_TABLE:session_3i
704+
1) "type"
705+
2) "SPAN"
706+
3) "dst_port"
707+
4) "Ethernet0"
708+
5) "src_port"
709+
6) "Ethernet4,PortChannel002"
710+
7) "direction"
711+
8) "RX"
644712
---------------------------------------------
645713

646714
### POLICER_TABLE

0 commit comments

Comments
 (0)