Time-Sensitive Networking (TSN) extends Ethernet to enable real-time communication, including the Credit-Based Shaper (CBS) for prioritized scheduling and the Time-Aware Shaper (TAS) for scheduled traffic. Generally, TSN requires streams to be explicitly admitted before being transmitted. To ensure that admitted traffic conforms with the traffic descriptors indicated for admission control, Per-Stream Filtering and Policing (PSFP) has been defined. For credit-based metering, well-known token bucket policers are applied. However, time-based metering requires time-dependent switch behavior and time synchronization with sub-microsecond precision. While TSN-capable switches support various TSN traffic shaping mechanisms, a full implementation of PSFP is still not available. To bridge this gap, we present a P4-based implementation of PSFP on a 100 Gb/s per port hardware switch. We explain the most interesting aspects of the PSFP implementation whose code is available on GitHub. We demonstrate credit-based and time-based policing and synchronization capabilities to validate the functionality and effectiveness of P4-PSFP. The implementation scales up to 35840 streams depending on the stream identification method. P4-PSFP can be used in practice as long as appropriate TSN switches lack this function. Moreover, its implementation may be helpful for other P4-based hardware implementations that require time synchronization.
翻译:时间敏感网络(TSN)通过拓展以太网实现实时通信,其中包括用于优先级调度的基于信用整形器(CBS)和用于调度流量的时间感知整形器(TAS)。通常情况下,TSN要求流在传输前必须经过显式准入控制。为确保准入流量符合准入控制所声明的流量描述符,标准定义了逐流过滤与管制(PSFP)。针对基于信用的计量,采用广为人知的令牌桶管制器;而基于时间的计量则要求交换机具有时间依赖行为及亚微秒级的时间同步精度。尽管支持TSN的交换机提供了多种TSN流量整形机制,但完整的PSFP实现仍不可用。为弥补这一空白,我们提出了一种基于P4的PSFP实现方案,该方案运行于每端口100 Gb/s的硬件交换机上。本文阐述了PSFP实现中最关键的若干方面(相关代码已公开于GitHub平台),并通过基于信用和基于时间的管制与同步能力验证了P4-PSFP的功能性与有效性。根据流标识方法的不同,该实现可扩展至35840条流。在缺乏相应功能的TSN交换机普及之前,P4-PSFP可在实际场景中直接应用。此外,其实现思路对需要时间同步的其他基于P4的硬件实现具有参考价值。