1

I tried with sudo ethtool --set-ring eth0 rx 1020, but I'm getting this error:

Cannot get device ring settings: Operation not supported`

Is there any other way to change network buffer to simulate NIC card errors and Packet drops.

closed as off-topic by Ron Maupin Jul 25 at 12:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "NE is a site for to ask and provide answers about professionally managed networks in a business environment. Your question falls outside the areas our community decided are on topic. Please visit the help center for more details. If you disagree with this closure, please ask on Network Engineering Meta." – Ron Maupin
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Unfortunately, questions about host/server configurations are off-topic here. You could try to ask this question on Server Fault for a business network. – Ron Maupin Jul 25 at 12:54
1

That's what the netem queue discipline is for.

For outgoing traffic, just set the qdisc of the outgoing interface to netem:

modprobe sch_netem
tc qdisc add dev eth0 root netem loss 3%

You can reset it to normal with

tc qdisc del dev eth0 root

For incoming traffic, the setup is a little more complicated, please check netem on incoming traffic.

  • Thanks for the replay. I think, netem works at network layer. But, I need at NIC card level. If I issue command like "netstat -i", it must show PKT_DROP and Errors. – Veerendra Aug 20 '15 at 16:37
  • 2
    There's no way to get the NIC (driver) to simulate failures. At best, you could try setting the ring buffer to 1 (very small), but the driver must support this. – Ricky Beam Aug 20 '15 at 18:27
  • Thanks Ricky Beam,,,I have one more question, Can we simulate packet errors at NIC(Physical layer) level like hash fails, etc? – Veerendra Aug 22 '15 at 7:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.