Hello,

diameter uses tcp and by design the source port of a tcp connection cannot be ensured.

One can try to bind local socket for opening a connection, but that is not guaranteed to happen, the kernel can overwrite and select another available port. TCP is connection oriented communication with one-to-one stream relation between source and destination, there cannot be two connections with same source ip/port and same destination ip/port. IIRC, there was another discussion on this list about similar topic with tcp connection, which got some references to resources online. Not sure it can be spotted quickly in the archive, but searching on the web should reveal appropriate information on the topic.

Cheers,
Daniel

On 03/07/15 15:55, micunek@gmail.com wrote:
Hi All,

I am trying to use Cx (Diameter) interface via TCP  towards our HSS according to Carsten Bock example. 

However kamailio client obtain TCP RST from HSS because a kamailio source port is different than port where kamailio is listen. I do not know if this is Diameter/Cx requirement or not. I did not find it in specifications. Is there any way how to ensure that kamailio use same port number for source and destination (3869)?. 


<?xml version="1.0" encoding="UTF-8"?>
<DiameterPeer
        FQDN="...3gppnetwork.org"
        Realm="...3gppnetwork.org"
        Vendor_Id="10415"
        Product_Name="CDiameterPeer"
        AcceptUnknownPeers="1"
        DropUnknownOnDisconnect="1"
        Tc="30"
        Workers="4"
        QueueLength="8"
        TransactionTimeout="5"
        SessionsHashSize="128"
        DefaultAuthSessionTimeout="3600"
        MaxAuthSessionTimeout="3600"
>
        <Peer FQDN="hss....3gppnetwork.org" Realm=".3gppnetwork.org" port="3868"/>

        <Acceptor port="3869" />

        <Auth id="16777216" vendor="10415"/> <!--3GPP CxDX -->

        <Realm name="....3gppnetwork.org">
                <Route FQDN="hss...3gppnetwork.org" metric="10"/>
        </Realm>

        <DefaultRoute FQDN="hss.....3gppnetwork.org" metric="10"/>
</DiameterPeer>

Thanks
Peter


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com