Doubt regarding Diameter BASE RA

260 views
Skip to first unread message

Sachin Parnami

unread,
Jun 17, 2009, 12:37:25 AM6/17/09
to mobicent...@googlegroups.com
Hi All,

What configuration it looks for peer table or how it identifies the connected peer? in DiameterBaseResourceAdaptor for the metioned line ?

List<Peer> peers = stack.unwrap(PeerTable.class).getPeerTable();

--
Regards,
Sachin Parnami

Sachin Parnami

unread,
Jun 19, 2009, 8:12:20 AM6/19/09
to mobicent...@googlegroups.com
Some How managed to dig the code :)
Need guidance for the scenario i am trying

I have Two Mobicents node one
Mobicents(JDiameter Server configuration)                         Mobicents(JDiameter Client Configuration)
           127.0.0.2                                                                                     127.0.0.1
Both nodes contains
mobicents-diameter-mux-1.0.0.GA.sar
diameter-base-ra-DU-1.0.0.GA.jar

Both the nodes are configured to each other and i see following message on console

on Configured Server

16:49:59,145 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.2,port=52924,localport=1812]
16:50:19,286 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.2,port=52925,localport=1812]
16:50:39,335 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.2,port=52926,localport=1812]
16:50:57,165 INFO  [TCPTransport] Read thread is stopped
16:50:57,175 INFO  [TCPTransport] Read thread is stopped
16:50:59,385 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.2,port=52927,localport=1812]
16:51:19,432 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.2,port=52928,localport=1812]
16:51:39,503 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.2,port=52929,localport=1812]

Now when i deploy Base-Example on client, i get peer connected message as well

16:50:19,823 INFO  [DiameterExampleSbb] Connected to Peer[aaa://127.0.0.2:1812]

But when the example tries to send any request to server it gets
16:50:19,832 ERROR [STDERR] org.jdiameter.api.RouteException: Can not find valid connection to peer[127.0.0.2:1812] in realm[mobicents.org]

Would like to know what i am trying is correct or not?
--
Regards,
Sachin Parnami

Bartosz Baranowski

unread,
Jun 19, 2009, 9:20:26 AM6/19/09
to mobicent...@googlegroups.com
Dump config, seems that Application IDs are not configred properly, altest - "Read Thread stopped" means that CER/CEA was not success (If I recall correctly.)
--
Bartosz Baranowski
JBoss R & D
==================================
Word of criticism meant to improve is always step forward.

Sachin Parnami

unread,
Jun 19, 2009, 9:28:13 AM6/19/09
to mobicent...@googlegroups.com
Thanks for replying
Please find attached JDiameter-config files
--
Regards,
Sachin Parnami
jdiameter-config-client.xml
jdiameter-config-server.xml

Alexandre Mendonça

unread,
Jun 19, 2009, 10:56:07 AM6/19/09
to mobicent...@googlegroups.com
In both configs:

<Realm name="mobicents.org" peers="localhost" local_action="LOCAL" dynamic="false" exp_time="1">

and

<Realm name="mobicents.org" peers="127.0.0.2" local_action="LOCAL" dynamic="false" exp_time="1">

should be:

<Realm name="mobicents.org" peers="localhost, 127.0.0.2" local_action="LOCAL" dynamic="false" exp_time="1">

Let me know if it fixes it.

--
Alexandre Mendonça
JBoss R&D

Sachin Parnami

unread,
Jun 20, 2009, 11:22:49 PM6/20/09
to mobicent...@googlegroups.com
Hi Alex,

Tried the provided solution but problem still persist :(
Is there any thing else i need to take care of ?

2009/6/19 Alexandre Mendonça <brai...@gmail.com>



--
Regards,
Sachin Parnami

Sachin Parnami

unread,
Jun 22, 2009, 10:11:01 AM6/22/09
to mobicent...@googlegroups.com
Guys any suggestion for this? :)
--
Regards,
Sachin Parnami

Alexandre Mendonça

unread,
Jun 22, 2009, 10:14:19 AM6/22/09
to mobicent...@googlegroups.com
I'm currently trying to setup the environment to see if I get the same behaviour.

Will let you know when I'm done.

Alexandre Mendonça
JBoss R&D

Sachin Parnami

unread,
Jun 30, 2009, 6:04:07 AM6/30/09
to mobicent...@googlegroups.com
Any update?
I am trying to Dig the code
I see Client Node  sends CER message which not at all processed by Server Node :(
Server node reaches upto TCPTransportClient's Start() and Run() when ever CER is being execute by Client :)

2009/6/22 Alexandre Mendonça <brai...@gmail.com>



--
Regards,
Sachin Parnami

Sachin Parnami

unread,
Jul 9, 2009, 1:18:24 AM7/9/09
to mobicent...@googlegroups.com
Did you happen to try the setup? :)
--
Regards,
Sachin Parnami

Alexandre Mendonça

unread,
Jul 9, 2009, 5:24:35 AM7/9/09
to mobicent...@googlegroups.com
Hi Sachin,

Sorry but ended up "losing" this issue :)

