From 07224cfbf00dd67ca4a33244d3783c6d9de00731 Mon Sep 17 00:00:00 2001 From: Manali Holankar Date: Wed, 3 Jul 2024 17:54:09 -0700 Subject: [PATCH 1/4] Add new Next Hop Type and allow Next Hop to be an IPMC Group Member Signed-off-by: Manali Holankar --- inc/saiipmcgroup.h | 15 ++++++++++++++- inc/sainexthop.h | 6 ++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/inc/saiipmcgroup.h b/inc/saiipmcgroup.h index 7cd90705a..6d8b598ab 100644 --- a/inc/saiipmcgroup.h +++ b/inc/saiipmcgroup.h @@ -93,11 +93,24 @@ typedef enum _sai_ipmc_group_member_attr_t * @brief IPMC output id * * @type sai_object_id_t - * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @flags CREATE_ONLY * @objects SAI_OBJECT_TYPE_ROUTER_INTERFACE, SAI_OBJECT_TYPE_TUNNEL + * @allownull true + * @default SAI_NULL_OBJECT_ID */ SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID, + /** + * @brief Next Hop Object ID if present over-rides the IPMC_OUTPUT_ID + * + * @type sai_object_id_t + * @flags CREATE_ONLY + * @objects SAI_OBJECT_TYPE_NEXT_HOP + * @allownull true + * @default SAI_NULL_OBJECT_ID + */ + SAI_IPMC_GROUP_MEMBER_ATTR_NEXT_HOP, + /** * @brief End of attributes */ diff --git a/inc/sainexthop.h b/inc/sainexthop.h index cc4d57478..5da33e9c1 100644 --- a/inc/sainexthop.h +++ b/inc/sainexthop.h @@ -50,6 +50,8 @@ typedef enum _sai_next_hop_type_t /** SRV6 SID List */ SAI_NEXT_HOP_TYPE_SRV6_SIDLIST, + /** IPMC next hop */ + SAI_NEXT_HOP_TYPE_IPMC, } sai_next_hop_type_t; /** @@ -76,7 +78,7 @@ typedef enum _sai_next_hop_attr_t * * @type sai_ip_address_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY - * @condition SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_IP or SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_MPLS or SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_TUNNEL_ENCAP + * @condition SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_IP or SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_MPLS or SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_TUNNEL_ENCAP or SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_IPMC */ SAI_NEXT_HOP_ATTR_IP, @@ -86,7 +88,7 @@ typedef enum _sai_next_hop_attr_t * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY * @objects SAI_OBJECT_TYPE_ROUTER_INTERFACE - * @condition SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_IP or SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_MPLS + * @condition SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_IP or SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_MPLS or SAI_NEXT_HOP_ATTR_TYPE == SAI_NEXT_HOP_TYPE_IPMC */ SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID, From 1f2799dd94cde2ba2a1f875383facb019387cc96 Mon Sep 17 00:00:00 2001 From: Manali Holankar Date: Mon, 8 Jul 2024 16:55:59 -0700 Subject: [PATCH 2/4] added document Signed-off-by: Manali Holankar @mholankar --- doc/IP-Multicast/MulticastNextHopRewrite.md | 86 +++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 doc/IP-Multicast/MulticastNextHopRewrite.md diff --git a/doc/IP-Multicast/MulticastNextHopRewrite.md b/doc/IP-Multicast/MulticastNextHopRewrite.md new file mode 100644 index 000000000..34a1bb2f3 --- /dev/null +++ b/doc/IP-Multicast/MulticastNextHopRewrite.md @@ -0,0 +1,86 @@ +# SAI attributes for disabling L3 rewrites + +# for IP Multicast forwarding + +``` +Author:mholankar@ +``` +## Overview + +This document discusses requirements and the SAI spec proposal for disabling rewriting fields +(SourceMAC,VLAN) as part of IPMC routing. + +## Background + +#### SAI pipeline for IPMC forwarding. After Multicast Replication, the egress +#### pipeline is very similar to Unicast Forwarding. The reference pipeline is +#### fromUnicastForwarding. + +- Nexthop sets the egress RIF and NextHopIP +- Neighbor table lookup on NextHopIP to set packet’s destination MAC address +- Egress RIF lookup to set packet’s source MAC address, VLAN and port. + +## Requirements + +We require knobs for disabling rewrites to following fields as part of Multicast forwarding flows + +``` +● Src MAC disable +● Vlan rewrite disable +``` + +We have scenarios where we need knobs for disabling header field rewrites, for Multicast +Replication. + +Case1:For certain flows, the switch does MulticastReplication for a VLAN tagged packet. However, +we do not want the VLAN tag to be over-written during replication, we want the replication to retain +the VLAN tag. For such a case we would like to disable L3 VLAN rewrite. + +Case2: For some scenarios, we may want to rewrite the SRC MAC. Having NextHop based knobs +for such rewrites would be very helpful. + +In summary, with SDN based forwarding, Controller treats the L2 fields like any other header field +which can be controlled and requires them to be configured flexibility as part of MulticastReplication. + +## Proposal + +Since we require capability to disable the rewrites for certain Multicast flows and not for all flows +via/to neighbor, the best option is to have these as part of NextHop object: + +- SAI_NEXT_HOP_ATTR_DISABLE_SRC_MAC_REWRITE +- SAI_NEXT_HOP_ATTR_DISABLE_DST_MAC_REWRITE +- SAI_NEXT_HOP_ATTR_DISABLE_VLAN_REWRITE + +### Example SAI object creation for an IPMCGroup: + +- Create a **SAI_OBJECT_TYPE_IPMC_GROUP** for the multicast group with the following + attributes. +- Create a SAI_OBJECT_TYPE_ROUTER_INTERFACE with following attributes: + ● SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID + ● SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS + ● SAI_ROUTER_INTERFACE_ATTR_TYPE=SAI_ROUTER_INTERFACE_TYPE_ + PORT + ● SAI_ROUTER_INTERFACE_ATTR_PORT_ID +- Create a SAI_OBJECT_TYPE_NEIGHBOR_ENTRY for each neighbor with: + ● “ip”=Link local address + ● “rif” + ● “switch id” + ● SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS(optional) + ● SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE=true +- Create SAI_OBJECT_TYPE_NEXT_HOP with: + ● SAI_NEXT_HOP_ATTR_TYPE=SAI_NEXT_HOP_TYPE_IPMC + ● SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID + ● SAI_NEXT_HOP_ATTR_IP=“ip”of neighbor + + +``` +● SAI_NEXT_HOP_ATTR_DISABLE_SRC_MAC_REWRITE=true +● SAI_NEXT_HOP_ATTR_DISABLE_VLAN_REWRITE=true +``` +- Create a **SAI_OBJECT_TYPE_IPMC_GROUP_MEMBER** with following attributes: + ● SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_GROUP_ID with ipmc_group_oid + ● SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID with rif_oid + ● SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_NEXT_HOP with next_hop_oid + + + From 24b23a731c3df079fb891911e3bc12ca4ef94319 Mon Sep 17 00:00:00 2001 From: Manali Holankar Date: Fri, 19 Jul 2024 15:34:09 -0700 Subject: [PATCH 3/4] Update saiipmcgroup.h Took care of review comments Signed-off-by: Manali Holankar @mholankar --- inc/saiipmcgroup.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/inc/saiipmcgroup.h b/inc/saiipmcgroup.h index 6d8b598ab..4e0faf8cc 100644 --- a/inc/saiipmcgroup.h +++ b/inc/saiipmcgroup.h @@ -93,24 +93,11 @@ typedef enum _sai_ipmc_group_member_attr_t * @brief IPMC output id * * @type sai_object_id_t - * @flags CREATE_ONLY - * @objects SAI_OBJECT_TYPE_ROUTER_INTERFACE, SAI_OBJECT_TYPE_TUNNEL - * @allownull true - * @default SAI_NULL_OBJECT_ID + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @objects SAI_OBJECT_TYPE_ROUTER_INTERFACE, SAI_OBJECT_TYPE_TUNNEL, SAI_OBJECT_TYPE_NEXT_HOP */ SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID, - /** - * @brief Next Hop Object ID if present over-rides the IPMC_OUTPUT_ID - * - * @type sai_object_id_t - * @flags CREATE_ONLY - * @objects SAI_OBJECT_TYPE_NEXT_HOP - * @allownull true - * @default SAI_NULL_OBJECT_ID - */ - SAI_IPMC_GROUP_MEMBER_ATTR_NEXT_HOP, - /** * @brief End of attributes */ From 1e678aa6bbe154bccc1fc71405c60a15484f0cd8 Mon Sep 17 00:00:00 2001 From: Manali Holankar Date: Fri, 2 Aug 2024 17:36:37 -0700 Subject: [PATCH 4/4] Update MulticastNextHopRewrite.md Signed-off-by: Manali Holankar --- doc/IP-Multicast/MulticastNextHopRewrite.md | 74 ++++++++++----------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/doc/IP-Multicast/MulticastNextHopRewrite.md b/doc/IP-Multicast/MulticastNextHopRewrite.md index 34a1bb2f3..e1695ba34 100644 --- a/doc/IP-Multicast/MulticastNextHopRewrite.md +++ b/doc/IP-Multicast/MulticastNextHopRewrite.md @@ -5,20 +5,22 @@ ``` Author:mholankar@ ``` + ## Overview -This document discusses requirements and the SAI spec proposal for disabling rewriting fields -(SourceMAC,VLAN) as part of IPMC routing. +This document discusses requirements and the SAI spec proposal for disabling rewriting fields (SourceMAC, VLAN) as part of IPMC routing. ## Background -#### SAI pipeline for IPMC forwarding. After Multicast Replication, the egress -#### pipeline is very similar to Unicast Forwarding. The reference pipeline is -#### fromUnicastForwarding. +### SAI pipeline for IPMC forwarding. After Multicast Replication, the egress + +### pipeline is very similar to Unicast Forwarding. The reference pipeline is + +### fromUnicastForwarding. - Nexthop sets the egress RIF and NextHopIP -- Neighbor table lookup on NextHopIP to set packet’s destination MAC address -- Egress RIF lookup to set packet’s source MAC address, VLAN and port. +- Neighbor table lookup on NextHopIP to set packet's destination MAC address +- Egress RIF lookup to set packet's source MAC address, VLAN and port. ## Requirements @@ -29,23 +31,18 @@ We require knobs for disabling rewrites to following fields as part of Multicast ● Vlan rewrite disable ``` -We have scenarios where we need knobs for disabling header field rewrites, for Multicast -Replication. +We have scenarios where we need knobs for disabling header field rewrites, for Multicast Replication. -Case1:For certain flows, the switch does MulticastReplication for a VLAN tagged packet. However, -we do not want the VLAN tag to be over-written during replication, we want the replication to retain -the VLAN tag. For such a case we would like to disable L3 VLAN rewrite. +Case1:For certain flows, the switch does MulticastReplication for a VLAN tagged packet. However, we do not want the VLAN tag to be over-written during replication, we want the replication to retain the VLAN tag. For such a case we would like to disable L3 VLAN rewrite. Please note: that when a disable L3 Vlan rewrite +flag is enabled, it does allow for untagged packets to get replicated. -Case2: For some scenarios, we may want to rewrite the SRC MAC. Having NextHop based knobs -for such rewrites would be very helpful. +Case2: For some scenarios, we may want to rewrite the SRC MAC. Having NextHop based knobs for such rewrites would be very helpful. -In summary, with SDN based forwarding, Controller treats the L2 fields like any other header field -which can be controlled and requires them to be configured flexibility as part of MulticastReplication. +In summary, with SDN based forwarding, Controller treats the L2 fields like any other header field which can be controlled and requires them to be configured flexibility as part of MulticastReplication. ## Proposal -Since we require capability to disable the rewrites for certain Multicast flows and not for all flows -via/to neighbor, the best option is to have these as part of NextHop object: +Since we require capability to disable the rewrites for certain Multicast flows and not for all flows via/to neighbor, the best option is to have these as part of NextHop object: - SAI_NEXT_HOP_ATTR_DISABLE_SRC_MAC_REWRITE - SAI_NEXT_HOP_ATTR_DISABLE_DST_MAC_REWRITE @@ -53,34 +50,31 @@ via/to neighbor, the best option is to have these as part of NextHop object: ### Example SAI object creation for an IPMCGroup: -- Create a **SAI_OBJECT_TYPE_IPMC_GROUP** for the multicast group with the following - attributes. +- Create a **SAI_OBJECT_TYPE_IPMC_GROUP** for the multicast group with the following attributes. - Create a SAI_OBJECT_TYPE_ROUTER_INTERFACE with following attributes: - ● SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID - ● SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS - ● SAI_ROUTER_INTERFACE_ATTR_TYPE=SAI_ROUTER_INTERFACE_TYPE_ - PORT - ● SAI_ROUTER_INTERFACE_ATTR_PORT_ID +● SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID +● SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS +● SAI_ROUTER_INTERFACE_ATTR_TYPE=SAI_ROUTER_INTERFACE_TYPE_ + + ``` + PORT + ``` + +● SAI_ROUTER_INTERFACE_ATTR_PORT_ID - Create a SAI_OBJECT_TYPE_NEIGHBOR_ENTRY for each neighbor with: - ● “ip”=Link local address - ● “rif” - ● “switch id” - ● SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS(optional) - ● SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE=true +● "ip"=Link local address ● "rif" ● "switch id" +● SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS(optional) +● SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE=true - Create SAI_OBJECT_TYPE_NEXT_HOP with: - ● SAI_NEXT_HOP_ATTR_TYPE=SAI_NEXT_HOP_TYPE_IPMC - ● SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID - ● SAI_NEXT_HOP_ATTR_IP=“ip”of neighbor - +● SAI_NEXT_HOP_ATTR_TYPE=SAI_NEXT_HOP_TYPE_IPMC +● SAI_NEXT_HOP_ATTR_ROUTER_INTERFACE_ID +● SAI_NEXT_HOP_ATTR_IP="ip"of neighbor ``` ● SAI_NEXT_HOP_ATTR_DISABLE_SRC_MAC_REWRITE=true ● SAI_NEXT_HOP_ATTR_DISABLE_VLAN_REWRITE=true ``` -- Create a **SAI_OBJECT_TYPE_IPMC_GROUP_MEMBER** with following attributes: - ● SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_GROUP_ID with ipmc_group_oid - ● SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID with rif_oid - ● SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_NEXT_HOP with next_hop_oid - - +- Create a **SAI_OBJECT_TYPE_IPMC_GROUP_MEMBER** with following attributes: +● SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_GROUP_ID with ipmc_group_oid +● SAI_IPMC_GROUP_MEMBER_ATTR_IPMC_OUTPUT_ID with next_hop_oid