Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ISIS MPLS Segment Routing #397

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Support for ISIS MPLS Segment Routing #397

wants to merge 33 commits into from

Conversation

SuryyaKrJana
Copy link
Contributor

@SuryyaKrJana SuryyaKrJana commented Nov 29, 2024

https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/open-traffic-generator/models/isis-sr/artifacts/openapi.yaml&nocors

Just to add a note that SR-MPLS is applicable to Emulated and Simulated ISIS Router.

ISIS Exposed New Configuration.

  • ISIS Router

    • Router Capabilities Tlv (242):
      • SR-Capabilities sub-tlv (2)
        • SRGB sub-sub tlv
      • SR Local Block sub-tlv (22)
      • Algorithms sub-tlv (19)
  • ISIS Interface

    • Adjacency Segment sub-tlv (advertised in Extnd. IsReachability)
  • Route Ranges

    • Prefix-SID sub-tlv (advertised in IPv4/v6 Reachability)
    • Prefix-Attribute sub-tlv**

Exposed New Learned Information

• Router Capabilities Tlv (242):
• Adjacency sid in IsReachability
• Prefix sid in Extnd. IP Reachability.

A OTG-ISIS <------> DUT <------> OTG_ISIS

```
  	config := gosnappi.NewConfig()

// add ports
p1 := config.Ports().Add().SetName("p1").SetLocation(opts.IxiaCPorts()[0])
p2 := config.Ports().Add().SetName("p2").SetLocation(opts.IxiaCPorts()[1])

// add devices
d1 := config.Devices().Add().SetName("d1")
d2 := config.Devices().Add().SetName("d2")

// add protocol stacks for device d1
d1Eth1 := d1.Ethernets().
	Add().
	SetName("d1Eth").
	SetMac("00:00:01:01:01:01").
	SetMtu(1500)

d1Eth1.Connection().SetPortName(p1.Name())

d1Eth1.
	Ipv4Addresses().
	Add().
	SetName("p1d1-ipv4").
	SetAddress("1.1.1.1").
	SetGateway("1.1.1.2").
	SetPrefix(24)

d1Isis := d1.Isis().
	SetName("p1d1isis").
	SetSystemId("640000000001")

d1Isis.Advanced().SetAreaAddresses([]string{
	"490001",
})

d1Isis.Basic().SetHostname("ixia-c-port1").SetIpv4TeRouterId("1.1.1.1")

// Enabling Segmented Routing and configuring Router capabilities.
    srStartingSid := 16000
srRange := 8000
    sid1Off := 100
    sid2Off  := 200
    sid3Off  := 300
    sid4Off  := 400

sr := d1Isis.SegmentRouting()
rtrCap := sr.RouterCapability()
rtrCap.Algorithms().Add().SetAlgorithm(0).SetAlgorithm(1)

rtrCap.SrlbRanges().Add().SetStartingSid(uint32(sr1StartingSid)).SetRange(uint32(sr1Range))
rtrCap.SetSBit(gosnappi.IsisRouterCapabilitySBit.FLOOD)
rtrCap.SetDBit(gosnappi.IsisRouterCapabilityDBit.NOT_DOWN)

srCap := rtrCap.SrCapability()
srCap.Flags().SetIpv4Mpls(true).SetIpv4Mpls(true)
srCap.SrgbRanges().Add().SetStartingSid(srStartingSid).SetRange(srRange)

d1IsisIntf := d1Isis.Interfaces().Add().SetEthName(d1Eth1.Name()).
	SetName("p1d1isis1-intf1").
	SetMetric(10).
	SetNetworkType(gosnappi.IsisInterfaceNetworkType.POINT_TO_POINT).
	SetLevelType(gosnappi.IsisInterfaceLevelType.LEVEL_1)
d1IsisIntf.L1Settings().SetDeadInterval(30).SetHelloInterval(10).SetPriority(0)

// Configuring Adjacency SID
d1IsisIntf.AdjacencySids().Add().SetSidIndex(sid3Off).SetPFlag(true)

d1IsisRoute1 := d1Isis.V4Routes().Add().SetName("p1d1isis-rr1")
d1IsisRoute1.Addresses().
	Add().
	SetAddress("21.1.1.1").
	SetPrefix(24).
	SetCount(1).
	SetStep(1)

//Configure Prefix Attribute
d1IsisRoute1.SetPrefixAttrEnabled(true).SetRFlag(true).SetNFlag(true)

//Configure Prefix Sid
d1IsisRoute1.PrefixSids().Add().SetSidIndex(uint32(sid1Off)).SetRFlag(true).SetNFlag(true).SetPFlag(true)

// add protocol stacks for device d2
d2Eth1 := d2.Ethernets().
	Add().
	SetName("d2Eth").
	SetMac("00:00:02:02:02:02").
	SetMtu(1500)

d2Eth1.Connection().SetPortName(p2.Name())

d2Eth1.
	Ipv4Addresses().
	Add().
	SetName("p2d1-ipv4").
	SetAddress("1.1.1.2").
	SetGateway("1.1.1.1").
	SetPrefix(24)

d2Isis := d2.Isis().
	SetName("p2d1isis").
	SetSystemId("650000000001")

d2Isis.Basic().SetHostname("ixia-c-port2").SetIpv4TeRouterId("1.1.1.2")

// Enabling Segmented Routing and configuring Router capabilities.
// Enabling Segmented Routing and configuring Router capabilities.
sr2 := d2Isis.SegmentRouting()
rtrCap2 := sr2.RouterCapability()
rtrCap2.Algorithms().Add().SetAlgorithm(0).SetAlgorithm(100)
rtrCap2.SrlbRanges().Add().SetStartingSid(srStartingSid ).SetRange(srRange )
rtrCap2.SetSBit(gosnappi.IsisRouterCapabilitySBit.FLOOD)
rtrCap2.SetDBit(gosnappi.IsisRouterCapabilityDBit.NOT_DOWN)

srCap2 := rtrCap.SrCapability()
srCap2.Flags().SetIpv4Mpls(true).SetIpv4Mpls(true)
srCap2.SrgbRanges().Add().SetStartingSid(uint32(srStartingSid)).SetRange(uint32(srRange))

d2IsisIntf := d2Isis.Interfaces().Add().SetEthName(d2Eth1.Name()).
	SetName("p2d1isis1-intf1").
	SetMetric(10).
	SetNetworkType(gosnappi.IsisInterfaceNetworkType.POINT_TO_POINT).
	SetLevelType(gosnappi.IsisInterfaceLevelType.LEVEL_1)
d2IsisIntf.L1Settings().SetDeadInterval(30).SetHelloInterval(10).SetPriority(0)
d2Isis.Advanced().SetAreaAddresses([]string{
	"490001",
})

d2IsisIntf.AdjacencySids().Add().SetSidIndex(sid4Off ).SetPFlag(true)

d2IsisRoute1 := d2Isis.V4Routes().Add().SetName("p2d1isis-rr1")
d2IsisRoute1.Addresses().
	Add().
	SetAddress("22.1.1.1").
	SetPrefix(24).
	SetCount(1).
	SetStep(1)

//Configure Prefix Attribute
d2IsisRoute1.SetPrefixAttrEnabled(true).SetRFlag(true).SetNFlag(true)

//Configure Prefix Sid
d2IsisRoute1.PrefixSids().Add().SetSidIndex(uint32(sid2Off)).SetRFlag(true).SetNFlag(true).SetPFlag(true)

// Add P1 <---> P2
flowCount := 2
for i := 1; i <= flowCount; i++ {
	fmt.Println("flow --> ", i)
	flow := config.Flows().Add()
	flow.Metrics().SetEnable(true)
	flow.Duration().FixedPackets().SetPackets(500)
	flow.Rate().SetPps(10)

}

// P1 ---> P2
f1 := config.Flows().Items()[0]
flowName := fmt.Sprint("p1 --> p2 flow", 1)
TxName := fmt.Sprint("MPLS Traffic Label Learned at P1", 1)
f1.SetName(flowName).
	TxRx().Device().
	SetTxNames([]string{TxName}).
	SetRxNames([]string{d2IsisRoute1.Name()})

f1Eth := f1.Packet().Add().Ethernet()
f1Eth.Src().SetValue(d1Eth1.Mac())
f1Eth.Dst().Auto()
    // Configuring static Node SID that will be advertised by ISIS Router on Port P2.  
    // However, we can configure with array of Node and Adjacency SIDs together.
f1Mpls := f1.Packet().Add().Mpls()
f1Mpls.Label().SetValue(uint32(srStartingSid + sid2Off))
f1Mpls.TrafficClass().SetValues([]uint32{1, 2})

f1Ip := f1.Packet().Add().Ipv4()
f1Ip.Src().SetValue("21.1.1.1")
f1Ip.Dst().SetValue("22.1.1.1")

// P2 ---> P1
f2 := config.Flows().Items()[1]
flowName = fmt.Sprint("p2 --> p1 flow", 2)
TxName = fmt.Sprint("MPLS Traffic Label Learned at P2", 2)
f2.SetName(flowName).
	TxRx().Device().
	SetTxNames([]string{TxName}).
	SetRxNames([]string{d1IsisRoute1.Name()})

f2Eth := f2.Packet().Add().Ethernet()
f2Eth.Src().SetValue(d2Eth1.Mac())
f2Eth.Dst().Auto()
   
     // Configuring static Node SID that will be advertised by ISIS Router on Port P1  
    // However, we can configure with array of Node and Adjacency SIDs together.
f2Mpls := f2.Packet().Add().Mpls()
f2Mpls.Label().SetValue(uint32(srStartingSid + sid1Off))
f2Mpls.TrafficClass().SetValues([]uint32{3, 4})

f2Ip := f2.Packet().Add().Ipv4()
f2Ip.Src().SetValue("22.1.1.1")
f2Ip.Dst().SetValue("21.1.1.1")

@apratimmukherjee apratimmukherjee changed the title Isis sr Support for ISIS MPLS Segment Routing Dec 10, 2024
device/isis/adjacencysegmentid.yaml Outdated Show resolved Hide resolved
device/isis/adjacencysegmentid.yaml Outdated Show resolved Hide resolved
device/isis/adjacencysegmentid.yaml Show resolved Hide resolved
device/isis/interface.yaml Outdated Show resolved Hide resolved
device/isis/adjacencysegmentid.yaml Show resolved Hide resolved
device/isis/segmentrouting.yaml Outdated Show resolved Hide resolved
device/isis/segmentrouting.yaml Outdated Show resolved Hide resolved
device/isis/segmentrouting.yaml Outdated Show resolved Hide resolved
device/isis/segmentrouting.yaml Outdated Show resolved Hide resolved
device/isis/interface.yaml Outdated Show resolved Hide resolved
apratimmukherjee

This comment was marked as resolved.

@SuryyaKrJana SuryyaKrJana linked an issue Dec 16, 2024 that may be closed by this pull request
@SuryyaKrJana SuryyaKrJana added the enhancement New feature or request label Dec 16, 2024
device/isis/adjacencysegmentid.yaml Outdated Show resolved Hide resolved
device/isis/adjacencysegmentid.yaml Outdated Show resolved Hide resolved
device/isis/adjacencysegmentid.yaml Outdated Show resolved Hide resolved
device/isis/adjacencysegmentid.yaml Outdated Show resolved Hide resolved
device/isis/adjacencysegmentid.yaml Outdated Show resolved Hide resolved
device/isis/v6routerange.yaml Outdated Show resolved Hide resolved
device/isis/isis.yaml Show resolved Hide resolved
device/isis/isis.yaml Outdated Show resolved Hide resolved
device/isis/prefixsegmentid.yaml Outdated Show resolved Hide resolved
device/isis/segmentrouting.yaml Show resolved Hide resolved
Copy link
Contributor

@apratimmukherjee apratimmukherjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ATE Feature: IS-IS Segment Routing
5 participants