idnits 2.17.1 draft-vassilev-bmwg-network-interconnect-tester-02.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 16 instances of too long lines in the document, the longest one being 8 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 193 has weird spacing: '...-stream uin...' == Line 233 has weird spacing: '...-stream uin...' == Line 280 has weird spacing: '...rw type ide...' -- The document date (October 8, 2019) is 1661 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 1 error (**), 0 flaws (~~), 4 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group V. Vassilev 3 Internet-Draft Lightside Instruments 4 Intended status: Standards Track October 8, 2019 5 Expires: April 10, 2020 7 A YANG Data Model for Network Interconnect Tester Management 8 draft-vassilev-bmwg-network-interconnect-tester-02 10 Abstract 12 This document introduces new YANG model for use in network 13 interconnect testing containing modules for traffic generator and 14 traffic analyzer. 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at https://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on April 10, 2020. 33 Copyright Notice 35 Copyright (c) 2019 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (https://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 2 52 1.1.1. Definitions and Acronyms . . . . . . . . . . . . . . 2 53 1.1.2. Tree Diagram . . . . . . . . . . . . . . . . . . . . 3 54 1.2. Problem Statement . . . . . . . . . . . . . . . . . . . . 3 55 1.3. Solution . . . . . . . . . . . . . . . . . . . . . . . . 3 56 2. Using the network interconnect tester model . . . . . . . . . 4 57 3. Traffic Generator Module Tree Diagram . . . . . . . . . . . . 4 58 4. Traffic Analyzer Module Tree Diagram . . . . . . . . . . . . 6 59 5. Traffic Generator Module YANG . . . . . . . . . . . . . . . . 7 60 6. Traffic Analyzer Module YANG . . . . . . . . . . . . . . . . 15 61 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22 62 7.1. URI Registration . . . . . . . . . . . . . . . . . . . . 22 63 7.2. YANG Module Name Registration . . . . . . . . . . . . . . 22 64 8. Security Considerations . . . . . . . . . . . . . . . . . . . 23 65 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 23 66 9.1. Normative References . . . . . . . . . . . . . . . . . . 23 67 9.2. Informative References . . . . . . . . . . . . . . . . . 23 68 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 24 69 A.1. Basic Test Program . . . . . . . . . . . . . . . . . . . 24 70 A.2. Generating RFC2544 Testframes . . . . . . . . . . . . . . 25 71 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 25 73 1. Introduction 75 There is a need for standard mechanism to allow the specification and 76 implementation of the transactions part of network tests. The 77 mechanism should allow the control and monitoring of the data plane 78 traffic in a transactional way. This document defines YANG modules 79 for test traffic generator, analyzer and internal interface loopback. 81 1.1. Terminology 83 The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 84 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 85 "OPTIONAL" in this document are to be interpreted as described in BCP 86 14, [RFC2119]. 88 1.1.1. Definitions and Acronyms 90 DUT: Device Under Test 92 TA: Traffic Analyzer 94 TG: Traffic Generator 96 1.1.2. Tree Diagram 98 For a reference to the annotations used in tree diagrams included in 99 this draft, please see YANG Tree Diagrams [RFC8340]. 101 1.2. Problem Statement 103 Network interconnect tests require active network elements part of 104 the tested network that generate test traffic and network elements 105 that analyze the test traffic at one or more points of its path. A 106 network interconnect tester is a device that can either generate test 107 traffic, analyze test traffic or both. Here is a figure borrowed 108 from [RFC2544] representing the horseshoe test setup topology 109 consisting of a single tester and a single DUT connected in a network 110 interconnect loop. 112 +------------+ 113 | | 114 +------------| tester |<-------------+ 115 | | | | 116 | +------------+ | 117 | | 118 | +------------+ | 119 | | | | 120 +----------->| DUT |--------------+ 121 | | 122 +------------+ 124 This document attempts to address the problem of defining YANG model 125 of a network interconnect tester that can be used for development of 126 vendor independent network interconnect tests and utilize the 127 advantages of transactional management using standard protocols like 128 NETCONF. 130 1.3. Solution 132 The proposed model splits the design into 3 modules - 1) Traffic 133 Generator module (TG), 2) Traffic Analyzer module (TA). The modules 134 are implemented as augmentations of the ietf-interfaces module adding 135 configuration and state data that models the functionality of a 136 tester. The TA and TG modules concept is illustrated with the 137 following diagram of a tester with two interfaces (named e0 and e1) 138 conected in a loop with single DUT: 140 +----------------+ 141 e0.egress | | e1.ingress 142 +------------| TG tester TA |<-------------+ 143 | | | | 144 | +----------------+ | 145 | | 146 | +------------+ | 147 | | | | 148 +------------->| DUT |----------------+ 149 | | 150 +------------+ 152 2. Using the network interconnect tester model 154 Basic example of how the model can be used in transactional network 155 test API to control the testers part of a network and report countrer 156 statistics and timing measurement data is presented in Appendix A. 157 One of the examples demonstrates the use of the [RFC2544] defined 158 testframe packet. 160 3. Traffic Generator Module Tree Diagram 162 module: ietf-traffic-generator 163 augment /if:interfaces/if:interface: 164 +--rw traffic-generator {egress-direction}? 165 | +--rw (type)? 166 | | +--:(single-stream) 167 | | | +--rw frame-size uint32 168 | | | +--rw (frame-data-type)? 169 | | | | +--:(raw-frame-data) 170 | | | | +--rw frame-data? string 171 | | | +--rw interframe-gap uint32 172 | | | +--rw interburst-gap? uint32 173 | | | +--rw frames-per-burst? uint32 174 | | | +--rw src-mac-address? yang:mac-address {ethernet}? 175 | | | +--rw dst-mac-address? yang:mac-address {ethernet}? 176 | | | +--rw ether-type? uint16 {ethernet}? 177 | | | +--rw vlan {ethernet-vlan,ethernet}? 178 | | | +--rw id uint16 179 | | | +--rw tpid? uint16 180 | | | +--rw pcp? uint8 181 | | | +--rw cfi? uint8 182 | | +--:(multi-stream) 183 | | +--rw streams 184 | | +--rw stream* [id] 185 | | +--rw id uint32 186 | | +--rw frame-size uint32 187 | | +--rw (frame-data-type)? 188 | | | +--:(raw-frame-data) 189 | | | +--rw frame-data? string 190 | | +--rw interframe-gap uint32 191 | | +--rw interburst-gap? uint32 192 | | +--rw frames-per-burst? uint32 193 | | +--rw frames-per-stream uint32 194 | | +--rw interstream-gap uint32 195 | | +--rw src-mac-address? yang:mac-address {ethernet}? 196 | | +--rw dst-mac-address? yang:mac-address {ethernet}? 197 | | +--rw ether-type? uint16 {ethernet}? 198 | | +--rw vlan {ethernet-vlan,ethernet}? 199 | | +--rw id uint16 200 | | +--rw tpid? uint16 201 | | +--rw pcp? uint8 202 | | +--rw cfi? uint8 203 | +--rw total-frames? uint64 204 +--rw traffic-generator-ingress {ingress-direction}? 205 +--rw (type)? 206 | +--:(single-stream) 207 | | +--rw frame-size uint32 208 | | +--rw (frame-data-type)? 209 | | | +--:(raw-frame-data) 210 | | | +--rw frame-data? string 211 | | +--rw interframe-gap uint32 212 | | +--rw interburst-gap? uint32 213 | | +--rw frames-per-burst? uint32 214 | | +--rw src-mac-address? yang:mac-address {ethernet}? 215 | | +--rw dst-mac-address? yang:mac-address {ethernet}? 216 | | +--rw ether-type? uint16 {ethernet}? 217 | | +--rw vlan {ethernet-vlan,ethernet}? 218 | | +--rw id uint16 219 | | +--rw tpid? uint16 220 | | +--rw pcp? uint8 221 | | +--rw cfi? uint8 222 | +--:(multi-stream) 223 | +--rw streams 224 | +--rw stream* [id] 225 | +--rw id uint32 226 | +--rw frame-size uint32 227 | +--rw (frame-data-type)? 228 | | +--:(raw-frame-data) 229 | | +--rw frame-data? string 230 | +--rw interframe-gap uint32 231 | +--rw interburst-gap? uint32 232 | +--rw frames-per-burst? uint32 233 | +--rw frames-per-stream uint32 234 | +--rw interstream-gap uint32 235 | +--rw src-mac-address? yang:mac-address {ethernet}? 236 | +--rw dst-mac-address? yang:mac-address {ethernet}? 237 | +--rw ether-type? uint16 {ethernet}? 238 | +--rw vlan {ethernet-vlan,ethernet}? 239 | +--rw id uint16 240 | +--rw tpid? uint16 241 | +--rw pcp? uint8 242 | +--rw cfi? uint8 243 +--rw total-frames? uint64 244 augment /if:interfaces-state/if:interface/if:statistics: 245 +--ro generated-pkts? yang:counter64 246 +--ro generated-octets? yang:counter64 247 +--ro generated-ingress-pkts? yang:counter64 {ingress-direction}? 248 +--ro generated-ingress-octets? yang:counter64 {ingress-direction}? 250 4. Traffic Analyzer Module Tree Diagram 252 module: ietf-traffic-analyzer 253 augment /if:interfaces/if:interface: 254 +--rw traffic-analyzer! {ingress-direction}? 255 | +--rw filter! {filter}? 256 | | +--rw type identityref 257 | | +--rw ether-type? uint16 258 | +--ro state 259 | +--ro pkts? yang:counter64 260 | +--ro errors? yang:counter64 261 | +--ro testframe-stats 262 | | +--ro testframe-pkts? yang:counter64 263 | | +--ro sequence-errors? yang:counter64 264 | | +--ro payload-errors? yang:counter64 265 | | +--ro latency 266 | | +--ro samples? uint64 267 | | +--ro min? uint64 268 | | +--ro max? uint64 269 | | +--ro average? uint64 270 | | +--ro latest? uint64 271 | +--ro capture {capture}? 272 | +--ro frame* [sequence-number] 273 | +--ro sequence-number uint64 274 | +--ro timestamp? yang:date-and-time 275 | +--ro length? uint32 276 | +--ro preceding-interframe-gap? uint32 277 | +--ro data? string 278 +--rw traffic-analyzer-egress! {egress-direction}? 279 +--rw filter! {filter}? 280 | +--rw type identityref 281 +--ro state 282 +--ro pkts? yang:counter64 283 +--ro errors? yang:counter64 284 +--ro testframe-stats 285 | +--ro testframe-pkts? yang:counter64 286 | +--ro sequence-errors? yang:counter64 287 | +--ro payload-errors? yang:counter64 288 | +--ro latency 289 | +--ro samples? uint64 290 | +--ro min? uint64 291 | +--ro max? uint64 292 | +--ro average? uint64 293 | +--ro latest? uint64 294 +--ro capture {capture}? 295 +--ro frame* [sequence-number] 296 +--ro sequence-number uint64 297 +--ro timestamp? yang:date-and-time 298 +--ro length? uint32 299 +--ro preceding-interframe-gap? uint32 300 +--ro data? string 301 augment /if:interfaces-state/if:interface/if:statistics: 302 +--ro testframe-pkts? yang:counter64 {ingress-direction}? 303 +--ro testframe-sequence-errors? yang:counter64 {ingress-direction}? 304 +--ro testframe-payload-errors? yang:counter64 {ingress-direction}? 305 augment /if:interfaces-state/if:interface/if:statistics: 306 +--ro testframe-egress-pkts? yang:counter64 {egress-direction}? 307 +--ro testframe-egress-sequence-errors? yang:counter64 {egress-direction}? 308 +--ro testframe-egress-payload-errors? yang:counter64 {egress-direction}? 310 5. Traffic Generator Module YANG 312 file "ietf-traffic-generator@2019-10-08.yang" 314 module ietf-traffic-generator { 315 yang-version 1.1; 316 namespace "urn:ietf:params:xml:ns:yang:ietf-traffic-generator"; 317 prefix tg; 319 import ietf-interfaces { 320 prefix if; 321 } 322 import ietf-yang-types { 323 prefix yang; 324 } 325 import iana-if-type { 326 prefix ianaift; 327 } 329 organization 330 "IETF Benchmarking Methodology Working Group"; 332 contact 333 "WG Web: 334 WG List: 336 Editor: Vladimir Vassilev 337 "; 338 description 339 "This module contains a collection of YANG definitions for 340 description and management of network interconnect testers. 342 Copyright (c) 2019 IETF Trust and the persons identified as 343 authors of the code. All rights reserved. 345 Redistribution and use in source and binary forms, with or 346 without modification, is permitted pursuant to, and subject 347 to the license terms contained in, the Simplified BSD License 348 set forth in Section 4.c of the IETF Trust's Legal Provisions 349 Relating to IETF Documents 350 (http://trustee.ietf.org/license-info). 352 This version of this YANG module is part of RFC XXXX; see 353 the RFC itself for full legal notices."; 355 revision 2019-10-08 { 356 description 357 "Initial revision."; 358 reference 359 "RFC XXXX: Network Interconnect Tester"; 360 } 362 feature egress-direction { 363 description 364 "The device can generate traffic in the egress direction."; 365 } 367 feature ingress-direction { 368 description 369 "The device can generate traffic in the ingress direction."; 370 } 372 feature multi-stream { 373 description 374 "The device can generate multi-stream traffic."; 375 } 377 feature ethernet { 378 description 379 "The device can generate ethernet traffic."; 381 } 383 feature ethernet-vlan { 384 if-feature "ethernet"; 385 description 386 "The device can generate vlan tagged ethernet traffic."; 387 } 389 grouping traffic-generator-burst-data { 390 description 391 "Generated traffic burst parameters."; 392 leaf frame-size { 393 type uint32; 394 mandatory true; 395 description 396 "Size of the frames generated. For example for 397 ethernet interfaces the following definition 398 applies: 400 Ethernet frame-size in octets includes: 401 * Destination Address (6 octets), 402 * Source Address (6 octets), 403 * Frame Type (2 octets), 404 * Data (min 46 octets or 42 octets + 4 octets 802.1Q tag), 405 * CRC Checksum (4 octets). 407 Ethernet frame-size does not include: 408 * Preamble (dependent on MAC configuration 409 by default 7 octets), 410 * Start of frame delimeter (1 octet) 412 Minimum standard ethernet frame-size is 64 bytes but 413 generators might support smaller sizes for validation."; 414 } 415 choice frame-data-type { 416 description 417 "Choice of frame data type generated."; 418 case raw-frame-data { 419 leaf frame-data { 420 type string { 421 pattern '([0-9A-F]{2})*'; 422 } 423 must 'string-length(.)<=(../frame-size*2)'; 424 description 425 "The raw frame data specified as hexadecimal string. 426 The specified data can be shorter then the ../frame-size 427 value specifying only the header or the header and the 428 payload without for example the 4 byte CRC Checksum 429 in the case of a Ethernet frame."; 430 } 431 } 432 } 433 leaf interframe-gap { 434 type uint32; 435 mandatory true; 436 description 437 "Length of the idle period between generated frames. 438 For example for ethernet interfaces the following 439 definition applies: 441 Ethernet interframe-gap between transmission of frames 442 known as the interframe gap (IFG). A brief recovery time 443 between frames allows devices to prepare for 444 reception of the next frame. The minimum 445 interframe gap is 96 bit times (12 octet times) (the time it 446 takes to transmit 96 bits (12 octets) of raw data on the 447 medium). However the preamble (7 octets) and start of 448 frame delimeter (1 octet) are considered a constant gap that 449 should be included in the interframe-gap. Thus the minimum 450 value for standard ethernet transmission should be considered 451 20 octets."; 452 } 453 leaf interburst-gap { 454 type uint32; 455 description 456 "Similar to the interframe-gap but takes place between 457 any two bursts of the stream."; 458 } 459 leaf frames-per-burst { 460 type uint32; 461 description 462 "Number of frames contained in a burst"; 463 } 464 } 466 grouping traffic-generator-multi-stream-data { 467 description 468 "Multi stream traffic generation parameters."; 469 container streams { 470 description 471 "Non-presence container holding the configured stream list."; 472 list stream { 473 key "id"; 474 description 475 "Each stream repeats a burst until frames-per-stream 476 count is reached followed by interstream-gap delay."; 478 leaf id { 479 type uint32; 480 description 481 "Number specifying the order of the stream."; 482 } 483 uses traffic-generator-burst-data; 484 leaf frames-per-stream { 485 type uint32; 486 mandatory true; 487 description 488 "The count of frames to be generated before 489 generation of the next stream is started."; 490 } 491 leaf interstream-gap { 492 type uint32; 493 mandatory true; 494 description 495 "Idle period after the last frame of the last burst."; 496 } 497 } 498 } 499 } 501 grouping ethernet-data { 502 description 503 "Ethernet frame data specific parameters."; 504 reference 505 "IEEE 802-2014 Clause 9.2"; 506 leaf src-mac-address { 507 type yang:mac-address; 508 description 509 "Source Address field of the generated Ethernet packet."; 510 } 511 leaf dst-mac-address { 512 type yang:mac-address; 513 description 514 "Destination Address field of the generated Ethernet packet."; 515 } 516 leaf ether-type { 517 type uint16; 518 description 519 "Length/Type field of the generated Ethernet packet."; 520 } 521 container vlan { 522 if-feature "ethernet-vlan"; 523 description 524 "VLAN tag fields.."; 525 leaf id { 526 type uint16 { 527 range "0..4095"; 528 } 529 mandatory true; 530 description 531 "VLAN id."; 532 } 533 leaf tpid { 534 type uint16; 535 default "33024"; 536 description 537 "Configures the Tag Protocol Identifier (TPID) 538 of the 802.1q VLAN tag sent. This value is used 539 together whith the vlan id for filtering incoming 540 vlan tagged packets."; 541 } 542 leaf pcp { 543 type uint8 { 544 range "0..7"; 545 } 546 default "0"; 547 description 548 "Configures the IEEE 802.1p Priority Code Point (PCP) value 549 of the transmitted 802.1q VLAN tag."; 550 } 551 leaf cfi { 552 type uint8 { 553 range "0..1"; 554 } 555 default "0"; 556 description 557 "Configures the Canonical Format Identifier (CFI) field 558 (shall be 0 for Ethernet switches) of the transmitted 559 802.1q VLAN tag."; 560 } 561 } 562 } 564 augment "/if:interfaces/if:interface" { 565 description 566 "Traffic generator augmentations of ietf-interfaces."; 567 container traffic-generator { 568 if-feature "egress-direction"; 569 description 570 "Traffic generator for egress direction."; 571 choice type { 572 description 573 "Choice of the type of the data model of the generator. 575 Single or multi stream."; 576 case single-stream { 577 uses traffic-generator-burst-data; 578 } 579 case multi-stream { 580 uses traffic-generator-multi-stream-data; 581 } 582 } 583 leaf total-frames { 584 type uint64; 585 description 586 "If this leaf is present the stream generation will stop 587 after the specified number of frames are generated."; 588 } 589 } 590 container traffic-generator-ingress { 591 if-feature "ingress-direction"; 592 description 593 "Traffic generator for ingress direction."; 594 choice type { 595 description 596 "Choice of the type of the data model of the generator. 597 Single or multi stream."; 598 case single-stream { 599 uses traffic-generator-burst-data; 600 } 601 case multi-stream { 602 uses traffic-generator-multi-stream-data; 603 } 604 } 605 leaf total-frames { 606 type uint64; 607 description 608 "If this leaf is present the stream generation will stop 609 after the specified number of frames are generated."; 610 } 611 } 612 } 614 augment "/if:interfaces-state/if:interface/if:statistics" { 615 description 616 "Counters of generated traffic octets and packets."; 617 leaf generated-pkts { 618 type yang:counter64; 619 description 620 "Traffic generator packets sent."; 621 } 622 leaf generated-octets { 623 type yang:counter64; 624 description 625 "Traffic generator octets sent."; 626 } 627 leaf generated-ingress-pkts { 628 if-feature "ingress-direction"; 629 type yang:counter64; 630 description 631 "Traffic generator packets generated in ingress mode."; 632 } 633 leaf generated-ingress-octets { 634 if-feature "ingress-direction"; 635 type yang:counter64; 636 description 637 "Traffic generator octets generated in ingress mode."; 638 } 639 } 641 augment "/if:interfaces/if:interface/tg:traffic-generator/tg:type/" 642 + "tg:single-stream" { 643 when "derived-from-or-self(../if:type, 'ianaift:ethernetCsmacd')" { 644 description 645 "Ethernet interface type."; 646 } 647 if-feature "ethernet"; 648 description 649 "Ethernet specific augmentation for egress 650 single stream generator type."; 651 uses ethernet-data; 652 } 654 augment "/if:interfaces/if:interface/tg:traffic-generator/tg:type/" 655 + "tg:multi-stream/tg:streams/tg:stream" { 656 when "derived-from-or-self(../../../if:type, 'ianaift:ethernetCsmacd')" { 657 description 658 "Ethernet interface type."; 659 } 660 if-feature "ethernet"; 661 description 662 "Ethernet specific augmentation for egress 663 multi stream generator type."; 664 uses ethernet-data; 665 } 667 augment "/if:interfaces/if:interface/tg:traffic-generator-ingress/tg:type/" 668 + "tg:single-stream" { 669 when "derived-from-or-self(../if:type, 'ianaift:ethernetCsmacd')" { 670 description 671 "Ethernet interface type."; 672 } 673 if-feature "ethernet"; 674 description 675 "Ethernet specific augmentation for ingress 676 single stream generator type."; 677 uses ethernet-data; 678 } 680 augment "/if:interfaces/if:interface/tg:traffic-generator-ingress/tg:type/" 681 + "tg:multi-stream/tg:streams/tg:stream" { 682 when "derived-from-or-self(../../../if:type, 'ianaift:ethernetCsmacd')" { 683 description 684 "Ethernet interface type."; 685 } 686 if-feature "ethernet"; 687 description 688 "Ethernet specific augmentation for ingress 689 multi stream generator type."; 690 uses ethernet-data; 691 } 692 } 694 696 6. Traffic Analyzer Module YANG 698 file "ietf-traffic-analyzer@2019-10-08.yang" 700 module ietf-traffic-analyzer { 701 yang-version 1.1; 702 namespace "urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer"; 703 prefix ta; 705 import ietf-interfaces { 706 prefix if; 707 } 708 import ietf-yang-types { 709 prefix yang; 710 } 712 organization 713 "IETF Benchmarking Methodology Working Group"; 714 contact 715 "WG Web: 716 WG List: 718 Editor: Vladimir Vassilev 719 "; 720 description 721 "This module contains a collection of YANG definitions for 722 description and management of network interconnect testers. 724 Copyright (c) 2019 IETF Trust and the persons identified as 725 authors of the code. All rights reserved. 727 Redistribution and use in source and binary forms, with or 728 without modification, is permitted pursuant to, and subject 729 to the license terms contained in, the Simplified BSD License 730 set forth in Section 4.c of the IETF Trust's Legal Provisions 731 Relating to IETF Documents 732 (http://trustee.ietf.org/license-info). 734 This version of this YANG module is part of RFC XXXX; see 735 the RFC itself for full legal notices."; 737 revision 2019-10-08 { 738 description 739 "Initial revision."; 740 reference 741 "RFC XXXX: Network Interconnect Tester"; 742 } 744 feature egress-direction { 745 description 746 "The device can analyze traffic from the egress direction."; 747 } 749 feature ingress-direction { 750 description 751 "The device can generate traffic from the ingress direction."; 752 } 754 feature filter { 755 description 756 "This feature indicates that the device implements 757 filter that can specify a subset of packets to be 758 analyzed when filtering is enabled."; 759 } 761 feature capture { 762 description 763 "This feature indicates that the device implements 764 packet capture functionality."; 765 } 766 identity filter { 767 description 768 "Base filter identity."; 769 } 771 identity ethernet { 772 base ta:filter; 773 description 774 "Ethernet packet fields filter."; 775 } 777 grouping statistics-data { 778 description 779 "Analyzer statistics."; 780 leaf pkts { 781 type yang:counter64; 782 description 783 "Total number of packets analyzed."; 784 } 785 leaf errors { 786 type yang:counter64; 787 description 788 "Count of packets with errors. 789 Not counted in the pkts or captured. 790 For example packets with CRC error."; 791 } 792 container testframe-stats { 793 description 794 "Statistics for testframe packets containing 795 either sequence number, payload checksum, 796 timestamp or any combination of these features."; 797 leaf testframe-pkts { 798 type yang:counter64; 799 description 800 "Total count of detected testframe packets."; 801 } 802 leaf sequence-errors { 803 type yang:counter64; 804 description 805 "Total count of testframe packets with 806 unexpected sequence number. After each sequence 807 error the expected next sequence number is 808 updated."; 809 } 810 leaf payload-errors { 811 type yang:counter64; 812 description 813 "Total count of testframe packets with 814 payload errors."; 815 } 816 container latency { 817 description 818 "Latency statistics."; 819 leaf samples { 820 type uint64; 821 description 822 "Total count of packets used for estimating 823 the latency statistics. Ideally 824 samples=../testframe-stats."; 825 } 826 leaf min { 827 type uint64; 828 units "nanoseconds"; 829 description 830 "Minimum measured latency."; 831 } 832 leaf max { 833 type uint64; 834 units "nanoseconds"; 835 description 836 "Maximum measured latency."; 837 } 838 leaf average { 839 type uint64; 840 units "nanoseconds"; 841 description 842 "The sum of all sampled latencies divided 843 by the number of samples."; 844 } 845 leaf latest { 846 type uint64; 847 units "nanoseconds"; 848 description 849 "Latency of the latest sample."; 850 } 851 } 852 } 853 } 855 grouping capture-data { 856 description 857 "Grouping with statistics and data 858 of one or more captured frame."; 859 container capture { 860 if-feature "capture"; 861 description 862 "Statistics and data of 863 one or more captured frames."; 864 list frame { 865 key "sequence-number"; 866 description 867 "Statistics and data of a captured frame."; 868 leaf sequence-number { 869 type uint64; 870 description 871 "Incremental counter of frames captured."; 872 } 873 leaf timestamp { 874 type yang:date-and-time; 875 description 876 "Timestamp of the moment the frame was captured."; 877 } 878 leaf length { 879 type uint32; 880 description 881 "Frame length. Ideally the data captured will be 882 of the same length but can be shorter 883 depending on implementation limitations."; 884 } 885 leaf preceding-interframe-gap { 886 type uint32; 887 units "nanoseconds"; 888 description 889 "Measured delay between the reception of the previous 890 frame was completed and the reception of the current 891 frame was started."; 892 } 893 leaf data { 894 type string { 895 pattern '([0-9A-F]{2})*'; 896 } 897 description 898 "Raw data of the captured frame."; 899 } 900 } 901 } 902 } 904 grouping filter-data { 905 description 906 "Grouping with a filter container specifying the filtering 907 rules for processing only a specific subset of the 908 frames."; 909 container filter { 910 if-feature "filter"; 911 presence "When present packets are 912 filtered before analyzed according 913 to the filter type"; 914 description 915 "Contains the filtering rules for processing only 916 a specific subset of the frames."; 917 leaf type { 918 type identityref { 919 base ta:filter; 920 } 921 mandatory true; 922 description 923 "Type of the applied filter. External modules can 924 define alternative filter type identities."; 925 } 926 } 927 } 929 augment "/if:interfaces/if:interface" { 930 description 931 "Traffic analyzer augmentations of ietf-interfaces."; 932 container traffic-analyzer { 933 if-feature "ingress-direction"; 934 presence "Enables the traffic analyzer for ingress traffic."; 935 description 936 "Traffic analyzer for ingress direction."; 937 uses filter-data; 938 container state { 939 config false; 940 description 941 "State data."; 942 uses statistics-data; 943 uses capture-data; 944 } 945 } 946 container traffic-analyzer-egress { 947 if-feature "egress-direction"; 948 presence "Enables the traffic analyzer for egress traffic."; 949 description 950 "Traffic analyzer for egress direction."; 951 uses filter-data; 952 container state { 953 config false; 954 description 955 "State data."; 956 uses statistics-data; 957 uses capture-data; 959 } 960 } 961 } 963 augment "/if:interfaces/if:interface/ta:traffic-analyzer/ta:filter" { 964 when "ta:type = 'ta:ethernet'"; 965 description 966 "Ethernet frame specific filter type."; 967 leaf ether-type { 968 type uint16; 969 description 970 "The Ethernet Type (or Length) value 971 defined by IEEE 802."; 972 reference 973 "IEEE 802-2014 Clause 9.2"; 974 } 975 } 977 augment "/if:interfaces-state/if:interface/if:statistics" { 978 if-feature "ingress-direction"; 979 description 980 "Counters implemented by ports with analyzers."; 981 leaf testframe-pkts { 982 type yang:counter64; 983 description 984 "Testframe packets recognized by the traffic analyzer."; 985 } 986 leaf testframe-sequence-errors { 987 type yang:counter64; 988 description 989 "Testframe packets part of the recognized total 990 but with unexpected sequence number."; 991 } 992 leaf testframe-payload-errors { 993 type yang:counter64; 994 description 995 "Testframe packets part of the recognized total 996 but with payload errors."; 997 } 998 } 1000 augment "/if:interfaces-state/if:interface/if:statistics" { 1001 if-feature "egress-direction"; 1002 description 1003 "Counters implemented by ports with egress analyzers."; 1004 leaf testframe-egress-pkts { 1005 type yang:counter64; 1006 description 1007 "Testframe egress packets recognized by the traffic analyzer."; 1008 } 1009 leaf testframe-egress-sequence-errors { 1010 type yang:counter64; 1011 description 1012 "Testframe egress packets part of the recognized total 1013 but with unexpected sequence number."; 1014 } 1015 leaf testframe-egress-payload-errors { 1016 type yang:counter64; 1017 description 1018 "Testframe egress packets part of the recognized total 1019 but with payload errors."; 1020 } 1021 } 1022 } 1024 1026 7. IANA Considerations 1028 This document registers three URIs and three YANG modules. 1030 7.1. URI Registration 1032 This document registers three URIs in the IETF XML registry 1033 [RFC3688]. Following the format in RFC 3688, the following 1034 registration is requested to be made: 1036 URI: urn:ietf:params:xml:ns:yang:ietf-traffic-generator 1037 URI: urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer 1038 URI: urn:ietf:params:xml:ns:yang:ietf-loopback 1040 Registrant Contact: The IESG. 1042 XML: N/A, the requested URI is an XML namespace. 1044 7.2. YANG Module Name Registration 1046 This document registers three YANG module in the YANG Module Names 1047 registry YANG [RFC6020]. 1049 name: ietf-traffic-generator 1050 namespace: urn:ietf:params:xml:ns:yang:ietf-traffic-generator 1051 prefix: tg 1052 reference: RFC XXXX 1054 name: ietf-traffic-analyzer 1055 namespace: urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer 1056 prefix: ta 1057 reference: RFC XXXX 1059 8. Security Considerations 1061 This document does not introduce any new security concerns in 1062 addition to those specified in [RFC7950], section 15. 1064 9. References 1066 9.1. Normative References 1068 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1069 Requirement Levels", BCP 14, RFC 2119, 1070 DOI 10.17487/RFC2119, March 1997, 1071 . 1073 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1074 the Network Configuration Protocol (NETCONF)", RFC 6020, 1075 DOI 10.17487/RFC6020, October 2010, 1076 . 1078 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 1079 RFC 7950, DOI 10.17487/RFC7950, August 2016, 1080 . 1082 9.2. Informative References 1084 [RFC2544] Bradner, S. and J. McQuaid, "Benchmarking Methodology for 1085 Network Interconnect Devices", RFC 2544, 1086 DOI 10.17487/RFC2544, March 1999, 1087 . 1089 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1090 DOI 10.17487/RFC3688, January 2004, 1091 . 1093 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 1094 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 1095 . 1097 Appendix A. Examples 1099 The following topology will be used for the examples in this section: 1101 +-------------+ +------------+ +------------+ 1102 | | e0 e0 | | e1 e0 | | 1103 | tester0 TG|>-------->| dut0 |>------->|TA tester1 | 1104 | | | | | | 1105 +-------------+ +------------+ +------------+ 1107 A.1. Basic Test Program 1109 This program based on transactional network test API shows how the 1110 modules can be used: 1112 #Connect to network 1113 net=tntapi.connect("topology.xml") 1115 # Configure DUTs and enable traffic-analyzers 1116 net.node("dut0").edit( \ 1117 "create /interfaces/interface[name='e0'] -- type=ethernetCsmacd") 1118 net.node("dut0").edit( 1119 "create /interfaces/interface[name='e1'] -- type=ethernetCsmacd") 1120 net.node("dut0").edit( 1121 "create /flows/flow[id='t0'] -- match/in-port=e0 " 1122 "actions/action[order='0']/output-action/out-port=e0") 1124 net.node("tester1").edit( 1125 "create /interfaces/interface[name='e0']/traffic-analyzer") 1126 net.commit() 1128 #Get network state - before 1129 before=net.get() 1131 # Start traffic 1132 net.node("tester0).edit( 1133 "create /interfaces/interface[name='e0']/traffic-generator -- " 1134 "frame-size=64 interframe-gap=20") 1136 net.commit() 1138 time.sleep(60) 1140 # Stop traffic 1141 net.node("tester1").edit("delete /interfaces/interface[name='e0']/" 1142 "traffic-generator") 1143 net.commit() 1144 #Get network state - after 1145 after=net.get() 1147 #Report 1148 sent_pkts=delta("tester0",before,after, 1149 "/interfaces/interface[name='e0']/statistics/out-unicast-pkts") 1151 received_pkts=delta("tester1",before,after, 1152 "/interfaces/interface[name='e0']/statistics/in-unicast-pkts") 1154 latency_max=absolute(after, 1155 "/interfaces/interface[name='e0']/traffic-analyzer/state/" 1156 "testframe-stats/latency/max") 1158 #Cleanup 1159 net.node("tester1").edit( 1160 "delete /interfaces/interface/traffic-analyzer") 1161 net.node("dut0").edit("delete /flows") 1162 net.node("dut0").edit("delete /interfaces") 1163 net.commit() 1165 A.2. Generating RFC2544 Testframes 1167 In sec. C.2.6.4 Test Frames a detailed format is specified. The 1168 frame-data leaf allows full control over the generated frames 1169 payload. 1171 ... 1172 net.node("tester1").edit( 1173 "merge /interfaces/interface[name='e0']/" 1174 "traffic-generator -- frame-data=" 1175 "6CA96F0000026CA96F00000108004500" 1176 "002ED4A500000A115816C0000201C000" 1177 "0202C0200007001A0000010203040506" 1178 "0708090A0B0C0D0E0F101112") 1179 ... 1181 Author's Address 1183 Vladimir Vassilev 1184 Lightside Instruments 1186 Email: vladimir@lightside-instruments.com