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

Warning: Unable to send packet: Error with PF_PACKET send() [11]: Message too long (errno = 90)的更多相关文章

  1. 排错-tcpreplay回放错误:send() [218] Message too long (errno = 90)

    排错-tcpreplay回放错误:send() [218] Message too long (errno = 90) by:授客 QQ:1033553122 问题描述: tcpreplay回放.pc ...

  2. mysql之 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11

    问题描述:启动MySQL后,出现连接不上,报 [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11[root@mysql01 ~]# service ...

  3. [DUBBO] Unexpected error occur at send statistic, cause: Forbid consumer 192.168.3.151 access servic

    [DUBBO] Unexpected error occur at send statistic, cause: Forbid consumer 192.168.3.151 access servic ...

  4. xmodmap: unable to open display '' Error: Couldn't connect to XServer passing null display

    /********************************************************************************* * xmodmap: unable ...

  5. 【Mac 10.13.0】安装 libimobiledevice,提示报错:warning: unable to access '/Users/lucky/.config/git/attributes': Permission denied解决方案

    打开终端,执行命令: 1.sudo chown -R XXX /usr/local  (XXX表示当前用户名) 2.ruby -e "$(curl -fsSL https://raw.git ...

  6. 【开发笔记】- Idea启动Gradle报错:Warning:Unable to make the module: reading, related gradle configuration was not found. Please, re-import the Gradle project and try again

    报错信息: Warning:Unable to make the module: reading, related gradle configuration was not found. Please ...

  7. VirtualBox问题解决合集 - [drm:vmw_host_log [vmwgfx]] *ERROR* Failed to send host log message

    转载:https://blog.csdn.net/mychangee/article/details/104954262 问题描述:[drm:vmw_host_log [vmwgfx]] ERROR  ...

  8. 记一次Jenkins 打包异常 ERROR: Exception when publishing, exception message [Failure]

    今天早上打包一直都没有问题,突然有一次打包突然出现异常现象,如下: ERROR: Exception when publishing, exception message [Failure] Buil ...

  9. git push ERROR: missing Change-Id in commit message footer

    今天上传代码时候报告错误:$ git push origin HEAD:refs/for/branch*Counting objects: 7, done.Delta compression usin ...

随机推荐

  1. 第一个输出程序 Console.WriteLine

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  2. Clamp函数

    Clamp函数可以将随机变化的数值限制在一个给定的区间[min, max]内: template<class T> T Clamp(T x, T min, T max) { if (x & ...

  3. [C#参考]事件机制

    还是那个项目,为了降低程序的耦合性,我决定小小的重构一下自己原来的代码,把Socket通信和帧的分析这两部分分别封装成一个类,当然线程没有变,只是封装了一下,为的就是模块测试完容易拼接.这也是我打算降 ...

  4. Java学习之字符串练习

    1.给定一个字符串数组.按照字典顺序进行从小到大的排序. * 思路: * 1,对数组排序.可以用选择,冒泡都行. * 2,for嵌套和比较以及换位. * 3,问题:以前排的是整数,比较用的比较运算符, ...

  5. Oracle 查询时间在当天的数据

    要实现这个功能需要用到trunc这个函数对时间的操作 select trunc(sysdate) from dual --2014-12-27 今天的日期为2014-12-27 select trun ...

  6. java.util.MissingResourceException解决策

    .properties文件放到当前目录下会报错: 需要放到src文件夹下:

  7. 使用wfastcgi在IIS上部署Python Flask应用

    本文介绍了如何在Windows上部署Python Flask应用,相关环境如下: 操作系统:windows 7 Python:3.4 WFastCGI: 2.2 应用所用到的包版本如下: Flask= ...

  8. MYSQL 执行计划

    Explain语法 EXPLAIN SELECT …… 变体: 1. EXPLAIN EXTENDED SELECT …… 将执行计划“反编译”成SELECT语句,运行SHOW WARNINGS 可得 ...

  9. 编程实现Windows系统自动登录

    编程实现Windows系统自动登录 原理: 通过注册表修改实现.Windows内置了自动登录的机制,在登录系统时,winlogon会检查注册表下有没有设置自动登录,如果设置了就上就会读取用户名和密码, ...

  10. centos 修改shm

    Linux下,Oracle 11g的自动内存管理不能指定大于这个/dev/shm的总量内存.否则就会出现如下错误 ORA-00845: MEMORY_TARGET not supported on t ...