I want to test the Statistics of the network Ethernet driver in Linux, I know the command for viewing Statistics is ethtool, netstat and so on...
In that have many fields, for each of the tests, I will generate a packet and check the corresponding stats field to see if it is incrementing or not..!
How to generate the error packets using the packet generation tools?
Short Answer: Use NetEm (Network Emulator).
More details: NetEm is a tool for introducing artificial behavior for traffic. See this tutorial. NetEm utilizes the TC (traffic class) mechanism for introducing rules, which can cause packet delay, loss, corruption and many more. An accelerated implementation of the tool (XNetEm) is currently being developed over XDP (was introduced in Netdev2.2).
Hope this helps.