nokia_sros adapter

Features

The main feature of this module is the handling of the whole configuration of nokia sros router/switch. It uses netconf as networking management protocol and yang as high level configuration modeling language. This module can manage any configuration node defined in https://github.com/nokia/7x50_YangModels and present in docs/yang_models. Instead of using the yang files directly, the module uses pre-compiled xml obtained from the yang models in docs/yang_models.

Tooling is available to convert yang configuration from the device into model code automatically (as shown below). For more information contact sales.

Usage example

The following example can be used to configure an eline on a device:

import nokia_sros
import nokia_sros::eth_cfm
import nokia_sros::eth_cfm::domain
import nokia_sros::eth_cfm::domain::association
import nokia_sros::service
import nokia_sros::service::epipe
import nokia_sros::service::epipe::bgp_evpn
import nokia_sros::service::epipe::bgp_evpn::mpls
import nokia_sros::service::epipe::bgp_evpn::mpls::auto_bind_tunnel
import nokia_sros::service::epipe::sap
import nokia_sros::service::epipe::sap::egress
import nokia_sros::service::epipe::sap::egress::qos
import nokia_sros::service::epipe::sap::egress::qos::sap_egress
import nokia_sros::service::epipe::sap::egress::qos::sap_egress::overrides
import nokia_sros::service::epipe::sap::egress::qos::sap_egress::overrides::queue
import nokia_sros::service::epipe::sap::eth_cfm
import nokia_sros::service::epipe::sap::eth_cfm::mep
import nokia_sros::service::epipe::sap::ingress
import nokia_sros::service::epipe::sap::ingress::qos
import nokia_sros::service::epipe::sap::ingress::qos::sap_ingress
import nokia_sros::service::epipe::sap::ingress::qos::sap_ingress::overrides
import nokia_sros::service::epipe::sap::ingress::qos::sap_ingress::overrides::policer
import yang


device = nokia_sros::NetconfDevice(
    mgmt_ip="127.0.0.1",
    name="router",
    yang_credentials=yang::Credentials(
        username_env_var="NETCONF_DEVICE_USER",
        password_env_var="NETCONF_DEVICE_PASSWORD",
    ),
)


nokia_sros::EthCfm(
    device=device,
    domain=nokia_sros::eth_cfm::Domain(
        md_admin_name="64512",
        level=7,
        association=nokia_sros::eth_cfm::domain::Association(
            ma_admin_name="10500",
            ccm_interval="10s",
            auto_mep_discovery=true,
            string="10500",
            bridge_identifier=nokia_sros::eth_cfm::domain::association::BridgeIdentifier(
                bridge_name="epipe-10500",
                mhf_creation="default",
                id_permission="chassis",
            ),
        ),
    ),
)

nokia_sros::Service(
    device=device,
    epipe=nokia_sros::service::Epipe(
        service_name="epipe-10500",
        service_id=10500,
        customer="1",
        admin_state="enable",
        service_mtu=1514,
        bgp=nokia_sros::service::epipe::Bgp(
            bgp_instance=1,
        ),
        sap=nokia_sros::service::epipe::Sap(
            sap_id="1/1/c2/1:101.*",
            description="cust=1;service_id=10500",
            admin_state="enable",
            ingress=nokia_sros::service::epipe::sap::Ingress(
                qos=nokia_sros::service::epipe::sap::ingress::Qos(
                    sap_ingress=nokia_sros::service::epipe::sap::ingress::qos::SapIngress(
                        policy_name="default-policy",
                        overrides=nokia_sros::service::epipe::sap::ingress::qos::sap_ingress::Overrides(
                            policer=nokia_sros::service::epipe::sap::ingress::qos::sap_ingress::overrides::Policer(
                                policer_id=3,
                                cbs="auto",
                                mbs="auto",
                                rate=nokia_sros::service::epipe::sap::ingress::qos::sap_ingress::overrides::policer::Rate(
                                    pir="max",
                                    cir="1000000",
                                ),
                            ),
                        ),
                    ),
                ),
            ),
            egress=nokia_sros::service::epipe::sap::Egress(
                qos=nokia_sros::service::epipe::sap::egress::Qos(
                    sap_egress=nokia_sros::service::epipe::sap::egress::qos::SapEgress(
                        policy_name="default-policy",
                        overrides=nokia_sros::service::epipe::sap::egress::qos::sap_egress::Overrides(
                            queue=nokia_sros::service::epipe::sap::egress::qos::sap_egress::overrides::Queue(
                                queue_id=3,
                                cbs="auto",
                                mbs="auto",
                                rate=nokia_sros::service::epipe::sap::egress::qos::sap_egress::overrides::queue::Rate(
                                    pir="max",
                                    cir="1000000",
                                ),
                            ),
                        ),
                    ),
                ),
            ),
            eth_cfm=nokia_sros::service::epipe::sap::EthCfm(
                mep=nokia_sros::service::epipe::sap::eth_cfm::Mep(
                    md_admin_name="64512",
                    ma_admin_name="10500",
                    mep_id=2,
                    direction="down",
                    admin_state="enable",
                    mac_address="d0:0d:1e:a0:00:02",
                    ccm=true,
                    eth_test=nokia_sros::service::epipe::sap::eth_cfm::mep::EthTest(),
                ),
            ),
        ),
        bgp_evpn=nokia_sros::service::epipe::BgpEvpn(
            evi=10500,
            local_attachment_circuit=nokia_sros::service::epipe::bgp_evpn::LocalAttachmentCircuit(
                name="circuit2-router-east",
                eth_tag=2,
            ),
            remote_attachment_circuit=nokia_sros::service::epipe::bgp_evpn::RemoteAttachmentCircuit(
                name="circuit2-remote-router-east",
                eth_tag=1,
            ),
            mpls=nokia_sros::service::epipe::bgp_evpn::Mpls(
                bgp_instance=1,
                admin_state="enable",
                ecmp=2,
                entropy_label=true,
                auto_bind_tunnel=nokia_sros::service::epipe::bgp_evpn::mpls::AutoBindTunnel(
                    resolution="any",
                    enforce_strict_tunnel_tagging=true,
                    resolution_filter=nokia_sros::service::epipe::bgp_evpn::mpls::auto_bind_tunnel::ResolutionFilter(
                        ldp=false,
                        rsvp=false,
                        sr_isis=false,
                        sr_te=false,
                    ),
                ),
            ),
        ),
    ),
)