Bug 222764

Summary: benchmarks/sipp Not working on FreeBSD 11.1 and 10.3
Product: Ports & Packages Reporter: OlivierW <olivierw1+bugzilla-freebsd>
Component: Individual Port(s)Assignee: Babak Farrokhi <farrokhi>
Status: Closed FIXED    
Severity: Affects Only Me CC: ganbold, szabig, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (farrokhi)
Version: Latest   
Hardware: Any   
OS: Any   

Description OlivierW 2017-10-03 22:17:29 UTC
Hello,

I tried using sipp on FreeBSD 10.3-RELEASE and 11.1-RELEASE-p1 but it doesn't seems to work. Or maybe there's something I'm missing/misunderstanding?
The same command lines works on Debian, so they should be correct.


On 10.3:
===============================
root@freebsd:~ # sipp -sn uac 127.0.0.1:5060
Resolving remote host '127.0.0.1'... Done.
                                          2017-10-03    23:51:14.236841 1507067474.236841: Can't get local IP address in getaddrinfo, local_host='freebsd', local_ip=''.


<< snip a looooot of new lines >>


------------------------------ Scenario Screen -------- [1-9]: Change Screen --
  Call-rate(length)   Port   Total-time  Total-calls  Remote-host
  10.0(0 ms)/1.000s   0          0.00 s            0  addr not supported:5060(UDP)

  0 new calls during 0.000 s period      0 ms scheduler resolution
  0 calls (limit 30)                     Peak was 0 calls, after 0 s
  0 Running, 0 Paused, 0 Woken up
  0 dead call msg (discarded)            0 out-of-call msg (discarded)
  0 open sockets

                                 Messages  Retrans   Timeout   Unexpected-Msg
      INVITE ---------->         0         0         0
         100 <----------         0         0         0         0
         180 <----------         0         0         0         0
         183 <----------         0         0         0         0
         200 <----------  E-RTD1 0         0         0         0
         ACK ---------->         0         0
       Pause [      0ms]         0                             0
         BYE ---------->         0         0         0
         200 <----------         0         0         0         0

------------------------------ Test Terminated --------------------------------


----------------------------- Statistics Screen ------- [1-9]: Change Screen --
  Start Time             | 2017-10-03   23:51:14.223386 1507067474.223386
  Last Reset Time        | 2017-10-03   23:51:14.223386 1507067474.223386
  Current Time           | 2017-10-03   23:51:14.239954 1507067474.239954
-------------------------+---------------------------+--------------------------
  Counter Name           | Periodic value            | Cumulative value
-------------------------+---------------------------+--------------------------
  Elapsed Time           | 00:00:00:016000           | 00:00:00:016000
  Call Rate              |    0.000 cps              |    0.000 cps
-------------------------+---------------------------+--------------------------
  Incoming call created  |        0                  |        0
  OutGoing call created  |        0                  |        0
  Total Call created     |                           |        0
  Current Call           |        0                  |
-------------------------+---------------------------+--------------------------
  Successful call        |        0                  |        0
  Failed call            |        0                  |        0
-------------------------+---------------------------+--------------------------
  Response Time 1        | 00:00:00:000000           | 00:00:00:000000
  Call Length            | 00:00:00:000000           | 00:00:00:000000
------------------------------ Test Terminated --------------------------------

2017-10-03      23:51:14.236841 1507067474.236841: Can't get local IP address in getaddrinfo, local_host='freebsd', local_ip=''.

root@freebsd:~ #
===============================



Note the messages:
"2017-10-03    23:51:14.236841 1507067474.236841: Can't get local IP address in getaddrinfo, local_host='freebsd', local_ip=''."
"addr not supported:5060(UDP)"
"2017-10-03      23:51:14.236841 1507067474.236841: Can't get local IP address in getaddrinfo, local_host='freebsd', local_ip=''."



On FreeBSD 11.1, it doesn't work, but the messages are differents:
===============================
root@asterisk:~ # sipp -sn uac 127.0.0.1:5060
Resolving remote host '127.0.0.1'... Done.
                                          2017-10-03    23:53:57.577494 1507067637.577494: Unknown RTP address 'addr not supported'.
                                                                                                                                    Use 'sipp -h' for details.


<< snip a looooot of new lines >>


