This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

I'm trying to analyse the protocol used to communicate with a device. The host computer just opens a connection to the device on port 9100, and leaves in open. It then communicates with the device very like a serial device (I suspect that the protocol is more or less unchanged from the old serial version of the device). To analyse the bytes sent and received, I need to capture them and ignore all the ethernet, tcp and ip "wrapping". I'd like to keep the timestamps if possible, because it's useful to see where the long breaks are (which usually mean the system was waiting for something external to happen).

How do I do this?

Thanks - Rowan

asked 24 Nov '12, 15:37

Rowan's gravatar image

Rowan
1333
accept rate: 0%


You can try this:

tshark -r input.cap -E separator=, -R "tcp.data" -T fields -e frame.number -e frame.time -e ip.src -e ip.dst -e tcp.data

It will output the hex representation of the tcp data plus some information about the frame. Instead of -e frame.time your can also use -e frame.time_relative

If you need ASCII output, you can use -e text instead of -e tcp.data

tshark -r input.cap -E separator=, -R "tcp.data" -T fields -e frame.number -e frame.time -e ip.src -e ip.dst -e text

Regards
Kurt

permanent link

answered 25 Nov '12, 02:35

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 25 Nov '12, 02:44

Thanks. This looks just the job, but it doesn't seem to produce any output. Where does it write its output to? Do I have to add some more options to give it an output filename? I tried several (e.g. -w - or -F libpcap) without success. Here's my actual command: "C:\Program Files\Wireshark\tshark.exe" -r "C:\Users\rbradley.ADC\Documents\Customers\Dansk\DanskLogs121113\2201 overnight capture.pcap" -E separator=, -R "tcp.data" -T fields -e frame.number -e frame.time -e ip.src -e ip.dst -e text

Can I do the same thing using the GUI version?

Thanks - Rowan

(25 Nov '12, 18:09) Rowan

This looks just the job, but it doesn't seem to produce any output.

The above command works for tcp. If it does not output anything, your protocol might use UDP. Is that the case?

(26 Nov '12, 01:27) Kurt Knochner ♦

Could you just write a Wireshark dissector for the (serial) protocol that registers itself with "udp.port" with a value of 9100?

permanent link

answered 25 Nov '12, 19:18

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×122
×20
×10

question asked: 24 Nov '12, 15:37

question was seen: 14,179 times

last updated: 26 Nov '12, 01:27

p​o​w​e​r​e​d by O​S​Q​A