[erlang-questions] Diameter client issue

Rudolph van Graan <>
Wed Mar 20 18:08:49 CET 2013


Hi there,

I'm trying to start up the Erlang diameter demo application shipped with Erlang/OTP. The issue is that, no matter what format I try, I can't get the client to connect to a remote diameter server. 

In that example, I started the application as follows:

> 3>  diameter:start(), client:start().
> ok
> 
> 4> client:connect({tcp,{10,151,0,166},{10,249,20,174},3868}).
> {ok,#Ref<0.0.0.643>}
> 
> 7> client:call().
> {error,no_connection}

Here, my local IP address is {10,151,0,166} and the remote one is {10,249,20,174}.

TCP to the server is working:

> telnet 10.249.20.174 3868
> Trying 10.249.20.174...
> Connected to 10.249.20.174.
> Escape character is '^]'.

I traced diameter_tcp and I can see that it is getting a badarg error somewhere:

> (<0.114.0>) returned from diameter_tcp:start/3 -> {ok,<0.115.0>,
>                                                    [{10,151,0,166}]}
> (<0.116.0>) call diameter_tcp:handle_info({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg},{monitor,<0.114.0>,<0.115.0>})
> (<0.116.0>) call diameter_tcp:m({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg},{monitor,<0.114.0>,<0.115.0>})
> (<0.116.0>) returned from diameter_tcp:m/2 -> ok


Does anyone have an idea what I am doing wrong? My feeling is that it has to do with the local ip address. I don't understand why I even need to supply a local IP address and the documentation isn't very clear.

Thanks,

Rudolph


 Here is the trace:

(<0.84.0>) call diameter_tcp:start_link({monitor,<0.114.0>,<0.115.0>})
(<0.116.0>) call diameter_tcp:init({monitor,<0.114.0>,<0.115.0>})
(<0.116.0>) call diameter_tcp:i({monitor,<0.114.0>,<0.115.0>})
(<0.116.0>) returned from diameter_tcp:i/1 -> {monitor,<0.114.0>,<0.115.0>}
(<0.84.0>) returned from diameter_tcp:start_link/1 -> {ok,<0.116.0>}
(<0.115.0>) call diameter_tcp:ssl([{ssl,false},
 {ip,{10,151,0,166}},
 {raddr,{10,249,20,174}},
 {rport,3868},
 {reuseaddr,true}])
(<0.115.0>) call diameter_tcp:ssl_opts([])
(<0.115.0>) returned from diameter_tcp:ssl_opts/1 -> false
(<0.115.0>) returned from diameter_tcp:ssl/1 -> {false,
                                                 [{ssl,false},
                                                  {ip,{10,151,0,166}},
                                                  {raddr,{10,249,20,174}},
                                                  {rport,3868},
                                                  {reuseaddr,true}]}
(<0.115.0>) call diameter_tcp:i(connect,#Ref<0.0.0.643>,gen_tcp,<0.114.0>,false,[{ssl,false},
 {ip,{10,151,0,166}},
 {raddr,{10,249,20,174}},
 {rport,3868},
 {reuseaddr,true}],[])
(<0.115.0>) call diameter_tcp:i(connect,#Ref<0.0.0.643>,gen_tcp,<0.114.0>,[{ssl,false},
 {ip,{10,151,0,166}},
 {raddr,{10,249,20,174}},
 {rport,3868},
 {reuseaddr,true}],[])
(<0.115.0>) call diameter_tcp:get_addr([{ip,{10,151,0,166}}],[])
(<0.115.0>) call diameter_tcp:addr([{ip,{10,151,0,166}}],[])
(<0.115.0>) returned from diameter_tcp:addr/2 -> {10,151,0,166}
(<0.115.0>) returned from diameter_tcp:get_addr/2 -> {10,151,0,166}
(<0.115.0>) call diameter_tcp:get_addr([{raddr,{10,249,20,174}}],[])
(<0.115.0>) call diameter_tcp:addr([{raddr,{10,249,20,174}}],[])
(<0.115.0>) returned from diameter_tcp:addr/2 -> {10,249,20,174}
(<0.115.0>) returned from diameter_tcp:get_addr/2 -> {10,249,20,174}
(<0.115.0>) call diameter_tcp:get_port([{rport,3868}])
(<0.115.0>) returned from diameter_tcp:get_port/1 -> 3868
(<0.115.0>) call diameter_tcp:gen_opts({10,151,0,166},[{ssl,false},{reuseaddr,true}])
(<0.115.0>) returned from diameter_tcp:gen_opts/2 -> [binary,
                                                      {packet,0},
                                                      {active,once},
                                                      {ip,{10,151,0,166}},
                                                      {ssl,false},
                                                      {reuseaddr,true}]
(<0.82.0>) returned from diameter_tcp:start_link/1 -> {ok,<0.115.0>,
                                                       [{10,151,0,166}]}
(<0.115.0>) call diameter_tcp:connect(gen_tcp,{10,249,20,174},3868,[binary,
 {packet,0},
 {active,once},
 {ip,{10,151,0,166}},
 {ssl,false},
 {reuseaddr,true}])
(<0.114.0>) returned from diameter_tcp:start/3 -> {ok,<0.115.0>,
                                                   [{10,151,0,166}]}
(<0.116.0>) call diameter_tcp:handle_info({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg},{monitor,<0.114.0>,<0.115.0>})
(<0.116.0>) call diameter_tcp:m({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg},{monitor,<0.114.0>,<0.115.0>})
(<0.116.0>) returned from diameter_tcp:m/2 -> ok
(<0.116.0>) call diameter_tcp:x({'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg})
(<0.116.0>) call diameter_tcp:terminate({shutdown,{'DOWN',#Ref<0.0.0.924>,process,<0.115.0>,badarg}},{monitor,<0.114.0>,<0.115.0>})
(<0.116.0>) returned from diameter_tcp:terminate/2 -> ok


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130320/9babcc49/attachment.html>


More information about the erlang-questions mailing list