Diameter Peer Discovery

As the name suggests it is the process by which a node finds another node to whom it is going to communicate, dynamically. Earlier in RADIUS we have to manually configure the name or address of the node as well as the secret key for each node. This will lead to large administrative burden. So to overcome this limitation diameter provides the dynamic Diameter agent discovery which is also known as peer discovery which makes simple and more  robust deployment of Diameter Services. The option of manual configuration of diameter node is also available.

Before going to details of HOW the diameter agent discovers the other diameter agent, we will look in to when it is needed to discovery a diameter agent by other diameter agent. There are two cases when it is needed.

1) When Diameter client needs to discovery a first-hop Diameter Agent. i.e. when a client wants to communicate with server or some diameter agent then it is not necessary  that client is directly connected to server/diameter agent. there might be one or more diameter agents(relay,proxy) between the client and server. so the message should pass through them, now which is the first node/hop to which message should be sent is known by peer discovery.

2) And in second case, any of the in between diameter agent will search the next agent to which the message to be send so that message reach to destination.

  ______ Case-I  _________ Case-II _________ case-II  ______
 |Client|----->|Dia Agent|----->|Dia Agent|----->|Server|
 |______|      |_________|      |_________|      |______|

           Fig- Showing When Peer discovery is Needed
    
In Diameter peer discovery is done by any of the methods.
1) SRVLOC
2) DNS
Whenever a peer is discovery, it will causes a entry of that peer in PEER-TABLE.

1)SRVLOC (SERVICE LOCATION PROTOCOL)
Here i have tried to explain how SRVLOC works in general and what are its basic features.It is a service discovery protocol that provides a flexible and  scalable way to the computers and other devices to find the information about existence,location and configuration of services in a network dynamically.

Traditionally, user have to find service by knowing the name of a network host (a human readable text string) which is an alias for the network address. But in SLP/SRVLOC user supplies the desired type of service and a set of attributes which describe the service.  Based on that description, the Service Location Protocol resolves the network address of the service for the user.

In SLP/SRVLOC Applications are modeled as clients that need to find servers attached to any of the available networks within an enterprise.For cases where there are many different clients and/or services available, the protocol is adapted to make use of nearby Directory Agents that offer a centralized repository for advertised services.

Terminology for SRVLOC
1)User Agent (UA):-A process working on the user's behalf to establish contact with some service.
2)Service Agent (SA):-A process working on the behalf of one or more services to advertise the services.
3)Directory Agent(DA):-A process which collects service advertisements.There can only be one DA present per given host.

SLP/SRVLOC is message based mechanism of finding the service. These are the messages used in SLP/SRVLOC.

Message Types used in SRVLOC
1)Service Request (SrvRqst)- Generated by User Agent to find the specific service in the network.
2)Service Reply (SrvRply) - It is the Reply in Response of Service Request either by Service Agent or by Director Agent.
3)Service Registration (SrvReg)-It is generated by Service Agent to register their services at Directory Agent.
4)Service Deregister (SrvDeReg)-It is generated by Service Agent to deregister their services from Directory Agent.
5)Service Acknowledge (SrvAck)-It is generated by Directory Agent in response of either SrvReg or SrvDeReg toward ServiceAgent
6)DA Advertisement (DAAdvert)- It is generated by Directory Agent to unsolicitely advertise itself whenever User Agent and Service Agent boots up
.

7)SA Advertisement (SAAdvert) -In the absence of Directory Agents, a User agent may request Service Agents in order to discover their scope configuration.  The User Agent may use these scopes in requests.

PROCESS OF DISCOVERY
In the small network SLP allows User Agent to directly issue a command to Service Agent, In this case User Agent BroadCasts/Multicasts the SrvRqst over the network. And in response the Service Agent which has the desired service will send the Unicast SrvRply to the User Agent.

+-----------+ ----Multicast SrvRqst----> +---------------+
|User Agent |                            | Service Agent |
+- ---------+ <----Unicast SrvRply------ +---------------+


In larger networks, one or more Directory Agents are used.  The Directory Agent functions as a cache.  Service Agents send register messages (SrvReg) containing all the services they advertise to Directory Agents and receive acknowledgements in reply (SrvAck). These advertisements must be refreshed with the Directory Agent or they expire.  User Agents unicast requests to Directory Agents instead of Service Agents if any Directory Agents are known.

 +-------+ --Unicast SrvRqst--> +-----------+ <--Unicast SrvReg-- +--------+
 | User  |                      | Directory |                     |Service |
 | Agent |                      |   Agent   |                     | Agent  |
 +-------+ <--Unicast SrvRply-- +-----------+ --Unicast SrvAck--> +--------+

User and Service Agents discover Directory Agents two ways.  First, they issue a multicast Service Request for the'Directory Agent' service when they start up.  Second, the Directory Agent sends an  unsolicited advertisement infrequently, which the User and Service Agents listen for.  In either case the Agents receive a DA Advertisement (DAAdvert).

+---------------+ -----Multicast SrvRqst ----> +-----------+
|    User or    | <----Unicast DAAdvert------  | Directory |
| Service Agent |                              |   Agent   |
+---------------+ <----Multicast DAAdvert----  +-----------+

This is how the peer discovery take place by SRVLOC. Same phenomenon is used in Base Diameter Protocol for Peer Discovery.

2)DNS Service Protocol
It is the way of finding the services on the network by using standard DNS programming interface. DNS provides various API's for the purpose of service discovery.The DNS Service Discovery API helps you to perform three main tasks:
-->Registering a service (DNSServiceRegister)
-->Browsing for services (DNSServiceBrowse)
-->Resolving service names to host names (DNSServiceResolve)
In support of these main tasks, this API can directly assist you in performing two subsidiary tasks:
-->Enumerating domains (finding recommended service domains)      (DNSServiceEnumerateDomains)
-->Updating registrations(changing your DNS registration data dynamically)

Similar type of  builtin  API's will be used by Base Diameter Protocol implicitly for peer discovery.

4 comments:

  1. Thanks for the information. But can you please also explain with an example in both the methods how the peer discovery is taking place. That would provide much clarity.

    Thank you,

    ReplyDelete
  2. Thanks for explaining the types of methods involved in peer discovery, I could understand service message is being broadcasted and particular service provider is being responded/acknowledged . It will be helpful if I could get some more info with any example how it is served in the actual n/w ? and also when the table is being populated if the particular hop goes down which provides a specific service will removed from the peer table ? , is it some thing similar to the ARP table maintained .

    ReplyDelete
  3. please share the traces of peer discovery so that i could understand in better and efficient manner..

    thankx in advance

    ReplyDelete
  4. Hi,

    What is NAPTR and how is it helpful in Dynamic peer discovery in Diameter? Could you explain it with example, please?

    Thanks in Advance

    ReplyDelete