------------------------------ Scenario Screen -------- [1-9]: Change Screen --
  Call-rate(length)   Port   Total-time  Total-calls  Remote-host
  10.0(0 ms)/1.000s   5060       0.00 s            0  addr not supported:5060(UDP)

  0 new calls during 0.000 s period      0 ms scheduler resolution
  0 calls (limit 30)                     Peak was 0 calls, after 0 s
  0 Running, 0 Paused, 0 Woken up
  0 dead call msg (discarded)            0 out-of-call msg (discarded)
  1 open sockets

                                 Messages  Retrans   Timeout   Unexpected-Msg
      INVITE ---------->         0         0         0
         100 <----------         0         0         0         0
         180 <----------         0         0         0         0
         183 <----------         0         0         0         0
         200 <----------  E-RTD1 0         0         0         0
         ACK ---------->         0         0
       Pause [      0ms]         0                             0
         BYE ---------->         0         0         0
         200 <----------         0         0         0         0

------------------------------ Test Terminated --------------------------------


----------------------------- Statistics Screen ------- [1-9]: Change Screen --
  Start Time             | 2017-10-03   23:53:57.559817 1507067637.559817
  Last Reset Time        | 2017-10-03   23:53:57.559817 1507067637.559817
  Current Time           | 2017-10-03   23:53:57.580010 1507067637.580010
-------------------------+---------------------------+--------------------------
  Counter Name           | Periodic value            | Cumulative value
-------------------------+---------------------------+--------------------------
  Elapsed Time           | 00:00:00:020000           | 00:00:00:020000
  Call Rate              |    0.000 cps              |    0.000 cps
-------------------------+---------------------------+--------------------------
  Incoming call created  |        0                  |        0
  OutGoing call created  |        0                  |        0
  Total Call created     |                           |        0
  Current Call           |        0                  |
-------------------------+---------------------------+--------------------------
  Successful call        |        0                  |        0
  Failed call            |        0                  |        0
-------------------------+---------------------------+--------------------------
  Response Time 1        | 00:00:00:000000           | 00:00:00:000000
  Call Length            | 00:00:00:000000           | 00:00:00:000000
------------------------------ Test Terminated --------------------------------


2017-10-03      23:53:57.577494 1507067637.577494: Unknown RTP address 'addr not supported'.
Use 'sipp -h' for details.
===============================




Note the messages:
"2017-10-03    23:53:57.577494 1507067637.577494: Unknown RTP address 'addr not supported'."
"addr not supported:5060(UDP)"
"2017-10-03      23:53:57.577494 1507067637.577494: Unknown RTP address 'addr not supported'."


I have of course tried different command lines, like:
"sipp 127.0.0.1:5060"
"sipp 127.0.0.1:5060 -sn uac"
"sipp 127.0.0.1:5060 -t t1" (to force TCP instead of UDP)
but without more luck. I also tried different IP addresses (local or distant), but it's still not working.




I installed "sipp" with "pkg", so not compiled myself and default configuration.
My FreeBSD 10.3 is a brand new install, with only "sipp" installed. I installed it to be sure it wasn't a new problem in FreeBSD 11.x.
Both FreeBSD are amd64.

Has anybody know what's the problem? Or does someone have a FreeBSD 9.x around to test? Or some i386 FreeBSD?

Best Regards,
Olivier
Comment 1 Ganbold Tsagaankhuu freebsd_committer 2018-01-12 04:50:35 UTC
Did you solve it? Please let me know.
I'm also having same issue as you.
Comment 2 Walter Schwarzenfeld freebsd_triage 2018-01-12 05:25:49 UTC
Maybe this is it?
https://github.com/SIPp/sipp/blob/master/CHANGES.md

