Traffic shaping and Quality of Service (QoS) enforcement are critical for managing bandwidth, latency, and fairness in networks. These tasks often rely on low-level traffic control settings, which require manual setup and technical expertise. This paper presents an automated framework that converts high-level traffic shaping intents in natural or declarative language into valid and correct traffic control rules. To the best of our knowledge, we present the first end-to-end pipeline that ties intent translation in a queuing-theoretic semantic model and, with a rule-based critic, yields deployable Linux traffic control configuration sets. The framework has three steps: (1) a queuing simulation with priority scheduling and Active Queue Management (AQM) builds a semantic model; (2) a language model, using this semantic model and a traffic profile, generates sub-intents and configuration rules; and (3) a rule-based critic checks and adjusts the rules for correctness and policy compliance. We evaluate multiple language models by generating traffic control commands from business intents that comply with relevant standards for traffic control protocols. Experimental results on 100 intents show significant gains, with LLaMA3 reaching 0.88 semantic similarity and 0.87 semantic coverage, outperforming other models by over 30\. A thorough sensitivity study demonstrates that AQM-guided prompting reduces variability threefold compared to zero-shot baselines.
翻译:流量整形与服务质量(QoS)保障对于管理网络带宽、延迟和公平性至关重要。这些任务通常依赖于底层的流量控制设置,需要人工配置和技术专业知识。本文提出了一种自动化框架,可将自然语言或声明式语言中的高层流量整形意图转换为有效且正确的流量控制规则。据我们所知,我们提出了首个端到端流程,该流程将意图翻译与排队论语义模型相结合,并通过基于规则的校验器生成可部署的Linux流量控制配置集。该框架包含三个步骤:(1)采用优先级调度和主动队列管理(AQM)的排队仿真构建语义模型;(2)语言模型利用该语义模型及流量剖面生成子意图与配置规则;(3)基于规则的校验器检查并调整规则以确保其正确性和策略合规性。我们通过从符合流量控制协议相关标准的业务意图生成流量控制命令,对多种语言模型进行了评估。在100条意图上的实验结果表明,LLaMA3取得了显著优势,其语义相似度达到0.88,语义覆盖率达到0.87,性能超越其他模型超过30%。深入的敏感性研究表明,与零样本基线相比,AQM引导的提示方法将输出波动性降低了三倍。