I've just tested it and if both are in 127.0.0.1 the example works... What's happening is:

  • If running at the same host, we need to use port to differentiate one peer from another... if Destination-Host AVP is only "127.0.0.1" and both of them are running on such interface, message will be routed to itself.
  • If running in different hosts, port should not be included as it will try to find the peer by IP:Port when it's only indexed by IP.. thus the cannot route message :\
My suggestion is that you try to set them up on same IP, using different ports... If you want to run in different IPs, you have to change this line of code (org.mobicents.slee.examples.diameter.DiameterExampleSbb:438):

avps.add(avpFactory.createAvp(Avp.DESTINATION_HOST, (this.destinationIP + ":" + this.destinationPort).getBytes()));

to

avps.add(avpFactory.createAvp(Avp.DESTINATION_HOST, (this.destinationIP).getBytes()));

In the meantime, we will try to figure what's the best way to avoid this situation, but I don't see much options.

Regards,

Alexandre Mendonça
JBoss R&D

Sachin Parnami

unread,
Jul 9, 2009, 7:56:20 AM7/9/09
to mobicent...@googlegroups.com
Hi Alex

My doubts inline :)
2009/7/9 Alexandre Mendonça <brai...@gmail.com>

Hi Sachin,

Sorry but ended up "losing" this issue :)

I've just tested it and if both are in 127.0.0.1 the example works... What's happening is:
  • If running at the same host, we need to use port to differentiate one peer from another... if Destination-Host AVP is only "127.0.0.1" and both of them are running on such interface, message will be routed to itself.
I tried running both on 127.0.0.1 assigining  1812 to server and 1813 to client, but no luck for the same configuration file i had attached earlier. can i get the configuration files details you have used for testing with deployed content? :)
  • If running in different hosts, port should not be included as it will try to find the peer by IP:Port when it's only indexed by IP.. thus the cannot route message :\
will try that and let you know how far it goes :)



--
Regards,
Sachin Parnami

Alexandre Mendonça

unread,
Jul 10, 2009, 1:33:50 PM7/10/09
to mobicent...@googlegroups.com
Here's the config... I've just noticed that running on same IP address causes issues routing back answer :( routes to itself as it only looks at 127.0.0.1 ... something to improve in the future.

Server > jdiameter-config.xml

<?xml version="1.0"?>
<Configuration xmlns="http://www.jdiameter.org/jdiameter-server">

  <LocalPeer>
    <URI value="aaa://127.0.0.1:1812" />
    <IPAddresses>
      <IPAddress value="127.0.0.1" />
    </IPAddresses>
    <Realm value="mobicents.org" />
    <VendorID value="193" />
    <ProductName value="jDiameter" />
    <FirmwareRevision value="1" />
    <OverloadMonitor>
      <Entry index="1" lowThreshold="0.5" highThreshold="0.6">
        <ApplicationID>
          <VendorId value="193" />
          <AuthApplId value="0" />
          <AcctApplId value="19302" />
        </ApplicationID>
      </Entry>
    </OverloadMonitor>
  </LocalPeer>

  <Parameters>
    <AcceptUndefinedPeer value="true" />
    <DuplicateProtection value="true" />
    <DuplicateTimer value="240000" />
    <UseUriAsFqdn value="false" /> <!-- Needed for Ericsson Emulator (set to true) -->
    <QueueSize value="10000" />
    <MessageTimeOut value="60000" />
    <StopTimeOut value="10000" />
    <CeaTimeOut value="10000" />
    <IacTimeOut value="30000" />
    <DwaTimeOut value="10000" />
    <DpaTimeOut value="5000" />
    <RecTimeOut value="10000" />
  </Parameters>

  <Network>
    <Peers>
      <Peer name="aaa://127.0.0.1:21812" attempt_connect="false" rating="1" />
    </Peers>
    <Realms>
      <Realm name="mobicents.org" peers="127.0.0.1" local_action="LOCAL" dynamic="false" exp_time="1">
        <ApplicationID>
          <VendorId value="193" />
          <AuthApplId value="0" />
          <AcctApplId value="19302" />
        </ApplicationID>
      </Realm>
    </Realms>
  </Network>

  <Extensions />

</Configuration>

Server > example.properties

#                     ##
# Diameter CCA Example #
##                     #

# Act as "client" or "server" (default: server)
example.mode=server

# The AS IP Address, Port and Realm (default: 127.0.0.1 / 1812 / mobicents.org)
origin.ip=127.0.0.1
origin.port=1812
origin.realm=mobicents.org

# The Remote IP Address, Port and Realm (default: 127.0.0.1 / 3868 / mobicents.org)
destination.ip=127.0.0.1
destination.port=21812
destination.realm=mobicents.org

Client > jdiameter-config.xml

<?xml version="1.0"?>
<Configuration xmlns="http://www.jdiameter.org/jdiameter-server">

  <LocalPeer>
    <URI value="aaa://127.0.0.1:21812" />
    <IPAddresses>
      <IPAddress value="127.0.0.1" />
    </IPAddresses>
    <Realm value="mobicents.org" />
    <VendorID value="193" />
    <ProductName value="jDiameter" />
    <FirmwareRevision value="1" />
    <OverloadMonitor>
      <Entry index="1" lowThreshold="0.5" highThreshold="0.6">
        <ApplicationID>
          <VendorId value="193" />
          <AuthApplId value="0" />
          <AcctApplId value="19302" />
        </ApplicationID>
      </Entry>
    </OverloadMonitor>
  </LocalPeer>

  <Parameters>
    <AcceptUndefinedPeer value="true" />
    <DuplicateProtection value="true" />
    <DuplicateTimer value="240000" />
    <UseUriAsFqdn value="false" /> <!-- Needed for Ericsson Emulator (set to true) -->
    <QueueSize value="10000" />
    <MessageTimeOut value="60000" />
    <StopTimeOut value="10000" />
    <CeaTimeOut value="10000" />
    <IacTimeOut value="30000" />
    <DwaTimeOut value="10000" />
    <DpaTimeOut value="5000" />
    <RecTimeOut value="10000" />
  </Parameters>

  <Network>
    <Peers>
      <Peer name="aaa://127.0.0.1:1812" attempt_connect="true" rating="1" />
    </Peers>
    <Realms>
      <Realm name="mobicents.org" peers="127.0.0.1" local_action="LOCAL" dynamic="false" exp_time="1">
        <ApplicationID>
          <VendorId value="193" />
          <AuthApplId value="0" />
          <AcctApplId value="19302" />
        </ApplicationID>
      </Realm>
    </Realms>
  </Network>

  <Extensions />

</Configuration>

Client > example.properties

#                     ##
# Diameter CCA Example #
##                     #

# Act as "client" or "server" (default: server)
example.mode=client

# The AS IP Address, Port and Realm (default: 127.0.0.1 / 1812 / mobicents.org)
origin.ip=127.0.0.1
origin.port=21812
origin.realm=mobicents.org

# The Remote IP Address, Port and Realm (default: 127.0.0.1 / 3868 / mobicents.org)
destination.ip=127.0.0.1
destination.port=1812
destination.realm=mobicents.org


--
Alexandre Mendonça
JBoss R&D


Sachin Parnami

unread,
Jul 15, 2009, 1:50:21 AM7/15/09
to mobicent...@googlegroups.com
Hi Alex,

Thanks for the details, at last got it working ;) , tried it on same IP (i.e. 127.0.0.1)

