sipp icon indicating copy to clipboard operation
sipp copied to clipboard

No need to be root for pcapplay.

Open wdoekes opened this issue 11 years ago • 12 comments

The first part, needed to get pcapplay without root powers going.

wdoekes avatar Mar 12 '14 10:03 wdoekes

Ok. And pushing along, the second part got appended to this pull request too.

Oh, well. That was the intention anyway.

wdoekes avatar Mar 12 '14 11:03 wdoekes

Looks good, thanks! I'd like to compile this and kick the tyres myself before I merge, but I should get to that this week.

What OSes have you tested this on? I have Linux, OS X, Cygwin and FreeBSD available to me, and it probably makes sense for me to test on the ones you haven't been able to.

rkday avatar Mar 14 '14 23:03 rkday

Only tested on Linux.

Similar changes have been running for a longer while on the sipp-osso hg fork, but those too have only been seen by a Linux OS.

Cheers, Walter

(Excuse the short msg. This was composed on a phone...)

Rob Day [email protected] wrote:

Looks good, thanks! I'd like to compile this and kick the tyres myself before I merge, but I should get to that this week.

What OSes have you tested this on? I have Linux, OS X, Cygwin and FreeBSD available to me, and it probably makes sense for me to test on the ones you haven't been able to.

— Reply to this email directly or view it on GitHub.

wdoekes avatar Mar 15 '14 06:03 wdoekes

I believe this has one issue: if you're using RTCP and/or other data over multiple ports, this does not work.

Not sure how to proceed.

  • We could run the old code if one is root.
  • Or we could add code to open extra ports as needed.

Both have disadvantages:

  • Using the old root-code makes behaviour inconsistent/unpredictable.
  • Opening ports as needed may not be possible (someone may have already allocated those).

wdoekes avatar May 13 '14 07:05 wdoekes

Sorry for the delay - had to mull that issue over. I think the right thing to do is to open the necessary range of ports - but we should do that at the very start (by checking the pcap files, seeing how many unique port numbers there are, and opening that many at the right offsets from the "base" port). If we fail to open one, we can just choose another "base" port and retry.

rkday avatar May 28 '14 21:05 rkday

Another option is to set CAP_NET_RAW on sipp.

vodik avatar May 29 '15 16:05 vodik

An interesting option, but it has its own drawbacks.

I tried it indeed:

sudo setcap cap_net_raw+ep `which sipp`

But that broke my unittest framework, which introspects which sockets are open by looking at proc:

$ ls /proc/`pidof sipp`/fd
ls: cannot open directory /proc/9986/fd: Permission denied

wdoekes avatar Jun 01 '15 09:06 wdoekes

Your personal unittest stuff Linux? Maybe ss would be more appropriate. The -p flag adds process information to the output.

vodik avatar Jun 01 '15 19:06 vodik

Same difference:

$ ss -lp | grep 5060
tcp    UNCONN     0      0                    *:ipproto-5060               *:*        users:(("sipp",3600,4))

Vs:

$ ss -lp | grep 5060
tcp    UNCONN     0      0                    *:ipproto-5060               *:*

Was to be expected ;)

wdoekes avatar Jun 01 '15 19:06 wdoekes

Yeah, huh. TIL.

vodik avatar Jun 01 '15 20:06 vodik

Interestingly, the polycom-sipped also did some work on this, seeing that the RAW sockets changed to DGRAM in this commit: https://github.com/SIPp/polycom-sipped/commit/e9b1f62ca1efbf0be010b2ea0650c601a43f1198

wdoekes avatar Aug 30 '15 10:08 wdoekes

hi, is there any update on this PR?

alienpenguin avatar Nov 19 '21 12:11 alienpenguin