Abstract
Software-Defined Networking (SDN) requires adaptive policy generation to ensure satisfactory Quality of Service (QoS) and Quality of Experience (QoE) expectations under dynamic network conditions. While generative AI can potentially automate the optimization of network configuration, there is a lack of methods for AI-driven policy automation and enforcement, particularly in translating high-level network intent into suitable service function chains using P4 switch configurations without misconfigurations. In this paper, we present a novel framework, viz., NetPrompt, that uses Large Language Models (LLMs) for automated and intent-driven policy generation in SDN in the context of a video streaming application. By integrating prompt engineering and structured model refinement, pre-trained NetPrompt adaptively selects the appropriate LLM configuration to generate suitable P4 scripts that align with user requirements, such as dynamic QoS adaptation. We validate NetPrompt in network emulators and advanced compute/network testbed environments, including Mininet, Chameleon Cloud, and FABRIC, to construct practical network topologies for evaluation against key performance metrics such as latency reduction, throughput improvement, and error rate minimization. Our experimental results demonstrate that NetPrompt reduces misconfigurations significantly, showcasing its potential in dynamic policy management of programmable networks.