sngrep icon indicating copy to clipboard operation
sngrep copied to clipboard

FreeBSD: the live capture does not show complete SIP package

Open dunst0 opened this issue 10 years ago • 7 comments

If captured live with sngrep the displayed packages are not complete, always are some of the last bits, from the SIP package missing.

But if captured with tcpdump and open after that with sngrep show complete call flow. If you would like to get the pcap from sngrep and tcpdump, I could send them per email to you.

It is so sad because sngrep helped me so much.

dunst0 avatar Oct 19 '16 19:10 dunst0

Of course, having a pcap to reproduce issues makes them a lot easier to fix. It would be nice if you can capture at the same time with both tools so I can compare each packet.

Send me both and I will try to debug it as soon as possible.

Thanks!!

Kaian avatar Oct 19 '16 19:10 Kaian

I did a trace with both tools and send you the pcap files per email. Thank you so much for working on this great tool. Helps me a lot with debuging voice traffic.

dunst0 avatar Oct 20 '16 08:10 dunst0

Hi @dunst0

I have checked the pcaps you sent me and I have a guess.. It seems the incomplete packets have IP fragmentation, so maybe not all fragments are being captured by libpcap.

Is it possible that you are using a port filter for sngrep, but not for tcpdump? If so, not all fragments have port data (ports are in UDP/TCP headers) and they are not passed to sngrep at all.

Thanks for the info!

Kaian avatar Oct 20 '16 09:10 Kaian

I didn't use any filters for both i called tcpdump -nqs 0 -w xyz.pcap and sngrep -d em0 and saved the pcap traces.

dunst0 avatar Oct 21 '16 08:10 dunst0

Hi @dunst0

Maybe the s0 (snaplen) setting of tcpdump is the key. I have opened the pcap generated by sngrep using wireshark and it displays Packet size limited during capture: SIP truntated.

Looking at tcpdump code, it seems this can be configured for live capture, so I have increased it to the max allowed by tcpdump.

This is a bit a blind shot, but if you can test the lastest commit of master to check if It changes something...

Thanks for the report!!

Kaian avatar Oct 24 '16 09:10 Kaian

Seems to work :smirk:

dunst0 avatar Oct 24 '16 13:10 dunst0

Nice! Glad to hear that :))

I will close this, but feel free to reopen if I've broken something :+1:

Kaian avatar Oct 24 '16 13:10 Kaian