如何为套接字打开 IPCOMP?

发布于 2024-12-10 21:17:36 字数 519 浏览 1 评论 0原文

由于我无法详细说明的原因,我们的系统使用非常小的 MTU(128 字节)。这些嵌入式设备位于完全独立的网络上,因此无法访问互联网或与其他设备交互。

显然,TCP 每个数据包占用 66 个字节,留给有效负载的空间并不多。

经过一番谷歌搜索后,我发现了 IPCOMP,它看起来可能有助于减少网络流量。

我的问题是如何启用此功能?有没有setsockopt,或者我需要特殊的驱动程序吗?

我见过的唯一例子是:

socket(PF_INET, SOCK_RAW, IPPROTO_COMP)

但这意味着我需要手动创建IP/TCP/有效负载。

任何人都有这方面的经验。

编辑:也许更好的方法是在此连接上启用 cslip 或 ppp。我可以找到有关在串行端口(用于拨号调制解调器)上启用 PPP 的教程,但没有找到有关在以太网上启用 PPP 的教程。
我看过有关 PPPoE 的文章,但这似乎增加了更多的有效负载,而不是减少了它。
谁能帮忙解决这个问题吗?

For reasons I can't go into, our system uses a very small MTU (128 bytes). These embedded devices are on a completely separate network so no internet access or interaction with other devices.

Obviously, TCP takes up 66 bytes per packet leaving not very much for payload.

After some googling, I came across IPCOMP which looks like it may help in reducing the amount of traffic on the network.

My question is how can I enable this? Is there a setsockopt, or do I need a special driver?

The only example I've seen is:

socket(PF_INET, SOCK_RAW, IPPROTO_COMP)

but this means I need to create the IP/TCP/payload manually.

Anyone have experience with this.

EDIT: Perhaps a better method would be to enable cslip or ppp on this connection. I can find tutorials on enabling PPP on a serial port (for dial-up modem), but nothing on enabling PPP on ethernet.
I've seen articles on PPPoE, but this seems to add MORE to the payload rather than reducing it.
Can anyone help with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

川水往事 2024-12-17 21:17:37

我过去曾尝试过 IP xfrm,但从未尝试过 comp 选项。如果您希望压缩所有传出流量,则可以使用类似的方法。

ip xfrm policy add dev eth0 dir out tmpl proto comp

I've played around with IP xfrm in the past but I've never tried the comp option. If you want all outgoing traffic compressed, something like this would work.

ip xfrm policy add dev eth0 dir out tmpl proto comp
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文