Warning: Unable to send packet: Error with PF_PACKET send() [11]: Message too long (errno = 90)

14 篇文章 0 订阅

今天在使用tcpreplay重放流量时,发现有的数据包没有发送成功:

Warning: Unable to send packet: Error with PF_PACKET send() [215]: Message too long (errno = 90)
Warning: Unable to send packet: Error with PF_PACKET send() [216]: Message too long (errno = 90)
Warning: Unable to send packet: Error with PF_PACKET send() [218]: Message too long (errno = 90)
Warning: Unable to send packet: Error with PF_PACKET send() [219]: Message too long (errno = 90)
Warning: Unable to send packet: Error with PF_PACKET send() [234]: Message too long (errno = 90)
Actual: 459 packets (386911 bytes) sent in 0.03 seconds.                Rated: 12897033.0 bps, 98.40 Mbps, 15300.00 pps
Statistics for network device: eth0
        Attempted packets:         235
        Successful packets:        217
        Failed packets:            18
        Retried packets (ENOBUFS): 0
        Retried packets (EAGAIN):  0
Statistics for network device: eth0
        Attempted packets:         224
        Successful packets:        224
        Failed packets:            0
        Retried packets (ENOBUFS): 0
        Retried packets (EAGAIN):  0
从错误提示看出,应该是数据包太大了。我查看了一下发送的数据包:

10:20:39.019199 IP xyw-Eliot.local.http > xyw-Eliot.local.53720: Flags [.], seq 323602:326522, ack 1978, win 31, length 2920
10:20:39.019298 IP xyw-Eliot.local.53720 > xyw-Eliot.local.http: Flags [.], ack 326522, win 543, length 0
10:20:39.047511 IP xyw-Eliot.local.http > xyw-Eliot.local.53720: Flags [.], seq 326522:329442, ack 1978, win 31, length 2920
10:20:39.047559 IP xyw-Eliot.local.53720 > xyw-Eliot.local.http: Flags [.], ack 329442, win 543, length 0
10:20:39.047665 IP xyw-Eliot.local.http > xyw-Eliot.local.53720: Flags [.], seq 329442:330902, ack 1978, win 31, length 1460
10:20:39.075783 IP xyw-Eliot.local.http > xyw-Eliot.local.53720: Flags [.], seq 330902:333822, ack 1978, win 31, length 2920
10:20:39.075824 IP xyw-Eliot.local.53720 > xyw-Eliot.local.http: Flags [.], ack 333822, win 543, length 0
10:20:39.104001 IP xyw-Eliot.local.http > xyw-Eliot.local.53720: Flags [.], seq 333822:336742, ack 1978, win 31, length 2920
10:20:39.104049 IP xyw-Eliot.local.53720 > xyw-Eliot.local.http: Flags [.], ack 336742, win 543, length 0
10:20:39.104322 IP xyw-Eliot.local.http > xyw-Eliot.local.53720: Flags [.], seq 336742:338202, ack 1978, win 31, length 1460
10:20:39.132219 IP xyw-Eliot.local.http > xyw-Eliot.local.53720: Flags [.], seq 338202:339662, ack 1978, win 31, length 1460
发现数据包长度已经超过1500(MTU默认为1500),所以问题的解决方法是修改系统的MTU值。

先说一下我的系统环境:ubuntu 12.04

linux系统修改MTU的方法比较简单,一个命令即可:

sudo ifconfig eth0 mtu 3000
这是将网卡eth0的MTU值设置为3000,这样再重新放包,发现数据包被全部发送:

sending out eth0 eth0
processing file: tcp_rewrite.pcap
Actual: 459 packets (386911 bytes) sent in 0.04 seconds.                Rated: 9672775.0 bps, 73.80 Mbps, 11475.00 pps
Statistics for network device: eth0
        Attempted packets:         235
        Successful packets:        235
        Failed packets:            0
        Retried packets (ENOBUFS): 0
        Retried packets (EAGAIN):  0
Statistics for network device: eth0
        Attempted packets:         224
        Successful packets:        224
        Failed packets:            0
        Retried packets (ENOBUFS): 0
        Retried packets (EAGAIN):  0


本文为Eliot原创,转载请注明出处: http://blog.csdn.net/xyw_blog/article/details/10741919

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值