Abstract:The network traffic measurement technology of programmable switches is capable of handling high-speed network traffic and offers significant advantages in terms of flexibility and real-time processing. However, due to the necessity of configuring the internal logic of switches using the complex P4 programming language, the deployment of measurement tasks becomes intricate and error-prone. Furthermore, measurement accuracy is often constrained by the available measurement resources within the switch of measurement tasks. This study proposes a detailed exploration of intent-based networking and network traffic measurement technology, introducing an intent-driven network traffic distributed measurement method. Firstly, an intent representation format based on measurement intent primitives is designed, and an intent compiler is developed to translate abstract intent representations into executable P4 code. Secondly, a network traffic distributed measurement approach is introduced, utilizing the resources of multiple switches to collaboratively complete a measurement task in a distributed manner. The dynamic allocation of measurement resources and counter-configuration algorithms are exemplified with heavy-hitter measurements. Finally, experimental results demonstrate the feasibility and certain advantages of the proposed method.