附录 C. 在资源调度使用框架中使用 "ietf-schedule" 模块的示例 (Examples of Using the "ietf-schedule" Module for Scheduled Use of Resources Framework)
中文导读: 本节对应 RFC 9922 的 附录 C. 在资源调度使用框架中使用 "ietf-schedule" 模块的示例 (Examples of Using the "ietf-schedule" Module for Scheduled Use of Resources Framework) 部分, 对应文档标题为 RFC 9922 - 用于调度的通用 YANG 数据模型. 下方若包含英文 RFC 原文, 注册表名称, 字段名, 算法名, 对象标识符, 媒体类型, 邮箱地址, URL, 代码, ABNF, ASN.1, YANG, JSON, XML, 测试向量或参考文献条目, 均按规范原样保留, 因为这些内容需要与 RFC 文本, IANA 注册表, 实现代码或验证工具逐字一致. 中文段落用于说明本节的作用, 阅读重点和实现含义, 不改变任何协议语义或注册值.
本页中的示例, 测试向量和样例报文用于帮助实现者验证编码, 解析, 互操作或错误处理行为. 示例值, 二进制串, Base64, 十六进制, JSON/XML 成员, HTTP/邮件头字段, 域名和地址均属于可复制测试材料, 因此不翻译. 中文说明只解释示例目的, 字段关系和使用注意事项.
本节举例说明 [RFC8413] 中支持 Traffic Engineering (TE) 资源 scheduled reservation 的架构, 如何利用 "ietf-schedule" 模块中定义的 "period-of-time" grouping 来实现资源的 scheduled use.
以下示例模块展示了如何定义 scheduled link capacity reservation.
module example-sch-capacity-res {
yang-version 1.1;
namespace "http://example.com/example-sch-capacity-res";
prefix "ex-schecaparev";
import ietf-network-topology {
prefix "nt";
}
import ietf-schedule {
prefix "schedule";
}
organization
"Example, Inc.";
contact
"Support at example.com";
description
"An example to show a scheduled link capacity reservation.";
revision "2026-02-20" {
description
"Initial version.";
reference
"RFC 9922: A YANG Data Model for Scheduling";
}
container link-capability-reservations {
description
"A container for a scheduled link capability reservations.";
list scheduled-link-capacity {
key "schedule-id";
description
"Definition of scheduled link capacity list.";
leaf schedule-id {
type string;
description
"The schedule identifier for this schedule rule.";
}
leaf link-id {
type nt:link-id;
description
"The identifier of a link in the topology.";
}
leaf reserved-capability {
type uint64;
units "Mbps";
description
"The reserved capability for a particular link.";
}
uses schedule:period-of-time;
}
}
}
[RFC8413] 第 4 节定义了资源 scheduled use 的参考架构. Service requester 向 Path Computation Element (PCE) 发送请求, 并包含请求方希望提供的 Label Switched Path (LSP) 参数. 用于提供 scheduled resource 的配置示例如图 25 所示.
<?xml version="1.0" encoding="utf-8"?>
<link-capability-reservations
xmlns="http://example.com/example-sch-capacity-res"
xmlns:schedule="urn:ietf:params:xml:ns:yang:ietf-schedule">
<scheduled-link-capacity>
<schedule-id>1</schedule-id>
<link-id>1-2-1</link-id>
<reserved-capability>500</reserved-capability>
<period-start>2025-03-10T08:00:00Z</period-start>
<period-end>2025-03-10T09:00:00Z</period-end>
</scheduled-link-capacity>
<scheduled-link-capacity>
<schedule-id>2</schedule-id>
<link-id>2-1-1</link-id>
<reserved-capability>400</reserved-capability>
<period-start>2025-04-01T00:00:00Z</period-start>
<duration>PT09:00:00</duration>
</scheduled-link-capacity>
<scheduled-link-capacity>
<schedule-id>3</schedule-id>
<link-id>2-1-1</link-id>
<reserved-capability>500</reserved-capability>
<period-start>2025-04-01T09:00:00Z</period-start>
<period-end>2025-04-01T23:59:59Z</period-end>
</scheduled-link-capacity>
</link-capability-reservations>
图 25: Scheduled Link's Bandwidth Reservation 示例