Diameter issue - Received message for unknown peer

941 views
Skip to first unread message

Grzegorz Jamka

unread,
Oct 16, 2011, 12:16:13 PM10/16/11
to mobicents-public
Hi,

I tried to write standalone Diameter client to communicate with
example service diameter-base-example-DU-2.4.1.FINAL.jar (sending/
receiving AccountingRequest/AccountingAnswer).

I have a problem with delivery message from Diameter stack to
application. In some point there is a matching of Destination-Host
with Local Peer URI. And this test didn't pass, although there is the
same value at server and client level:
aaa://127.0.0.1:3868

The log message I get is:
WARN [PeerImpl] Received message for unknown peer [aaa://localhost:
3868]. Answering with 3002 (UNABLE_TO_DELIVER) Result-Code.
WARN [RouterImpl] Could not find route info for Hop-by-Hop Id
[225963440]. Table size is [0]

Test failed in org.jdiameter.server.impl.PeerImpl.receiveMessage(),
line with
if (destHost.equals(metaData.getLocalPeer().getUri().getFQDN())) {

Software versions:
- diameter-base-ra-DU-2.5.0.FINAL.jar
- diameter-base-example-DU-2.4.1.FINAL.jar
- mobicents-diameter-mux-1.4.0.CR1.sar
- mobicents-jainslee-2.5.0.FINAL-jboss-5.1.0.GA

All packages are from Mobicents site, I didn't recompile any, I used
original binaries.
Below is link to archive with my sample service and server
configuration as well as logs from console.

https://sites.google.com/site/morethanspec/jslee/issues/diameter-issue.zip

To start service just call:
mvn clean install
mvn exec:java -
Dexec.mainClass="com.mts.diameter.guide.DiameterApplicationMain"

Best regards,
Grzegorz Jamka

Grzegorz Jamka

unread,
Oct 18, 2011, 4:56:08 PM10/18/11
to mobicents-public
OK,

I found a bit time to investigate this case and here is what I found.
I put three log messages to print what comes with each of variables:

logger.info("## Server URI FQN: '" +
metaData.getLocalPeer().getUri().getFQDN() + "'");
logger.info("## Server URI: '" +
metaData.getLocalPeer().getUri().toString() + "'");
logger.info("## Dest URI: '" + destHost + "'");

if (destHost.equals(metaData.getLocalPeer().getUri().getFQDN())) {
...

And the logs:
22:28:15,078 INFO [PeerImpl] ## Server URI FQN: '127.0.0.1'
22:28:15,078 INFO [PeerImpl] ## Server URI: 'aaa://127.0.0.1:3868'
22:28:15,078 INFO [PeerImpl] ## Dest URI: 'aaa://127.0.0.1:3868'


As I read in RFC 3588 Destination-Host AVP is of type
DiameterIdentity. DiameterIdentity is of type FQDN so the condition is
correct.
But if I remove setup Destination-Host directly from the code and I
will base only on what stack will setup I ended with value from
Configuration/Network/Peers/Peer/name attribute value, which has to be
DiameterURI.
The problem is gone when I setup Destination-Host AVP with value
127.0.0.1 from the code.

So I see that there is some inconsistency in some point.

Best regards,
Grzegorz Jamka

Alexandre Mendonça

unread,
Oct 24, 2011, 11:06:45 AM10/24/11
to mobicent...@googlegroups.com
Hi Grzegorz,

If I got correctly your issue, the problem is some inconsistency between URI and FQDN. Let me try to clarify

Destination-Host should be just the FQDN, but for allowing easier setup of several servers/clients we do allow using it as URI, but that should be used together with the UseUriAsFqdn set to true.

But in my opinion, and to keep everything according to specs, I recommend using different addresses (eg: 127.0.0.1, 127.0.0.2, ...). Also keep in mind that there's no name resolving in FQDN, so using localhost or 127.0.0.1 is different.

Regards,

--
Alexandre Mendonça // JBoss R&D
http://ammendonca.blogspot.com/

Grzegorz Jamka

unread,
Oct 30, 2011, 9:55:13 AM10/30/11
to mobicent...@googlegroups.com
1. Mobicents Diameter MUX configuration on server side - jdiameter-config.xml:
DiameterIdentity: <URI value="aaa://127.0.0.1:3868" />FQDN: 127.0.0.1
2. Client configuration - jdiameter-config.xml
XML element : Configuration/Network/Peers/Peer Attribute value :
namevalue : aaa://127.0.0.1:3868Accepted format : Diameter URI
3. Client request If we don't set Destination-Host AVP excplicitly
then stack will do it. As I see it takes value from attribute
described in 2) : aaa://127.0.0.1:3868, which is NOT VALID FORMAT of
Destination-Host AVP.Even if UseUriAsFqdn is set to false.
4. Server receives requestAt PeerImpl there is comparision of FQDN
(which value is taken from point 1) ) with AVP value which has
Diameter URI format.
5. When it works properlyTo work it properly I have to set
Diameter-Host excplicitly, e.g.
avps.removeAvp(Avp.DESTINATION_HOST);
avps.addAvp(Avp.DESTINATION_HOST,
messageParser.utf8StringToBytes("127.0.0.1"));
And that is OK.
Summary:
I try to notice that there is a problem in point number 3), that if I
DON'T set Destination-Host EXPLICITLY stack put its value IN WRONG
FORMAT.I don't mean interpretation on server site but on client site.

Best regards
Grzegorz
2011/10/24 Alexandre Mendonça <brai...@gmail.com>:

Alexandre Mendonça

unread,
Nov 1, 2011, 1:47:56 PM11/1/11
to mobicent...@googlegroups.com
Thank Grzegorz, it's now clear what the problem is.

Can you please create an issue at http://code.google.com/p/mobicents/issues/entry?template=Mobicents%20Diameter%20Template with these instructions, so we can keep track and fix it?

Thanks & Regards,

--
Alexandre Mendonça // JBoss R&D
http://ammendonca.blogspot.com/



Grzegorz Jamka

unread,
Nov 2, 2011, 3:03:48 PM11/2/11
to mobicent...@googlegroups.com
You welcome,
Issue 2955

Best regards,
Grzegorz Jamka

2011/11/1 Alexandre Mendonça <brai...@gmail.com>:

Alexandre Mendonça

unread,
Nov 6, 2011, 10:30:53 PM11/6/11
to mobicent...@googlegroups.com
Thanks, will investigate.

Regards,

--
Alexandre Mendonça // JBoss R&D
http://ammendonca.blogspot.com/



Reply all
Reply to author
Forward
0 new messages