我需要使用 DSCP 标记来标记数据包以测试产品,但我没有找到直接执行此操作的方法。我是否只是错过了一些东西,或者我真的需要开始学习 C 网络编程才能完成这项工作?
或者,这可能更容易,是否有一个程序(适用于 Linux)可以比 iperf 更好地发送带有 DSCP 标记的数据?我知道你也可以用 ping 进行标记,但它不适合我的测试需求(iperf 在某种程度上可以,但对于繁重的测试目的来说它并不可靠。)
I have a need to mark packets with DSCP markers for testing a product, but I'm not seeing a way to do this directly. Am I just missing something, or do I really need to start learning network programming in C to get this done?
Or, which may be easier, is there a program out there (for Linux) that will send data with DSCP markers better than iperf? I know you can mark with ping, also, but it won't suit my needs for testing (iperf does, to an extent, but it's been unreliable for heavy testing purposes.)
发布评论
评论(2)
您应该使用 Ruby 的
setsockopt
,它包装了 Linux 系统调用。请参阅此处的 TOS/DSCP 设置列表。
另请参阅此问题的答案。
You should use Ruby's
setsockopt
, which wraps the Linux system call.See a list of TOS/DSCP settings here.
Also see the answer to this question.
使用 Iperf 工具并在命令中提供 ToS 值,根据您的要求使用 -S 作为可选选项。
using Iperf tool with ToS value provide in command using -S as optional as per your requirement.