Skip to content

IS-IS Graceful Support #423

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

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

IS-IS Graceful Support #423

wants to merge 58 commits into from

Conversation

SuryyaKrJana
Copy link
Contributor

@SuryyaKrJana SuryyaKrJana commented Apr 21, 2025

IS-IS Graceful Restart Support

Example Test configuration and Graceful Restart Trigger on IS-IS router on Port-1 and whereas IS-IS Router is configured as Restarter Helper:

// Config Creation
func IsisGRConfig(client *api.ApiClient) gosnappi.Config {
	config := gosnappi.NewConfig()
	port1 := config.Ports().Add().SetName("port1").SetLocation(opts.IxiaCPorts()[0])
	port2 := config.Ports().Add().SetName("port2").SetLocation(opts.IxiaCPorts()[1])

	// port 1 device 1
	p1d1 := config.Devices().Add().SetName("p1d1")
	// port 1 device 1 ethernet
	p1d1Eth := p1d1.Ethernets().Add().
		SetName("p1d1Eth").
		SetMac("00:00:01:01:01:01").
		SetMtu(1500)
	p1d1Eth.Connection().SetPortName(port1.Name())

	// port 1 device 1 ipv4
	p1d1Ipv4 := p1d1Eth.Ipv4Addresses().
		Add().
		SetAddress("1.1.1.2").
		SetGateway("1.1.1.1").
		SetName("p1d1Ipv4").
		SetPrefix(24)

	// port 1 device 1 isis
	p1d1Isis := p1d1.Isis().SetName("p1d1Isis").SetSystemId("640000000001")

	// port 1 device 1 isis basic
	p1d1Isis.Basic().SetIpv4TeRouterId(p1d1Ipv4.Address())
	p1d1Isis.Basic().SetHostname("ixia-c-port1")
	p1d1Isis.Basic().SetLearnedLspFilter(true)

	// port 1 device 1 isis advance
	p1d1Isis.Advanced().SetAreaAddresses([]string{"490001"})
	p1d1Isis.Advanced().SetEnableAttachedBit(false)

	// Enable Graceful restarting mode only on IS-IS Router on Port1.
	p1d1Isis.GracefulRestart().SetHelperMode(false)

	// port 1 device 1 isis interface
	p1d1IsisIntf := p1d1Isis.Interfaces().Add().
		SetEthName(p1d1Eth.Name()).
		SetNetworkType("point_to_point").
		SetLevelType(gosnappi.IsisInterfaceLevelType.LEVEL_2).
		SetMetric(10).
		SetName("p1d1IsisIntf")

	// l2 settings
	p1d1IsisIntf.L2Settings().
		SetDeadInterval(30).
		SetHelloInterval(10).
		SetPriority(0)
	p1d1IsisIntf.
		Advanced().SetAutoAdjustSupportedProtocols(true)

	// port 1 device 1 isis v4 routes
	p1d1Isisv4routes := p1d1Isis.
		V4Routes().
		Add().
		SetName("p1d1IsisIpv4").
		SetLinkMetric(10).
		SetOriginType(gosnappi.IsisV4RouteRangeOriginType.INTERNAL)
	p1d1Isisv4routes.Addresses().Add().
		SetAddress("10.10.10.1").
		SetPrefix(32).
		SetCount(1).
		SetStep(1)

	// port 2 device 1
	p2d1 := config.Devices().Add().SetName("p2d1")
	// port 2 device 1 ethernet
	p2d1Eth := p2d1.Ethernets().Add().
		SetName("p2d1Eth").
		SetMac("00:00:02:03:03:03").
		SetMtu(1500)
	p2d1Eth.Connection().SetPortName(port2.Name())

	// port 2 device 1 ipv4
	p2d1Ipv4 := p2d1Eth.Ipv4Addresses().
		Add().
		SetAddress("2.2.1.2").
		SetGateway("2.2.1.1").
		SetName("p2d1Ipv4").
		SetPrefix(24)

	// port 2 device 1 isis
	p2d1Isis := p2d1.Isis().SetName("p2d1Isis").SetSystemId("650000000001")

	// port 2 device 1 isis basic
	p2d1Isis.Basic().SetIpv4TeRouterId(p2d1Ipv4.Address())
	p2d1Isis.Basic().SetHostname("ixia-c-port2")
	p2d1Isis.Basic().SetLearnedLspFilter(true)

	// port 2 device 1 isis advance
	p2d1Isis.Advanced().SetAreaAddresses([]string{"490001"})
	p2d1Isis.Advanced().SetEnableAttachedBit(false)

	// Enable Graceful restart & helper mode on IS-IS Router on Port2.
	p1d1Isis.GracefulRestart().SetHelperMode(true)

	// port 2 device 1 isis interface
	p2d1IsisIntf := p2d1Isis.Interfaces().Add().
		SetEthName(p2d1Eth.Name()).
		SetNetworkType("point_to_point").
		SetLevelType(gosnappi.IsisInterfaceLevelType.LEVEL_2).
		SetMetric(10).
		SetName("p2d1IsisIntf")

	//l2 Settings
	p2d1IsisIntf.L2Settings().
		SetDeadInterval(30).
		SetHelloInterval(10).
		SetPriority(0)
	p2d1IsisIntf.
		Advanced().SetAutoAdjustSupportedProtocols(true)

	// port 2 device 1 isis v4 routes
	p2d1Isisv4routes := p2d1Isis.
		V4Routes().
		Add().
		SetName("p2d1IsisIpv4").
		SetLinkMetric(10).
		SetOriginType(gosnappi.IsisV4RouteRangeOriginType.INTERNAL)
	p2d1Isisv4routes.Addresses().Add().
		SetAddress("20.20.20.1").
		SetPrefix(32).
		SetCount(1).
		SetStep(1)

	// P1 ---> P2
	f1 := config.Flows().Add().SetName("f1:p1->p2")
	f1.Metrics().SetEnable(true)
	f1.Size().SetFixed(300)
	f1.Rate().SetPps(100)
	f1.Duration().FixedPackets().SetPackets(1000)
	f1.
		TxRx().Device().
		SetTxNames([]string{p1d1Isisv4routes.Name()}).
		SetRxNames([]string{p2d1Isisv4routes.Name()})

	f1Eth := f1.Packet().Add().Ethernet()
	f1Eth.Src().SetValue(p1d1Eth.Mac())
	f1Eth.Dst().Auto()

	f1Ip := f1.Packet().Add().Ipv4()
	f1Ip.Src().SetValue("10.10.10.1")
	f1Ip.Dst().SetValue("20.20.20.1")

	// // P2 ---> P1
	f2 := config.Flows().Add().SetName("f2:p2->p1")
	f2.Metrics().SetEnable(true)
	f2.Size().SetFixed(300)
	f2.Rate().SetPps(100)
	f2.Duration().FixedPackets().SetPackets(1000)
	f2.
		TxRx().Device().
		SetTxNames([]string{p2d1Isisv4routes.Name()}).
		SetRxNames([]string{p1d1Isisv4routes.Name()})

	f2Eth := f2.Packet().Add().Ethernet()
	f2Eth.Src().SetValue(p2d1Eth.Mac())
	f2Eth.Dst().Auto()

	f2Ip := f2.Packet().Add().Ipv4()
	f2Ip.Src().SetValue("20.20.20.1")
	f2Ip.Dst().SetValue("10.10.10.1")

	return config
}

// Go test function showing Graceful Restart Trigger
func TestPdpIsisGR(t *testing.T) {
	
        .................................................
       ...................................................
	grAction := gosnappi.NewControlAction()
	isisRestart := grAction.Protocol().Isis().InitiateRestart()
	routerName := []string{"p1d1Isis"}
	isisRestart.SetRouterNames(routerName)
	unplanned := isisRestart.Unplanned()
	unplanned.SetHoldingTime(30)
	unplanned.SetRestartAfter(20)

	if _, err := client.Api().SetControlAction(grAction); err != nil {
		t.Fatal(err)
	}
       .................................................
       ...................................................
}

@SuryyaKrJana SuryyaKrJana self-assigned this Apr 22, 2025
@SuryyaKrJana SuryyaKrJana added the enhancement New feature or request label Apr 22, 2025
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.

In general , looks as per last discussion.
Some more clarifications esp. in descriptions might be needed.

apratimmukherjee

This comment was marked as 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.

Some comments re-opened that look to have been missed.
Some new comments related to possible improvements in documentation.
From point of view of objects / attributes and data types , 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.

5 participants