Git Product home page Git Product logo

Comments (17)

greg-dennis avatar greg-dennis commented on July 17, 2024 1

The latest Ondatra commit now provides some basic support for gathering ISIS LSPs through gNMI. It provides the LSP ID, IS type/level, and sequence number. Please note that the network instance value for both ISIS and BGP must be the name of the interface created when using the Ondatra AddInterface function, and the id of the protocol is always "0". Please give it a try and I will let you know when flags is done.

from ondatra.

greg-dennis avatar greg-dennis commented on July 17, 2024

I still be investigating this feature request in my sprint that starts tomorrow. It may be quite a sizable feature request, so no promises about this being completed immediately. I'll report back when the investigation is done.

from ondatra.

greg-dennis avatar greg-dennis commented on July 17, 2024

I am evaluating this request this sprint and will have either completed this request or will have a timetable to announce by 10/25.

from ondatra.

greg-dennis avatar greg-dennis commented on July 17, 2024

@Vibaswan can you please provide an IxNetwork config and reference to the IxNetwork operation that retrieves the specific info you are interested in?

from ondatra.

Vibaswan avatar Vibaswan commented on July 17, 2024

Hi @greg-dennis ,
Given below is the test which would create ISIS in b2b and can retrieve the info using the api
/topology/deviceGroup/ethernet/isisL3/operations/getlearnedinfo and then retrieving the table from learned info `/topology/2/deviceGroup/1/ethernet/1/isisL3/2/learnedInfo/1/table/1' the same way we have retrieved bgp learned info

Note: some parameters like off-load bit is not yet supported by ATE and we have raised feature request for the same in Ixnetwork, would let you know once its done.

ISIS-b2b Test:

package topology_test

import (
	"fmt"
	"sort"
	"testing"

	"github.com/openconfig/featureprofiles/internal/fptest"
	"github.com/openconfig/ondatra"
	"github.com/openconfig/ondatra/telemetry"
)

func TestMain(m *testing.M) {
	fptest.RunTests(m)
}

// plen is the IPv4 prefix length used for IPv4 assignments in this
// topology.
const plen = 30

// dutPortIP assigns IP addresses for DUT port i, where i is the index
// of the port slices returned by dut.Ports().
func dutPortIP(i int) string {
	if i == 0 {
		return fmt.Sprintf("100.1.0.11")
	} else {
		return fmt.Sprintf("100.1.0.1")
	}
}

// atePortCIDR assigns IP addresses with prefixlen for ATE port i, where
// i is the index of the port slices returned by ate.Ports().
func atePortCIDR(i int) string {
	if i == 0 {
		return fmt.Sprintf("100.1.0.1/24")
	} else {
		return fmt.Sprintf("100.1.0.11/24")
	}
}

func ipPrefix(i int) string {
	if i == 0 {
		return fmt.Sprintf("1.2.3.4/24")
	} else {
		return fmt.Sprintf("5.6.7.8/24")
	}
}

func getRouterId(i int) string {
	if i == 1 {
		return fmt.Sprintf("1.1.1.2")
	} else {
		return fmt.Sprintf("1.1.1.1")
	}
}

func configureIsisATE(t *testing.T, ate *ondatra.ATEDevice, atePorts []*ondatra.Port) {
	top := ate.Topology().New()

	for i, ap := range atePorts {
		t.Logf("ATE AddInterface: ports[%d] = %v", i, ap)
		in := top.AddInterface(ap.Name()).WithPort(ap)
		in.IPv4().WithAddress(atePortCIDR(i)).WithDefaultGateway(dutPortIP(i))
		if false {
			t.Logf("Disabling FEC on port %v", ap)
			in.Ethernet().FEC().WithEnabled(false)
		}
		in.ISIS().WithTERouterID(getRouterId(i)).WithLevelL1().WithNetworkTypeBroadcast()
		ng := in.AddNetwork(fmt.Sprintf("isis-%d", i+1))
		ng.IPv4().WithAddress(ipPrefix(i))
		ng.ISIS().WithActive(true).WithIPReachabilityMetric(20)
	}

	top.Push(t).StartProtocols(t)
}

func sortPorts(ports []*ondatra.Port) []*ondatra.Port {
	sort.Slice(ports, func(i, j int) bool {
		idi, idj := ports[i].ID(), ports[j].ID()
		li, lj := len(idi), len(idj)
		if li == lj {
			return idi < idj
		}
		return li < lj // "port2" < "port10"
	})
	return ports
}

func TestIsis(t *testing.T) {
	ate := ondatra.ATE(t, "ate")
	atePorts := sortPorts(ate.Ports())
	configureIsisATE(t, ate, atePorts)

	// Query Telemetry
	t.Run("Telemetry", func(t *testing.T) {
		const want = telemetry.Interface_OperStatus_UP

		at := ate.Telemetry()
		for _, ap := range atePorts {
			if got := at.Interface(ap.Name()).OperStatus().Get(t); got != want {
				t.Errorf("%s oper-status got %v, want %v", ap, got, want)
			}

			// currently we cant get these attributes and it returns empty objects or lists
			is := at.NetworkInstance(ap.Name()).Protocol(telemetry.PolicyTypes_INSTALL_PROTOCOL_TYPE_ISIS, fmt.Sprintf("isis-%s", ap.Name())).Isis()
			level := is.LevelAny().LspAny()
			fmt.Println(level)
			isType := is.LevelAny().LspAny().IsType().Get(t)
			fmt.Println(isType)
			flags := is.LevelAny().LspAny().Flags().Get(t)
			fmt.Println(flags)
			seq := is.LevelAny().LspAny().SequenceNumber().Get(t)
			fmt.Println(seq)
		}
	})
}

from ondatra.

greg-dennis avatar greg-dennis commented on July 17, 2024

Here is a sample table of information I received from the ISIS learned info:

name value
Learned Via L2
Learned From
Metric 30
IPv4 Prefix 72.16.1.0
Mask 30
Prefix Attribute Flags
IPv4 Source Router ID
IPv6 Source Router ID
SID/Label
Algorithm
FAPM Metric
System ID 11 11 11 11 11 11
Pseudo Node Index 0
LSP Index 0
Host Name xx07.sql17
Sequence Number 3
Age (in secs) 32

As you can see, several values were blank. Does this contain everything of interest?

from ondatra.

greg-dennis avatar greg-dennis commented on July 17, 2024

@Vibaswan, for this example, I am inferring that both the level number and is-type is 2, that the LSP ID is "1111.1111.1111.00-00", the sequence number is 3, and the flags are an empty list. Do you know how I trigger some flag attributes to be learned?

from ondatra.

Vibaswan avatar Vibaswan commented on July 17, 2024

Hi @greg-dennis ,
Currently we are on Holiday, will get back to you by the end of the week

from ondatra.

Vibaswan avatar Vibaswan commented on July 17, 2024

Hi @greg-dennis ,
In order to activate the flags we need to add some more configuration to the below line in the test script

in.ISIS().WithTERouterID(getRouterId(i)).WithLevelL1().WithNetworkTypeBroadcast()

so, after the addition it will look something like this

isis := in.ISIS().WithTERouterID(getRouterId(i)).WithLevelL1().WithNetworkTypeBroadcast()
isis.WithWideMetricEnabled(true)
isis.SegmentRouting().WithEnabled(true)

from ondatra.

Vibaswan avatar Vibaswan commented on July 17, 2024

Hi @greg-dennis,

The test script which I shared for you is just a sample to retrieve learned info from ISIS router. This requirement has come from @cprabha of Juniper and in future there might be other fields that may be needed by the WBB test cases. @cprabha would you please comment if the given table of contents (provided in the earlier comments by @greg-dennis ) would suffice your need (apart from overload bit, as this is not present in current IxNetwork ISIS router)

from ondatra.

cprabha avatar cprabha commented on July 17, 2024

@Vibaswan , @greg-dennis
As Per gnmi1.3 testcase details we need verify overload bit and metric on ATE for ISIS sessions.

from ondatra.

cprabha avatar cprabha commented on July 17, 2024

Thanks Greg, I will check and update you.

from ondatra.

greg-dennis avatar greg-dennis commented on July 17, 2024

I tried the suggestion configuration but couldn't get Ixia to render flags in the learned info. I'm tempted to mark this fixed and let either of you @Vibaswan or @cprabha augment the inference now that the structure for it is in place:
https://github.com/openconfig/ondatra/blob/main/internal/ixgnmi/isislsdb.go#L106

Now that the basic structure is in place, do you think you could submit PRs for whatever additional information you want rendered in the telemetry?

from ondatra.

cprabha avatar cprabha commented on July 17, 2024

from ondatra.

Vibaswan avatar Vibaswan commented on July 17, 2024

yes I could fetch the sequence number and istype using the new ondatra release also could see the learned info is being triggered at IxNetwork side

from ondatra.

greg-dennis avatar greg-dennis commented on July 17, 2024

I am going to mark this fixed then. The code has been significantly refactored to make adding new gnmi from learned info fairly straightforward. Please submit PRs for any additional gnmi needed from learned info or reach out to me with any difficulties you have doing that.

from ondatra.

cprabha avatar cprabha commented on July 17, 2024

Thanks Greg, Vibaswan.

from ondatra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.