I am getting mentioned error but example works fine

On Server

11:03:57,982 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.1,port=58532,localport=1812]
11:03:58,170 ERROR [TCPTransport] Transport exception
java.nio.channels.AsynchronousCloseException
    at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:185)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
    at org.jdiameter.client.impl.transport.tcp.TCPTransportClient.run(TCPTransportClient.java:104)
    at java.lang.Thread.run(Thread.java:595)
11:03:58,170 INFO  [TCPTransport] Read thread is stopped
11:04:08,226 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.1,port=56794,localport=1812]
11:04:08,756 ERROR [TCPTransport] Transport exception
java.nio.channels.AsynchronousCloseException
    at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:185)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
    at org.jdiameter.client.impl.transport.tcp.TCPTransportClient.run(TCPTransportClient.java:104)
    at java.lang.Thread.run(Thread.java:595)
11:04:08,756 INFO  [TCPTransport] Read thread is stopped
11:04:18,801 INFO  [netWork] Open incomming connection Socket[addr=/127.0.0.1,port=45014,localport=1812]


On Client

11:03:57,964 ERROR [STDERR] 15 Jul, 2009 11:03:57 AM org.jdiameter.server.impl.io.tcp.NetWorkGuard <init>
INFO: Open server socket: ServerSocket[addr=/127.0.0.1,localport=21812]
11:03:57,988 INFO  [DiameterStackMultiplexer] Diameter Stack Mux :: Successfully initialized stack.
11:03:58,168 ERROR [STDERR] 15 Jul, 2009 11:03:58 AM org.jdiameter.client.impl.controller.PeerImpl$ActionContext processCeaMessage
WARNING: Result code value:5010
11:03:58,169 ERROR [STDERR] 15 Jul, 2009 11:03:58 AM org.jdiameter.client.impl.transport.tcp.TCPTransportClient run
SEVERE: Transport exception
java.nio.channels.AsynchronousCloseException
    at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:185)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236)
    at org.jdiameter.client.impl.transport.tcp.TCPTransportClient.run(TCPTransportClient.java:104)
    at java.lang.Thread.run(Thread.java:595)
11:03:58,169 ERROR [STDERR] 15 Jul, 2009 11:03:58 AM org.jdiameter.client.impl.transport.tcp.TCPTransportClient run
INFO: Read thread is stopped


2009/7/10 Alexandre Mendonça <brai...@gmail.com>



--
Regards,
Sachin Parnami

Bartosz Baranowski

unread,
Jul 15, 2009, 4:16:49 AM7/15/09
to mobicent...@googlegroups.com
This is weird, could YOu dump config from server and client?

Sachin Parnami

unread,
Jul 15, 2009, 4:34:59 AM7/15/09
to mobicent...@googlegroups.com

Its Same without any change what Alex has posted in previous mail :)
--
Regards,
Sachin Parnami
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages