Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting jdiameter to a DRA #155

Open
tdevinda opened this issue May 9, 2020 · 8 comments
Open

Connecting jdiameter to a DRA #155

tdevinda opened this issue May 9, 2020 · 8 comments

Comments

@tdevinda
Copy link

tdevinda commented May 9, 2020

I need to connect the stack to a DRA. So the messages I send will be routed through a DRA (Diameter Routing Agent)
So far, I see no possibility to do that in the config. I have to statically configure Peer nodes and jdiameter sends the packet to the resolved IP for the DestinationHost AVP.

My DestinationHost values are in other networks and could be anything. (cannot be pre-configured)
This is the basic idea ( Key host(realm) )

app.me.com(me.com) --> dra.me.com(me.com) : XXR sends the request to other.them.org
dra.me.com(me.com) --> other.them.org(them.org) : XXR

Although the destination host AVP contains other.them.org, the packet has to be sent to dra.me.com. The DRA will take care of the rest.

Is this possible with jdiameter? How can I achieve this?
If this is not possible with jdiameter which part of the code do I need to modify to make this happen. I can do a PR if it goes right. I think this will be useful to many people since most telco based diameter applications are behind DRAs.

@nhanth87
Copy link

nhanth87 commented May 9, 2020

Hi,
I think you are looking for SRV entries in DNS records and not related to Diameter

@tdevinda
Copy link
Author

Thats a good idea to try out. But I doubt if I can send messages out which are not specified in the peer configuration. I will try it anyway.

@tom130
Copy link

tom130 commented May 13, 2020

I think for instance F5 DRAs has realm based routing and even you could do some magic with regex patterns to send it to realm or even to some particular hosts

@tom130
Copy link

tom130 commented May 13, 2020

btw you two options:

  1. specify the final destination in the request
  2. put the DRA realm there and if the DRA is clever enough it can do the manipulation or origins and destinations - it acts like a proxy and hides the topology, but like I wrote.. we had to develop a groovy script for the F5 DRA

@stevedwyer-nasstar
Copy link

We were able to get this working by specifying the OCS's realm as the destination realm in the request, and not manually specifying a destination host.

By adding the DRAs (which have their own realm) to the OCS's realm, jdiameter then routes requests to one of the peers in the OCS realm (i.e. one of the DRAs). Because the destination realm in the request is the OCS's realm, the DRA then forwards the request accordingly (that's outside our control, but we've had confirmation that the messages are successfully routed).

Our client's jdiameter config's Network section looks like this:

    <Network>
        <Peers>
            <Peer name="DRA1" rating="1" ip="fill in later"/>
            <Peer name="DRA2" rating="1" ip="fill in later"/>
        </Peers>
        <Realms>
            <!-- DRAs -->
            <Realm name="dra.realm" peers="DRA1,DRA2" local_action="LOCAL" dynamic="false" exp_time="1">
                <ApplicationID>
                    <VendorId value="0"/>
                    <AuthApplId value="0"/>
                    <AcctApplId value="0"/>
                </ApplicationID>
            </Realm>
            <!-- Ro -->
            <Realm name="ocs.realm" peers="DRA1,DRA2" local_action="LOCAL" dynamic="false" exp_time="1">
                <ApplicationID>
                    <VendorId value="10415"/>
                    <AuthApplId value="4"/>
                    <AcctApplId value="0"/>
                </ApplicationID>
            </Realm>
        </Realms>
    </Network>

Note that the DRA's realm supports VendorId 0, AuthApplId 0, AcctApplId 0, so it can connect and send/receive CER/CEA, DPR/DPA and DWR/DWA requests. The OCS's realm supports 3GPP Ro requests, which are then forwarded to the OCS.

@tdevinda
Copy link
Author

We were able to get this working by specifying the OCS's realm as the destination realm in the request, and not manually specifying a destination host.

By adding the DRAs (which have their own realm) to the OCS's realm, jdiameter then routes requests to one of the peers in the OCS realm (i.e. one of the DRAs). Because the destination realm in the request is the OCS's realm, the DRA then forwards the request accordingly (that's outside our control, but we've had confirmation that the messages are successfully routed).

Our client's jdiameter config's Network section looks like this:

    <Network>
        <Peers>
            <Peer name="DRA1" rating="1" ip="fill in later"/>
            <Peer name="DRA2" rating="1" ip="fill in later"/>
        </Peers>
        <Realms>
            <!-- DRAs -->
            <Realm name="dra.realm" peers="DRA1,DRA2" local_action="LOCAL" dynamic="false" exp_time="1">
                <ApplicationID>
                    <VendorId value="0"/>
                    <AuthApplId value="0"/>
                    <AcctApplId value="0"/>
                </ApplicationID>
            </Realm>
            <!-- Ro -->
            <Realm name="ocs.realm" peers="DRA1,DRA2" local_action="LOCAL" dynamic="false" exp_time="1">
                <ApplicationID>
                    <VendorId value="10415"/>
                    <AuthApplId value="4"/>
                    <AcctApplId value="0"/>
                </ApplicationID>
            </Realm>
        </Realms>
    </Network>

Note that the DRA's realm supports VendorId 0, AuthApplId 0, AcctApplId 0, so it can connect and send/receive CER/CEA, DPR/DPA and DWR/DWA requests. The OCS's realm supports 3GPP Ro requests, which are then forwarded to the OCS.

Thanks a lot for this. I will look into this option as well. As of this moment we're sending the actual destination which the packet needs to go, in a custom AVP and then trying to replace those from the DRA.

@preetirani07
Copy link

preetirani07 commented Feb 9, 2022

Yes this is possible.
Modifications in the config file : Add the Other Diameter node's realm(not DRA's realm) in the Realms.
and IP Port of the DRA in the Peers.
Example:
<Network>
<Peers>
<Peer name="<DRA ip:port>" attempt_connect="false" rating="1" />
</Peers>
<Realms>
<Realm name="<Other node's Realm>" peers="<DRA IP>" local_action="LOCAL" dynamic="false" exp_time="1">
<ApplicationID>...</ApplicationID>
</Realm>
</Realms>
</Network>

Modifications in the JDiameter Request - Add Destination Host(optional) and Destination Realm of Other node

@tdevinda
Copy link
Author

This would not work. Peers are statically configured. In my case, I was sending the messages to any telco operator in the world. But thanks for this. I think Stephen's and your answers are worthwhile trying out when I dive into diameter again. We closed this project using the DRA only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants