Giter VIP home page Giter VIP logo

Comments (23)

simsong avatar simsong commented on June 6, 2024 1

The answer to your question ""can't it just work with udp like tcpdump does?" "no, it can't, because the udp packets aren't structured as a continuous stream of human-readable text."

from tcpflow.

simsong avatar simsong commented on June 6, 2024

Have you tried setting a filter that explicitly allows UDP traffic?

On May 15, 2012, at 6:50 PM, René Berber wrote:

Hi,

Using tcpflow version 1.2.6, with libpcap 1.2.1, in a NAS which is running Linux 2.6.12, I'm unable to see any UDP traffic.

I'm guessing is a problem in my environment, but I just tested with tcpdump and that works.

Any ideas?


Reply to this email directly or view it on GitHub:
#2

from tcpflow.

rb07 avatar rb07 commented on June 6, 2024

Yes, of course.

Examples of what I've used (just so you see I'm not making a mistake):

$ tcpflow -ce udp

$ tcpflow -ce host deleted and udp port 80

from tcpflow.

simsong avatar simsong commented on June 6, 2024

Thanks for the bug report. Indeed, it seems that udp isn't working in that version. If you wish to fix it, I'm happy to take the fix.

On May 15, 2012, at 7:20 PM, René Berber wrote:

Yes, of course.

Examples of what I've used (just so you see I'm not making a mistake):

$ tcpflow -ce udp

$ tcpflow -ce host and udp port 80


Reply to this email directly or view it on GitHub:
#2 (comment)

from tcpflow.

rb07 avatar rb07 commented on June 6, 2024

OK, I'll take a look at the code, see if I can debug what's going on (with one of my favorite tools).

from tcpflow.

rb07 avatar rb07 commented on June 6, 2024

After spelunking the code I found that UDP has never been supported (see tcpip.cpp:794).

Just by running with debug level 50 you can also see this:

$ src/tcpflow -d 50 -Ce udp
src/tcpflow[27281]: printing packets to console only
src/tcpflow[27281]: packet header dump suppressed
src/tcpflow[27281]: converting non-printable characters to '.'
src/tcpflow[27281]: using colors
src/tcpflow[27281]: tcpflow version 1.2.6
src/tcpflow[27281]: looking for handler for datalink type 1 for interface egiga0
src/tcpflow[27281]: filter expression: 'udp'
src/tcpflow[27281]: filter code:
(000) ldh      [12]
(001) jeq      #0x800           jt 2    jf 5
(002) ldb      [23]
(003) jeq      #0x11            jt 4    jf 5
(004) ret      #65535
(005) ret      #0
src/tcpflow[27281]: listening on egiga0
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
...

from tcpflow.

simsong avatar simsong commented on June 6, 2024

Well, it's never been supported, but I added it recently.

On May 16, 2012, at 5:45 PM, René Berber wrote:

After spelunking the code I found that UDP has never been supported (see tcpip.cpp:794).

Just by running with debug level 50 you can also see this:

$ src/tcpflow -d 50 -Ce udp
src/tcpflow[27281]: printing packets to console only
src/tcpflow[27281]: packet header dump suppressed
src/tcpflow[27281]: converting non-printable characters to '.'
src/tcpflow[27281]: using colors
src/tcpflow[27281]: tcpflow version 1.2.6
src/tcpflow[27281]: looking for handler for datalink type 1 for interface egiga0
src/tcpflow[27281]: filter expression: 'udp'
src/tcpflow[27281]: filter code:
(000) ldh      [12]
(001) jeq      #0x800           jt 2    jf 5
(002) ldb      [23]
(003) jeq      #0x11            jt 4    jf 5
(004) ret      #65535
(005) ret      #0
src/tcpflow[27281]: listening on egiga0
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
...

Reply to this email directly or view it on GitHub:
#2 (comment)

from tcpflow.

rb07 avatar rb07 commented on June 6, 2024

On 5/16/2012 8:29 PM, Simson L. Garfinkel wrote:

Well, it's never been supported, but I added it recently.

Do you mean post version 1.2.6?

Should I have downloaded the repository instead of the release?

René Berber

from tcpflow.

simsong avatar simsong commented on June 6, 2024

Then again, perhaps I didn't add it yet. I think that somebody wanted me to add it and I wasn't sure that it even made sense to do.

On May 16, 2012, at 5:45 PM, René Berber wrote:

After spelunking the code I found that UDP has never been supported (see tcpip.cpp:794).

Just by running with debug level 50 you can also see this:

