今天在使用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. 对于System.Net.Http的学习(一)——System.Net.Http 简介(转)

    最新在学习System.Net.Http的知识,看到有篇文章写的十分详细,就想转过来,自己记录下.原地址是http://www.cnblogs.com/chillsrc/p/3439215.html? ...

  2. c++ 11 vs 98

    在求最长子字符串中题中要遍历个上万字符数据 1.使用c++11代码 for (auto ch : s) { auto ss = vsi[ch]; vsi[ch].insert(i); i++; } 2 ...

  3. Hibernate知识总结(一)——Hibernate原理概述

    一.Hibernate是什么: 它是一个持久化框架,它对JDBC进行了轻量级的封装,简化对数据库的操作,提高开发效率.和另一个持久化框架MyBatis一样,他们操作数据库都是通过一个session对象 ...

  4. WPF:向客户端发出某一属性值已更改的通知INotifyPropertyChanged接口

    Person.cs using System.ComponentModel; namespace _01_INotifyPropertyChanged { class Person:INotifyPr ...

  5. ngrok原理浅析(转载)

    之前在进行 微信Demo开发时曾用到过 ngrok这个强大的tunnel(隧道)工具,ngrok在其github官方页面上的自我诠释是 "introspected tunnels to lo ...

  6. OC中没有实现NSCopying技术时的深复制技术

    最近看书看到一种新的实现深复制对象的技术,使用Foundation的归档技术,下面是代码: NSData *data = [NSKeyedArchiver archivedDataWithRootOb ...

  7. Select XML Nodes by Name [C#]

    原文 http://www.csharp-examples.net/xml-nodes-by-name/ To find nodes in an XML file you can use XPath ...

  8. BZOJ 3498 PA2009 Cakes(三元环处理)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=3498 [题目大意] N个点m条边,每个点有一个点权a. 对于任意一个三元环(j,j,k ...

  9. CSS 常用自定义样式

    目录: 1. 文本单行显示,并对超出部分截断以省略号代替: 2.列布局或栅格布局:比如:左侧固定宽度,右侧占满剩下的宽度: 章节: 1. 文本单行显示,并对超出部分截断以省略号代替:参见以下代码: d ...

  10. S3C6410 GPIO操作接口

    在后面的驱动学习中,需要对GPIO进行一系列的操作,了解这些引脚操作有助于编码的效率. 一.配置GPIO S3C6410要使用其引脚时,需要对其进行配置,如配置为输入/输出/中断等功能,根据芯片手册来 ...