idnits 2.17.1 draft-ietf-i2rs-rib-data-model-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 4 instances of too long lines in the document, the longest one being 15 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (February 11, 2018) is 2265 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-06) exists of draft-ietf-netmod-yang-tree-diagrams-04 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 6536 (Obsoleted by RFC 8341) == Outdated reference: A later version (-17) exists of draft-ietf-i2rs-rib-info-model-13 Summary: 3 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group L. Wang 3 Internet-Draft Individual 4 Intended status: Standards Track M. Chen 5 Expires: August 15, 2018 Huawei 6 A. Dass 7 Ericsson 8 H. Ananthakrishnan 9 Packet Design 10 S. Kini 11 Individual 12 N. Bahadur 13 Bracket Computing 14 February 11, 2018 16 A YANG Data Model for Routing Information Base (RIB) 17 draft-ietf-i2rs-rib-data-model-10 19 Abstract 21 This document defines a YANG data model for Routing Information Base 22 (RIB) that aligns with the I2RS RIB information model. 24 Requirements Language 26 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 27 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 28 document are to be interpreted as described in RFC 2119 [RFC2119]. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at https://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on August 15, 2018. 47 Copyright Notice 49 Copyright (c) 2018 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents 54 (https://trustee.ietf.org/license-info) in effect on the date of 55 publication of this document. Please review these documents 56 carefully, as they describe your rights and restrictions with respect 57 to this document. Code Components extracted from this document must 58 include Simplified BSD License text as described in Section 4.e of 59 the Trust Legal Provisions and are provided without warranty as 60 described in the Simplified BSD License. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 65 1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 66 1.2. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 3 67 2. Model Structure . . . . . . . . . . . . . . . . . . . . . . . 3 68 2.1. RIB Capability . . . . . . . . . . . . . . . . . . . . . 7 69 2.2. Routing Instance and Rib . . . . . . . . . . . . . . . . 7 70 2.3. Route . . . . . . . . . . . . . . . . . . . . . . . . . . 8 71 2.4. Nexthop . . . . . . . . . . . . . . . . . . . . . . . . . 9 72 2.5. RPC Operations . . . . . . . . . . . . . . . . . . . . . 14 73 2.6. Notifications . . . . . . . . . . . . . . . . . . . . . . 18 74 3. YANG Modules . . . . . . . . . . . . . . . . . . . . . . . . 20 75 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 64 76 5. Security Considerations . . . . . . . . . . . . . . . . . . . 64 77 6. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 65 78 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 66 79 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 66 80 8.1. Normative References . . . . . . . . . . . . . . . . . . 66 81 8.2. Informative References . . . . . . . . . . . . . . . . . 67 82 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 67 84 1. Introduction 86 The Interface to the Routing System (I2RS) [RFC7921] provides read 87 and write access to the information and state within the routing 88 process that exists inside the routing elements, this is achieved via 89 protocol message exchange between I2RS clients and I2RS agents 90 associated with the routing system. One of the functions of I2RS is 91 to read and write data of Routing Information Base (RIB). 92 [I-D.ietf-i2rs-usecase-reqs-summary] introduces a set of RIB use 93 cases. The RIB information model is defined in 94 [I-D.ietf-i2rs-rib-info-model]. 96 This document defines a YANG [RFC6020][RFC6991] data model for the 97 RIB that satisfies the RIB use cases and aligns with the RIB 98 information model. 100 1.1. Definitions and Acronyms 102 RIB: Routing Information Base 104 Information Model (IM): An abstract model of a conceptual domain, 105 independent of a specific implementation or data representation. 107 1.2. Tree Diagrams 109 YANG tree diagrams provide a concise representation of a YANG module, 110 and SHOULD be included to help readers understand YANG module 111 structure. Guidelines on tree diagrams can be found in Section 3 of 112 [I-D.ietf-netmod-yang-tree-diagrams]. 114 2. Model Structure 116 The following figure shows an overview of structure tree of the ietf- 117 i2rs-rib module. To give a whole view of the structure tree, some 118 details of the tree are omitted. The relevant details are introduced 119 in the subsequent sub-sections. 121 module: ietf-i2rs-rib 122 +--rw routing-instance 123 +--rw name string 124 +--rw interface-list* [name] 125 | +--rw name if:interface-ref 126 +--rw router-id? yang:dotted-quad 127 +--rw lookup-limit? uint8 128 +--rw rib-list* [name] 129 +--rw name string 130 +--rw address-family rib-family-definition 131 +--rw ip-rpf-check? boolean 132 +--rw route-list* [route-index] 133 | +--rw route-index uint64 134 | +--rw match 135 | | +--rw (route-type)? 136 | | +--:(ipv4) 137 | | | ... 138 | | +--:(ipv6) 139 | | | ... 140 | | +--:(mpls-route) 141 | | | ... 142 | | +--:(mac-route) 143 | | | ... 145 | | +--:(interface-route) 146 | | ... 147 | +--rw nexthop 148 | | +--rw nexthop-id? uint32 149 | | +--rw sharing-flag? boolean 150 | | +--rw (nexthop-type)? 151 | | +--:(nexthop-base) 152 | | | ... 153 | | +--:(nexthop-chain) {nexthop-chain}? 154 | | | ... 155 | | +--:(nexthop-replicates) {nexthop-replicates}? 156 | | | ... 157 | | +--:(nexthop-protection) {nexthop-protection}? 158 | | | ... 159 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 160 | | ... 161 | +--rw route-status 162 | | ... 163 | +--rw route-attributes 164 | | ... 165 | +--rw route-vendor-attributes 166 +--rw nexthop-list* [nexthop-member-id] 167 +--rw nexthop-member-id uint32 168 rpcs: 169 +---x rib-add 170 | +---w input 171 | | +---w name string 172 | | +---w address-family rib-family-definition 173 | | +---w ip-rpf-check? boolean 174 | +--ro output 175 | +--ro result uint32 176 | +--ro reason? string 177 +---x rib-delete 178 | +---w input 179 | | +---w name string 180 | +--ro output 181 | +--ro result uint32 182 | +--ro reason? string 183 +---x route-add 184 | +---w input 185 | | +---w return-failure-detail? boolean 186 | | +---w rib-name string 187 | | +---w routes 188 | | +---w route-list* [route-index] 189 | | ... 190 | +--ro output 191 | +--ro success-count uint32 192 | +--ro failed-count uint32 193 | +--ro failure-detail 194 | +--ro failed-routes* [route-index] 195 | +--ro route-index uint32 196 | +--ro error-code? uint32 197 +---x route-delete 198 | +---w input 199 | | +---w return-failure-detail? boolean 200 | | +---w rib-name string 201 | | +---w routes 202 | | +---w route-list* [route-index] 203 | | ... 204 | +--ro output 205 | +--ro success-count uint32 206 | +--ro failed-count uint32 207 | +--ro failure-detail 208 | +--ro failed-routes* [route-index] 209 | +--ro route-index uint32 210 | +--ro error-code? uint32 211 +---x route-update 212 | +---w input 213 | | +---w return-failure-detail? boolean 214 | | +---w rib-name string 215 | | +---w (match-options)? 216 | | +--:(match-route-prefix) 217 | | | ... 218 | | +--:(match-route-attributes) 219 | | | ... 220 | | +--:(match-route-vendor-attributes) {...}? 221 | | | ... 222 | | +--:(match-nexthop) 223 | | ... 224 | +--ro output 225 | +--ro success-count uint32 226 | +--ro failed-count uint32 227 | +--ro failure-detail 228 | +--ro failed-routes* [route-index] 229 | +--ro route-index uint32 230 | +--ro error-code? uint32 231 +---x nh-add 232 | +---w input 233 | | +---w rib-name string 234 | | +---w nexthop-id? uint32 235 | | +---w sharing-flag? boolean 236 | | +---w (nexthop-type)? 237 | | +--:(nexthop-base) 238 | | | ... 239 | | +--:(nexthop-chain) {nexthop-chain}? 240 | | | ... 242 | | +--:(nexthop-replicates) {nexthop-replicates}? 243 | | | ... 244 | | +--:(nexthop-protection) {nexthop-protection}? 245 | | | ... 246 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 247 | | ... 248 | +--ro output 249 | +--ro result uint32 250 | +--ro reason? string 251 | +--ro nexthop-id? uint32 252 +---x nh-delete 253 +---w input 254 | +---w rib-name string 255 | +---w nexthop-id? uint32 256 | +---w sharing-flag? boolean 257 | +---w (nexthop-type)? 258 | +--:(nexthop-base) 259 | | ... 260 | +--:(nexthop-chain) {nexthop-chain}? 261 | | ... 262 | +--:(nexthop-replicates) {nexthop-replicates}? 263 | | ... 264 | +--:(nexthop-protection) {nexthop-protection}? 265 | | ... 266 | +--:(nexthop-load-balance) {nexthop-load-balance}? 267 | ... 268 +--ro output 269 +--ro result uint32 270 +--ro reason? string 271 notifications: 272 +---n nexthop-resolution-status-change 273 | +--ro nexthop 274 | | +--ro nexthop-id? uint32 275 | | +--ro sharing-flag? boolean 276 | | +--ro (nexthop-type)? 277 | | +--:(nexthop-base) 278 | | | ... 279 | | +--:(nexthop-chain) {nexthop-chain}? 280 | | | ... 281 | | +--:(nexthop-replicates) {nexthop-replicates}? 282 | | | ... 283 | | +--:(nexthop-protection) {nexthop-protection}? 284 | | | ... 285 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 286 | | ... 287 | +--ro nexthop-state nexthop-state-definition 288 +---n route-change 289 +--ro rib-name string 290 +--ro address-family rib-family-definition 291 +--ro route-index uint64 292 +--ro match 293 | +--ro (route-type)? 294 | +--:(ipv4) 295 | | ... 296 | +--:(ipv6) 297 | | ... 298 | +--:(mpls-route) 299 | | ... 300 | +--:(mac-route) 301 | | ... 302 | +--:(interface-route) 303 | ... 304 +--ro route-installed-state route-installed-state-definition 305 +--ro route-state route-state-definition 306 +--ro route-change-reason route-reason-definition 308 Figure 1: Overview of I2RS RIB Module Structure 310 2.1. RIB Capability 312 RIB capability negotiation is very important because not all of the 313 hardware will be able to support all kinds of nexthops and there 314 might be a limitation on how many levels of lookup can be practically 315 performed. Therefore, a RIB data model MUST specify a way for an 316 external entity to learn about the functional capabilities of a 317 network device. 319 At the same time, nexthop chains can be used to specify multiple 320 headers over a packet, before that particular packet is forwarded. 321 Not every network device will be able to support all kinds of nexthop 322 chains along with the arbitrary number of headers which are chained 323 together. The RIB data model MUST provide a way to expose the 324 nexthop chaining capability supported by a given network device. 326 This module uses the feature and if-feature statements to achieve 327 above capability advertisement. 329 2.2. Routing Instance and Rib 331 A routing instance, in the context of the RIB information model, is a 332 collection of RIBs, interfaces, and routing protocol parameters. A 333 routing instance creates a logical slice of the router and can allow 334 multiple different logical slices, across a set of routers, to 335 communicate with each other. The routing protocol parameters control 336 the information available in the RIBs. More detail about routing 337 instance can be found in Section 2.2 of 338 [I-D.ietf-i2rs-rib-info-model]. 340 For a routing instance, there can be multiple RIBs. Therefore, this 341 model uses "list" to express the RIBs. The structure tree is shown 342 below: 344 +--rw routing-instance 345 +--rw name string 346 +--rw interface-list* [name] 347 | +--rw name if:interface-ref 348 +--rw router-id? yang:dotted-quad 349 +--rw lookup-limit? uint8 350 +--rw rib-list* [name] 351 +--rw name string 352 +--rw address-family rib-family-definition 353 +--rw ip-rpf-check? boolean 354 +--rw route-list* [route-index] 355 ... (refer to Section 2.3) 357 Figure 2: Routing Instance Structure 359 2.3. Route 361 A route is essentially a match condition and an action following that 362 match. The match condition specifies the kind of route (e.g., IPv4, 363 MPLS, MAC, Interface etc.) and the set of fields to match on. 365 According to the definition in [I-D.ietf-i2rs-rib-info-model], a 366 route MUST associate with the following attributes: 368 o ROUTE_PREFERENCE: See Section 2.3 of 369 [I-D.ietf-i2rs-rib-info-model]. 371 o ACTIVE: Indicates whether a route has at least one fully resolved 372 nexthop and is therefore eligible for installation in the FIB. 374 o INSTALLED: Indicates whether the route got installed in the FIB. 376 In addition, a route can be associated with one or more optional 377 route attributes (e.g., route-vendor-attributes). 379 A RIB will have a number of routes, so the routes are expressed as a 380 list under a specific RIB. Each RIB has its own route list. 382 +--rw route-list* [route-index] 383 +--rw route-index uint64 384 +--rw match 385 | +--rw (route-type)? 386 | +--:(ipv4) 387 | | +--rw ipv4 388 | | +--rw (ip-route-match-type)? 389 | | +--:(dest-ipv4-address) 390 | | | ... 391 | | +--:(src-ipv4-address) 392 | | | ... 393 | | +--:(dest-src-ipv4-address) 394 | | ... 395 | +--:(ipv6) 396 | | +--rw ipv6 397 | | +--rw (ip-route-match-type)? 398 | | +--:(dest-ipv6-address) 399 | | | ... 400 | | +--:(src-ipv6-address) 401 | | | ... 402 | | +--:(dest-src-ipv6-address) 403 | | ... 404 | +--:(mpls-route) 405 | | +--rw mpls-label uint32 406 | +--:(mac-route) 407 | | +--rw mac-address uint32 408 | +--:(interface-route) 409 | +--rw interface-identifier if:interface-ref 410 +--rw nexthop 411 | ...(refer to Section 2.4) 413 Figure 3: Routes Structure 415 2.4. Nexthop 417 A nexthop represents an object resulting from a route lookup. As 418 illustrated in Section 2.4 of [I-D.ietf-i2rs-rib-info-model], to 419 support various use cases (e.g., load balance, protection, multicast 420 or a combination of them), the nexthop is modeled as a multi-level 421 structure and supports recursion. The first level of the nexthop 422 includes the following four types: 424 o Base: The "base" nexthop is the foundation of all other nexthop 425 types. It includes the follow basic nexthops: 427 * nexthop-id 429 * IPv4 address 430 * IPv6 address 432 * egress-interface 434 * egress-interface with IPv4 address 436 * egress-interface with IPv6 address 438 * egress-interface with MAC address 440 * logical-tunnel 442 * tunnel-encapsulation 444 * tunnel-decapsulation 446 * rib-name 448 o Chain: Provide a way to perform multiple operations on a packet by 449 logically combining them. 451 o Load-balance: Designed for load-balance case where it normally 452 will have multiple weighted nexthops. 454 o Protection: Designed for protection scenario where it normally 455 will have primary and standby nexthop. 457 o Replicate: Designed for multiple destinations forwarding. 459 The structure tree of nexthop is shown in the following figures. 461 +--rw nexthop 462 | +--rw nexthop-id? uint32 463 | +--rw sharing-flag? boolean 464 | +--rw (nexthop-type)? 465 | +--:(nexthop-base) 466 | | ...(refer to Figure 5) 467 | +--:(nexthop-chain) {nexthop-chain}? 468 | | +--rw nexthop-chain 469 | | +--rw nexthop-list* [nexthop-member-id] 470 | | +--rw nexthop-member-id uint32 471 | +--:(nexthop-replicates) {nexthop-replicates}? 472 | | +--rw nexthop-replicates 473 | | +--rw nexthop-list* [nexthop-member-id] 474 | | +--rw nexthop-member-id uint32 475 | +--:(nexthop-protection) {nexthop-protection}? 476 | | +--rw nexthop-protection 477 | | +--rw nexthop-list* [nexthop-member-id] 478 | | +--rw nexthop-member-id uint32 479 | | +--rw nexthop-preference nexthop-preference-definition 480 | +--:(nexthop-load-balance) {nexthop-load-balance}? 481 | +--rw nexthop-lb 482 | +--rw nexthop-list* [nexthop-member-id] 483 | +--rw nexthop-member-id uint32 484 | +--rw nexthop-lb-weight nexthop-lb-weight-definition 486 Figure 4: Nexthop Structure 488 Figure 5 (as shown blow) is a sub-tree of nexthop, it's under the 489 nexthop base node and shows that structure of the "base" nexthop. 491 +--:(nexthop-base) 492 | +--rw nexthop-base 493 | +--rw (nexthop-base-type)? 494 | +--:(special-nexthop) 495 | | +--rw special? special-nexthop-definition 496 | +--:(egress-interface-nexthop) 497 | | +--rw outgoing-interface if:interface-ref 498 | +--:(ipv4-address-nexthop) 499 | | +--rw ipv4-address inet:ipv4-address 500 | +--:(ipv6-address-nexthop) 501 | | +--rw ipv6-address inet:ipv6-address 502 | +--:(egress-interface-ipv4-nexthop) 503 | | +--rw egress-interface-ipv4-address 504 | | +--rw outgoing-interface if:interface-ref 505 | | +--rw ipv4-address inet:ipv4-address 506 | +--:(egress-interface-ipv6-nexthop) 507 | | +--rw egress-interface-ipv6-address 508 | | +--rw outgoing-interface if:interface-ref 509 | | +--rw ipv6-address inet:ipv6-address 510 | +--:(egress-interface-mac-nexthop) 511 | | +--rw egress-interface-mac-address 512 | | +--rw outgoing-interface if:interface-ref 513 | | +--rw ieee-mac-address uint32 514 | +--:(tunnel-encap-nexthop) {nexthop-tunnel}? 515 | | +--rw tunnel-encap 516 | | +--rw (tunnel-type)? 517 | | +--:(ipv4) {ipv4-tunnel}? 518 | | | +--rw ipv4-header 519 | | | +--rw src-ipv4-address inet:ipv4-address 520 | | | +--rw dest-ipv4-address inet:ipv4-address 521 | | | +--rw protocol uint8 522 | | | +--rw ttl? uint8 523 | | | +--rw dscp? uint8 524 | | +--:(ipv6) {ipv6-tunnel}? 525 | | | +--rw ipv6-header 526 | | | +--rw src-ipv6-address inet:ipv6-address 527 | | | +--rw dest-ipv6-address inet:ipv6-address 528 | | | +--rw next-header uint8 529 | | | +--rw traffic-class? uint8 530 | | | +--rw flow-label? uint16 531 | | | +--rw hop-limit? uint8 532 | | +--:(mpls) {mpls-tunnel}? 533 | | | +--rw mpls-header 534 | | | +--rw label-operations* [label-oper-id] 535 | | | +--rw label-oper-id uint32 536 | | | +--rw (label-actions)? 537 | | | +--:(label-push) 538 | | | | +--rw label-push 539 | | | | +--rw label uint32 540 | | | | +--rw s-bit? boolean 541 | | | | +--rw tc-value? uint8 542 | | | | +--rw ttl-value? uint8 543 | | | +--:(label-swap) 544 | | | +--rw label-swap 545 | | | +--rw in-label uint32 546 | | | +--rw out-label uint32 547 | | | +--rw ttl-action? ttl-action-definition 548 | | +--:(gre) {gre-tunnel}? 549 | | | +--rw gre-header 550 | | | +--rw (dest-address-type)? 551 | | | | +--:(ipv4) 552 | | | | | +--rw ipv4-dest inet:ipv4-address 553 | | | | +--:(ipv6) 554 | | | | +--rw ipv6-dest inet:ipv6-address 555 | | | +--rw protocol-type uint16 556 | | | +--rw key? uint64 557 | | +--:(nvgre) {nvgre-tunnel}? 558 | | | +--rw nvgre-header 559 | | | +--rw (nvgre-type)? 560 | | | | +--:(ipv4) 561 | | | | | +--rw src-ipv4-address inet:ipv4-address 562 | | | | | +--rw dest-ipv4-address inet:ipv4-address 563 | | | | | +--rw protocol uint8 564 | | | | | +--rw ttl? uint8 565 | | | | | +--rw dscp? uint8 566 | | | | +--:(ipv6) 567 | | | | +--rw src-ipv6-address inet:ipv6-address 568 | | | | +--rw dest-ipv6-address inet:ipv6-address 569 | | | | +--rw next-header uint8 570 | | | | +--rw traffic-class? uint8 571 | | | | +--rw flow-label? uint16 572 | | | | +--rw hop-limit? uint8 573 | | | +--rw virtual-subnet-id uint32 574 | | | +--rw flow-id? uint16 575 | | +--:(vxlan) {vxlan-tunnel}? 576 | | +--rw vxlan-header 577 | | +--rw (vxlan-type)? 578 | | | +--:(ipv4) 579 | | | | +--rw src-ipv4-address inet:ipv4-address 580 | | | | +--rw dest-ipv4-address inet:ipv4-address 581 | | | | +--rw protocol uint8 582 | | | | +--rw ttl? uint8 583 | | | | +--rw dscp? uint8 584 | | | +--:(ipv6) 585 | | | +--rw src-ipv6-address inet:ipv6-address 586 | | | +--rw dest-ipv6-address inet:ipv6-address 587 | | | +--rw next-header uint8 588 | | | +--rw traffic-class? uint8 589 | | | +--rw flow-label? uint16 590 | | | +--rw hop-limit? uint8 591 | | +--rw vxlan-identifier uint32 592 | +--:(tunnel-decapsulation-nexthop) {nexthop-tunnel}? 593 | | +--rw tunnel-decapsulation 594 | | +--rw (tunnel-type)? 595 | | +--:(ipv4) {ipv4-tunnel}? 596 | | | +--rw ipv4-decapsulation 597 | | | +--rw ipv4-decapsulation tunnel-decapsulation-action-definition 598 | | | +--rw ttl-action? ttl-action-definition 599 | | +--:(ipv6) {ipv6-tunnel}? 600 | | | +--rw ipv6-decapsulation 601 | | | +--rw ipv6-decapsulation tunnel-decapsulation-action-definition 602 | | | +--rw hop-limit-action? hop-limit-action-definition 603 | | +--:(mpls) {mpls-tunnel}? 604 | | +--rw label-pop 605 | | +--rw label-pop mpls-label-action-definition 606 | | +--rw ttl-action? ttl-action-definition 607 | +--:(logical-tunnel-nexthop) {nexthop-tunnel}? 608 | | +--rw logical-tunnel 609 | | +--rw tunnel-type tunnel-type-definition 610 | | +--rw tunnel-name string 611 | +--:(rib-name-nexthop) 612 | | +--rw rib-name? string 613 | +--:(nexthop-identifier) 614 | +--rw nexthop-ref nexthop-ref 616 Figure 5: Nexthop Base Structure 618 2.5. RPC Operations 620 This module defines the following RPC operations: 622 o rib-add: Add a RIB to a routing instance. A name of the RIB, 623 address family of the RIB and (optionally) whether the RPF check 624 is enabled are passed as the input parameters. The output is the 625 result of the add operation: 627 * true - success; 629 * false - failed; when failed, the i2rs agent may return the 630 specific reason that causes the failure. 632 o rib-delete: Delete a RIB from a routing instance. When a RIB is 633 deleted, all routes installed in the RIB will be deleted. A name 634 of the RIB is passed as the input parameter. The output is the 635 result of the delete operation: 637 * true - success; 639 * false - failed; when failed, the i2rs agent may return the 640 specific reason that causes the failure. 642 o route-add: Add a route or a set of routes to a RIB. A RIB name, 643 the route prefix(es), route attributes, route vendor attributes, 644 nexthop and whether return failure detail are passed as the input 645 parameters. Before calling the route-add rpc, it is required to 646 call the nh-add rpc to create and/or return the nexthop identifier 647 but during situations when the nexthop already exists and the 648 nexthop-id is known, this action is not expected.. The output is a 649 combination of the route operation states while querying the 650 appropriate node in the data tree that include: 652 * success-count: the number of routes that were successfully 653 added; 655 * failed-count: the number of the routes that failed to be added; 657 * failure-detail: shows the specific routes that failed to be 658 added. 660 o route-delete: Delete a route or a set of routes from a RIB. A 661 name of the RIB, the route prefix(es) and whether to return 662 failure detail are passed as the input parameters. The output is 663 a combination of route operation states that include: 665 * success-count: the number of routes that were successfully 666 deleted; 668 * failed-count: the number of the routes that failed to be 669 deleted; 671 * failure-detail: shows the specific routes that failed to be 672 deleted. 674 o route-update: Update a route or a set of routes. A RIB name, the 675 route prefix(es), or route attributes, or route vendor attributes, 676 or nexthop are passed as the input parameters. The match 677 conditions can be either route prefix(es), or route attributes, or 678 route vendor attributes, or nexthop. The update actions include: 679 update the nexthop, update the route attributes, update the route 680 vendor attributes. The output is combination of the route 681 operation states that include: 683 * success-count: the number of routes that were successfully 684 updated; 686 * failed-count: the number of the routes that failed to be 687 updated; 689 * failure-detail: shows the specific routes that failed to be 690 updated. 692 o nh-add: Add a nexthop to a RIB. A name of the RIB and a nexthop 693 are passed as the input parameters. The network node is required 694 to allocate a nexthop identifier to the nexthop. The outputs 695 include the result of the nexthop add operation. 697 * true - success; when success, a nexthop identifier will be 698 returned to the i2rs client. 700 * false - failed; when failed, the i2rs agent may return the 701 specific reason that causes the failure. 703 o nh-delete: Delete a nexthop from a RIB. A name of a RIB and a 704 nexthop or nexthop identifier are passed as the input parameters. 705 The output is the result of the delete operation: 707 * true - success; 709 * false - failed; when failed, the i2rs agent may return the 710 specific reason that causes the failure. 712 The structure tree of rpcs is shown in following figure. 714 rpcs: 715 +---x rib-add 716 | +---w input 717 | | +---w rib-name string 718 | | +---w address-family rib-family-definition 719 | | +---w ip-rpf-check? boolean 720 | +--ro output 721 | +--ro result uint32 722 | +--ro reason? string 723 +---x rib-delete 724 | +---w input 725 | | +---w rib-name string 726 | +--ro output 727 | +--ro result uint32 728 | +--ro reason? string 729 +---x route-add 730 | +---w input 731 | | +---w return-failure-detail? boolean 732 | | +---w rib-name string 733 | | +---w routes 734 | | +---w route-list* [route-index] 735 | | ... 736 | +--ro output 737 | +--ro success-count uint32 738 | +--ro failed-count uint32 739 | +--ro failure-detail 740 | +--ro failed-routes* [route-index] 741 | +--ro route-index uint32 742 | +--ro error-code? uint32 743 +---x route-delete 744 | +---w input 745 | | +---w return-failure-detail? boolean 746 | | +---w rib-name string 747 | | +---w routes 748 | | +---w route-list* [route-index] 749 | | ... 750 | +--ro output 751 | +--ro success-count uint32 752 | +--ro failed-count uint32 753 | +--ro failure-detail 754 | +--ro failed-routes* [route-index] 755 | +--ro route-index uint32 756 | +--ro error-code? uint32 757 +---x route-update 758 | +---w input 759 | | +---w return-failure-detail? boolean 760 | | +---w rib-name string 761 | | +---w (match-options)? 762 | | +--:(match-route-prefix) 763 | | | ... 764 | | +--:(match-route-attributes) 765 | | | ... 766 | | +--:(match-route-vendor-attributes) {...}? 767 | | | ... 768 | | +--:(match-nexthop) 769 | | ... 770 | +--ro output 771 | +--ro success-count uint32 772 | +--ro failed-count uint32 773 | +--ro failure-detail 774 | +--ro failed-routes* [route-index] 775 | +--ro route-index uint32 776 | +--ro error-code? uint32 777 +---x nh-add 778 | +---w input 779 | | +---w rib-name string 780 | | +---w nexthop-id? uint32 781 | | +---w sharing-flag? boolean 782 | | +---w (nexthop-type)? 783 | | ... 784 | +--ro output 785 | +--ro result uint32 786 | +--ro reason? string 787 | +--ro nexthop-id? uint32 788 +---x nh-delete 789 +---w input 790 | +---w rib-name string 791 | +---w nexthop-id? uint32 792 | +---w sharing-flag? boolean 793 | +---w (nexthop-type)? 794 | ... 795 +--ro output 796 +--ro result uint32 797 +--ro reason? string 799 Figure 6: RPCs Structure 801 2.6. Notifications 803 Asynchronous notifications are sent by the RIB manager of a network 804 device to an external entity when some event triggers on the network 805 device. An implementation of this RIB data model MUST support 806 sending two kinds of asynchronous notifications. 808 1. Route change notification: 810 o Installed (Indicates whether the route got installed in the FIB) ; 812 o Active (Indicates whether a route has at least one fully resolved 813 nexthop and is therefore eligible for installation in the FIB) ; 815 o Reason - E.g. Not authorized 817 2. Nexthop resolution status notification 819 Nexthops can be fully resolved or an unresolved. 821 A resolved nexthop has an adequate level of information to send the 822 outgoing packet towards the destination by forwarding it on an 823 interface to a directly connected neighbor. 825 An unresolved nexthop is something that requires the RIB manager to 826 determine the final resolved nexthop. In one example, a nexthop 827 could be an IP address. The RIB manager would resolve how to reach 828 that IP address, e.g. by checking if that particular IP address is 829 reachable by regular IP forwarding or by a MPLS tunnel or by both. 830 If the RIB manager cannot resolve the nexthop, then the nexthop 831 remains in an unresolved state and is NOT a suitable candidate for 832 installation in the FIB. 834 An implementation of this RIB data model MUST support sending route- 835 change notifications whenever a route transitions between the 836 following states: 838 o from the active state to the inactive state 840 o from the inactive state to the active state 842 o from the installed state to the uninstalled state 843 o from the uninstalled state to the installed state 845 A single notification MAY be used when a route transitions from 846 inactive/uninstalled to active/installed or in the other direction. 848 The structure tree of notifications is shown in the following figure. 850 notifications: 851 +---n nexthop-resolution-status-change 852 | +--ro nexthop 853 | | +--ro nexthop-id uint32 854 | | +--ro sharing-flag boolean 855 | | +--ro (nexthop-type)? 856 | | +--:(nexthop-base) 857 | | | ... 858 | | +--:(nexthop-chain) {nexthop-chain}? 859 | | | ... 860 | | +--:(nexthop-replicates) {nexthop-replicates}? 861 | | | ... 862 | | +--:(nexthop-protection) {nexthop-protection}? 863 | | | ... 864 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 865 | | ... 866 | +--ro nexthop-state nexthop-state-definition 867 +---n route-change 868 +--ro rib-name string 869 +--ro address-family rib-family-definition 870 +--ro route-index uint64 871 +--ro match 872 | +--ro (route-type)? 873 | +--:(ipv4) 874 | | ... 875 | +--:(ipv6) 876 | | ... 877 | +--:(mpls-route) 878 | | ... 879 | +--:(mac-route) 880 | | ... 881 | +--:(interface-route) 882 | ... 883 +--ro route-installed-state route-installed-state-definition 884 +--ro route-state route-state-definition 885 +--ro route-change-reason route-change-reason-definition 887 Figure 7: Notifications Structure 889 3. YANG Modules 891 file "ietf-i2rs-rib@2017-12-05.yang" 893 module ietf-i2rs-rib { 894 yang-version 1.1; 895 namespace "urn:ietf:params:xml:ns:yang:ietf-i2rs-rib"; 896 // replace with iana namespace when assigned 897 prefix "iir"; 899 import ietf-inet-types { 900 prefix inet; 901 reference "RFC 6991"; 902 } 904 import ietf-interfaces { 905 prefix if; 906 reference "RFC 7223"; 907 } 909 import ietf-yang-types { 910 prefix yang; 911 reference "RFC 6991"; 912 } 914 organization 915 "IETF I2RS (Interface to Routing System) Working Group"; 916 contact 917 "WG Web: 918 WG List: 920 Editor: Lixing Wang 921 923 Editor: Mach(Guoyi) Chen 924 926 Editor: Amit Dass 927 929 Editor: Hariharan Ananthakrishnan 930 932 Editor: Sriganesh Kini 933 935 Editor: Nitin Bahadur 936 "; 938 description 939 "This module defines a YANG data model for 940 Routing Information Base (RIB) that aligns 941 with the I2RS RIB information model. 942 Copyright (c) <2018> IETF Trust and the persons 943 identified as authors of the code. All rights reserved."; 944 revision "2018-02-12" { 945 description "initial revision"; 946 reference "draft-ietf-i2rs-data-model-10"; 948 // RFC Ed.: replace XXXX with actual RFC number and remove 949 // this note 951 } 953 //Features 954 feature nexthop-tunnel { 955 description 956 "This feature means that a node supports 957 tunnel nexthop capability."; 958 } 960 feature nexthop-chain { 961 description 962 "This feature means that a node supports 963 chain nexthop capability."; 964 } 966 feature nexthop-protection { 967 description 968 "This feature means that a node supports 969 protection nexthop capability."; 970 } 972 feature nexthop-replicates { 973 description 974 "This feature means that a node supports 975 replicates nexthop capability."; 976 } 978 feature nexthop-load-balance { 979 description 980 "This feature means that a node supports 981 load balance nexthop capability."; 982 } 983 feature ipv4-tunnel { 984 description 985 "This feature means that a node supports 986 IPv4 tunnel encapsulation capability."; 987 } 989 feature ipv6-tunnel { 990 description 991 "This feature means that a node supports 992 IPv6 tunnel encapsulation capability."; 993 } 995 feature mpls-tunnel { 996 description 997 "This feature means that a node supports 998 MPLS tunnel encapsulation capability."; 999 } 1001 feature vxlan-tunnel { 1002 description 1003 "This feature means that a node supports 1004 VxLAN tunnel encapsulation capability."; 1005 } 1007 feature gre-tunnel { 1008 description 1009 "This feature means that a node supports 1010 GRE tunnel encapsulation capability."; 1011 } 1013 feature nvgre-tunnel { 1014 description 1015 "This feature means that a node supports 1016 NvGRE tunnel encapsulation capability."; 1017 } 1019 feature route-vendor-attributes { 1020 description 1021 "This feature means that a node supports 1022 route vendor attributes."; 1023 } 1025 //Identities and Type Definitions 1026 identity mpls-label-action { 1027 description 1028 "Base identity from which all MPLS label 1029 operations are derived. 1030 The MPLS label stack operations include: 1032 push - to add a new label to a label stack, 1033 pop - to pop the top label from a label stack, 1034 swap - to exchange the top label of a label 1035 stack with new label."; 1036 } 1038 identity label-push { 1039 base "mpls-label-action"; 1040 description 1041 "MPLS label stack operation: push."; 1042 } 1044 identity label-pop { 1045 base "mpls-label-action"; 1046 description 1047 "MPLS label stack operation: pop."; 1048 } 1050 identity label-swap { 1051 base "mpls-label-action"; 1052 description 1053 "MPLS label stack operation: swap."; 1054 } 1056 typedef mpls-label-action-definition { 1057 type identityref { 1058 base "mpls-label-action"; 1059 } 1060 description 1061 "MPLS label action definition."; 1062 } 1064 identity tunnel-decapsulation-action { 1065 description 1066 "Base identity from which all tunnel decapsulation 1067 actions are derived. 1068 Tunnel decapsulation actions include: 1069 ipv4-decapsulation - to decapsulate an IPv4 tunnel, 1070 ipv6-decapsulation - to decapsulate an IPv6 tunnel."; 1071 } 1073 identity ipv4-decapsulation { 1074 base "tunnel-decapsulation-action"; 1075 description 1076 "IPv4 tunnel decapsulation."; 1077 } 1079 identity ipv6-decapsulation { 1080 base "tunnel-decapsulation-action"; 1081 description 1082 "IPv4 tunnel decapsulation."; 1083 } 1085 typedef tunnel-decapsulation-action-definition { 1086 type identityref { 1087 base "tunnel-decapsulation-action"; 1088 } 1089 description 1090 "Tunnel decapsulation definition."; 1091 } 1093 identity ttl-action { 1094 description 1095 "Base identity from which all TTL 1096 actions are derived."; 1097 } 1099 identity no-action { 1100 base "ttl-action"; 1101 description 1102 "Do nothing regarding the TTL."; 1103 } 1105 identity copy-to-inner { 1106 base "ttl-action"; 1107 description 1108 "Copy the TTL of the outer header 1109 to the inner header."; 1110 } 1112 identity decrease-and-copy-to-inner { 1113 base "ttl-action"; 1114 description 1115 "Decrease TTL by one and copy the TTL 1116 to the inner header."; 1117 } 1119 identity decrease-and-copy-to-next { 1120 base "ttl-action"; 1121 description 1122 "Decrease TTL by one and copy the TTL 1123 to the next header.For example: when 1124 MPLS label swapping, decrease the TTL 1125 of the inner label and copy it to the 1126 outer label."; 1127 } 1128 typedef ttl-action-definition { 1129 type identityref { 1130 base "ttl-action"; 1131 } 1132 description 1133 "TTL action definition."; 1134 } 1136 identity hop-limit-action { 1137 description 1138 "Base identity from which all hop limit 1139 actions are derived."; 1140 } 1142 identity hop-limit-no-action { 1143 base "hop-limit-action"; 1144 description 1145 "Do nothing regarding the hop limit."; 1146 } 1148 identity hop-limit-copy-to-inner { 1149 base "hop-limit-action"; 1150 description 1151 "Copy the hop limit of the outer header 1152 to the inner header."; 1153 } 1155 typedef hop-limit-action-definition { 1156 type identityref { 1157 base "hop-limit-action"; 1158 } 1159 description 1160 "IPv6 hop limit action definition."; 1161 } 1163 identity special-nexthop { 1164 description 1165 "Base identity from which all special 1166 nexthops are derived."; 1167 } 1169 identity discard { 1170 base "special-nexthop"; 1171 description 1172 "This indicates that the network 1173 device should drop the packet and 1174 increment a drop counter."; 1175 } 1176 identity discard-with-error { 1177 base "special-nexthop"; 1178 description 1179 "This indicates that the network 1180 device should drop the packet, 1181 increment a drop counter and send 1182 back an appropriate error message 1183 (like ICMP error)."; 1184 } 1186 identity receive { 1187 base "special-nexthop"; 1188 description 1189 "This indicates that the traffic is 1190 destined for the network device. For 1191 example, protocol packets or OAM packets. 1192 All locally destined traffic SHOULD be 1193 throttled to avoid a denial of service 1194 attack on the router's control plane. An 1195 optional rate-limiter can be specified 1196 to indicate how to throttle traffic 1197 destined for the control plane."; 1198 } 1200 identity cos-value { 1201 base "special-nexthop"; 1202 description 1203 "Cos-value special nexthop."; 1204 } 1206 typedef special-nexthop-definition { 1207 type identityref { 1208 base "special-nexthop"; 1209 } 1210 description 1211 "Special nexthop definition."; 1212 } 1214 identity ip-route-match-type { 1215 description 1216 "Base identity from which all route 1217 match types are derived. 1218 Route match type could be: 1219 match source, or 1220 match destination, or 1221 match source and destination."; 1222 } 1223 identity match-ip-src { 1224 base "ip-route-match-type"; 1225 description 1226 "Source route match type."; 1227 } 1228 identity match-ip-dest { 1229 base "ip-route-match-type"; 1230 description 1231 "Destination route match type"; 1232 } 1233 identity match-ip-src-dest { 1234 base "ip-route-match-type"; 1235 description 1236 "Source and Destination route match type"; 1237 } 1239 typedef ip-route-match-type-definition { 1240 type identityref { 1241 base "ip-route-match-type"; 1242 } 1243 description 1244 "IP route match type definition."; 1245 } 1247 identity rib-family { 1248 description 1249 "Base identity from which all RIB 1250 address families are derived."; 1251 } 1253 identity ipv4-rib-family { 1254 base "rib-family"; 1255 description 1256 "IPv4 RIB address family."; 1257 } 1259 identity ipv6-rib-family { 1260 base "rib-family"; 1261 description 1262 "IPv6 RIB address family."; 1263 } 1265 identity mpls-rib-family { 1266 base "rib-family"; 1267 description 1268 "MPLS RIB address family."; 1269 } 1270 identity ieee-mac-rib-family { 1271 base "rib-family"; 1272 description 1273 "MAC RIB address family."; 1274 } 1276 typedef rib-family-definition { 1277 type identityref { 1278 base "rib-family"; 1279 } 1280 description 1281 "RIB address family definition."; 1282 } 1284 identity route-type { 1285 description 1286 "Base identity from which all route types 1287 are derived."; 1288 } 1290 identity ipv4-route { 1291 base "route-type"; 1292 description 1293 "IPv4 route type."; 1294 } 1296 identity ipv6-route { 1297 base "route-type"; 1298 description 1299 "IPv6 route type."; 1300 } 1302 identity mpls-route { 1303 base "route-type"; 1304 description 1305 "MPLS route type."; 1306 } 1308 identity ieee-mac { 1309 base "route-type"; 1310 description 1311 "MAC route type."; 1312 } 1314 identity interface { 1315 base "route-type"; 1316 description 1317 "Interface route type."; 1319 } 1321 typedef route-type-definition { 1322 type identityref { 1323 base "route-type"; 1324 } 1325 description 1326 "Route type definition."; 1327 } 1329 identity tunnel-type { 1330 description 1331 "Base identity from which all tunnel 1332 types are derived."; 1333 } 1335 identity ipv4-tunnel { 1336 base "tunnel-type"; 1337 description 1338 "IPv4 tunnel type"; 1339 } 1341 identity ipv6-tunnel { 1342 base "tunnel-type"; 1343 description 1344 "IPv6 Tunnel type"; 1345 } 1347 identity mpls-tunnel { 1348 base "tunnel-type"; 1349 description 1350 "MPLS tunnel type"; 1351 } 1353 identity gre-tunnel { 1354 base "tunnel-type"; 1355 description 1356 "GRE tunnel type"; 1357 } 1359 identity vxlan-tunnel { 1360 base "tunnel-type"; 1361 description 1362 "VxLAN tunnel type"; 1363 } 1365 identity nvgre-tunnel { 1366 base "tunnel-type"; 1367 description 1368 "NVGRE tunnel type"; 1369 } 1371 typedef tunnel-type-definition { 1372 type identityref { 1373 base "tunnel-type"; 1374 } 1375 description 1376 "Tunnel type definition."; 1377 } 1379 identity route-state { 1380 description 1381 "Base identity from which all route 1382 states are derived."; 1383 } 1385 identity active { 1386 base "route-state"; 1387 description 1388 "Active state."; 1389 } 1391 identity inactive { 1392 base "route-state"; 1393 description 1394 "Inactive state."; 1395 } 1397 typedef route-state-definition { 1398 type identityref { 1399 base "route-state"; 1400 } 1401 description 1402 "Route state definition."; 1403 } 1405 identity nexthop-state { 1406 description 1407 "Base identity from which all nexthop 1408 states are derived."; 1409 } 1411 identity resolved { 1412 base "nexthop-state"; 1413 description 1414 "Reolved nexthop state."; 1416 } 1418 identity unresolved { 1419 base "nexthop-state"; 1420 description 1421 "Unresolved nexthop state."; 1422 } 1424 typedef nexthop-state-definition { 1425 type identityref { 1426 base "nexthop-state"; 1427 } 1428 description 1429 "Nexthop state definition."; 1430 } 1432 identity route-installed-state { 1433 description 1434 "Base identity from which all route 1435 installed states are derived."; 1436 } 1438 identity uninstalled { 1439 base "route-installed-state"; 1440 description 1441 "Uninstalled state."; 1442 } 1444 identity installed { 1445 base "route-installed-state"; 1446 description 1447 "Installed state."; 1448 } 1450 typedef route-installed-state-definition { 1451 type identityref { 1452 base "route-installed-state"; 1453 } 1454 description 1455 "Route installed state definition."; 1456 } 1458 //Route change reason identities 1460 identity route-change-reason { 1461 description 1462 "Base identity from which all route change 1463 reasons are derived."; 1465 } 1467 identity lower-route-preference { 1468 base "route-change-reason"; 1469 description 1470 "This route was installed in the FIB because it had 1471 a lower route preference value (and thus was more 1472 preferred) than the route it replaced."; 1473 } 1475 identity higher-route-preference { 1476 base "route-change-reason"; 1477 description 1478 "This route was uninstalled from the FIB because it had 1479 a higher route preference value (and thus was less 1480 preferred) than the route that replaced it."; 1481 } 1483 identity resolved-nexthop { 1484 base "route-change-reason"; 1485 description 1486 "This route was made active because at least 1487 one of its nexthops was resolved."; 1488 } 1490 identity unresolved-nexthop { 1491 base "route-change-reason"; 1492 description 1493 "This route was made inactive because all of 1494 its nexthops are unresolved."; 1495 } 1497 typedef route-change-reason-definition { 1498 type identityref { 1499 base "route-change-reason"; 1500 } 1501 description 1502 "Route change reason definition."; 1503 } 1505 typedef nexthop-preference-definition { 1506 type uint8 { 1507 range "1..99"; 1508 } 1509 description 1510 "Nexthop-preference is used for protection schemes. 1511 It is an integer value between 1 and 99. Lower 1512 values are more preferred. To download N 1513 nexthops to the FIB, the N nexthops with the lowest 1514 value are selected. If there are more than N 1515 nexthops that have the same preference, an 1516 implementation of i2rs client should select N 1517 nexthops and download them, as for how to select 1518 the nexthops is left to the implementations."; 1519 } 1520 typedef nexthop-lb-weight-definition { 1521 type uint8 { 1522 range "1..99"; 1523 } 1524 description 1525 "Nexthop-lb-weight is used for load-balancing. 1526 Each list member MUST be assigned a weight 1527 between 1 and 99. The weight determines the 1528 proportion of traffic to be sent over a nexthop 1529 used for forwarding as a ratio of the weight of 1530 this nexthop divided by the weights of all the 1531 nexthops of this route that are used for forwarding. 1532 To perform equal load-balancing, one MAY specify 1533 a weight of 0 for all the member nexthops. The 1534 value 0 is reserved for equal load-balancing 1535 and if applied, MUST be applied to all member nexthops."; 1536 } 1538 typedef nexthop-ref { 1539 type leafref { 1540 path "/iir:routing-instance" + 1541 "/iir:rib-list" + 1542 "/iir:route-list" + 1543 "/iir:nexthop" + 1544 "/iir:nexthop-id"; 1545 } 1546 description 1547 "A nexthop reference that provides 1548 an indirection reference to a nexthop."; 1549 } 1551 //Groupings 1552 grouping route-prefix { 1553 description 1554 "The common attributes used for all types of route prefix."; 1555 leaf route-index { 1556 type uint64 ; 1557 mandatory true; 1558 description 1559 "Route index."; 1561 } 1562 container match { 1563 description 1564 "The match condition specifies the 1565 kind of route (IPv4, MPLS, etc.) 1566 and the set of fields to match on."; 1567 choice route-type { 1568 description 1569 "Route types: IPv4, IPv6, MPLS, MAC etc."; 1570 case ipv4 { 1571 description 1572 "IPv4 route case."; 1573 container ipv4 { 1574 description 1575 "IPv4 route match."; 1576 choice ip-route-match-type { 1577 description 1578 "IP route match type options: 1579 match source, or 1580 match destination, or 1581 match source and destination."; 1582 case dest-ipv4-address { 1583 leaf dest-ipv4-prefix { 1584 type inet:ipv4-prefix; 1585 mandatory true; 1586 description 1587 "An IPv4 destination address as the match."; 1588 } 1589 } 1590 case src-ipv4-address { 1591 leaf src-ipv4-prefix { 1592 type inet:ipv4-prefix; 1593 mandatory true; 1594 description 1595 "An IPv4 source address as the match."; 1596 } 1597 } 1598 case dest-src-ipv4-address { 1599 container dest-src-ipv4-address { 1600 description 1601 "A combination of an IPv4 source and 1602 an IPv4 destination address as the match."; 1603 leaf dest-ipv4-prefix { 1604 type inet:ipv4-prefix; 1605 mandatory true; 1606 description 1607 "The IPv4 destination address of the match."; 1608 } 1609 leaf src-ipv4-prefix { 1610 type inet:ipv4-prefix; 1611 mandatory true; 1612 description 1613 "The IPv4 source address of the match"; 1614 } 1615 } 1616 } 1617 } 1618 } 1619 } 1620 case ipv6 { 1621 description 1622 "IPv6 route case."; 1623 container ipv6 { 1624 description 1625 "IPv6 route match."; 1626 choice ip-route-match-type { 1627 description 1628 "IP route match type options: 1629 match source, or 1630 match destination, or 1631 match source and destination."; 1632 case dest-ipv6-address { 1633 leaf dest-ipv6-prefix { 1634 type inet:ipv6-prefix; 1635 mandatory true; 1636 description 1637 "An IPv6 destination address as the match."; 1638 } 1639 } 1640 case src-ipv6-address { 1641 leaf src-ipv6-prefix { 1642 type inet:ipv6-prefix; 1643 mandatory true; 1644 description 1645 "An IPv6 source address as the match."; 1646 } 1647 } 1648 case dest-src-ipv6-address { 1649 container dest-src-ipv6-address { 1650 description 1651 "A combination of an IPv6 source and 1652 an IPv6 destination address as the match."; 1653 leaf dest-ipv6-prefix { 1654 type inet:ipv6-prefix; 1655 mandatory true; 1656 description 1657 "The IPv6 destination address of the match"; 1658 } 1659 leaf src-ipv6-prefix { 1660 type inet:ipv6-prefix; 1661 mandatory true; 1662 description 1663 "The IPv6 source address of the match."; 1664 } 1665 } 1666 } 1667 } 1668 } 1669 } 1670 case mpls-route { 1671 description 1672 "MPLS route case."; 1673 leaf mpls-label { 1674 type uint32 ; 1675 mandatory true; 1676 description 1677 "The label used for matching."; 1678 } 1679 } 1680 case mac-route { 1681 description 1682 "MAC route case."; 1683 leaf mac-address { 1684 type uint32 ; 1685 mandatory true; 1686 description 1687 "The MAC address used for matching."; 1688 } 1689 } 1690 case interface-route { 1691 description 1692 "Interface route case."; 1693 leaf interface-identifier { 1694 type if:interface-ref; 1695 mandatory true; 1696 description 1697 "The interface used for matching."; 1698 } 1699 } 1700 } 1701 } 1702 } 1704 grouping route { 1705 description 1706 "The common attributes used for all types of routes."; 1707 uses route-prefix; 1708 container nexthop { 1709 description 1710 "The nexthop of the route."; 1711 uses nexthop; 1712 } 1713 //In the information model, it is called route-statistic 1714 container route-status { 1715 description 1716 "The status information of the route."; 1717 leaf route-state { 1718 type route-state-definition; 1719 config false; 1720 description 1721 "Indicate a route's state: Active or Inactive."; 1722 } 1723 leaf route-installed-state { 1724 type route-installed-state-definition; 1725 config false; 1726 description 1727 "Indicate that a route's installed states: 1728 Installed or uninstalled."; 1729 } 1730 leaf route-reason { 1731 type route-change-reason-definition; 1732 config false; 1733 description 1734 "Indicate the reason that causes the route change."; 1735 } 1736 } 1737 container route-attributes { 1738 description 1739 "Route attributes."; 1740 uses route-attributes; 1741 } 1742 container route-vendor-attributes { 1743 description 1744 "Route vendor attributes."; 1745 uses route-vendor-attributes; 1746 } 1747 } 1749 grouping nexthop-list { 1750 description 1751 "A generic nexthop list."; 1752 list nexthop-list { 1753 key "nexthop-member-id"; 1754 description 1755 "A list of nexthops."; 1756 leaf nexthop-member-id { 1757 type uint32; 1758 mandatory true; 1759 description 1760 "A nexthop identifier that points 1761 to a nexthop list member. 1762 A nexthop list member is a nexthop."; 1763 } 1764 } 1765 } 1767 grouping nexthop-list-p { 1768 description 1769 "A nexthop list with preference parameter."; 1770 list nexthop-list { 1771 key "nexthop-member-id"; 1772 description 1773 "A list of nexthop."; 1774 leaf nexthop-member-id { 1775 type uint32; 1776 mandatory true; 1777 description 1778 "A nexthop identifier that points 1779 to a nexthop list member. 1780 A nexthop list member is a nexthop."; 1781 } 1782 leaf nexthop-preference { 1783 type nexthop-preference-definition; 1784 mandatory true; 1785 description 1786 "Nexthop-preference is used for protection schemes. 1787 It is an integer value between 1 and 99. Lower 1788 values are more preferred. To download a 1789 primary/standby/tertiary group to the FIB, the 1790 nexthops that are resolved and are most preferred 1791 are selected."; 1792 } 1793 } 1794 } 1796 grouping nexthop-list-w { 1797 description 1798 "A nexthop list with weight parameter."; 1799 list nexthop-list { 1800 key "nexthop-member-id"; 1801 description 1802 "A list of nexthop."; 1803 leaf nexthop-member-id { 1804 type uint32; 1805 mandatory true; 1806 description 1807 "A nexthop identifier that points 1808 to a nexthop list member. 1809 A nexthop list member is a nexthop."; 1810 } 1811 leaf nexthop-lb-weight { 1812 type nexthop-lb-weight-definition; 1813 mandatory true; 1814 description 1815 "The weight of a nexthop of 1816 the load balance nexthops."; 1817 } 1818 } 1819 } 1821 grouping nexthop { 1822 description 1823 "The nexthop structure."; 1824 leaf nexthop-id { 1825 type uint32; 1826 description 1827 "An identifier that refers to a nexthop."; 1828 } 1829 leaf sharing-flag { 1830 type boolean; 1831 description 1832 "To indicate whether a nexthop is sharable 1833 or non-sharable. 1834 true - sharable, means the nexthop can be shared 1835 with other routes 1836 false - non-sharable, means the nexthop can not 1837 be shared with other routes."; 1838 } 1839 choice nexthop-type { 1840 description 1841 "Nexthop type options."; 1842 case nexthop-base { 1843 container nexthop-base { 1844 description 1845 "The base nexthop."; 1846 uses nexthop-base; 1847 } 1848 } 1849 case nexthop-chain { 1850 if-feature nexthop-chain; 1851 container nexthop-chain { 1852 description 1853 "A chain nexthop."; 1854 uses nexthop-list; 1855 } 1856 } 1857 case nexthop-replicates { 1858 if-feature nexthop-replicates; 1859 container nexthop-replicates { 1860 description 1861 "A replicates nexthop."; 1862 uses nexthop-list; 1863 } 1864 } 1865 case nexthop-protection { 1866 if-feature nexthop-protection; 1867 container nexthop-protection { 1868 description 1869 "A protection nexthop."; 1870 uses nexthop-list-p; 1871 } 1872 } 1873 case nexthop-load-balance { 1874 if-feature nexthop-load-balance; 1875 container nexthop-lb { 1876 description 1877 "A load balance nexthop."; 1878 uses nexthop-list-w; 1879 } 1880 } 1881 } 1882 } 1884 grouping nexthop-base { 1885 description 1886 "The base nexthop."; 1887 choice nexthop-base-type { 1888 description 1889 "Nexthop base type options."; 1890 case special-nexthop { 1891 leaf special { 1892 type special-nexthop-definition; 1893 description 1894 "A special nexthop."; 1895 } 1896 } 1897 case egress-interface-nexthop { 1898 leaf outgoing-interface { 1899 type if:interface-ref; 1900 mandatory true; 1901 description 1902 "The nexthop is an outgoing interface."; 1903 } 1904 } 1905 case ipv4-address-nexthop { 1906 leaf ipv4-address { 1907 type inet:ipv4-address; 1908 mandatory true; 1909 description 1910 "The nexthop is an IPv4 address."; 1911 } 1912 } 1913 case ipv6-address-nexthop { 1914 leaf ipv6-address { 1915 type inet:ipv6-address; 1916 mandatory true; 1917 description 1918 "The nexthop is an IPv6 address."; 1919 } 1920 } 1921 case egress-interface-ipv4-nexthop { 1922 container egress-interface-ipv4-address{ 1923 leaf outgoing-interface { 1924 type if:interface-ref; 1925 mandatory true; 1926 description 1927 "Name of the outgoing interface."; 1928 } 1929 leaf ipv4-address { 1930 type inet:ipv4-address; 1931 mandatory true; 1932 description 1933 "The nexthop points to an interface with 1934 an IPv4 address."; 1935 } 1936 description 1937 "The nexthop is an egress-interface and an IP 1938 address. This can be used in cases e.g. where 1939 the IP address is a link-local address."; 1940 } 1941 } 1942 case egress-interface-ipv6-nexthop { 1943 container egress-interface-ipv6-address { 1944 leaf outgoing-interface { 1945 type if:interface-ref; 1946 mandatory true; 1947 description 1948 "Name of the outgoing interface."; 1949 } 1950 leaf ipv6-address { 1951 type inet:ipv6-address; 1952 mandatory true; 1953 description 1954 "The nexthop points to an interface with 1955 an IPv6 address."; 1956 } 1957 description 1958 "The nexthop is an egress-interface and an IP 1959 address. This can be used in cases e.g. where 1960 the IP address is a link-local address."; 1961 } 1962 } 1963 case egress-interface-mac-nexthop { 1964 container egress-interface-mac-address { 1965 leaf outgoing-interface { 1966 type if:interface-ref; 1967 mandatory true; 1968 description 1969 "Name of the outgoing interface."; 1970 } 1971 leaf ieee-mac-address { 1972 type uint32; 1973 mandatory true; 1974 description 1975 "The nexthop points to an interface with 1976 a specific mac-address."; 1977 } 1978 description 1979 "The egress interface must be an Ethernet 1980 interface. Address resolution is not required 1981 for this nexthop."; 1982 } 1983 } 1984 case tunnel-encap-nexthop { 1985 if-feature nexthop-tunnel; 1986 container tunnel-encap { 1987 uses tunnel-encap; 1988 description 1989 "This can be an encap representing an IP tunnel or 1990 MPLS tunnel or others as defined in info model. 1991 An optional egress interface can be chained to the 1992 tunnel encap to indicate which interface to send 1993 the packet out on. The egress interface is useful 1994 when the network device contains Ethernet interfaces 1995 and one needs to perform address resolution for the 1996 IP packet."; 1997 } 1998 } 1999 case tunnel-decapsulation-nexthop { 2000 if-feature nexthop-tunnel; 2001 container tunnel-decapsulation { 2002 uses tunnel-decapsulation; 2003 description 2004 "This is to specify the decapsulation of a tunnel header."; 2005 } 2006 } 2007 case logical-tunnel-nexthop { 2008 if-feature nexthop-tunnel; 2009 container logical-tunnel { 2010 uses logical-tunnel; 2011 description 2012 "This can be a MPLS LSP or a GRE tunnel (or others 2013 as defined in this document), that is represented 2014 by a unique identifier (e.g. name)."; 2015 } 2016 } 2017 case rib-name-nexthop { 2018 leaf rib-name { 2019 type string; 2020 description 2021 "A nexthop pointing to a RIB indicates that the 2022 route lookup needs to continue in the specified 2023 RIB. This is a way to perform chained lookups."; 2024 } 2025 } 2026 case nexthop-identifier { 2027 leaf nexthop-ref { 2028 type nexthop-ref; 2029 mandatory true; 2030 description 2031 "A nexthop reference that points to a nexthop."; 2032 } 2033 } 2034 } 2035 } 2037 grouping route-vendor-attributes { 2038 description 2039 "Route vendor attributes."; 2040 } 2041 grouping logical-tunnel { 2042 description 2043 "A logical tunnel that is identified 2044 by a type and a tunnel name."; 2045 leaf tunnel-type { 2046 type tunnel-type-definition; 2047 mandatory true; 2048 description 2049 "A tunnel type."; 2050 } 2051 leaf tunnel-name { 2052 type string; 2053 mandatory true; 2054 description 2055 "A tunnel name that points to a logical tunnel."; 2056 } 2057 } 2059 grouping ipv4-header { 2060 description 2061 "The IPv4 header encapsulation information."; 2062 leaf src-ipv4-address { 2063 type inet:ipv4-address; 2064 mandatory true; 2065 description 2066 "The source IP address of the header."; 2067 } 2068 leaf dest-ipv4-address { 2069 type inet:ipv4-address; 2070 mandatory true; 2071 description 2072 "The destination IP address of the header."; 2073 } 2074 leaf protocol { 2075 type uint8; 2076 mandatory true; 2077 description 2078 "The protocol id of the header."; 2079 } 2080 leaf ttl { 2081 type uint8; 2082 description 2083 "The TTL of the header."; 2084 } 2085 leaf dscp { 2086 type uint8; 2087 description 2088 "The DSCP field of the header."; 2090 } 2091 } 2093 grouping ipv6-header { 2094 description 2095 "The IPv6 header encapsulation information."; 2096 leaf src-ipv6-address { 2097 type inet:ipv6-address; 2098 mandatory true; 2099 description 2100 "The source IP address of the header."; 2101 } 2102 leaf dest-ipv6-address { 2103 type inet:ipv6-address; 2104 mandatory true; 2105 description 2106 "The destination IP address of the header."; 2107 } 2108 leaf next-header { 2109 type uint8; 2110 mandatory true; 2111 description 2112 "The next header of the IPv6 header."; 2113 } 2114 leaf traffic-class { 2115 type uint8; 2116 description 2117 "The traffic class value of the header."; 2118 } 2119 leaf flow-label { 2120 type uint16; 2121 description 2122 "The flow label of the header."; 2123 } 2124 leaf hop-limit { 2125 type uint8; 2126 description 2127 "The hop limit the header."; 2128 } 2129 } 2131 grouping nvgre-header { 2132 description 2133 "The NvGRE header encapsulation information."; 2134 choice nvgre-type { 2135 description 2136 "NvGRE can use eigher IPv4 2137 or IPv6 header for encapsulation."; 2139 case ipv4 { 2140 uses ipv4-header; 2141 } 2142 case ipv6 { 2143 uses ipv6-header; 2144 } 2145 } 2146 leaf virtual-subnet-id { 2147 type uint32; 2148 mandatory true; 2149 description 2150 "The subnet identifier of the NvGRE header."; 2151 } 2152 leaf flow-id { 2153 type uint16; 2154 description 2155 "The flow identifier of the NvGRE header."; 2156 } 2157 } 2159 grouping vxlan-header { 2160 description 2161 "The VxLAN encapsulation header information."; 2162 choice vxlan-type { 2163 description 2164 "NvGRE can use either IPv4 2165 or IPv6 header for encapsulation."; 2166 case ipv4 { 2167 uses ipv4-header; 2168 } 2169 case ipv6 { 2170 uses ipv6-header; 2171 } 2172 } 2173 leaf vxlan-identifier { 2174 type uint32; 2175 mandatory true; 2176 description 2177 "The VxLAN identifier of the VxLAN header."; 2178 } 2179 } 2181 grouping gre-header { 2182 description 2183 "The GRE encapsulation header information."; 2184 choice dest-address-type { 2185 description 2186 "GRE options: IPv4 and IPv6"; 2188 case ipv4 { 2189 leaf ipv4-dest { 2190 type inet:ipv4-address; 2191 mandatory true; 2192 description 2193 "The destination IP address of the GRE header."; 2194 } 2195 } 2196 case ipv6 { 2197 leaf ipv6-dest { 2198 type inet:ipv6-address; 2199 mandatory true; 2200 description 2201 "The destination IP address of the GRE header."; 2202 } 2203 } 2204 } 2205 leaf protocol-type { 2206 type uint16; 2207 mandatory true; 2208 description 2209 "The protocol type of the GRE header."; 2210 } 2211 leaf key { 2212 type uint64; 2213 description 2214 "The GRE key of the GRE header."; 2215 } 2216 } 2218 grouping mpls-header { 2219 description 2220 "The MPLS encapsulation header information."; 2221 list label-operations { 2222 key "label-oper-id"; 2223 description 2224 "Label operations."; 2225 leaf label-oper-id { 2226 type uint32; 2227 description 2228 "An optional identifier that points 2229 to a label operation."; 2230 } 2231 choice label-actions { 2232 description 2233 "Label action options."; 2234 case label-push { 2235 container label-push { 2236 description 2237 "Label push operation."; 2238 leaf label { 2239 type uint32; 2240 mandatory true; 2241 description 2242 "The label to be pushed."; 2243 } 2244 leaf s-bit { 2245 type boolean; 2246 description 2247 "The s-bit of the label to be pushed. "; 2248 } 2249 leaf tc-value { 2250 type uint8; 2251 description 2252 "The traffic class value of the label to be pushed."; 2253 } 2254 leaf ttl-value { 2255 type uint8; 2256 description 2257 "The TTL value of the label to be pushed."; 2258 } 2259 } 2260 } 2261 case label-swap { 2262 container label-swap { 2263 description 2264 "Label swap operation."; 2265 leaf in-label { 2266 type uint32; 2267 mandatory true; 2268 description 2269 "The label to be swapped."; 2270 } 2271 leaf out-label { 2272 type uint32; 2273 mandatory true; 2274 description 2275 "The out MPLS label."; 2276 } 2277 leaf ttl-action { 2278 type ttl-action-definition; 2279 description 2280 "The label ttl actions: 2281 - No-action, or 2282 - Copy to inner label,or 2283 - Decrease (the in label) by 1 and 2284 copy to the out label."; 2285 } 2286 } 2287 } 2288 } 2289 } 2290 } 2292 grouping tunnel-encap{ 2293 description 2294 "Tunnel encapsulation information."; 2295 choice tunnel-type { 2296 description 2297 "Tunnel options for next-hops."; 2298 case ipv4 { 2299 if-feature ipv4-tunnel; 2300 container ipv4-header { 2301 uses ipv4-header; 2302 description 2303 "IPv4 header."; 2304 } 2305 } 2306 case ipv6 { 2307 if-feature ipv6-tunnel; 2308 container ipv6-header { 2309 uses ipv6-header; 2310 description 2311 "IPv6 header."; 2312 } 2313 } 2314 case mpls { 2315 if-feature mpls-tunnel; 2316 container mpls-header { 2317 uses mpls-header; 2318 description 2319 "MPLS header."; 2320 } 2321 } 2322 case gre { 2323 if-feature gre-tunnel; 2324 container gre-header { 2325 uses gre-header; 2326 description 2327 "GRE header."; 2328 } 2329 } 2330 case nvgre { 2331 if-feature nvgre-tunnel; 2332 container nvgre-header { 2333 uses nvgre-header; 2334 description 2335 "NvGRE header."; 2336 } 2337 } 2338 case vxlan { 2339 if-feature vxlan-tunnel; 2340 container vxlan-header { 2341 uses vxlan-header; 2342 description 2343 "VxLAN header."; 2344 } 2345 } 2346 } 2347 } 2349 grouping tunnel-decapsulation { 2350 description 2351 "Tunnel decapsulation information."; 2352 choice tunnel-type { 2353 description 2354 "Nexthop tunnel type options."; 2355 case ipv4 { 2356 if-feature ipv4-tunnel; 2357 container ipv4-decapsulation { 2358 description 2359 "IPv4 decapsulation."; 2360 leaf ipv4-decapsulation { 2361 type tunnel-decapsulation-action-definition; 2362 mandatory true; 2363 description 2364 "IPv4 decapsulation operations."; 2365 } 2366 leaf ttl-action { 2367 type ttl-action-definition; 2368 description 2369 "The ttl actions: 2370 no-action or copy to inner header."; 2371 } 2372 } 2373 } 2374 case ipv6 { 2375 if-feature ipv6-tunnel; 2376 container ipv6-decapsulation { 2377 description 2378 "IPv6 decapsulation."; 2379 leaf ipv6-decapsulation { 2380 type tunnel-decapsulation-action-definition; 2381 mandatory true; 2382 description 2383 "IPv6 decapsulation operations."; 2384 } 2385 leaf hop-limit-action { 2386 type hop-limit-action-definition; 2387 description 2388 "The hop limit actions: 2389 no-action or copy to inner header."; 2390 } 2391 } 2392 } 2393 case mpls { 2394 if-feature mpls-tunnel; 2395 container label-pop { 2396 description 2397 "MPLS decapsulation."; 2398 leaf label-pop { 2399 type mpls-label-action-definition; 2400 mandatory true; 2401 description 2402 "Pop a label from the label stack."; 2403 } 2404 leaf ttl-action { 2405 type ttl-action-definition; 2406 description 2407 "The label ttl action."; 2408 } 2409 } 2410 } 2411 } 2412 } 2414 grouping route-attributes { 2415 description 2416 "Route attributes."; 2417 leaf route-preference { 2418 type uint32; 2419 mandatory true; 2420 description 2421 "ROUTE_PREFERENCE: This is a numerical value that 2422 allows for comparing routes from different 2423 protocols. Static configuration is also 2424 considered a protocol for the purpose of this 2425 field. It is also known as administrative-distance. 2426 The lower the value, the higher the preference."; 2427 } 2428 leaf local-only { 2429 type boolean ; 2430 mandatory true; 2431 description 2432 "Indicate whether the attributes is local only."; 2433 } 2434 container address-family-route-attributes{ 2435 description 2436 "Address family related route attributes."; 2437 choice route-type { 2438 description 2439 "Address family related route attributes."; 2440 case ip-route-attributes { 2441 } 2442 case mpls-route-attributes { 2443 } 2444 case ethernet-route-attributes { 2445 } 2446 } 2447 } 2448 } 2450 container routing-instance { 2451 description 2452 "A routing instance, in the context of 2453 the RIB information model, is a collection 2454 of RIBs, interfaces, and routing parameters"; 2455 leaf name { 2456 type string; 2457 description 2458 "The name of the routing instance. This MUST 2459 be unique across all routing instances in 2460 a given network device."; 2461 } 2462 list interface-list { 2463 key "name"; 2464 description 2465 "This represents the list of interfaces associated 2466 with this routing instance. The interface list helps 2467 constrain the boundaries of packet forwarding. 2468 Packets coming on these interfaces are directly 2469 associated with the given routing instance. The 2470 interface list contains a list of identifiers, with 2471 each identifier uniquely identifying an interface."; 2472 leaf name { 2473 type if:interface-ref; 2474 description 2475 "A reference to the name of a network layer interface."; 2477 } 2478 } 2479 leaf router-id { 2480 type yang:dotted-quad; 2481 description 2482 "Router ID - 32-bit number in the form of a dotted quad."; 2483 } 2484 leaf lookup-limit { 2485 type uint8; 2486 description 2487 "A limit on how many levels of a lookup can be performed."; 2488 } 2489 list rib-list { 2490 key "name"; 2491 description 2492 "A list of RIBs that are associated with the routing 2493 instance."; 2494 leaf name { 2495 type string; 2496 mandatory true; 2497 description 2498 "A reference to the name of each RIB."; 2499 } 2500 leaf address-family { 2501 type rib-family-definition; 2502 mandatory true; 2503 description 2504 "The address family of a RIB."; 2505 } 2506 leaf ip-rpf-check { 2507 type boolean; 2508 description 2509 "Each RIB can be optionally associated with a 2510 ENABLE_IP_RPF_CHECK attribute that enables Reverse 2511 path forwarding (RPF) checks on all IP routes in that 2512 RIB. Reverse path forwarding (RPF) check is used to 2513 prevent spoofing and limit malicious traffic."; 2514 } 2515 list route-list { 2516 key "route-index"; 2517 description 2518 "A list of routes of a RIB."; 2519 uses route; 2520 } 2521 // This is a list that maintains the nexthops added to the RIB. 2522 uses nexthop-list; 2523 } 2524 } 2525 //RPC Operations 2526 rpc rib-add { 2527 description 2528 "To add a RIB to a instance"; 2529 input { 2530 leaf name { 2531 type string; 2532 mandatory true; 2533 description 2534 "A reference to the name of the RIB 2535 that is to be added."; 2536 } 2537 leaf address-family { 2538 type rib-family-definition; 2539 mandatory true; 2540 description 2541 "The address family of the RIB."; 2542 } 2543 leaf ip-rpf-check { 2544 type boolean; 2545 description 2546 "Each RIB can be optionally associated with a 2547 ENABLE_IP_RPF_CHECK attribute that enables Reverse 2548 path forwarding (RPF) checks on all IP routes in that 2549 RIB. Reverse path forwarding (RPF) check is used to 2550 prevent spoofing and limit malicious traffic."; 2551 } 2552 } 2553 output { 2554 leaf result { 2555 type boolean; 2556 mandatory true; 2557 description 2558 "Return the result of the rib-add operation. 2559 true - success; 2560 false - failed"; 2561 } 2562 leaf reason { 2563 type string; 2564 description 2565 "The specific reason that causes the failure."; 2566 } 2567 } 2568 } 2570 rpc rib-delete { 2571 description 2572 "To delete a RIB from a routing instance. 2574 After deleting the RIB, all routes installed 2575 in the RIB will be deleted as well."; 2576 input { 2577 leaf name { 2578 type string; 2579 mandatory true; 2580 description 2581 "A reference to the name of the RIB 2582 that is to be deleted."; 2583 } 2584 } 2585 output { 2586 leaf result { 2587 type boolean; 2588 mandatory true; 2589 description 2590 "Return the result of the rib-delete operation. 2591 true - success; 2592 false - failed"; 2593 } 2594 leaf reason { 2595 type string; 2596 description 2597 "The specific reason that causes failure."; 2598 } 2599 } 2600 } 2602 grouping route-operation-state { 2603 description 2604 "Route operation state."; 2605 leaf success-count { 2606 type uint32; 2607 mandatory true; 2608 description 2609 "The numbers of routes that are successfully 2610 added/deleted/updated."; 2611 } 2612 leaf failed-count { 2613 type uint32; 2614 mandatory true; 2615 description 2616 "The numbers of the routes that are failed 2617 to be added/deleted/updated."; 2618 } 2619 container failure-detail { 2620 description 2621 "The failure detail reflects the reason why a route 2622 operation fails. It is a array that includes the route 2623 index and error code of the failed route."; 2624 list failed-routes { 2625 key "route-index"; 2626 description 2627 "The list of failed routes."; 2628 leaf route-index { 2629 type uint32; 2630 description 2631 "The route index of the failed route."; 2632 } 2633 leaf error-code { 2634 type uint32; 2635 description 2636 "The error code that reflects the failure reason."; 2637 } 2638 } 2639 } 2640 } 2642 rpc route-add { 2643 description 2644 "To add a route or a list of route to a RIB"; 2645 input { 2646 leaf return-failure-detail { 2647 type boolean; 2648 default false; 2649 description 2650 "Whether return the failure detail. 2651 true - return the failure detail; 2652 false - do not return the failure detail; 2653 the default is false."; 2654 } 2655 leaf rib-name { 2656 type string; 2657 mandatory true; 2658 description 2659 "A reference to the name of a RIB."; 2660 } 2661 container routes { 2662 description 2663 "The routes to be added to the RIB."; 2664 list route-list { 2665 key "route-index"; 2666 description 2667 "The list of routes to be added."; 2668 uses route-prefix; 2669 container route-attributes { 2670 uses route-attributes; 2671 description 2672 "The route attributes."; 2673 } 2674 container route-vendor-attributes { 2675 if-feature route-vendor-attributes; 2676 uses route-vendor-attributes; 2677 description 2678 "The route vendor attributes."; 2679 } 2680 container nexthop { 2681 uses nexthop; 2682 description 2683 "The nexthop of the added route."; 2684 } 2685 } 2686 } 2687 } 2688 output { 2689 uses route-operation-state; 2690 } 2691 } 2693 rpc route-delete { 2694 description 2695 "To delete a route or a list of route from a RIB"; 2696 input { 2697 leaf return-failure-detail { 2698 type boolean; 2699 default false; 2700 description 2701 "Whether return the failure detail. 2702 true - return the failure detail; 2703 false - do not return the failure detail; 2704 the default is false."; 2705 } 2706 leaf rib-name { 2707 type string; 2708 mandatory true; 2709 description 2710 "A reference to the name of a RIB."; 2711 } 2712 container routes { 2713 description 2714 "The routes to be added to the RIB."; 2715 list route-list{ 2716 key "route-index"; 2717 description 2718 "The list of routes to be deleted."; 2719 uses route-prefix; 2720 } 2721 } 2722 } 2723 output { 2724 uses route-operation-state; 2725 } 2726 } 2728 grouping route-update-options { 2729 description 2730 "Update options: 2731 1. update the nexthop 2732 2. update the route attributes 2733 3. update the route-vendor-attributes."; 2734 choice update-options { 2735 description 2736 "Update options: 2737 1. update the nexthop 2738 2. update the route attributes 2739 3. update the route-vendor-attributes."; 2740 case update-nexthop { 2741 container updated-nexthop { 2742 uses nexthop; 2743 description 2744 "The nexthop used for updating."; 2745 } 2746 } 2747 case update-route-attributes { 2748 container updated-route-attr { 2749 uses route-attributes; 2750 description 2751 "The route attributes used for updating."; 2752 } 2753 } 2754 case update-route-vendor-attributes { 2755 container updated-route-vendor-attr { 2756 uses route-vendor-attributes; 2757 description 2758 "The vendor route attributes used for updating."; 2759 } 2760 } 2761 } 2762 } 2764 rpc route-update { 2765 description 2766 "To update a route or a list of route of a RIB. 2767 The inputs: 2768 1. The match conditions, could be: 2769 a. route prefix, or 2770 b. route attributes, or 2771 c. nexthop; 2772 2. The update parameters to be used: 2773 a. new nexthop; 2774 b. new route attributes;nexthop 2775 Actions: 2776 1. update the nexthop 2777 2. update the route attributes 2778 The outputs: 2779 success-count - the number of routes updated; 2780 failed-count - the number of routes fail to update 2781 failure-detail - the detail failure info. 2782 "; 2783 input { 2784 leaf return-failure-detail { 2785 type boolean; 2786 default false; 2787 description 2788 "Whether return the failure detail. 2789 true - return the failure detail; 2790 false - do not return the failure detail; 2791 the default is false."; 2792 } 2793 leaf rib-name { 2794 type string; 2795 mandatory true; 2796 description 2797 "A reference to the name of a RIB."; 2798 } 2799 choice match-options { 2800 description 2801 "Match options."; 2802 case match-route-prefix { 2803 description 2804 "Update the routes that match route 2805 prefix(es) condition."; 2806 container input-routes { 2807 description 2808 "The matched routes to be updated."; 2809 list route-list { 2810 key "route-index"; 2811 description 2812 "The list of routes to be updated."; 2813 uses route-prefix; 2814 uses route-update-options; 2815 } 2816 } 2817 } 2818 case match-route-attributes { 2819 description 2820 "Update the routes that match the 2821 route attributes condition."; 2822 container input-route-attributes { 2823 description 2824 "The route attributes are used for matching."; 2825 uses route-attributes; 2826 } 2827 container update-parametors { 2828 description 2829 "Update options: 2830 1. update the nexthop 2831 2. update the route attributes 2832 3. update the route-vendor-attributes."; 2833 uses route-update-options; 2834 } 2835 } 2836 case match-route-vendor-attributes { 2837 if-feature route-vendor-attributes; 2838 description 2839 "Update the routes that match the 2840 vendor attributes condition"; 2841 container input-route-vendor-attributes { 2842 description 2843 "The vendor route attributes are used for matching."; 2844 uses route-vendor-attributes; 2845 } 2846 container update-parameters-vendor { 2847 description 2848 "Update options: 2849 1. update the nexthop 2850 2. update the route attributes 2851 3. update the route-vendor-attributes."; 2852 uses route-update-options; 2853 } 2854 } 2855 case match-nexthop { 2856 description 2857 "Update the routes that match the nexthop."; 2858 container input-nexthop { 2859 description 2860 "The nexthop used for matching."; 2861 uses nexthop; 2863 } 2864 container update-parameters-nexthop { 2865 description 2866 "Update options: 2867 1. update the nexthop 2868 2. update the route attributes 2869 3. update the route-vendor-attributes."; 2870 uses route-update-options; 2871 } 2872 } 2873 } 2874 } 2875 output { 2876 uses route-operation-state; 2877 } 2878 } 2880 rpc nh-add { 2881 description 2882 "To add a nexthop to a RIB. 2883 Inputs parameters: 2884 1. RIB name 2885 2. nexthop; 2886 Actions: 2887 Add the nexthop to the RIB 2888 Outputs: 2889 1.Operation result: 2890 true - success 2891 false - failed; 2892 2. nexthop identifier."; 2893 input { 2894 leaf rib-name { 2895 type string; 2896 mandatory true; 2897 description 2898 "A reference to the name of a RIB."; 2899 } 2900 uses nexthop; 2901 } 2902 output { 2903 leaf result { 2904 type boolean; 2905 mandatory true; 2906 description 2907 "Return the result of the rib-add operation. 2908 true - success; 2909 false - failed;"; 2910 } 2911 leaf reason { 2912 type string; 2913 description 2914 "The specific reason that causes the failure."; 2915 } 2916 leaf nexthop-id { 2917 type uint32; 2918 description 2919 "A nexthop identifier that is allocated to the nexthop."; 2920 } 2921 } 2922 } 2924 rpc nh-delete { 2925 description 2926 "To delete a nexthop from a RIB"; 2927 input { 2928 leaf rib-name { 2929 type string; 2930 mandatory true; 2931 description 2932 "A reference to the name of a RIB."; 2933 } 2934 uses nexthop; 2935 } 2936 output { 2937 leaf result { 2938 type boolean; 2939 mandatory true; 2940 description 2941 "Return the result of the rib-add operation. 2942 true - success; 2943 false - failed."; 2944 } 2945 leaf reason { 2946 type string; 2947 description 2948 "The specific reason that causes the failure."; 2949 } 2950 } 2951 } 2953 /*Notifications*/ 2954 notification nexthop-resolution-status-change { 2955 description 2956 "Nexthop resolution status (resolved/unresolved) 2957 notification."; 2958 container nexthop{ 2959 description 2960 "The nexthop."; 2961 uses nexthop; 2962 } 2963 leaf nexthop-state { 2964 type nexthop-state-definition; 2965 mandatory true; 2966 description 2967 "Nexthop resolution status (resolved/unresolved) 2968 notification."; 2969 } 2970 } 2972 notification route-change { 2973 description 2974 "Route change notification."; 2975 leaf rib-name { 2976 type string; 2977 mandatory true; 2978 description 2979 "A reference to the name of a RIB."; 2980 } 2981 leaf address-family { 2982 type rib-family-definition; 2983 mandatory true; 2984 description 2985 "The address family of a RIB."; 2986 } 2987 uses route-prefix; 2988 leaf route-installed-state { 2989 type route-installed-state-definition; 2990 mandatory true; 2991 description 2992 "Indicates whether the route got installed in the FIB."; 2993 } 2994 leaf route-state { 2995 type route-state-definition; 2996 mandatory true; 2997 description 2998 "Indicates whether a route is active or inactive."; 2999 } 3000 list route-change-reasons { 3001 key "route-change-reason"; 3002 description 3003 "The reasons that cause the route change. A route 3004 change that may result from several reasons. For 3005 example, a nexthop becoming resolved will make a 3006 route A active which is of better preference than 3007 a currently active route B, which results in the 3008 route A being installed"; 3009 leaf route-change-reason { 3010 type route-change-reason-definition; 3011 mandatory true; 3012 description 3013 "The reason that causes the route change."; 3014 } 3015 } 3016 } 3017 } 3019 3021 4. IANA Considerations 3023 This document registers a URI in the "ns" registry with the "IETF XML 3024 registry" [RFC3688]: 3026 -------------------------------------------------------------------- 3027 URI: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib 3028 Registrant Contact: The IESG. 3029 XML: N/A, the requested URI is an XML namespace. 3030 -------------------------------------------------------------------- 3032 This document requests to register a YANG module in the "YANG Module 3033 Names registry" [RFC6020]: 3035 -------------------------------------------------------------------- 3036 name: ietf-i2rs-rib 3037 namespace: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib 3038 prefix: iir 3039 reference: RFC XXXX 3040 -------------------------------------------------------------------- 3042 5. Security Considerations 3044 The YANG module specified in this document defines a schema for data 3045 that is designed to be accessed via network management protocols such 3046 as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer 3047 is the secure transport layer, and the mandatory-to-implement secure 3048 transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer 3049 is HTTPS, and the mandatory-to-implement secure transport is TLS 3050 [RFC5246]. 3052 The NETCONF access control model [RFC6536] provides the means to 3053 restrict access for particular NETCONF or RESTCONF users to a 3054 preconfigured subset of all available NETCONF or RESTCONF protocol 3055 operations and content. 3057 The YANG modules define information that can be configurable in 3058 certain instances, for example, a RIB, a route, a nexthop can be 3059 created or deleted by client applications, the YANG modules also 3060 define RPCs that can be used by client applications to add/delete 3061 RIBs, routes and nexthops. In such cases, a malicious client could 3062 attempt to remove, add or update a RIB, a route, a nexthop, by 3063 creating or deleting corresponding elements in the RIB, route and 3064 nexthop lists, respectively. Removing a RIB or a route could lead to 3065 disruption or impact in performance of a service, updating a route 3066 may lead to suboptimal path and degradation of service levels as well 3067 as possibly disruption of service. For those reasons, it is 3068 important that the NETCONF access control model is vigorously applied 3069 to prevent misconfiguration by unauthorized clients. 3071 There are a number of data nodes defined in this YANG module that are 3072 writable/creatable/deletable (i.e., config true, which is the 3073 default). These data nodes may be considered sensitive or vulnerable 3074 in some network environments. Write operations (e.g., edit-config) 3075 to these data nodes without proper protection can have a negative 3076 effect on network operations. These are the subtrees and data nodes 3077 and their sensitivity/vulnerability in the ietf-i2rs-rib module: 3079 o RIB: A malicious client could attempt to remove a RIB from a 3080 routing instance, for example in order to sabotage the services 3081 provided by the RIB, or to add a RIB to a routing instance, hence 3082 to inject unauthorized traffic into the nexthop. 3084 o route:A malicious client could attempt to remove or add a route 3085 from/to a RIB, for example in order to sabotage the services 3086 provided by the RIB. 3088 o nexthop: A malicious client could attempt to remove or add a 3089 nexthop from/to RIB, which may lead to suboptimal path and 3090 degradation of service levels as well as possibly disruption of 3091 service. 3093 6. Contributors 3095 The following individuals also contribute to this document. 3097 o Zekun He, Tencent Holdings Ltd 3099 o Sujian Lu, Tencent Holdings Ltd 3101 o Jeffery Zhang, Juniper Networks 3103 7. Acknowledgements 3105 The authors would like to thank Chris Bowers and John Scudder for his 3106 review, suggestion and comments to this document. 3108 8. References 3110 8.1. Normative References 3112 [I-D.ietf-netmod-yang-tree-diagrams] 3113 Bjorklund, M. and L. Berger, "YANG Tree Diagrams", draft- 3114 ietf-netmod-yang-tree-diagrams-04 (work in progress), 3115 December 2017. 3117 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3118 Requirement Levels", BCP 14, RFC 2119, 3119 DOI 10.17487/RFC2119, March 1997, 3120 . 3122 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 3123 DOI 10.17487/RFC3688, January 2004, 3124 . 3126 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 3127 (TLS) Protocol Version 1.2", RFC 5246, 3128 DOI 10.17487/RFC5246, August 2008, 3129 . 3131 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 3132 the Network Configuration Protocol (NETCONF)", RFC 6020, 3133 DOI 10.17487/RFC6020, October 2010, 3134 . 3136 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 3137 and A. Bierman, Ed., "Network Configuration Protocol 3138 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 3139 . 3141 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 3142 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 3143 . 3145 [RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration 3146 Protocol (NETCONF) Access Control Model", RFC 6536, 3147 DOI 10.17487/RFC6536, March 2012, 3148 . 3150 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 3151 RFC 6991, DOI 10.17487/RFC6991, July 2013, 3152 . 3154 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 3155 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 3156 . 3158 8.2. Informative References 3160 [I-D.ietf-i2rs-rib-info-model] 3161 Bahadur, N., Kini, S., and J. Medved, "Routing Information 3162 Base Info Model", draft-ietf-i2rs-rib-info-model-13 (work 3163 in progress), January 2018. 3165 [I-D.ietf-i2rs-usecase-reqs-summary] 3166 Hares, S. and M. Chen, "Summary of I2RS Use Case 3167 Requirements", draft-ietf-i2rs-usecase-reqs-summary-03 3168 (work in progress), November 2016. 3170 [RFC7921] Atlas, A., Halpern, J., Hares, S., Ward, D., and T. 3171 Nadeau, "An Architecture for the Interface to the Routing 3172 System", RFC 7921, DOI 10.17487/RFC7921, June 2016, 3173 . 3175 Authors' Addresses 3177 Lixing Wang 3178 Individual 3180 Email: wang_little_star@sina.com 3182 Mach(Guoyi) Chen 3183 Huawei 3185 Email: mach.chen@huawei.com 3187 Amit Dass 3188 Ericsson 3190 Email: amit.dass@ericsson.com 3191 Hariharan Ananthakrishnan 3192 Packet Design 3194 Email: hari@packetdesign.com 3196 Sriganesh Kini 3197 Individual 3199 Email: sriganeshkini@gmail.com 3201 Nitin Bahadur 3202 Bracket Computing 3204 Email: nitin_bahadur@yahoo.com