idnits 2.17.1 draft-vassilev-bmwg-network-interconnect-tester-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 == Line 191 has weird spacing: '...-stream uin...' == Line 237 has weird spacing: '...-stream uin...' == Line 292 has weird spacing: '...rw type ide...' -- The document date (September 5, 2020) is 1330 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: 0 errors (**), 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 September 5, 2020 5 Expires: March 9, 2021 7 A YANG Data Model for Network Interconnect Tester Management 8 draft-vassilev-bmwg-network-interconnect-tester-04 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 March 9, 2021. 33 Copyright Notice 35 Copyright (c) 2020 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 . . . . . . . . . . . . . . . . . . . . 2 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 . . . . . . . . . . . . . . . . 8 60 6. Traffic Analyzer Module YANG . . . . . . . . . . . . . . . . 16 61 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 62 7.1. URI Registration . . . . . . . . . . . . . . . . . . . . 23 63 7.2. YANG Module Name Registration . . . . . . . . . . . . . . 23 64 8. Security Considerations . . . . . . . . . . . . . . . . . . . 24 65 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 24 66 9.1. Normative References . . . . . . . . . . . . . . . . . . 24 67 9.2. Informative References . . . . . . . . . . . . . . . . . 24 68 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 24 69 A.1. Basic Test Program . . . . . . . . . . . . . . . . . . . 25 70 A.2. Generating RFC2544 Testframes . . . . . . . . . . . . . . 26 71 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 26 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 1.1.1. Definitions and Acronyms 85 DUT: Device Under Test 87 TA: Traffic Analyzer 89 TG: Traffic Generator 91 1.1.2. Tree Diagram 93 For a reference to the annotations used in tree diagrams included in 94 this document, please see YANG Tree Diagrams [RFC8340]. 96 1.2. Problem Statement 98 Network interconnect tests require active network elements part of 99 the tested network that generate test traffic and network elements 100 that analyze the test traffic at one or more points of its path. A 101 network interconnect tester is a device that can either generate test 102 traffic, analyze test traffic or both. Here is a figure borrowed 103 from [RFC2544] representing the horseshoe test setup topology 104 consisting of a single tester and a single DUT connected in a network 105 interconnect loop. 107 +------------+ 108 | | 109 +------------| tester |<-------------+ 110 | | | | 111 | +------------+ | 112 | | 113 | +------------+ | 114 | | | | 115 +----------->| DUT |--------------+ 116 | | 117 +------------+ 119 This document attempts to address the problem of defining YANG model 120 of a network interconnect tester that can be used for development of 121 vendor independent network interconnect tests and utilize the 122 advantages of transactional management using standard protocols like 123 NETCONF. 125 1.3. Solution 127 The proposed model splits the design into 3 modules - 1) Traffic 128 Generator module (TG), 2) Traffic Analyzer module (TA). The modules 129 are implemented as augmentations of the ietf-interfaces module adding 130 configuration and state data that models the functionality of a 131 tester. The TA and TG modules concept is illustrated with the 132 following diagram of a tester with two interfaces (named e0 and e1) 133 connected in a loop with single DUT: 135 +----------------+ 136 e0.egress | | e1.ingress 137 +------------| TG tester TA |<-------------+ 138 | | | | 139 | +----------------+ | 140 | | 141 | +------------+ | 142 | | | | 143 +------------->| DUT |----------------+ 144 | | 145 +------------+ 147 2. Using the network interconnect tester model 149 Basic example of how the model can be used in transactional network 150 test API to control the testers part of a network and report counter 151 statistics and timing measurement data is presented in Appendix A. 152 All example cases present the configuration and state data from a 153 single test trial. The search algorithm logic that operates to 154 control the trial configuration is outside the scope of this 155 document. One of the examples demonstrates the use of the [RFC2544] 156 defined testframe packet. 158 3. Traffic Generator Module Tree Diagram 160 module: ietf-traffic-generator 161 augment /if:interfaces/if:interface: 162 +--rw traffic-generator {egress-direction}? 163 | +--rw (type)? 164 | | +--:(single-stream) 165 | | | +--rw frame-size uint32 166 | | | +--rw (frame-data-type)? 167 | | | | +--:(raw-frame-data) 168 | | | | +--rw frame-data? string 169 | | | +--rw interframe-gap uint32 170 | | | +--rw interburst-gap? uint32 171 | | | +--rw frames-per-burst? uint32 172 | | | +--rw src-mac-address? yang:mac-address {ethernet}? 173 | | | +--rw dst-mac-address? yang:mac-address {ethernet}? 174 | | | +--rw ether-type? uint16 {ethernet}? 175 | | | +--rw vlan {ethernet-vlan,ethernet}? 176 | | | +--rw id uint16 177 | | | +--rw tpid? uint16 178 | | | +--rw pcp? uint8 179 | | | +--rw cfi? uint8 180 | | +--:(multi-stream) 181 | | +--rw streams 182 | | +--rw stream* [id] 183 | | +--rw id uint32 184 | | +--rw frame-size uint32 185 | | +--rw (frame-data-type)? 186 | | | +--:(raw-frame-data) 187 | | | +--rw frame-data? string 188 | | +--rw interframe-gap uint32 189 | | +--rw interburst-gap? uint32 190 | | +--rw frames-per-burst? uint32 191 | | +--rw frames-per-stream uint32 192 | | +--rw interstream-gap uint32 193 | | +--rw src-mac-address? 194 | | yang:mac-address {ethernet}? 195 | | +--rw dst-mac-address? 196 | | yang:mac-address {ethernet}? 197 | | +--rw ether-type? 198 | | uint16 {ethernet}? 199 | | +--rw vlan {ethernet-vlan,ethernet}? 200 | | +--rw id uint16 201 | | +--rw tpid? uint16 202 | | +--rw pcp? uint8 203 | | +--rw cfi? uint8 204 | +--rw realtime-epoch? yang:date-and-time 205 | | {realtime-epoch}? 206 | | 207 | +--rw total-frames? uint64 208 +--rw traffic-generator-ingress {ingress-direction}? 209 +--rw (type)? 210 | +--:(single-stream) 211 | | +--rw frame-size uint32 212 | | +--rw (frame-data-type)? 213 | | | +--:(raw-frame-data) 214 | | | +--rw frame-data? string 215 | | +--rw interframe-gap uint32 216 | | +--rw interburst-gap? uint32 217 | | +--rw frames-per-burst? uint32 218 | | +--rw src-mac-address? yang:mac-address {ethernet}? 219 | | +--rw dst-mac-address? yang:mac-address {ethernet}? 220 | | +--rw ether-type? uint16 {ethernet}? 221 | | +--rw vlan {ethernet-vlan,ethernet}? 222 | | +--rw id uint16 223 | | +--rw tpid? uint16 224 | | +--rw pcp? uint8 225 | | +--rw cfi? uint8 226 | +--:(multi-stream) 227 | +--rw streams 228 | +--rw stream* [id] 229 | +--rw id uint32 230 | +--rw frame-size uint32 231 | +--rw (frame-data-type)? 232 | | +--:(raw-frame-data) 233 | | +--rw frame-data? string 234 | +--rw interframe-gap uint32 235 | +--rw interburst-gap? uint32 236 | +--rw frames-per-burst? uint32 237 | +--rw frames-per-stream uint32 238 | +--rw interstream-gap uint32 239 | +--rw src-mac-address? 240 | yang:mac-address {ethernet}? 241 | +--rw dst-mac-address? 242 | yang:mac-address {ethernet}? 243 | +--rw ether-type? 244 | uint16 {ethernet}? 245 | +--rw vlan {ethernet-vlan,ethernet}? 246 | +--rw id uint16 247 | +--rw tpid? uint16 248 | +--rw pcp? uint8 249 | +--rw cfi? uint8 250 +--rw realtime-epoch? yang:date-and-time 251 | {realtime-epoch}? 252 | 253 +--rw total-frames? uint64 254 augment /if:interfaces-state/if:interface/if:statistics: 255 +--ro generated-pkts? yang:counter64 256 +--ro generated-octets? yang:counter64 257 +--ro generated-ingress-pkts? 258 | yang:counter64 {ingress-direction}? 259 +--ro generated-ingress-octets? 260 yang:counter64 {ingress-direction}? 262 4. Traffic Analyzer Module Tree Diagram 264 module: ietf-traffic-analyzer 265 augment /if:interfaces/if:interface: 266 +--rw traffic-analyzer! {ingress-direction}? 267 | +--rw filter! {filter}? 268 | | +--rw type identityref 269 | | +--rw ether-type? uint16 270 | +--ro state 271 | +--ro pkts? yang:counter64 272 | +--ro errors? yang:counter64 273 | +--ro testframe-stats 274 | | +--ro testframe-pkts? yang:counter64 275 | | +--ro sequence-errors? yang:counter64 276 | | +--ro payload-errors? yang:counter64 277 | | +--ro latency 278 | | +--ro samples? uint64 279 | | +--ro min? uint64 280 | | +--ro max? uint64 281 | | +--ro average? uint64 282 | | +--ro latest? uint64 283 | +--ro capture {capture}? 284 | +--ro frame* [sequence-number] 285 | +--ro sequence-number uint64 286 | +--ro timestamp? yang:date-and-time 287 | +--ro length? uint32 288 | +--ro preceding-interframe-gap? uint32 289 | +--ro data? string 290 +--rw traffic-analyzer-egress! {egress-direction}? 291 +--rw filter! {filter}? 292 | +--rw type identityref 293 +--ro state 294 +--ro pkts? yang:counter64 295 +--ro errors? yang:counter64 296 +--ro testframe-stats 297 | +--ro testframe-pkts? yang:counter64 298 | +--ro sequence-errors? yang:counter64 299 | +--ro payload-errors? yang:counter64 300 | +--ro latency 301 | +--ro samples? uint64 302 | +--ro min? uint64 303 | +--ro max? uint64 304 | +--ro average? uint64 305 | +--ro latest? uint64 306 +--ro capture {capture}? 307 +--ro frame* [sequence-number] 308 +--ro sequence-number uint64 309 +--ro timestamp? yang:date-and-time 310 +--ro length? uint32 311 +--ro preceding-interframe-gap? uint32 312 +--ro data? string 313 augment /if:interfaces-state/if:interface/if:statistics: 314 +--ro testframe-pkts? 315 | yang:counter64 {ingress-direction}? 316 +--ro testframe-sequence-errors? 317 | yang:counter64 {ingress-direction}? 318 +--ro testframe-payload-errors? 319 yang:counter64 {ingress-direction}? 320 augment /if:interfaces-state/if:interface/if:statistics: 321 +--ro testframe-egress-pkts? 322 | yang:counter64 {egress-direction}? 323 +--ro testframe-egress-sequence-errors? 324 | yang:counter64 {egress-direction}? 325 +--ro testframe-egress-payload-errors? 326 yang:counter64 {egress-direction}? 328 5. Traffic Generator Module YANG 330 file "ietf-traffic-generator@2020-09-05.yang" 332 module ietf-traffic-generator { 333 yang-version 1.1; 334 namespace "urn:ietf:params:xml:ns:yang:ietf-traffic-generator"; 335 prefix tg; 337 import ietf-interfaces { 338 prefix if; 339 reference 340 "RFC 8343: A YANG Data Model For Interface Management"; 341 } 342 import ietf-yang-types { 343 prefix yang; 344 reference 345 "RFC 6991: Common YANG Data Types"; 346 } 347 import iana-if-type { 348 prefix ianaift; 349 reference 350 "RFC 7224: IANA Interface Type YANG Module"; 351 } 353 organization 354 "IETF Benchmarking Methodology Working Group"; 355 contact 356 "WG Web: 357 WG List: 359 Editor: Vladimir Vassilev 360 "; 361 description 362 "This module contains a collection of YANG definitions for 363 description and management of network interconnect testers. 365 Copyright (c) 2020 IETF Trust and the persons identified as 366 authors of the code. All rights reserved. 368 Redistribution and use in source and binary forms, with or 369 without modification, is permitted pursuant to, and subject 370 to the license terms contained in, the Simplified BSD License 371 set forth in Section 4.c of the IETF Trust's Legal Provisions 372 Relating to IETF Documents 373 (http://trustee.ietf.org/license-info). 374 This version of this YANG module is part of RFC XXXX; see 375 the RFC itself for full legal notices."; 377 revision 2020-09-05 { 378 description 379 "Initial revision."; 380 reference 381 "RFC XXXX: A YANG Data Model for 382 Network Interconnect Tester Management"; 383 } 385 feature egress-direction { 386 description 387 "The device can generate traffic in the egress direction."; 388 } 390 feature ingress-direction { 391 description 392 "The device can generate traffic in the ingress direction."; 393 } 395 feature multi-stream { 396 description 397 "The device can generate multi-stream traffic."; 398 } 400 feature ethernet { 401 description 402 "The device can generate ethernet traffic."; 403 } 405 feature ethernet-vlan { 406 if-feature "ethernet"; 407 description 408 "The device can generate vlan tagged ethernet traffic."; 409 } 411 feature realtime-epoch { 412 description 413 "The device can generate traffic precisely 414 at configured realtime epoch."; 415 } 417 grouping common-data { 418 description 419 "Common configuration data."; 420 leaf realtime-epoch { 421 if-feature "realtime-epoch"; 422 type yang:date-and-time; 423 description 424 "If this leaf is present the stream generation will start 425 at the specified realtime epoch."; 426 } 427 leaf total-frames { 428 type uint64; 429 description 430 "If this leaf is present the traffic generation will stop 431 after the specified number of frames are generated."; 432 } 433 } 435 grouping burst-data { 436 description 437 "Generated traffic burst parameters."; 438 leaf frame-size { 439 type uint32; 440 mandatory true; 441 description 442 "Size of the frames generated. For example for 443 ethernet interfaces the following definition 444 applies: 446 Ethernet frame-size in octets includes: 447 * Destination Address (6 octets), 448 * Source Address (6 octets), 449 * Frame Type (2 octets), 450 * Data (min 46 octets or 42 octets + 4 octets 802.1Q tag), 451 * CRC Checksum (4 octets). 453 Ethernet frame-size does not include: 454 * Preamble (dependent on MAC configuration 455 by default 7 octets), 456 * Start of frame delimiter (1 octet) 458 Minimum standard ethernet frame-size is 64 bytes but 459 generators might support smaller sizes for validation."; 460 } 461 choice frame-data-type { 462 description 463 "Choice of frame data type generated."; 464 case raw-frame-data { 465 leaf frame-data { 466 type string { 467 pattern '([0-9A-F]{2})*'; 468 } 469 must 'string-length(.)<=(../frame-size*2)'; 470 description 471 "The raw frame data specified as hexadecimal string. 472 The specified data can be shorter then the ../frame-size 473 value specifying only the header or the header and the 474 payload without for example the 4 byte CRC Checksum 475 in the case of a Ethernet frame."; 476 } 477 } 478 } 479 leaf interframe-gap { 480 type uint32; 481 mandatory true; 482 description 483 "Length of the idle period between generated frames. 484 For example for ethernet interfaces the following 485 definition applies: 487 Ethernet interframe-gap between transmission of frames 488 known as the interframe gap (IFG). A brief recovery time 489 between frames allows devices to prepare for 490 reception of the next frame. The minimum 491 interframe gap is 96 bit times (12 octet times) (the time it 492 takes to transmit 96 bits (12 octets) of raw data on the 493 medium). However the preamble (7 octets) and start of 494 frame delimiter (1 octet) are considered a constant gap that 495 should be included in the interframe-gap. Thus the minimum 496 value for standard ethernet transmission should be considered 497 20 octets."; 498 } 499 leaf interburst-gap { 500 type uint32; 501 description 502 "Similar to the interframe-gap but takes place between 503 any two bursts of the stream."; 504 } 505 leaf frames-per-burst { 506 type uint32; 507 description 508 "Number of frames contained in a burst"; 509 } 510 } 512 grouping multi-stream-data { 513 description 514 "Multi stream traffic generation parameters."; 515 container streams { 516 description 517 "Non-presence container holding the configured stream list."; 519 list stream { 520 key "id"; 521 description 522 "Each stream repeats a burst until frames-per-stream 523 count is reached followed by interstream-gap delay."; 524 leaf id { 525 type uint32; 526 description 527 "Number specifying the order of the stream."; 528 } 529 uses burst-data; 530 leaf frames-per-stream { 531 type uint32; 532 mandatory true; 533 description 534 "The count of frames to be generated before 535 generation of the next stream is started."; 536 } 537 leaf interstream-gap { 538 type uint32; 539 mandatory true; 540 description 541 "Idle period after the last frame of the last burst."; 542 } 543 } 544 } 545 } 547 grouping ethernet-data { 548 description 549 "Ethernet frame data specific parameters."; 550 reference 551 "IEEE 802-2014 Clause 9.2"; 552 leaf src-mac-address { 553 type yang:mac-address; 554 description 555 "Source Address field of the generated Ethernet packet."; 556 } 557 leaf dst-mac-address { 558 type yang:mac-address; 559 description 560 "Destination Address field of the generated Ethernet packet."; 561 } 562 leaf ether-type { 563 type uint16; 564 description 565 "Length/Type field of the generated Ethernet packet."; 566 } 567 container vlan { 568 if-feature "ethernet-vlan"; 569 description 570 "VLAN tag fields.."; 571 leaf id { 572 type uint16 { 573 range "0..4095"; 574 } 575 mandatory true; 576 description 577 "VLAN id."; 578 } 579 leaf tpid { 580 type uint16; 581 default "33024"; 582 description 583 "Configures the Tag Protocol Identifier (TPID) 584 of the 802.1q VLAN tag sent. This value is used 585 together with the vlan id for filtering incoming 586 vlan tagged packets."; 587 } 588 leaf pcp { 589 type uint8 { 590 range "0..7"; 591 } 592 default "0"; 593 description 594 "Configures the IEEE 802.1p Priority Code Point (PCP) value 595 of the transmitted 802.1q VLAN tag."; 596 } 597 leaf cfi { 598 type uint8 { 599 range "0..1"; 600 } 601 default "0"; 602 description 603 "Configures the Canonical Format Identifier (CFI) field 604 (shall be 0 for Ethernet switches) of the transmitted 605 802.1q VLAN tag."; 606 } 607 } 608 } 610 augment "/if:interfaces/if:interface" { 611 description 612 "Traffic generator augmentations of ietf-interfaces."; 613 container traffic-generator { 614 if-feature "egress-direction"; 615 description 616 "Traffic generator for egress direction."; 617 choice type { 618 description 619 "Choice of the type of the data model of the generator. 620 Single or multi stream."; 621 case single-stream { 622 uses burst-data; 623 } 624 case multi-stream { 625 uses multi-stream-data; 626 } 627 } 628 uses common-data; 629 } 630 container traffic-generator-ingress { 631 if-feature "ingress-direction"; 632 description 633 "Traffic generator for ingress direction."; 634 choice type { 635 description 636 "Choice of the type of the data model of the generator. 637 Single or multi stream."; 638 case single-stream { 639 uses burst-data; 640 } 641 case multi-stream { 642 uses multi-stream-data; 643 } 644 } 645 uses common-data; 646 } 647 } 649 augment "/if:interfaces-state/if:interface/if:statistics" { 650 description 651 "Counters of generated traffic octets and packets."; 652 leaf generated-pkts { 653 type yang:counter64; 654 description 655 "Traffic generator packets sent."; 656 } 657 leaf generated-octets { 658 type yang:counter64; 659 description 660 "Traffic generator octets sent."; 661 } 662 leaf generated-ingress-pkts { 663 if-feature "ingress-direction"; 664 type yang:counter64; 665 description 666 "Traffic generator packets generated in ingress mode."; 667 } 668 leaf generated-ingress-octets { 669 if-feature "ingress-direction"; 670 type yang:counter64; 671 description 672 "Traffic generator octets generated in ingress mode."; 673 } 674 } 676 augment "/if:interfaces/if:interface/tg:traffic-generator/tg:type/" 677 + "tg:single-stream" { 678 when "derived-from-or-self(../if:type, 'ianaift:ethernetCsmacd')" { 679 description 680 "Ethernet interface type."; 681 } 682 if-feature "ethernet"; 683 description 684 "Ethernet specific augmentation for egress 685 single stream generator type."; 686 uses ethernet-data; 687 } 689 augment "/if:interfaces/if:interface/tg:traffic-generator/" 690 + "tg:type/tg:multi-stream/tg:streams/tg:stream" { 691 when "derived-from-or-self(../../../if:type," 692 + "'ianaift:ethernetCsmacd')" { 693 description 694 "Ethernet interface type."; 695 } 696 if-feature "ethernet"; 697 description 698 "Ethernet specific augmentation for egress 699 multi stream generator type."; 700 uses ethernet-data; 701 } 703 augment "/if:interfaces/if:interface/tg:traffic-generator-ingress/" 704 + "tg:type/tg:single-stream" { 705 when "derived-from-or-self(../if:type, 'ianaift:ethernetCsmacd')" { 706 description 707 "Ethernet interface type."; 708 } 709 if-feature "ethernet"; 710 description 711 "Ethernet specific augmentation for ingress 712 single stream generator type."; 713 uses ethernet-data; 714 } 716 augment "/if:interfaces/if:interface/tg:traffic-generator-ingress/" 717 + "tg:type/tg:multi-stream/tg:streams/tg:stream" { 718 when "derived-from-or-self(../../../if:type," 719 + "'ianaift:ethernetCsmacd')" { 720 description 721 "Ethernet interface type."; 722 } 723 if-feature "ethernet"; 724 description 725 "Ethernet specific augmentation for ingress 726 multi stream generator type."; 727 uses ethernet-data; 728 } 729 } 731 733 6. Traffic Analyzer Module YANG 735 file "ietf-traffic-analyzer@2020-09-05.yang" 737 module ietf-traffic-analyzer { 738 yang-version 1.1; 739 namespace "urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer"; 740 prefix ta; 742 import ietf-interfaces { 743 prefix if; 744 reference 745 "RFC 8343: A YANG Data Model For Interface Management"; 746 } 747 import ietf-yang-types { 748 prefix yang; 749 reference "RFC 6991: Common YANG Data Types"; 750 } 752 organization 753 "IETF Benchmarking Methodology Working Group"; 754 contact 755 "WG Web: 756 WG List: 758 Editor: Vladimir Vassilev 759 "; 760 description 761 "This module contains a collection of YANG definitions for 762 description and management of network interconnect testers. 764 Copyright (c) 2020 IETF Trust and the persons identified as 765 authors of the code. All rights reserved. 767 Redistribution and use in source and binary forms, with or 768 without modification, is permitted pursuant to, and subject 769 to the license terms contained in, the Simplified BSD License 770 set forth in Section 4.c of the IETF Trust's Legal Provisions 771 Relating to IETF Documents 772 (http://trustee.ietf.org/license-info). 774 This version of this YANG module is part of RFC XXXX; see 775 the RFC itself for full legal notices."; 777 revision 2020-09-05 { 778 description 779 "Initial revision."; 780 reference 781 "RFC XXXX: A YANG Data Model for 782 Network Interconnect Tester Management"; 783 } 785 feature egress-direction { 786 description 787 "The device can analyze traffic from the egress direction."; 788 } 790 feature ingress-direction { 791 description 792 "The device can generate traffic from the ingress direction."; 793 } 795 feature filter { 796 description 797 "This feature indicates that the device implements 798 filter that can specify a subset of packets to be 799 analyzed when filtering is enabled."; 800 } 802 feature capture { 803 description 804 "This feature indicates that the device implements 805 packet capture functionality."; 806 } 807 identity filter { 808 description 809 "Base filter identity."; 810 } 812 identity ethernet { 813 base ta:filter; 814 description 815 "Ethernet packet fields filter."; 816 } 818 grouping statistics-data { 819 description 820 "Analyzer statistics."; 821 leaf pkts { 822 type yang:counter64; 823 description 824 "Total number of packets analyzed."; 825 } 826 leaf errors { 827 type yang:counter64; 828 description 829 "Count of packets with errors. 830 Not counted in the pkts or captured. 831 For example packets with CRC error."; 832 } 833 container testframe-stats { 834 description 835 "Statistics for testframe packets containing 836 either sequence number, payload checksum, 837 timestamp or any combination of these features."; 838 leaf testframe-pkts { 839 type yang:counter64; 840 description 841 "Total count of detected testframe packets."; 842 } 843 leaf sequence-errors { 844 type yang:counter64; 845 description 846 "Total count of testframe packets with 847 unexpected sequence number. After each sequence 848 error the expected next sequence number is 849 updated."; 850 } 851 leaf payload-errors { 852 type yang:counter64; 853 description 854 "Total count of testframe packets with 855 payload errors."; 856 } 857 container latency { 858 description 859 "Latency statistics."; 860 leaf samples { 861 type uint64; 862 description 863 "Total count of packets used for estimating 864 the latency statistics. Ideally 865 samples=../testframe-stats."; 866 } 867 leaf min { 868 type uint64; 869 units "nanoseconds"; 870 description 871 "Minimum measured latency."; 872 } 873 leaf max { 874 type uint64; 875 units "nanoseconds"; 876 description 877 "Maximum measured latency."; 878 } 879 leaf average { 880 type uint64; 881 units "nanoseconds"; 882 description 883 "The sum of all sampled latencies divided 884 by the number of samples."; 885 } 886 leaf latest { 887 type uint64; 888 units "nanoseconds"; 889 description 890 "Latency of the latest sample."; 891 } 892 } 893 } 894 } 896 grouping capture-data { 897 description 898 "Grouping with statistics and data 899 of one or more captured frame."; 900 container capture { 901 if-feature "capture"; 902 description 903 "Statistics and data of 904 one or more captured frames."; 905 list frame { 906 key "sequence-number"; 907 description 908 "Statistics and data of a captured frame."; 909 leaf sequence-number { 910 type uint64; 911 description 912 "Incremental counter of frames captured."; 913 } 914 leaf timestamp { 915 type yang:date-and-time; 916 description 917 "Timestamp of the moment the frame was captured."; 918 } 919 leaf length { 920 type uint32; 921 description 922 "Frame length. Ideally the data captured will be 923 of the same length but can be shorter 924 depending on implementation limitations."; 925 } 926 leaf preceding-interframe-gap { 927 type uint32; 928 units "nanoseconds"; 929 description 930 "Measured delay between the reception of the previous 931 frame was completed and the reception of the current 932 frame was started."; 933 } 934 leaf data { 935 type string { 936 pattern '([0-9A-F]{2})*'; 937 } 938 description 939 "Raw data of the captured frame."; 940 } 941 } 942 } 943 } 945 grouping filter-data { 946 description 947 "Grouping with a filter container specifying the filtering 948 rules for processing only a specific subset of the 949 frames."; 950 container filter { 951 if-feature "filter"; 952 presence "When present packets are 953 filtered before analyzed according 954 to the filter type"; 955 description 956 "Contains the filtering rules for processing only 957 a specific subset of the frames."; 958 leaf type { 959 type identityref { 960 base ta:filter; 961 } 962 mandatory true; 963 description 964 "Type of the applied filter. External modules can 965 define alternative filter type identities."; 966 } 967 } 968 } 970 augment "/if:interfaces/if:interface" { 971 description 972 "Traffic analyzer augmentations of ietf-interfaces."; 973 container traffic-analyzer { 974 if-feature "ingress-direction"; 975 presence "Enables the traffic analyzer for ingress traffic."; 976 description 977 "Traffic analyzer for ingress direction."; 978 uses filter-data; 979 container state { 980 config false; 981 description 982 "State data."; 983 uses statistics-data; 984 uses capture-data; 985 } 986 } 987 container traffic-analyzer-egress { 988 if-feature "egress-direction"; 989 presence "Enables the traffic analyzer for egress traffic."; 990 description 991 "Traffic analyzer for egress direction."; 992 uses filter-data; 993 container state { 994 config false; 995 description 996 "State data."; 997 uses statistics-data; 998 uses capture-data; 1000 } 1001 } 1002 } 1004 augment "/if:interfaces/if:interface/ta:traffic-analyzer/ta:filter" { 1005 when "ta:type = 'ta:ethernet'"; 1006 description 1007 "Ethernet frame specific filter type."; 1008 leaf ether-type { 1009 type uint16; 1010 description 1011 "The Ethernet Type (or Length) value 1012 defined by IEEE 802."; 1013 reference 1014 "IEEE 802-2014 Clause 9.2"; 1015 } 1016 } 1018 augment "/if:interfaces-state/if:interface/if:statistics" { 1019 if-feature "ingress-direction"; 1020 description 1021 "Counters implemented by ports with analyzers."; 1022 leaf testframe-pkts { 1023 type yang:counter64; 1024 description 1025 "Testframe packets recognized by the traffic analyzer."; 1026 } 1027 leaf testframe-sequence-errors { 1028 type yang:counter64; 1029 description 1030 "Testframe packets part of the recognized total 1031 but with unexpected sequence number."; 1032 } 1033 leaf testframe-payload-errors { 1034 type yang:counter64; 1035 description 1036 "Testframe packets part of the recognized total 1037 but with payload errors."; 1038 } 1039 } 1041 augment "/if:interfaces-state/if:interface/if:statistics" { 1042 if-feature "egress-direction"; 1043 description 1044 "Counters implemented by ports with egress analyzers."; 1045 leaf testframe-egress-pkts { 1046 type yang:counter64; 1047 description 1048 "Testframe egress packets recognized by the traffic analyzer."; 1049 } 1050 leaf testframe-egress-sequence-errors { 1051 type yang:counter64; 1052 description 1053 "Testframe egress packets part of the recognized total 1054 but with unexpected sequence number."; 1055 } 1056 leaf testframe-egress-payload-errors { 1057 type yang:counter64; 1058 description 1059 "Testframe egress packets part of the recognized total 1060 but with payload errors."; 1061 } 1062 } 1063 } 1065 1067 7. IANA Considerations 1069 This document registers three URIs and three YANG modules. 1071 7.1. URI Registration 1073 This document registers three URIs in the IETF XML registry 1074 [RFC3688]. Following the format in RFC 3688, the following 1075 registration is requested to be made: 1077 URI: urn:ietf:params:xml:ns:yang:ietf-traffic-generator 1078 URI: urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer 1079 URI: urn:ietf:params:xml:ns:yang:ietf-loopback 1081 Registrant Contact: The IESG. 1083 XML: N/A, the requested URI is an XML namespace. 1085 7.2. YANG Module Name Registration 1087 This document registers three YANG module in the YANG Module Names 1088 registry YANG [RFC6020]. 1090 name: ietf-traffic-generator 1091 namespace: urn:ietf:params:xml:ns:yang:ietf-traffic-generator 1092 prefix: tg 1093 reference: RFC XXXX 1095 name: ietf-traffic-analyzer 1096 namespace: urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer 1097 prefix: ta 1098 reference: RFC XXXX 1100 8. Security Considerations 1102 This document does not introduce any new security concerns in 1103 addition to those specified in [RFC7950], section 15. 1105 9. References 1107 9.1. Normative References 1109 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1110 the Network Configuration Protocol (NETCONF)", RFC 6020, 1111 DOI 10.17487/RFC6020, October 2010, 1112 . 1114 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 1115 RFC 7950, DOI 10.17487/RFC7950, August 2016, 1116 . 1118 9.2. Informative References 1120 [RFC2544] Bradner, S. and J. McQuaid, "Benchmarking Methodology for 1121 Network Interconnect Devices", RFC 2544, 1122 DOI 10.17487/RFC2544, March 1999, 1123 . 1125 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1126 DOI 10.17487/RFC3688, January 2004, 1127 . 1129 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 1130 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 1131 . 1133 Appendix A. Examples 1135 The following topology will be used for the examples in this section: 1137 +-------------+ +------------+ +------------+ 1138 | | e0 e0 | | e1 e0 | | 1139 | tester0 TG|>-------->| dut0 |>------->|TA tester1 | 1140 | | | | | | 1141 +-------------+ +------------+ +------------+ 1143 A.1. Basic Test Program 1145 This program based on transactional network test API shows how the 1146 modules can be used: 1148 #Connect to network 1149 net=tntapi.connect("topology.xml") 1151 # Configure DUTs and enable traffic-analyzers 1152 net.node("dut0").edit( \ 1153 "create /interfaces/interface[name='e0'] -- type=ethernetCsmacd") 1154 net.node("dut0").edit( 1155 "create /interfaces/interface[name='e1'] -- type=ethernetCsmacd") 1156 net.node("dut0").edit( 1157 "create /flows/flow[id='t0'] -- match/in-port=e0 " 1158 "actions/action[order='0']/output-action/out-port=e1") 1160 net.node("tester1").edit( 1161 "create /interfaces/interface[name='e0']/traffic-analyzer") 1162 net.commit() 1164 #Get network state - before 1165 before=net.get() 1167 # Start traffic 1168 net.node("tester0).edit( 1169 "create /interfaces/interface[name='e0']/traffic-generator -- " 1170 "frame-size=64 interframe-gap=20") 1172 net.commit() 1174 time.sleep(60) 1176 # Stop traffic 1177 net.node("tester1").edit("delete /interfaces/interface[name='e0']/" 1178 "traffic-generator") 1179 net.commit() 1181 #Get network state - after 1182 after=net.get() 1183 #Report 1184 sent_pkts=delta("tester0",before,after, 1185 "/interfaces/interface[name='e0']/statistics/out-unicast-pkts") 1187 received_pkts=delta("tester1",before,after, 1188 "/interfaces/interface[name='e0']/statistics/in-unicast-pkts") 1190 latency_max=absolute(after, 1191 "/interfaces/interface[name='e0']/traffic-analyzer/state/" 1192 "testframe-stats/latency/max") 1194 #Cleanup 1195 net.node("tester1").edit( 1196 "delete /interfaces/interface/traffic-analyzer") 1197 net.node("dut0").edit("delete /flows") 1198 net.node("dut0").edit("delete /interfaces") 1199 net.commit() 1201 A.2. Generating RFC2544 Testframes 1203 In sec. C.2.6.4 Test Frames a detailed format is specified. The 1204 frame-data leaf allows full control over the generated frames 1205 payload. 1207 ... 1208 net.node("tester1").edit( 1209 "merge /interfaces/interface[name='e0']/" 1210 "traffic-generator -- frame-data=" 1211 "6CA96F0000026CA96F00000108004500" 1212 "002ED4A500000A115816C0000201C000" 1213 "0202C0200007001A0000010203040506" 1214 "0708090A0B0C0D0E0F101112") 1215 ... 1217 Author's Address 1219 Vladimir Vassilev 1220 Lightside Instruments 1222 Email: vladimir@lightside-instruments.com