Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP buffer size過大時, err msg (Message too long)而無法雙倍發包, 是否可以先分割? #48

Closed
kennylam777 opened this issue Jul 26, 2016 · 5 comments

Comments

@kennylam777
Copy link

kennylam777 commented Jul 26, 2016

分析過源碼, TCP的包在跑 net_speeder.c的 libnet_adv_write_raw_ipv4,

例如
packet len:[13180] actual write:[-1] err msg:[libnet_write_raw_ipv4(): -1 bytes written (Message too long)

但如果控制TCP buffer size, 讓packet len小於MTU, 那就沒問題可以雙倍發

問題是, MTU再多也只有9K, 13180這種大小應該還有不少機會

@kennylam777
Copy link
Author

找到暫時解決方法

#2

@willyloving
Copy link

packet len:[5800] actual write:[-1]
err msg:[libnet_write_raw_ipv4(): -1 bytes written (Message too long)
],如何解决?

@wilhelmTian
Copy link

尝试了一下,关闭网卡打包功能转交系统可解,但会提高cpu和ram占用。
ethtool -K eth0 tx off
ethtool -K eth0 rx off
ethtool -K eth0 gso off
ethtool -K eth0 gro off

@yyuurrii34
Copy link

我想到一个最简单的解决办法,这种情况你把mtu阈值改大点不就完了,具体改多大,看你报错的文件大小而定。
ifconfig 网卡名 mtu 多大数 up

@snooda snooda closed this as completed Jul 12, 2019
@liuxyon
Copy link

liuxyon commented Oct 23, 2019

尝试了一下,关闭网卡打包功能转交系统可解,但会提高cpu和ram占用。
ethtool -K eth0 tx off
ethtool -K eth0 rx off
ethtool -K eth0 gso off
ethtool -K eth0 gro off

不起作用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants