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