LINUX.ORG.RU

Получить данные из дампа

 


1

1

Есть tcpdump в рамках которого датчик шлет свои измерения по TCP на хост.

Необходимо получить набор пар dt (время от начала дампа) <-> value (значение, отправленное датчиком)

Как это проще всего сделать?

Update: Проблема вот в чем: траффик получен уже после того, когда было установленно сетевое соединение. Т.е. основная задача - научится открывать TCP-сокеты, которые готовы будут получать данные не заморачиваясь на ASC-SYN.

★★★★★

Последнее исправление: trex6 (всего исправлений: 2)

tcpdump -ttttt -X -q -r /var/lib/tcpdump/eth0.dump tcp and src host 10.0.0.10

Так не подойдёт? Вместо 10.0.0.10, разумеет подставить ip-шник датчика.

shell-script ★★★★★
()
Ответ на: комментарий от trex6

Не понял задачи из первого поста.

Дамп уже есть, теперь надо его проиграть в сеть.

А для этого есть tcpreplay

tcpreplay (tcpreplay) - Replay network traffic stored in pcap files
USAGE:  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
   -K, --enable-file-cache    Enable caching of packets to internal memory
       --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
       --listnics             List available network interfaces and exit
   -l, --loop=num             Loop through the capture file X times
       --pktlen               Override the snaplen and use the actual packet len
   -L, --limit=num            Limit the number of packets to send
   -x, --multiplier=str       Modify replay speed to a given multiple
   -p, --pps=num              Replay packets at a given packets/sec
   -M, --mbps=str             Replay packets at a given Mbps
   -t, --topspeed             Replay packets as fast as possible
   -o, --oneatatime           Replay one packet at a time for each user input
       --pps-multi=num        Number of packets to send for each time interval
   -P, --pid                  Print the PID of tcpreplay at startup
       --stats=num            Print statistics every X seconds
   -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

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.

tcpreplay is a tool for replaying network traffic from files saved with
tcpdump or other tools which write pcap(3) files.

varchar
()
Ответ на: комментарий от varchar

Это я тоже нашел. Проблема вот в чем: траффик получен уже после того, когда было установленно сетевое соединение. Т.е. основная задача - научится открывать TCP-сокеты, которые готовы будут получать данные не заморачиваясь на ASC-SYN.

trex6 ★★★★★
() автор топика
Ответ на: комментарий от varchar

Похоже на правду. Завтра попробую проверить.

trex6 ★★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.