3.2. Main Module
The following is the formal YANG definition for ietf-internet-traffic-statistics.¶
```
module ietf-internet-traffic-statistics {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-internet-traffic-statistics";
prefix itv;
import ietf-inet-types {
prefix inet;
reference
"RFC 6991: Common YANG Data Types";
}
organization
"IETF NMOP Working Group";
contact
"Editor: Jing Zhao <zhaoj501@chinaunicom.cn>";
description
"This module defines a YANG data model for end-to-end Internet traffic
statistics. It provides a standardized structure for collecting
telemetry across fixed, mobile, and backbone network segments.
Copyright (c) 2026 IETF Trust and the persons identified as
authors of the code. All rights reserved.";
revision 2026-03-02 {
description
"Initial revision.";
reference
"RFC XXXX: Internet traffic statistics";
}
/* --- Typedefs --- */
typedef radio-access-type {
type enumeration {
enum GSM { description "2G - Global System for Mobile Communications."; }
enum UMTS { description "3G - Universal Mobile Telecommunications System."; }
enum LTE { description "4G - Long Term Evolution."; }
enum NR { description "5G - New Radio."; }
enum WLAN { description "Wireless Local Area Network (Wi-Fi)."; }
enum UNKNOWN {
description "Unknown or unidentified radio access technology.";
}
}
description
"Comprehensive enumeration of supported radio access technologies.";
}
typedef percentage {
type decimal64 {
fraction-digits 4;
range "0.0000 .. 100.0000";
}
units "percent";
description
"Percentage value with four decimal places of precision.";
}
/* --- Groupings --- */
grouping common-counters {
description
"Standard traffic volume counters with numerical defaults.";
leaf ipv4-in {
type uint64;
units "octets";
default 0;
}
leaf ipv4-out {
type uint64;
units "octets";
default 0;
}
leaf ipv6-in {
type uint64;
units "octets";
default 0;
}
leaf ipv6-out {
type uint64;
units "octets";
default 0;
}
}
grouping performance-stats {
description
"Key quality of service (QoS) metrics with mandatory defaults.";
leaf ipv4-delay {
type uint32;
units "ms";
default 0;
}
leaf ipv4-loss-rate {
type percentage;
default 0.0000;
}
leaf ipv6-delay {
type uint32;
units "ms";
default 0;
}
leaf ipv6-loss-rate {
type percentage;
default 0.0000;
}
}
/* --- Core Data Nodes --- */
container statistics-system {
description
"Top-level anchor for the traffic statistics system.";
container config {
description "Task configurations and network planning metadata.";
container network-planning {
description "Organizational and geographic hierarchy configuration.";
list organization {
key "org-code";
description "Mapping of anonymized codes to network hierarchy.";
leaf org-code {
type string;
description "Anonymized organization code for local inventory.";
}
leaf-list levels {
type string;
max-elements 5;
ordered-by user;
description "Hierarchical levels of the organization.";
}
leaf province-code {
type string;
description "Anonymized province identifier.";
}
leaf city-code {
type string;
description "Anonymized city identifier.";
}
}
}
container app-probe {
description "Configuration for active service probing tasks.";
list target {
key "target-id";
description "List of domains or IPs to be monitored via probes.";
leaf target-id {
type string;
description "Unique identifier for the probe target.";
}
leaf domain {
type inet:host;
description "Target domain name or IP address.";
}
leaf protocol {
type enumeration {
enum TCP;
enum UDP;
enum ICMP;
enum HTTP;
enum HTTPS;
}
description "Protocol used for measurement.";
}
}
}
}
container state {
config false;
description
"Real-time operational telemetry and statistics.";
container home-fixed-network {
description "Fixed-line access network statistics.";
list access-node-stats {
key "node-id";
leaf node-id {
type string;
description "ID of the OLT/Access node.";
}
container traffic {
uses common-counters;
}
list app-category-summary {
key "category";
leaf category {
type string;
description "Service category (Video, Web).";
}
uses common-counters;
uses performance-stats;
}
}
}
container mobile-network {
description "Mobile RAN performance data.";
container regional-summary {
list region {
key "region-code radio-type";
leaf region-code {
type string;
description "Anonymized region ID.";
}
leaf radio-type {
type radio-access-type;
}
uses common-counters;
}
}
list app-rankings {
key "app-group radio-type";
leaf app-group {
type string;
description "App group name.";
}
leaf radio-type {
type radio-access-type;
description "Radio access technology type.";
}
uses common-counters;
uses performance-stats;
}
}
container ip-network {
description "Backbone/Bearer network traffic flows.";
list biz-flow {
key "direction ip-type";
leaf direction {
type enumeration {
enum inflow;
enum outflow;
}
}
leaf ip-type {
type enumeration {
enum ipv4;
enum ipv6;
}
}
leaf intl-traffic {
type uint64;
units "octets";
default 0;
}
leaf peering-traffic {
type uint64;
units "octets";
default 0;
}
}
}
container idc-network {
description "Data center egress statistics.";
list tenant-summary {
key "hashed-tenant-id";
leaf hashed-tenant-id {
type string;
description "Anonymized tenant ID.";
}
uses common-counters;
}
}
container campus-network {
description "Enterprise/Campus network quality.";
list enterprise-stats {
key "hashed-ent-id";
leaf hashed-ent-id {
type string;
description "Anonymized enterprise ID.";
}
uses common-counters;
uses performance-stats;
}
}
container app-probe-results {
description "Results of active application probing.";
list probe-stat {
key "target-id";
leaf target-id {
type leafref {
path "/itv:statistics-system/itv:config/itv:app-probe/itv:target/itv:target-id";
}
description
"Reference to the corresponding probe target in config.";
}
uses performance-stats;
}
}
}
}
}
¶
```¶