Permalink
Fetching contributors…
Cannot retrieve contributors at this time
880 lines (791 sloc) 24.3 KB
module cisco-bgp-state {
yang-version 1;
namespace "urn:cisco:params:xml:ns:yang:cisco-bgp-state";
prefix bgps;
import ietf-inet-types {
prefix inet;
}
import tailf-common {
prefix tailf;
}
organization
"Cisco Systems, Inc.";
contact
" Cisco Systems, Inc.
Customer Service
Postal: 170 W Tasman Drive
San Jose, CA 95134
Tel: +1 1800 553-NETS
E-mail: cs-yang@cisco.com";
description
" This module contains a collection of YANG definitions for
monitoring BGP information.";
reference "TODO";
revision 2015-10-16 {
description "Proposed";
}
identity afi-safi {
description
"Base identity from which identities describing address
families are derived.";
}
identity ipv4-mdt {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity ipv4-multicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity ipv4-unicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity ipv4-mvpn {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity ipv4-flowspec {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity ipv6-multicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity ipv6-unicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity ipv6-mvpn {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity ipv6-flowspec {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity l2vpn-vpls {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity l2vpn-e-vpn {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity nsap-unicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity rtfilter-unicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity vpnv4-multicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity vpnv4-unicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity vpnv6-unicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity vpnv6-multicast {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity vpnv4-flowspec {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
identity vpnv6-flowspec {
base afi-safi;
description
"This identity represents IPv4 address family.";
}
typedef bgp-fsm-state {
type enumeration {
enum idle {
tailf:code-name "bgp_idle";
description "neighbor is in Idle state";
}
enum connect {
tailf:code-name "bgp_connect";
description "neighbor is in Connect state";
}
enum active {
tailf:code-name "bgp_active";
description "neighbor is in Active state";
}
enum opensent {
tailf:code-name "bgp_opensent";
description "neighbor is in OpenSent state";
}
enum openconfirm {
tailf:code-name "bgp_openconfirm";
description "neighbor is in OpenConfirm state";
}
enum established {
tailf:code-name "bgp_established";
description "neighbor is in Established state";
}
enum nonnegotiated {
tailf:code-name "bgp_nonnegotiated";
description "neighbor is Non Negotiated";
}
}
}
typedef tcp-fsm-state {
type enumeration {
enum closed {
description
"no connection";
}
enum listen {
description
"waiting for a connection request from any remote TCP";
}
enum synsent {
description
"waiting for a matching connection request
after having sent a connection request";
}
enum synrcvd {
description
"waiting for a confirming connection request acknowledgment
after having both received and sent a connection request";
}
enum established {
description
"connection established";
}
enum finwait1 {
description
"waiting for a connection termination request
from the remote TCP, or an acknowledgment of
the connection termination request previously sent";
}
enum finwait2 {
description
"waiting for a connection termination request from the
remote TCP";
}
enum closewait {
description
"waiting for a connection termination request from
the local use";
}
enum lastack {
description
"waiting for an acknowledgment of the connection termination
request previously sent to the remote TCP";
}
enum closing {
description
"waiting for a connection termination request acknowledgment
from the remote";
}
enum timewait {
description
"waiting for enough time to pass to be sure the remote TCP
received the acknowledgment of its connection termination
request";
}
}
}
typedef bgp-route-option {
type enumeration {
enum bgp-all-routes {
description
"All entries";
}
enum bgp-cidr-only-routes {
description
"CIDR ONLY route entries";
}
enum bgp-dampened-routes {
description
"Dampened route entries";
}
enum bgp-rib-fail-routes {
description
"Rib failure routes";
}
enum bgp-injected-routes {
description
"Injected route entries";
}
enum bgp-pending-routes {
description
"prefixes pending deletion";
}
enum bgp-inconsistent-routes {
description
"inconsistency paths";
}
}
}
grouping route-entries {
container networks {
list network {
key "prefix";
leaf prefix {
//type inet:ip-prefix;
type string;
}
leaf next-hop {
type string;
}
leaf metric {
type uint32;
}
leaf local-preference {
type uint32;
}
leaf weight {
type uint32;
}
leaf path {
type string;
}
leaf origin-code {
type enumeration {
enum igp;
enum egp;
enum incomplete;
}
}
container status-codes {
leaf "suppressed" {
type empty;
}
leaf "damped" {
type empty;
}
leaf "history" {
type empty;
}
leaf "valid" {
type empty;
}
leaf "best" {
type empty;
}
leaf "internal" {
type empty;
}
leaf "rib-failure" {
type empty;
}
leaf "stale" {
type empty;
}
leaf "multipath" {
type empty;
}
leaf "backup-path" {
type empty;
}
leaf "rt-filter" {
type empty;
}
leaf "best-external" {
type empty;
}
leaf "additional-path" {
type empty;
}
leaf "rib-compressed" {
type empty;
}
leaf "rpki-status" {
type enumeration {
enum valid {
tailf:code-name "rpki_valid";
}
enum invalid {
tailf:code-name "rpki_invalid";
}
enum not-found;
}
}
}
}
}
}
grouping bgp-prefix-counters {
leaf current-prefixes {
type uint64;
description
"Current number of prefixes accepted";
}
leaf total-prefixes {
type uint64;
description
"Total number of prefixes accepted";
}
leaf implicit-withdraw {
type uint64;
description
"number of times that a prefix has been withdrawn
and readvertised";
}
leaf explicit-withdraw {
type uint64;
description
"Number of times that a prefix has been withdrawn
because it is no longer feasible";
}
leaf bestpaths {
type uint64;
description
"Number of received prefixes installed as best paths";
}
leaf multipaths {
type uint64;
description
"Number of received prefixes installed as multipaths";
}
}
grouping bgp-af-prefix-activity {
container prefix-activity {
description
"Prefix statistics for an address family";
container sent {
uses bgp-prefix-counters;
}
container received {
uses bgp-prefix-counters;
}
}
}
grouping bgp-negotiated-capabilities {
description
"Information for bgp neighbor session negotiated
capabilities";
leaf-list negotiated-cap {
type string;
}
}
grouping bgp-message-counters {
description
"Information for BGP message counters";
leaf opens {
type uint32;
description
"OPEN messages";
}
leaf updates {
type uint32;
description
"UPDATE messages";
}
leaf notifications {
type uint32;
description
"NOTIFICATION messages";
}
leaf keepalives {
type uint32;
description
"KEEPALIVE messages";
}
leaf route-refreshes {
type uint32;
description
"Route refresh messages";
}
}
grouping bgp-negotiated-keepalive-timers{
description
"Information for neigotiated keepalive timers";
container negotiated-keepalive-timers {
leaf hold-time {
type uint16;
description
"Hold time";
}
leaf keepalive-interval {
type uint16;
description
"keepalive interval";
}
}
}
grouping bgp-neighbor-counters {
description
"Information for bgp session counters";
container messages {
container sent {
uses bgp-message-counters;
}
container received {
uses bgp-message-counters;
}
}
container queue {
leaf inq-depth {
type uint32;
description "Input Q depth";
}
leaf outq-depth {
type uint32;
description "Output Q depth";
}
}
}
grouping bgp-session-transport {
description "BGP neighbor session TCP state";
container connection {
leaf state {
description
"TCP FSM state";
type tcp-fsm-state;
}
leaf mode {
type enumeration {
enum active {
description
"active connection";
}
enum passive {
description
"passive connection";
}
}
}
leaf total_established {
type uint32;
description
"number of times a TCP and BGP connection has been
successfully established";
}
leaf total_dropped {
type uint32;
description
"number of times that a valid session has failed
or been taken down";
}
leaf last-reset {
type string;
description
"since the peering session was last reset";
}
leaf reset-reason {
type string;
description
"The reason for the last reset";
}
}
container transport {
leaf path-mtu-discovery {
type boolean;
}
leaf local-port {
type uint32 ;
description
"Local TCP port used for TCP session";
}
leaf local-host {
type inet:ip-address;
description
"Local address used for the TCP session";
}
leaf foreign-port {
type uint32;
description
"Remote port used by the peer for the TCP session";
}
leaf foreign-host {
type inet:ip-address;
description
"Remote address to which the BGP session has
established";
}
leaf mss {
type uint32;
description
"Maximum Data segment size";
}
}
}
grouping bgp-session-state {
description "bgp neighbor session state of FSM";
leaf session-state {
type bgp-fsm-state;
}
}
grouping bgp-neighbor-summary {
description
"Summary of neighbor";
container neighbors {
list neighbor-state {
key "id";
leaf id {
type string;
}
leaf bgp-version {
type uint32;
}
leaf messages-received {
type uint64;
}
leaf messages-sent {
type uint64;
}
leaf table-version {
type uint64;
}
leaf input-queue {
type uint64;
}
leaf output-queue {
type uint64;
}
leaf up-time {
type string;
}
leaf state {
type bgp-fsm-state;
}
leaf prefixes-received {
type uint64;
}
}
}
}
grouping bgp-neighbor-state {
leaf description {
type string;
}
leaf bgp-version {
type uint16;
description
"BGP version being used to communicate with the
remote router";
}
leaf link {
type enumeration {
enum internal {
tailf:code-name "link_internal";
description "iBGP neighbors";
}
enum external {
tailf:code-name "link_external";
description "eBGP neighbors";
}
}
}
leaf up-time {
type string;
description
"How long the bgp session has been up since
the sessioin was established";
}
leaf last-write {
type string;
description
"since BGP last sent a message from this neighbor";
}
leaf last-read {
type string;
description
"since BGP last received a message to this neighbor";
}
leaf installed-prefixes {
type uint32;
description
"number of installed prefixes";
}
uses bgp-session-state;
uses bgp-negotiated-keepalive-timers;
uses bgp-negotiated-capabilities;
uses bgp-neighbor-counters;
uses bgp-session-transport;
}
grouping bgp-af-route-entries {
container bgp-routes {
list route-entries {
key "afi-safi route-option vrf-name";
leaf afi-safi {
type identityref {
base afi-safi;
}
}
leaf route-option {
type bgp-route-option;
}
leaf vrf-name {
type string;
}
//leaf table-version {
// type uint64;
// description
// "BGP table version number.";
//}
//leaf router-id {
// type string;
//}
uses route-entries {
when "(afi-safi = 'bgps:ipv4-unicast') or " +
"(afi-safi = 'bgps:ipv6-unicast') or " +
"(afi-safi = 'bgps:rtfilter-unicast') or " +
"(afi-safi = 'bgps:nsap-unicast') or " +
"(afi-safi = 'bgps:ipv6-multicast') or " +
"(afi-safi = 'bgps:ipv4-multicast')";
}
}
}
}
grouping bgp-address-family-summary {
container af-summary {
description
"Summary of address familiy";
leaf router-id {
type inet:ip-address;
}
container version {
leaf bgp-table {
type uint64;
description
"BGP table version number";
}
leaf routing-table {
type uint64;
description
"Routing table version number";
}
}
container prefixes {
leaf total-entries {
description
"total prefix entires";
type uint64;
}
leaf memory-usage {
type uint64;
description
"total memory usage in byte";
}
}
container path {
leaf total-entries {
type uint64;
}
leaf memory-usage {
type uint64;
}
}
container as-path {
leaf total-entries {
type uint64;
}
leaf memory-usage {
type uint64;
}
}
container route-map {
leaf total-entries {
type uint64;
}
leaf memory-usage {
type uint64;
}
}
container filter-list {
leaf total-entries {
type uint64;
}
leaf memory-usage {
type uint64;
}
}
container activities {
description
"BGP activity information";
leaf prefixes {
type uint64;
}
leaf paths {
type uint64;
}
leaf scan-interval {
description "scan interval in second";
type string;
}
}
leaf total-memory {
type uint64;
}
uses bgp-neighbor-summary;
}
}
grouping bgp-address-family-state {
description
"Operational state relevant to address-family";
container address-families {
list address-family {
key "afi-safi vrf-name";
leaf afi-safi {
type identityref {
base afi-safi;
}
}
leaf vrf-name {
type string;
}
uses bgp-address-family-summary;
}
}
}
grouping bgp-global-neighbor-state {
container neighbors {
description
"Operational state relevent to bgp
global neighbor";
list neighbor {
key "afi-safi vrf-name neighbor-id";
leaf afi-safi {
type string;
}
leaf vrf-name {
type string;
}
leaf neighbor-id {
type string;
}
uses bgp-neighbor-state;
uses bgp-af-prefix-activity;
}
}
}
container bgp-state {
config false;
description
"Data nodes for BGP entries.";
uses bgp-global-neighbor-state;
uses bgp-address-family-state;
uses bgp-af-route-entries;
}
}