According to one method, the method occurs at a network equipment test device. The method includes receiving one or more source code files for programming a packet forwarding plane of a network node; analyzing the one or more source code files to determine test metadata, wherein analyzing the one or more source code files to determine the test metadata includes identifying source code portions that indicate conditions for rejecting or accepting packets and determining the test metadata based on the conditions; generating, using the test metadata, one or more test plans for testing the network node, wherein the one or more test plans define test packets to be sent to the network node for testing the network node's implementation of the conditions for rejecting or accepting packets; and testing the network node using the one or more test plans.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method for testing a network node using source code, the method comprising: at a network equipment test device: receiving one or more source code files for programming a packet forwarding plane of a network node; analyzing the one or more source code files to determine test metadata, wherein analyzing the one or more source code files to determine the test metadata includes identifying source code portions that indicate conditions for rejecting or accepting packets and determining the test metadata based on the conditions, wherein analyzing the one or more source code files to determine the test metadata includes generating, using the one or more source code files, a parse data structure indicating processing states for a protocol parser; traversing a path of the parse data structure to identify a sequence of packet headers indicative of valid packets; and generating, using the sequence of packet headers, a test plan that defines valid test traffic for testing the network node; generating, using the test metadata, one or more test plans for testing the network node, wherein the one or more test plans define test packets to be sent to the network node for testing the network node's implementation of the conditions for rejecting or accepting packets; and testing the network node using the one or more test plans.
2. The method of claim 1 wherein the one or more source code files include P4 programming language source code.
3. The method of claim 1 wherein the network node includes a router, a switch, a network interface card, a programmable network device, or a virtualized network function (VNF).
4. The method of claim 1 wherein the one or more source code files include protocol structure information, protocol field information, or protocol parsing information.
5. The method of claim 1 wherein the source code portions include a specify code portion, a verify code portion, a define code portion, a table key and entries code portion, or a protocol fields code portion.
6. The method of claim 1 comprising: generating, using the sequence of packet headers, a second test plan that defines invalid test traffic for testing the network node.
7. The method of claim 1 comprising: traversing a second path of the parse data structure to identify a second sequence of packet headers indicative of valid packets; and generating, using the second sequence of packet headers, a second test plan that defines valid test traffic for testing the network node.
8. The method of claim 1 wherein the network equipment test device includes a source code compiler, wherein the source code compiler converts source code in the one or more source code files into logic for implementing the packet forwarding plane of the network node, wherein the source code compiler sends the logic to the network node for execution.
9. A system for testing a network node using source code, the system comprising: at least one processor; at least one memory; and a network equipment test device implemented using the at least one processor and the at least one memory, wherein the network equipment test device is configured for: receiving one or more source code files for programming a packet forwarding plane of a network node; analyzing the one or more source code files to determine test metadata, wherein analyzing the one or more source code files to determine the test metadata includes identifying source code portions that indicate conditions for rejecting or accepting packets and determining the test metadata based on the conditions, wherein the network equipment test device is configured for generating, using the one or more source code files, a parse data structure indicating processing states for a protocol parser; traversing a path of the parse data structure to identify a sequence of packet headers indicative of valid packets; and generating, using the sequence of packet headers, a test plan that defines valid test traffic for testing the network node; generating, using the test metadata, one or more test plans for testing the network node, wherein the one or more test plans define test packets to be sent to the network node for testing the network node's implementation of the conditions for rejecting or accepting packets; and testing the network node using the one or more test plans.
10. The system of claim 9 wherein the one or more source code files include P4 programming language source code.
11. The system of claim 9 wherein the network node includes a router, a switch, a network interface card, a programmable network device, or a virtualized network function (VNF).
12. The system of claim 9 wherein the one or more source code files include protocol structure information, protocol field information, or protocol parsing information.
13. The system of claim 9 wherein the source code portions include a specify code portion, a verify code portion, a define code portion, a table key and entries code portion, or a protocol fields code portion.
14. The system of claim 9 wherein the network equipment test device is configured for generating, using the sequence of packet headers, a second test plan that defines invalid test traffic for testing the network node.
15. The system of claim 9 wherein the network equipment test device is configured for: traversing a second path of the parse data structure to identify a second sequence of packet headers indicative of valid packets; and generating, using the second sequence of packet headers, a second test plan that defines valid test traffic for testing the network node.
16. The system of claim 9 wherein the network equipment test device includes a source code compiler, wherein the source code compiler converts source code in the one or more source code files into logic for implementing the packet forwarding plane of the network node, wherein the source code compiler sends the logic to the network node for execution.
17. A non-transitory computer readable medium comprising computer executable instructions embodied in the computer readable medium that when executed by at least one processor of a computer perform steps comprising: receiving one or more source code files for programming a packet forwarding plane of a network node; analyzing the one or more source code files to determine test metadata, wherein analyzing the one or more source code files to determine the test metadata includes identifying source code portions that indicate conditions for rejecting or accepting packets and determining the test metadata based on the conditions, wherein analyzing the one or more source code files to determine the test metadata includes generating, using the one or more source code files, a parse data structure indicating processing states for a protocol parser; traversing a path of the parse data structure to identify a sequence of packet headers indicative of valid packets; and generating, using the sequence of packet headers, a test plan that defines valid test traffic for testing the network node; generating, using the test metadata, one or more test plans for testing the network node, wherein the one or more test plans define test packets to be sent to the network node for testing the network node's implementation of the conditions for rejecting or accepting packets; and testing the network node using the one or more test plans.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
July 13, 2018
December 29, 2020
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.