$ src/tcpflow -d 50 -Ce udp
src/tcpflow[27281]: printing packets to console only
src/tcpflow[27281]: packet header dump suppressed
src/tcpflow[27281]: converting non-printable characters to '.'
src/tcpflow[27281]: using colors
src/tcpflow[27281]: tcpflow version 1.2.6
src/tcpflow[27281]: looking for handler for datalink type 1 for interface egiga0
src/tcpflow[27281]: filter expression: 'udp'
src/tcpflow[27281]: filter code:
(000) ldh      [12]
(001) jeq      #0x800           jt 2    jf 5
(002) ldb      [23]
(003) jeq      #0x11            jt 4    jf 5
(004) ret      #65535
(005) ret      #0
src/tcpflow[27281]: listening on egiga0
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
src/tcpflow[27281]: got non-TCP frame -- IP proto 17
...

Reply to this email directly or view it on GitHub:
#2 (comment)

from tcpflow.

simsong avatar simsong commented on June 6, 2024

On May 16, 2012, at 6:31 PM, René Berber wrote:

On 5/16/2012 8:29 PM, Simson L. Garfinkel wrote:

Well, it's never been supported, but I added it recently.

Do you mean post version 1.2.6?

Should I have downloaded the repository instead of the release?

Probably not.

René Berber


Reply to this email directly or view it on GitHub:
#2 (comment)

from tcpflow.

kostix avatar kostix commented on June 6, 2024

Looks like that would be useful for some folks. Actually I almost answered there with an advice to try tcpflow and then was somewhat puzzled to see it does only supports TCP. Yeah, the project's name clearly has the "tcp" word in it and I know UDP isn't a streaming protocol and so it doesn't "has flows". But at the same time people routinely think of UDP as implementing some sort of connections. Stateful firewalls such as Linux Netfilter do have a notion of UDP sessions.

So I would have being able to decapsulate UDP traffic won't be an unwelcomed addition. The problem is that it probably requires some sort of code that would deal with non-ASCII bytes in payloads in addition to decapsulation code.

from tcpflow.

simsong avatar simsong commented on June 6, 2024

It looks like the poster is confused. The packets are not HTTP packets, they are SSDP packets advertising a HTTP service. There is now a comment on the post which makes this clear.

from tcpflow.

ottomata avatar ottomata commented on June 6, 2024

Hi, I'm trying to use tcpflow to capture UDP packet payloads as well. tcpdump -A is kind of working for me, but I thought I'd try tcpflow too. It seems I can't capture UDP data either.

from tcpflow.

simsong avatar simsong commented on June 6, 2024

What do you want to do with the UDP data? You can't put it into TCP streams.
On Jan 25, 2013, at 2:57 PM, Andrew Otto [email protected] wrote:

Hi, I'm trying to use tcpflow to capture UDP packet payloads as well. tcpdump -A is kind of working for me, but I thought I'd try tcpflow too. It seems I can't capture UDP data either.


Reply to this email directly or view it on GitHub.

from tcpflow.

ottomata avatar ottomata commented on June 6, 2024

I'm trying to debug some packet loss issues. I'm just trying to examine the contents of the UDP packet payload, to see if the expected traffic is making it to the NIC.

On Jan 25, 2013, at 3:01 PM, "Simson L. Garfinkel" [email protected] wrote:

What do you want to do with the UDP data? You can't put it into TCP streams.
On Jan 25, 2013, at 2:57 PM, Andrew Otto [email protected] wrote:

Hi, I'm trying to use tcpflow to capture UDP packet payloads as well. tcpdump -A is kind of working for me, but I thought I'd try tcpflow too. It seems I can't capture UDP data either.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

from tcpflow.

simsong avatar simsong commented on June 6, 2024

So why are you using tcpflow and not tcpdump?

On Jan 25, 2013, at 3:03 PM, Andrew Otto [email protected] wrote:

I'm trying to debug some packet loss issues. I'm just trying to examine the contents of the UDP packet payload, to see if the expected traffic is making it to the NIC.

On Jan 25, 2013, at 3:01 PM, "Simson L. Garfinkel" [email protected] wrote:

What do you want to do with the UDP data? You can't put it into TCP streams.
On Jan 25, 2013, at 2:57 PM, Andrew Otto [email protected] wrote:

Hi, I'm trying to use tcpflow to capture UDP packet payloads as well. tcpdump -A is kind of working for me, but I thought I'd try tcpflow too. It seems I can't capture UDP data either.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

from tcpflow.

ottomata avatar ottomata commented on June 6, 2024

