在C(Linux)中发送ipv6 jumbograms:如何更改数据包头 [英] send ipv6 jumbograms in c (linux) : How to change packet headers

查看:56
本文介绍了在C(Linux)中发送ipv6 jumbograms:如何更改数据包头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,这个问题太天真了,但我很困惑.我想发送IPv6 jumbograms(以便能够多播大小> 64 KB的数据包).我已经能够成功多播正常的IPv6 UDP数据包. 要从RFC 2675发送千字节图,我必须进行以下更改:

I am sorry if the question is too naive, but I am confused. I want to send IPv6 jumbograms (to be able to multicast packets of size > 64 KB). I have been able to multicast normal IPv6 UDP packets successfully. For sending jumbograms, from RFC 2675, I get that I have to make the following changes :

  1. 将有效载荷长度设置为0
  2. 将下一个标头设置为逐跳

但是,我不知道如何在c socket programming中实现这些功能(该函数调用make等).我必须创建一个自定义标头,还是可以使用sendto之类的功能来发送Jumbogram?

But, I don't get how to implement these in c socket programming (which function calls to make etc.). Do I have to create a custom header or are there functions like sendto available to send jumbograms?

推荐答案

如果要创建自己的标头,则可以使用原始套接字.有关更多信息,请键入man -s7 raw在此处查找.请注意,您实际上将需要以这种方式实现自己的IP堆栈.

You could use raw sockets if you are making your own headers. For more information, type man -s7 raw or look here. Note you will effectively need to implement your own IP stack that way.

但是,我的理解是linux本身本身就支持IPv6 jumbograms,因此您无需打扰.尝试ifconfig lo mtu 100000并在环回设备上进行一些测试以进行检查.

However, my understanding is that linux itself supports IPv6 jumbograms natively so you don't need to bother. Try ifconfig lo mtu 100000 and do some tests over the loopback device to check.

我怀疑问题可能出在您的网络适配器以及路径(端到端)上的所有内容也都需要支持jumbograms.

I suspect the issue might be that your network adaptor and everything on the path (end to end) needs to support the jumbograms too.

这篇关于在C(Linux)中发送ipv6 jumbograms:如何更改数据包头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