There is a new version 3.6.0.
Comment 3 Ganbold Tsagaankhuu freebsd_committer 2018-01-12 05:28:20 UTC
SIPp v3.3 (TLS, built Jul 22 2013, 08:43:48) works for me, but this package is old and built for FreeBSD 9.x. I took it from http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/9.2-RELEASE/packages/benchmarks/ and it requires older libssl and libcrypto.
Comment 4 Ganbold Tsagaankhuu freebsd_committer 2018-01-12 06:34:48 UTC
sipp-3.4.1 works.
Comment 5 Ganbold Tsagaankhuu freebsd_committer 2018-01-12 06:45:33 UTC
SIPp v3.5.0 is not working.
Comment 6 Ganbold Tsagaankhuu freebsd_committer 2018-01-12 06:52:04 UTC
(In reply to w.schwarzenfeld from comment #2)

sipp-3.6-dev version is not working.
Comment 7 Ganbold Tsagaankhuu freebsd_committer 2018-01-12 07:42:18 UTC
It seems like get_inet_address() function is not working anymore in case of FreeBSD.
Following old function from sipp-3.4.1 in sipp-3.5.0 sort of works for me:

--- src/socket.cpp-orig 2018-01-12 14:36:14.758860000 +0800
+++ src/socket.cpp      2018-01-12 15:31:55.925119000 +0800
@@ -337,11 +337,27 @@

 static char* get_inet_address(const struct sockaddr_storage* addr, char* dst, int len)
 {
-    if (getnameinfo(_RCAST(struct sockaddr*, addr), sizeof(*addr),
-                    dst, len, NULL, 0, NI_NUMERICHOST) != 0) {
-        snprintf(dst, len, "addr not supported");
+//    if (getnameinfo(_RCAST(struct sockaddr*, addr), sizeof(*addr),
+//                    dst, len, NULL, 0, NI_NUMERICHOST) != 0) {
+//        snprintf(dst, len, "addr not supported");
+//    }
+//    return dst;
+    static char * ip_addr = NULL;
+
+    if (!ip_addr) {
+        ip_addr = (char *)malloc(1024*sizeof(char));
+    }
+    if (getnameinfo(_RCAST(struct sockaddr *, addr),
+                    SOCK_ADDR_SIZE(addr),
+                    ip_addr,
+                    1024,
+                    NULL,
+                    0,
+                    NI_NUMERICHOST) != 0) {
+        strcpy(ip_addr, "addr not supported");
     }
-    return dst;
+
+    return ip_addr;
 }

I had to run following command to make it work in this case:

sipp -sn uac -m 1 -d 30000 -r 10 -l 200 -s 1002 -mp 6000 SERVER_IP -l 10 -trace_err -i MY_IP -mi MY_IP -rsa SERVER_IP:5060 -auth_uri SERVER_IP:5060
Comment 8 OlivierW 2018-01-24 11:20:59 UTC
(In reply to Ganbold Tsagaankhuu from comment #1)
Hello Ganbold,

Sadly, I didn't solve the issue, and as I needed sipp in emergency, I used it on Debian :-(
I haven't found time to do more tests or try your patch.

Best Regards,
Olivier
Comment 9 szabig 2018-02-14 14:20:00 UTC
This worked for me:



*** sipp-3.5.1/src/socket.cpp	Thu Mar 17 09:05:49 2016
--- sipp-3.5.1/src/socket.cpp.new	Wed Feb 14 15:05:39 2018
*************** const char *sip_tls_error_string(SSL *ss
*** 338,344 ****
  
  static char* get_inet_address(const struct sockaddr_storage* addr, char* dst, int len)
  {
!     if (getnameinfo(_RCAST(struct sockaddr*, addr), sizeof(*addr),
                      dst, len, NULL, 0, NI_NUMERICHOST) != 0) {
          snprintf(dst, len, "addr not supported");
      }
--- 338,344 ----
  
  static char* get_inet_address(const struct sockaddr_storage* addr, char* dst, int len)
  {
!     if (getnameinfo(_RCAST(struct sockaddr*, addr), sizeof(struct sockaddr),
                      dst, len, NULL, 0, NI_NUMERICHOST) != 0) {
          snprintf(dst, len, "addr not supported");
      }
Comment 10 szabig 2018-02-15 12:03:07 UTC
(In reply to szabig from comment #9)
... on a second thought, this is probably the intended solution (and it works):

*** sipp-3.5.1/src/socket.cpp	Thu Mar 17 09:05:49 2016
--- sipp-3.5.1/src/socket.cpp.new	Thu Feb 15 12:57:22 2018
***************
*** 338,344 ****
  
  static char* get_inet_address(const struct sockaddr_storage* addr, char* dst, int len)
  {
!     if (getnameinfo(_RCAST(struct sockaddr*, addr), sizeof(*addr),
                      dst, len, NULL, 0, NI_NUMERICHOST) != 0) {
          snprintf(dst, len, "addr not supported");
      }
--- 338,344 ----
  
  static char* get_inet_address(const struct sockaddr_storage* addr, char* dst, int len)
  {
!     if (getnameinfo(_RCAST(struct sockaddr*, addr), SOCK_ADDR_SIZE(addr),
                      dst, len, NULL, 0, NI_NUMERICHOST) != 0) {
          snprintf(dst, len, "addr not supported");
      }
Comment 11 commit-hook freebsd_committer 2018-07-08 11:16:19 UTC
A commit references this bug:

Author: farrokhi
Date: Sun Jul  8 11:15:52 UTC 2018
New revision: 474174
URL: https://svnweb.freebsd.org/changeset/ports/474174

Log:
  benchmarks/sipp:

  PR:		222764
  Submitted by:	szabig <szabig@kgb.hu>
  Reported by:	OlivierW <olivierw1+bugzilla-freebsd@hotmail.com>

Changes:
  head/benchmarks/sipp/Makefile
  head/benchmarks/sipp/files/
  head/benchmarks/sipp/files/patch-src_socket.cpp