I am using tcpdump, but I was having trouble with it for a bit, and then ran into tcpflow. tcpflow seemed more natural to capture the raw payload data. I'm just letting you know that the udp option doesn't work for me either. I don't need it to, since tcpdump is a fine tool for this job, but since tcpflow advertised that it would work, I thought I'd try it.

On Jan 25, 2013, at 3:07 PM, "Simson L. Garfinkel" [email protected] wrote:

So why are you using tcpflow and not tcpdump?

On Jan 25, 2013, at 3:03 PM, Andrew Otto [email protected] wrote:

I'm trying to debug some packet loss issues. I'm just trying to examine the contents of the UDP packet payload, to see if the expected traffic is making it to the NIC.

On Jan 25, 2013, at 3:01 PM, "Simson L. Garfinkel" [email protected] wrote:

What do you want to do with the UDP data? You can't put it into TCP streams.
On Jan 25, 2013, at 2:57 PM, Andrew Otto [email protected] wrote:

Hi, I'm trying to use tcpflow to capture UDP packet payloads as well. tcpdump -A is kind of working for me, but I thought I'd try tcpflow too. It seems I can't capture UDP data either.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

from tcpflow.

simsong avatar simsong commented on June 6, 2024

Where is tcpflow advertised as working with UDP traffic?

On Jan 25, 2013, at 3:41 PM, Andrew Otto [email protected] wrote:

I am using tcpdump, but I was having trouble with it for a bit, and then ran into tcpflow. tcpflow seemed more natural to capture the raw payload data. I'm just letting you know that the udp option doesn't work for me either. I don't need it to, since tcpdump is a fine tool for this job, but since tcpflow advertised that it would work, I thought I'd try it.

On Jan 25, 2013, at 3:07 PM, "Simson L. Garfinkel" [email protected] wrote:

So why are you using tcpflow and not tcpdump?

On Jan 25, 2013, at 3:03 PM, Andrew Otto [email protected] wrote:

I'm trying to debug some packet loss issues. I'm just trying to examine the contents of the UDP packet payload, to see if the expected traffic is making it to the NIC.

On Jan 25, 2013, at 3:01 PM, "Simson L. Garfinkel" [email protected] wrote:

What do you want to do with the UDP data? You can't put it into TCP streams.
On Jan 25, 2013, at 2:57 PM, Andrew Otto [email protected] wrote:

Hi, I'm trying to use tcpflow to capture UDP packet payloads as well. tcpdump -A is kind of working for me, but I thought I'd try tcpflow too. It seems I can't capture UDP data either.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

from tcpflow.

ottomata avatar ottomata commented on June 6, 2024

Ha, maybe you didn't advertise it, but I was lead here via the aforementioned StackOverflow reply :p

from tcpflow.

simsong avatar simsong commented on June 6, 2024

Huh. I'll take a look at the link; can you send it to me?
On Jan 25, 2013, at 4:16 PM, Andrew Otto [email protected] wrote:

Ha, maybe you didn't advertise it, but I was lead here via the aforementioned StackOverflow reply :p


Reply to this email directly or view it on GitHub.

from tcpflow.

davidnewhall avatar davidnewhall commented on June 6, 2024

For anyone else winding up here after trying to dump UDP packets with tcpflow, two things to note:

  1. There is an older version of tcpflow written by Jeremy Elson that has a man page on the Internet that seems to indicate tcpflow supports UDP. This man page looks a lot like the one included with the version of tcpflow in this repo.
  2. Neither version of tcpflow supports UDP processing.

Good luck!

from tcpflow.

simsong avatar simsong commented on June 6, 2024

For anyone else winding up here after trying to dump UDP packets with tcpflow, two things to note:

  1. There is an older version of tcpflow written by Jeremy Elson that has a man page on the Internet that seems to indicate tcpflow supports UDP. This man page looks a lot like the one included with the version of tcpflow in this repo.
  2. Neither version of tcpflow supports UDP processing.

Good luck!

  1. I took over tcpflow from Jeremy Elson many years ago.

  2. What would it mean for a program that processes TCP packets to support "UDP processing." What does that even mean?

from tcpflow.

davidnewhall avatar davidnewhall commented on June 6, 2024
  1. Thank you for the explanation.
  2. I'm not a network engineer, but I understand packets well enough. My very very simple answer is another question, sorry: "can't it just work with udp like tcpdump does?" I've been looking for a way visualize statsd packets with ip headers, and tcpdump is the only tool I have, but it's output is awful; lots of nonprintable characters make lots of periods and random letters at the beginning of the packet. The command I ran that I was hopeful would work is: tcpflow -c udp port 8125

Thanks so much for the reply!

from tcpflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.