(参考)tcpreplay使用手册
- 格式:docx
- 大小:61.41 KB
- 文档页数:12
tcpreplay使用方法什么是tcpreplay?tcpreplay是一个用于重放网络流量的工具,它可以将之前捕获的网络流量重新发送到网络中。
它是一个非常有用的工具,可以用于网络流量分析、性能测试、安全测试等各种场景。
安装tcpreplay在使用tcpreplay之前,我们需要先安装它。
tcpreplay可以在Linux、Windows和Mac OS X上运行,我们可以根据自己的操作系统选择相应的安装方法。
Linux在大多数Linux发行版上,可以使用包管理器来安装tcpreplay。
例如,在Debian/Ubuntu上,可以使用以下命令安装tcpreplay:sudo apt-get install tcpreplayWindows在Windows上安装tcpreplay相对复杂一些,需要使用Cygwin来模拟Linux环境。
以下是安装步骤:1.下载并安装Cygwin:访问Cygwin的官方网站()下载安装程序。
安装时,选择默认选项即可。
2.打开Cygwin终端:在开始菜单中找到Cygwin,打开Cygwin终端。
3.安装tcpreplay:在Cygwin终端中,运行以下命令来安装tcpreplay:apt-cyg install tcpreplayMac OS X在Mac OS X上安装tcpreplay相对简单,可以使用Homebrew包管理器来安装。
以下是安装步骤:1.安装Homebrew:打开终端,运行以下命令来安装Homebrew:/bin/bash -c "$(curl -fsSL "2.安装tcpreplay:在终端中,运行以下命令来安装tcpreplay:brew install tcpreplay使用tcpreplay安装完成tcpreplay后,我们可以开始使用它来重放网络流量了。
准备网络流量文件首先,我们需要准备一个网络流量文件,该文件包含了之前捕获的网络流量。
励研同步系统EasyPlayer使⽤说明书Easy Player使⽤说明书深圳市励研科技同步系统使⽤说明欢迎使⽤感谢您购买和使⽤我公司的产品,为了您的利益,在使⽤产品前请您仔细阅读本产品说明书及附带的全部资料。
声明:未按照产品说明书操作和使⽤产品,⽽导致任何的财产或者其他损失,深圳市励研科技有限公司将不承担责任。
关于本产品说明书说明书版权属于深圳市励研科技有限公司所有;说明书内容如同实际产品不⼀致,以实际产品为准。
Easy player⽬录1引⾔ (4)2⽤途 (4)3运⾏环境 (4)3.1硬件环境 (4)3.2软件环境 (5)4使⽤过程 (5)4.1安装与初始化 (5)5操作步骤 (8)5.1E ASY P LAYER⼊门 (8)5.1.1Easy Player的启动与退出 (8)5.1.2软件窗⼝介绍 (9)5.2创建演播⽅案 (11)5.2.1新建演播⽅案 (11)5.2.2新建屏幕 (13)5.2.3新建节⽬ (16)5.2.4新建节⽬窗⼝ (19)5.3设置⽂件属性 (21)5.3.1增加播放⽂件 (21)5.3.2增加所有可以播放的⽂件 (21)5.3.3增加⽂本⽂件 (22)5.3.4增加⽂本 (24)5.3.5增加单⾏⽂本 (25)5.3.6增加图像⽂件 (27)5.3.7增加Office⽂件 (28)5.3.8增加多媒体⽂件 (32)5.3.9增加视频输⼊ (33)5.3.10增加Flash⽂件 (36)5.3.11增加⽇期/时间 (37)5.3.12增加计时 (39)5.4编辑节⽬窗⼝播放 (41)5.4.1演播⽅式 (41)5.4.2⼀个节⽬窗⼝下,⼀个⽂件的播放 (42)5.4.3⼀个节⽬窗⼝下,多个⽂件的播放 (42)5.4.4⼀个节⽬下,多个节⽬窗⼝的播放 (42)5.4.5两个节⽬下,各⼀个节⽬窗⼝的播放 (43)1引⾔Easy player是我公司⾃主研发的适⽤于各LED显⽰屏节⽬编辑播放的⼀款软件。
Manual de instalación y uso VLC media playerDESCRIPCIÓNEl programa VLC es un reproductor multimedia gratuito de código abierto, reproduce la gran mayoría de formatos multimedia por lo que es una gran herramienta. Además de reproducir archivos, con el VLC se pueden convertir diversos formatos, función de suma importancia que no todos los programas reproductores poseen.DESCARGA DEL PROGRAMAPara obtener el programa VLC se debe ingresar a la dirección web:https:///vlc/index.es.htmlEl programa automáticamente reconoce la versión de sistema operativo con el que cuenta el dispositivo, por lo que basta con dar clic en DESCARGAR VLC.Una vez descargado, se debe EJECUTAR el archivo de instalación, doble clic en el archivo descargado (parte inferior izquierda).PROCESO DE INSTALACIÓNEl proceso de instalación inicia solicitando el lenguaje en el que desea ejecutar el programa. Clic OKLas siguientes ventanas muestran una serie de recomendaciones para la instalación, clic SIGUIENTE en ambas.Luego de un breve proceso de instalación (imagen izquierda), el programa se encuentra listo para ser utilizado, clic TERMINAR (imagen derecha).Interfaz inicialLa interfaz de VLC media player se caracteriza por ser sencilla y amigable.Consta básicamente de tres partes:1.Barra de herramientas(Parte superior):Contiene menús desplegables para localizarherramientas enfocadas a aplicación de procesos a material audiovisual y configuración.2.Área de reproducción (Pantalla negra): Área donde se podrá visualizar el contenido multimedia.3.Barra de reproducción (Parte inferior): Comandos propiamente de reproducción, PLAY, STOP,V olumen, Tiempo de reproducción, entre otros.IMPORTANTE: Una característica muy notable del VLC es que permite subir el volumen hasta un 200% (Parte inferior derecha de barra de reproducción), gran ventaja en los casos donde los audios desde la fuente presentan poca ganancia, con esta opción el audio se “amplifica” sin ningún proceso durante la reproducción.REPRODUCIR UN ARCHIVOPara reproducir un archivo en el programa VLC,clic en MEDIO, luego clic ABRIR ARCHIVOEn la ventana podremos localizar el archivo deseado, clic en el archivo, luego clic ABRIREl archivo se despliega en el Área de reproducción y se habilita la barra de reproducción.FUNCIONES DESTACABLES•CONVERTIR FORMATOSVLC permite convertir el formato de un archivo de video,para esto clic en MEDIO,luego en CONVERTIREn la ventana desplegada, clic en ARCHIVO, luego en AÑADIRSe selecciona el archivo a convertir, clic en ABRIRCon esto el archivo ya se encuentra incluido, clic en CONVERTIR/GUARDAREn esta ventana verificamos la información, el archivo en la parte superior, Convertir seleccionado.En la pestaña desplegable PERFIL, se selecciona el formato deseado.Ahora, es momento de determinar la dirección donde será guardado nuestro video convertido. Para esto en la ventana izquierda, clic en EXPLORAR, esto despliega la ventana derecha, ahí seleccionaremos el nombre y donde será guardado nuestro video. Clic en GUARDAR.Lo anterior habilitará en la ventana izquierda el botón INICIAR, clic en él.Luego de un breve proceso de conversión, podemos ir a la dirección específicada en ARCHIVO DESTINO y se encontrará el Archivo convertido.•VL sub (Buscador de subtítulos)El programa VLC, también permite la inclusión de archivos de subtítulo dentro de un archivo de video. Por ejemplo, puede tener una película en idioma español sin subtítulos, a la que puede buscarle los subtítulos en inglés o francés y posteriormente incluírselos con VLC.Para esto,primero es necesario contar con los archivos de subtítulo,VLC cuenta con una Biblioteca/buscador de subtítulos, para accesar a ella, Clic en VER, luego Vlsub- RESEARCHEn la ventana mostrada, se solicitan varios datos para tratar de localizar los archivos disponibles. NOTA: Es importante descargar los archivos he incluirlos al archivo de video y confirmar que sean los adecuados, ya que existen casos que los subtítulos se encuentran desfasados al audio.En caso de encontrar un posible archivo, clic en el link deseado y clic en DOWNLOAD SELECTIONUna vez concluida la descarga, tendremos nuestro archivo listo para ser insertado en el archivo de video.IMPORTANTE:Este es un insumo que brinda VLC (No siempre se van a poder encontrar los subtítulos requeridos en esta plataforma), pero de igual forma si el archivo es adquirido de otra fuente, de igual forma puede ser insertado en el video. A continuación el procedimiento de inserción.•INSERTAR SUBTÍTULOSCuando contamos con el o los archivos de subtítulos podemos insertarlos en nuestro archivo de video. Clic en la barra de herramientas en SUBTÍTULO, luego AÑADIR ARCHIVO DE SUBTÍTULOSEn la ventana, localizamos el archivo de subtítulo y clic en ABRIRUna vez agregado el programa nos brinda un mensaje de confirmación.V ARIOS ARCHIVOS DE SUBTÍTULO EN UN MISMO VIDEOEn VLC podemos agregar los archivos de subtítulos que se requieran, por lo que debemos seleccionar cual archivo mostrar.Casos posibles:1.Archivo de video sin subtítulos: En este caso tenemos dos panoramas posibles, solo incorporarun archivo de subtítulos (inglés por ejemplo) o múltiples archivos de subtítulos (inglés, francése italiano por ejemplo).2.Archivo de video con subtítulos incorporados: De igual forma que el caso anterior existen dospanoramas posibles. Solo que en este particularmente siempre vamos a tener múltiples archivos de subtítulo, esto debido a que si solo incorporamos uno, ya el video traía un archivo de subtítulo desde su fuente. Por esto es necesario saber como seleccionar los subtítulos que deseamos mostrar.SELECCIONAR ARCHIVO DE SUBTÍTULOSCuando contamos con múltiples archivos de subtítulo (2 o más) debemos seleccionar cual archivo mostrar.Clic derecho en el ÁREA DE REPRODUCCIÓN, nos posicionamos en SUBTÍTULO, al incluir varios archivos se nos habilitará la opción pista, donde estarán incluidos los archivos insertados anteriormente y ahí podremos seleccionar que archivo mostrar.IMPORTANTE:La tarea de conseguir el archivo de subtítulo adecuado, en ocasiones es bastante laboriosa por lo que se recomienda llevar a cabo este proceso con tiempo.。
tcpreplay安装与配置需准备的安装包:m4-1.4.13.tar.gzbison -2.4.1.tar.gzflex-2.5.39.tar.gzlibpcap -1.1.1.tar.gztcpreplay-3.4.4.tar.gz安装步骤:(部署顺序不能打乱)一、安装m41.解压m4-1.4.13.tar.gz:tar –zxvf m4-1.4.13.tar.gz2.进入安装目录m4-1.4.13:cd m4-1.4.133.执行:./configure4.编译:make5.安装:make install二、安装bison1.解压bison -2.4.1.tar.gz:tar –zxvf bison -2.4.1.tar.gz2.进入安装目录bison -2.4.1:cd bison -2.4.13.执行:./configure4.编译:make5.安装:make install三、安装flex1.解压flex-2.5.39.tar.gz:tar –zxvf flex-2.5.39.tar.gz2.进入安装目录flex-2.5.39:cd flex-2.5.393.执行:./configure4.编译:make5.安装:make install四、安装libpcap1.解压libpcap -1.1.1.tar.gz:tar –zxvf libpcap -1.1.1.tar.gz2.进入安装目录libpcap -1.1.1:cd libpcap -1.1.13.执行:./configure4.编译:make5.安装:make install五、安装tcpreplay1.解压tcpreplay-3.4.4.tar.gz:tar –zxvf tcpreplay-3.4.4.tar.gz2.进入安装目录tcpreplay-3.4.4:cd tcpreplay-3.4.43.执行:./configure4.编译:make5.安装:make install参数设置:tcpreplay (tcpreplay) - Replay network traffic stored in pcap filesUSAGE: tcpreplay [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <pcap_file(s)>-q, --quiet Quiet mode-T, --timer=str Select packet timing mode: select, ioport, rdtsc, gtod, nano, abstime--sleep-accel=num Reduce the amount of time to sleep by specified usec--rdtsc-clicks=num Specify the RDTSC clicks/usec-v, --verbose Print decoded packets via tcpdump to STDOUT-A, --decode=str Arguments passed to tcpdump decoder- requires these options:verbose-K, --enable-file-cache Enable caching of packets to internal memory- requires these options:loop--preload-pcap Preloads packets into RAM before sending-c, --cachefile=str Split traffic via a tcpprep cache file-i, --intf1=str Server/primary traffic output interface-I, --intf2=str Client/secondary traffic output interface- requires these options:cachefile--listnics List available network interfaces and exit-l, --loop=num Loop through the capture file X times- it must be: greater than or equal to 0--pktlen Override the snaplen and use the actual packet len -L, --limit=num Limit the number of packets to send- it must be: greater than or equal to 1 -x, --multiplier=str Modify replay speed to a given multiple- prohibits these options:ppsmbpsoneatatimetopspeed-p, --pps=num Replay packets at a given packets/sec- prohibits these options:multipliermbpsoneatatimetopspeed-M, --mbps=str Replay packets at a given Mbps- prohibits these options:multiplierppsoneatatimetopspeed-t, --topspeed Replay packets as fast as possible- prohibits these options:mbpsmultiplierppsoneatatime-o, --oneatatime Replay one packet at a time for each user input- prohibits these options:mbpsppsmultipliertopspeed--pps-multi=num Number of packets to send for each time interval- requires these options:pps- it must be: greater than or equal to 1 -P, --pid Print the PID of tcpreplay at startup--stats=num Print statistics every X seconds- it must be: greater than or equal to 1 -V, --version Print version information-h, --less-help Display less usage information and exit-H, --help Display usage information and exit-!, --more-help Extended usage information passed thru pager --save-opts[=arg] Save the option state to a config file--load-opts=str Load options from a config file- disabled as --no-load-opts- may appear multiple times实例:在eth0的端口已1000Mbps的速率发送数据包0100001A.pcap 一次:tcpreplay --intf1=eth0 --mbps=1000 --loop=1 0100001A.pcap。
tcpreplay用法tcpreplay用法简介:tcpreplay是一款用于重新发送网络数据包的工具。
它可以帮助网络管理员和安全专家进行网络流量分析、测试和仿真。
以下是tcpreplay的用法介绍:1. 安装和配置tcpreplay:首先,你需要从tcpreplay的官方网站下载并安装tcpreplay工具。
安装完成后,你可以根据需要进行一些配置,如指定网卡、设置发送速率等。
2. 选择和准备要回放的数据包:使用tcpreplay之前,你需要准备要回放的数据包文件。
可以是从网络上捕获的pcap文件,或者是之前保存的数据包文件。
如果需要修改数据包内容,你可以使用其他工具进行处理。
3. 回放数据包:使用tcpreplay回放数据包非常简单,只需要执行以下命令:tcpreplay --intf1 eth0 packet.pcap这个命令会将packet.pcap文件中的数据包发送到eth0网卡。
4. 参数设置:tcpreplay提供了各种参数,以满足不同的需求。
例如,你可以使用"-t"参数指定数据包的发送速率,"-l"参数控制重放的循环次数,"-k"参数设置发送数据包的间隔时间等。
5. 监控和分析:在回放数据包期间,你可以使用网络流量分析工具,如Wireshark,来监控回放过程中的数据包流量。
这有助于检测网络问题、分析安全威胁等。
总结:tcpreplay是一款功能强大的网络工具,可用于重新发送网络数据包。
它可以帮助网络管理员进行流量分析、测试和仿真。
通过掌握tcpreplay的用法,你可以更好地管理和保护你的网络。
前言工具的名称就能猜到工具的作用,就是重放TCP的报文,但是这个工具究竟功能如何,是不是仅仅局限于在一个网卡上回放报文,这篇说明书主要介绍tcprelay的一些与测试有关的使用,在介绍tcpreplay命令的使用之前,先要介绍与之密切相关的一个命令:tcpprep,中文直译就是tcp准备的意思,它的作用可以参见官方网站的介绍说明:tcpprep is the pcap pre-processor for tcpreplay and tcprewrite. The purpose of tcpprep is to create a cache file which is used to "split" traffic into two sides (often called primary/secondary or client/server). If you are intending to use tcpreplay with two NIC's, then tcpprep is what decides which interface each packet will use. By using a seperate process to generate cache files, tcpreplay can send packets at a much higher rate then if it had to do the calculations to split traffic itself.CET-4翻译:(建议大家看man文件,阅读3次就能够比较好的理解了)tcpprep是一个在tcpreplay和tcprewrite(3.0.beta11版本才有,这里不讨论)之前使用的pcap文件的处理程序。
使用tcpprep的目的就是建立一个cache文件,用于分离通信流量中的两方(通常叫做主要的/次要的或者客户端/服务器)。
tcpreplay命令使⽤详解tcpreplay⽤于重放保存在pcap⽂件中的⽹络流量,它⽀持按照捕获pcap⽂件时数据包的速度、或者指定速度去重放⽹络流量,只要在硬件承受的范围内即可。
它可以根据需要,使流量可以在两个⽹卡直接拆分、写⼊⽂件、进⾏筛选、以各种⽅式进⾏编辑,从⽽为测试防⽕墙、NIDS和其他⽹络设备提供了⽅法。
格式:tcpreplay [-flags] [-flag [value]] [--option-name[[=| ]value]] <pcap_file(s)>1、命令参数: -d number, --dbug=number启⽤调试输出。
此选项最多可出现1次。
此选项将整数作为参数。
number的值被限制为:在0到5的范围内此选项的默认输⼊number为:0如果使⽤--enable-debug进⾏配置,则可以为调试输出指定详细级别。
数字越⼤,越详细。
-q, --quiet静默模式。
除了运⾏结束时的统计数据外,不打印任何内容 -T string, --timer=string选择数据包计时模式:select,ioport,gtod,nano。
此选项最多可出现1次。
此选项的默认string是:gtod允许您选择要使⽤的数据包计时⽅法:nano - Use nanosleep() APIselect - Use select() APIioport - Write to the i386 IO Port 0x80gtod [default] - Use a gettimeofday() loop --maxsleep=number设置数据包之间休眠不超过X毫秒。
此选项将整数作为参数。
此选项的默认输⼊number为:0设置tcpreplay在数据包之间休眠的最⼤毫秒数限制。
有效防⽌数据包之间的长时间延迟,⽽不会影响⼤多数数据包。
默认为禁⽤。
-v, --verbose通过tcpdump将解码后的数据包打印到标准输出。
开源机器人开源机器人项目项目项目--Player中文手册项目名称:Player Project软 件:Player/Stage/Gazebo版 本:2.0.1作 者:雷 斌2006-9-20说明:1、本中文手册由武汉理工大学-物流工程学院-传感器网络与机器人实验室雷斌编写,由于Player项目的不断发展,各个版本会有较大变动,请参考其网上资料主页:/;2、Player项目是一个开源软件项目,而且本手册里使用的操作系统和软件都是开源的,可以从Internet上获得;3、Player项目的软件主要运行在Linux, Solaris, *BSD and Mac OSX (Darwin).操作系统上,本手册运用的操作系统为SuSE10.0 Linux(版本越新越好);4、本手册主要运用Java客户端,需要JDK1.5, Eclipse3.1.1(版本越新越好);5、编写此手册的主要目的是对学习、使用Player/Stage一段时间后的总结。
同时,也希望这些总结能够对中国的机器人控制、仿真研究学习有些帮助。
在这个手册里,我将重点介绍自己在学习、使用Player/Stage中自己的理解、遇到的问题,如何解决等方面,对于具体的结构和其他方面请参考其主页上的资料;6、由于本身水平有限,难免会有错误,希望大家多多指正。
(发邮件到lbhaha@,注明主题“playerstage”)7、本手册可以自由发布,但作者保留相关权利。
目录第一章 Player项目简介第二章 什么是Player?第三章 什么是Stage?第四章 如何安装Player/Stage第五章 如何使用Player/Stage第六章 Java客户端程序编写第一章第一章 Player 项目简介Player/Stage 最初是由美国南加州大学机器人研究实验室,于1999年开发的一个为多机器人系统提供内部接口和仿真环境的项目。
目前,作为一个开源项目,它已经被世界上许多机器人研究者使用、修改和扩展。
TcpReplay使用方法【转】TcpReplay使用方法2010-12-08 12:06转载自 xiao___q最终编辑地狱的福音第1章. 说明本文档只适用于T cpreplay3.x。
第2章. Tcpreplay系列工具2.1. 概述首先推荐一个网站:/,上面有T cpreplay的安装包和很多文档,包括手册、man页和FAQ等。
本文也是在参考这个网站的基础上,通过一些实验而得出的。
Tcpreplay是一系列工具的总称,包括tcpreplay、tcprewrite和tcpprep等工具,这也是T cpreplay的第一个字母大写的原因。
它用来在Unix系统或类Unix系统上重放网络包。
这些包是由tcpdump、ethereal和wireshark等软件抓取到的,即pcap格式的数据包。
正因为Tcpreplay有重放数据包的功能,所以它常被用来模拟IDS 攻击等测试环境,被广泛地用来测试防火墙和IDS工具的安全性。
2.2. 功能安装Tcpreplay包时,默认情况下是安装了如表1所示的这些工具的。
表 1还给出了各个工具的功能。
表 1 Tcpreplay系列工具的功能2.3. 各工具的组合从表1可以看出tcpreplay负责发送数据包,tcprewrite用来改写数据包,tcpprep用来区分客户端和服务器。
1) 因为数据包中的内容都是双向的(客户端->服务器,服务器->客户端),tcprewrite改写数据,tcpreplay发送数据包时都应该区分方向(即区分客户端和服务器),因此这两个工具一般是工作在tcpprep的基础上的。
2) tcpreplay可以发送任意pcap数据包,如果它想改变发送内容,就必须先用tcprewrite来改写数据包,然后再发送改写后的数据包。
2.4. 补充说明Tcpreplay2.x中的tcpreplay将区分客户端和服务器、改写数据包,发送数据包等功能都集成在一起。
Tcpreplay功能介绍一.Tcpreplay内容Tcpreplay就是重放TCP报文,包括三方面内容:tcpprep(确认客户端发给服务器的报文,还是服务器发给客户端的报文),tcprewrite(编辑报文),tcpreplay(发送报文)。
Tcpprep是在tcprewrite和tcpreplay之前使用的pcap文件的处理程序。
使用tcpprep的目的就是建立一个cache文件,用于分离通信流量的两方(客户端/服务器)。
如果在两个网卡上使用tcpreplay,tcpprep就是用来决定每一个报文(packet)从哪一个借口发出。
Tcprewrite编辑报文,通常在2-4层。
比如修改MAC/IP地址或TCP/UDP端口。
大多数协议都是双向的,所以tcprewrite需要知道什么时候在另一个方向上使用。
(例如:二层修改源MAC地址和目的MAC地址;三层修改IP地址,自动重新计算校验和;四层修改tcp/udp 端口,自动重新计算校验和)Tcpreplay通过使用tcpprep分离程序建立的cache文件,根据cache文件通过自身计算来分离流量,高速率发送报文。
(可以指定重放速度;重放多少次;重放多少个;一个一个重放《用于调试》)二. 重要参数1. Tcpprep参数:-d后跟数字,表示输出调试信息,0-5,默认值为0。
-a一般情况下都需要的参数,表示按模式自动分离通信流量生成cache文件。
-c可选参数,表示分离流量时采用CIDR(无类别域间路由选择)。
(报文由主网卡发出)-r可选参数,表示使用regex模式分离通信流量,有点类似于CIDR 模式,但是它匹配的是服务器源IP。
-p可选参数,基于目的端口来分离通信流量,它区分的依据是认为0-1023端口都是服务器的端发出的报文,其他的端口都是客户端发出的报文。
-e表示基于服务器源MAC地址分离通信流量-C可选参数,表示在cache文件中嵌入注释内容,用于注释说明cache 文件的内容。
Tcpreplay基本介绍Tcpreplay是一种在Unix系统或类似Unix系统上重放网络包的软件工具,通过tcpdump、ethereal和wireshark等软件来抓取pcap格式的数据包后,其可以对所呈现的pcap格式的包进行指定重放速度,重放多少次数,重放多少个及一个一个重放以此用于调试。
在linux下, 用ifconfig命令可以获得接口的名字: eth0, eth1……Tcpreplay常用的一些参数:-i指定数据报文发送的网口-t指以最快速度对数据报文进行回放-m指定一个倍数值n,即比默认速率快n倍的发送报文-M 指以Mbps(兆字节每秒)发送数据报文-p指定每秒发送报文的个数-l 指定循环的次数-o 指一次一个数据包的速度发送数据报文-v 指对一些信息进行及时打印最简单的方式:指定一个网口,将数据包全部重放到指定网口上#tcpreplay–ieth0 123.pcap控制发送速度:1)以最快的速度发送数据包# tcpreplay-t -ieth0 123.pcap2)以原有速度的1/4发送数据包# tcpreplay -m 0.25.-ieth0 123.pcap 3)以10M每秒的速度发送数据报文#tcpreplay–M 10 –i eth0 123.pcap 4)以每秒50个包的速度发送包# tcpreplay -p 50-i eth0 123.pcap 5)以一次一个的速度发送数据包# tcpreplay -o -v–ieth0 123.pcap控制发送次数:Tcpreplay循环重发数据包1)使数据包重放15次# tcpreplay-l 15-i eth0 123.pcap 2)无限循环重放,直至Ctrl+C结束# tcpreplay –l 0 –ieth0 123.pcap。
tcpreplay的安装使用经验(转)#Author: ypguo<guoyoooping@>#Data: 2010.4.23#Version: 1.1[关键字]: tcpreplay, tcpprep, tcprewrite, libpcap, winpcap, linux, windows, cygwin [摘要]: 本文总结了tcpreplay的安装使用经验. 我是在cygwin上试验的.[目录]:(Created by TxtBrowser)1. 什么是tcpreplay2. 安装指南3. 使用指南. 3.1 tcpprep(pcap pre-processor). 3.1.1 根据报文源IP确定client/server报文. 3.1.2 使用自动模式确定client/server报文. 3.2 tcprewrite. 3.3 tcpreplay1. 什么是tcpreplay引用一段tcpreplay官方网站(/trac/)的话来解释什么是tcpreplay[1]:#摘自tcpreplay官方网站(/trac/):|Tcpreplay is a suite of BSD licensed tools written by Aaron Turner for UNIX|(and Win32 under Cygwin) operating systems which gives you the ability to use|previously captured traffic in libpcap format to test a variety of network|devices. It allows you to classify traffic as client or server, rewrite Layer|2, 3 and 4 headers and finally replay the traffic back onto the network and|through other devices such as switches, routers, firewalls, NIDS and IPS's.|Tcpreplay supports both single and dual NIC modes for testing both sniffing|and inline devices.简单的说, tcpreplay是一种pcap包的重放工具, 它可以将用ethreal, wireshark工具抓下来的包原样或经过任意修改后重放回去. 它允许你对报文做任意的修改(主要是指对2层, 3层, 4层报文头), 指定重放报文的速度等, 这样tcpreplay就可以用来复现抓包的情景以定位bug, 以极快的速度重放从而实现压力测试.tcpreplay本身包含了几个辅助工具, 用于准备发包的cache, 重写报文等:* tcpprep - 简单的说就是划分哪些包是client的, 哪些是server的, 一会发包的时候client的包从一个网卡发, server的包可能从另一个网卡发.* tcprewrite - 简单的说就是修改2层, 3层, 4层报文头部.* tcpreplay - 真正发包, 可以选择主、从网卡, 发包速度等.* tcpbridge - bridge two network segments with the power of tcprewrite2. 安装指南tcpreplay官方提供的下载地址为: /trac/wiki/Download,由于tcpreplay依赖libpcap库,所以安装tcpreplay之前必须先安装libpcap(在windows下为winpcap), 否则./configure的时候你会得到提示说libpcap库没有安装.linux下的依赖库libpcap由tcpdump工程组开发, 好像也是个开源工程, 可以到/下载到, 可以用源码安装, 貌似比较简单.windows(包括cygwin) 下的依赖库winpcap则必须到winpcap的官方网站上去下载: /install/default.htm. winpcap是libpcap在windows上的移植, 这个貌似不是开源的, 所以你只能得到一个静态库和编程接口"WpdPack_4_1_2.zip", 解压缩后可以得到文件夹"WpdPack", 将该文件夹拷贝到cygwin的根目录,即可完成winpcap的安装, 在"./configure"的时候选上参数--with-libpcap=/wpdpack(我自己试验过,貌似没有这个参数也可以成功, 不过还是建议加上这个参数)[2]:#winpcap的安装过程:|$ unzip WpdPack_4_1_2.zip|$ cp -r WpdPack/ / (安装tcpreplay的依赖winpcap, 即把WpdPack拷贝到根目录下.)#tcpreplay的安装过程:|$ ./autogen.sh (Subversion checkouts only)|$ ./configure --with-libpcap=/wpdpack|$ make|# make test (Note: tcprewrite tests are currently broken on Cygwin/Win32)|# make install3. 使用指南到此为止, 你机器上的tcpreplay已经可以使用了, 具体怎么用, 网上的攻略也很多, 但最权威的使用指南当然是官网的Online Manual:/trac/wiki/manual, 前面简单地介绍了tcpreplay内嵌的几个工具的用途, 下面给出一个我用过的一个例子, 仅供更好的理解Online Manual:以前的版本貌似可以用一个命令把pcap包直接经过修改发出去, 但是3.0以后的tcpreplay不支持这样了, 发包前先得用tcpgrep建立一个cache, 再用tcprewite修改包的信息, 最后用tcpreplay发出去:建立cache文件的作用解释,主要是加速报文的发送,cache文件中存放着pcap文件中每个帧的编号和时间戳等信息,以达到tcpreplay回放时可以更加快速的发送报文的目的。
Il simbolo del fulmine con la freccia in un triangolo equilatero ha lo scopo di avvertire l’utente della presenza di tensione Per ridurre il rischio discosse elettriche, nonrimuovere la copertura(o il pannello posteriore).Il punto esclamativo all’internodel triangolo equilatero ha loscopo di avvertire l’utente dellapresenza di importanti istruzionisul funzionamento e laFabbricato su licenza5,974, 380; 5,978,762; 6,487,535 e di altri brevetti statunitensi e internazionali già emessi o in attesa di emissione. DTS e DTS 2.0 + Digital Out sono marchi di fabbrica registrati.Il simbolo e i loghi DTS sono marchi di fabbrica di DTS, Inc. © 1996-2008O!Play Mini PlusCapitolo 1: Introduzione1-10Connessione con l’adattatore di correntePer collegare l’adattatore di corrente:1.Collegare l’adattatore AC alla porta DC-in, sul retro di O!Play MEDIA PRO.2. Collegare l’adattatore AC ad una sorgente di alimentazione.Connessione di O!Play MEDIA PRO con altri dispositiviPer la connessione con uno schermo, operare in uno dei seguenti modi:1. • U tilizzare un cavo mini-HDMI per collegare O!Play MEDIA PRO ad una HDTV o ad un monitor HDMI.Preparazione di O!PLAY MEDIA PROLe impostazioni predefinite dell’indirizzo IP Fisso sono le seguenti:: 192.168.0.2: 255.255.255.0Indirizzo IP e subnet mask possono anche essere richiesti all’ISP (InternetL’indirizzo IP di MEDIA PRO e del computer devono essere univoci, ma nello stesso gruppo di lavoro e nella stessa subnet.assicurarsi che i file del computerassicurarsi che i file del computer Per accedere ai file di un PC della rete,assicurarsisiano condivisi in rete. Per ulteriori informazioni, consultare il paragrafoCapitolo 2: Connessioni e Servizi di RetePer condividere file nel sistema operativo Windows® XP:Sulla cartella appare l’icona di una manoindicante che il contenuto della cartellaè condiviso in rete.VistaVista, sono possibili due modalità di condivisione Condivisione di file da una cartella del computer.Condivisione di file da una cartella del computerPer condividere i file da una cartella contenuta nel computer:Dal computer, selezionare la cartella contenente i file da condividere.Con il tasto di destra del mouse, cliccare sulla cartella selezionata e scegliereCliccare >Collegamenti Preferitipassword sul vostro computer.>connessioni di rete e condivisione e condivisione.Cliccare >connessioni di rete e condivisionecondivisioneAssicurarsi che siano state correttamente selezionate le seguenti opzioni: Allow Windows to manage homegroup connections (recommended)7:Nel computer, selezionare la cartella contenente i file da condividere.Properties.Advanced Sharing....23Gestione File permette di visualizzare tutti i file multimediali contenuti nei dispositivi di archiviazione./ per navigare su System (Sistema),Network (Rete) e MISC, quindi premere per configurare la categoria selezionata.per scorrere sull’elemento da configurare./ per passare ad un’altra categoria.Se necessario, utilizzare i tasti su/giù / per aumentare/ridurre unper annullare le impostazioni.per individuare il video da riprodurre.per avviare la riproduzione del file. E’ possibile premere il per selezionare l’effetto video.per individuare il file musicale da ascoltare. per avviare la riproduzione del file.per confermare la selezione.Per configurare le impostazioni audio dalla pagina delle impostazioni::Visualizzazione di Foto in Modalità PresentazionePer visualizzare le foto in modalità presentazione:Quano la foto selezionata è visualizzata a schermo intero, premere sul telecomando per avviare la presentazione. Le foto contenute nella stessa cartella sorgente, saranno visualizzate in ordine di successione.per sospendere la presentazione.per tornare alla cartella sorgente.Scorrere sull’opzione desiderata, quindi premere per salvare oppure。
tcpreplay使用手册2013年4月27日星期六陈海敏简介Tcpreplay是一系列工具的总称,包括tcpreplay、tcprewrite和tcpprep 等工具,这也是Tcpreplay的第一个字母大写的原因。
它用来在Unix系统或类Unix系统上重放网络包。
这些包是由tcpdump、ethereal和wireshark等软件抓取到的,即pcap格式的数据包。
正因为Tcpreplay有重放数据包的功能,所以它常被用来模拟IDS攻击等测试环境,被广泛地用来测试防火墙和IDS工具的安全性。
一、tcpreplay使用方法1 基本用法将抓取到的pcap包通过eth0网口进行回放,当存在多网卡时,可以选择通过哪个口进行发送,一般一台机子只有一个网卡eth0# tcpreplay --intf1=eth0 sample.pcap或者缩写#tcpreplay -i eth0 sample.pcap关于缩写,一般都是全称的首字母,不再给出特别说明,自己可以通过tcpreplay –h 命令进行查看,附录部分也给出了部分常用的,可以参考。
2 以不同的速度回放1)以尽可能大的速度回放#tcpreplay --topspeed --intf1=eth0 sample.pcap2)以10Mbps速率回放# tcpreplay --mbps=10.0 --intf1=eth0 sample.pcap3)以原速度的7.3倍速率回放#tcpreplay --multiplier=7.3 --intf1=eth0 sample.pcap4)以原速度的0.5倍速率回放#tcpreplay --multiplier=0.5 --intf1=eth0 sample.pcap5)以每秒回放25个包的速率回放#tcpreplay --pps=25 --intf1=eth0 sample.pcap6)以一次一个包的速率发送数据包(debug时很有用)#tcpreplay --oneatatime --verbose --intf1=eth0 sample.pcap3 循环播放数据包1)重放10次#tcpreplay --loop=10 --intf1=eth0 sample.pcap2)无限循环重放,直到Ctrl+C结束#tcpreplay --loop=0 --intf1=eth0 sample.pcap4 两个网口之间重放数据包1)可以利用tcpprep将数据包通信双方区分为客户端和服务器端,这样在eth0和eth1之间通信就相当于是客户端和服务器。
# tcpreplay --cachefile=sample.prep --intf1=eth0 --intf2=eth1 sample.pcap说明:cachefile为由tcpprep生成,会在下面的tcpgrep部分介绍具体用法2)如果已经将数据包分成两个文件,那么tcpreplay就可以用如下的命令在两个网口之间进行数据的重放。
# tcpreplay --dualfile --intf1=eth0 --intf2=eth1 side-a.pcap side-b.pcap更多详细信息.请查看: /trac/wiki/tcpreplay二、tcpprep使用方法1 基本用法tcpprep用于将pcap数据包分解为客户端和服务器端.tcpprep所支持的模式:•Auto/Bridge•Auto/Router•Auto/Client•Auto/Server•IPv4 matching CIDR•IPv4 matching Regex•TCP/UDP Port•MAC address1.1 auto/bridge模式在auto/bridge模式下,tcpprep根据clinet和server的行为分析数据包.client行为如下定义:•发送一个TCP Syn 包到另外一台主机•发送一个DNS 请求•收到一个ICMP 端口不可达Server行为如下定义:•发送一个TCP Syn/Ack 包到另外一台主机•发送一个DNS 应答•发关一个ICMP 端口不可达例: tcpprep --auto=bridge --pcap=input.pcap--cachefile=input.cache如果数据包中有任何一个包无法分类.tcpprep将报错.在分类完后,服务器端到客户端的数据包率将被设置为此数据包的数据率,客户端到服务器端的数据率将会是它的两倍.不然.你也可以用ratio参数修改它.ratio对每一种模式都是有效的.例如:tcpprep --auto=bridge --pcap=input.pcap--cachefile=input.cache --ratio=3.51.2 auto/router模式在auto/router模式下,首先是按auto/bridger模式的方法标记出client 和server.对于存在那些未标记的主机.通过分析其与其它主机的数据包,将其划分到相同的子网,并标记为与其子网内其它主机相同的标记.例:tcpprep --auto=router --pcap=input.pcap--cachefile=input.cache1.3 auto/client模式在auto/client模式下,其分类标准与auto/birdge相同,只不过对于那些被标记为client的IP.其只对ip 的第一个行为做判断,而不是每一次都做判断.例:tcpprep --auto=client --pcap=input.pcap --cachefile=input.cache1.4 auto/server模式auto/server与auto/client相似.不同在于它是对被标记为server的ip 做处理.1.5 Cidr模式在Cidr模式下.用户手动给出server所在的网段.而不像在auto模式下由tcpprep来区分.例:Tcpprep --cidr=10.0.0.0/8,172.16.0.0/12 --pcap=input.pcap --cachefile=input.cache1.6 Regex模式在Regex模式下.用户给出能匹配server的正则表达式.例:tcpprep --regex="(10|20)\..*" --pcap=input.pcap--cachefile=input.cache1.7 port模式在port模式下,用端口号来区分server 和client.默认情况下,0—1024端口为server端所有.1024以外为client所有.当然.你也可以在自己/etc/services中划分服务器端口.tcpprep --port --services=/etc/services --pcap=input.pcap--cachefile=input.cache1.8 mac模式在mac模式下.由用户指定那些mac为服务端mac.例:Tcpprep --mac=00:21:00:55:23:AF,00:45:90:E0:CF:A2--pcap=input.pcap --cachefile=input.cache2 跳过数据包2.1 参数include在include下.可以指定所要处理的数据包1)只处理源IP在10.0.0.0/8,192.168.0.0/16网段的数据包Tcpprep --auto=bridge --include=S:10.0.0.0/8,192.168.0.0/16 --pcap=input.pcap --cachefile=input.cache2)只处理目的IP在10.0.0.0/8,192.168.0.0/16网段的数据包tcpprep --include=D:10.0.0.0/8,192.168.0.0/16--pcap=input.pcap --cachefile=input.cache3)只处理目的IP和源IP都在10.0.0.0/8,192.168.0.0/16网段的数据包.Tcpprep --auto=bridge --include=B:10.0.0.0/8,192.168.0.0/16 --pcap=input.pcap --cachefile=input.cache4)处理只要源IP或者目的IP在10.0.0.0/8,192.168.0.0/16网段的数据包.5)Tcpprep --auto=bridge--include=E:10.0.0.0/8,192.168.0.0/16 --pcap=input.pcap--cachefile=input.cache6)处理指定编号1到5,9,15,72到结尾处的这些数据包Tcpprep --auto=bridge --include=P:1-5,9,15,72- --pcap=input.pcap --cachefile=input.cache7)只处理协议为tcp的端口号为22的据包Tcpprep --auto=bridge --include=F:"tcp port 22"--pcap=input.pcap --cachefile=input.cache2.2 参数ExcludeExclude和include使用相似,功能相反..只举一例.其它类推.例如:只处理源IP不在10.0.0.0/8,192.168.0.0/16网段内的数据包.Tcpprep --auto=bridge--exclude=S:10.0.0.0/8,192.168.0.0/16 --pcap=input.pcap--cachefile=input.cache2.3其他在使用tcpprep工具时,我们还可以给所得的cache文件加一些注释.例: tcpprep --auto=bridge --pcap=input.pcap--cachefile=input.cache --comment="This is our evil packet pcap"使用如下命令查看注释.tcpprep --print-comment=input.cache查看每个数据包的状态.tcpprep --print-stats=input.cache查看每个数据包的数据.tcpprep --print-info=input.cache更多详细信息.请查看: /trac/wiki/tcpprep三、tcprewrite使用方法1.基本用法Tcprewrite至少需要两个参数.infile指定需要编辑的pcap文件,outfile,指定输出的pcap文件名.例:$ tcprewrite --infile=input.pcap --outfile=output.pcapinput.pcap为原数据包,output.pcap为被修改后的数据包,此处并没有对数据包内容进行任何修改,具体参数,下面介绍。