zoukankan      html  css  js  c++  java
  • Warning: Unable to send packet: Error with PF_PACKET send() [11]: Message too long (errno = 90)

    今天在使用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

  • 相关阅读:
    国内外DNS服务器地址列表
    MySQL语法大全_自己整理的学习笔记(摘抄)
    http代理和sock5代理有什么区别
    sql anywhere 网络连接
    ASCII码表_全_完整版
    libevent 编写问答服务器
    简单实现h264转ts
    libevent1.4 阅读记录三
    libevent1.4 阅读记录二
    nginx 学习
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3293837.html
Copyright © 2011-2022 走看看