[Xorp-hackers] XRL IPC questions

Dave Roberts dave@vyatta.com
Thu, 09 Mar 2006 13:26:48 -0800


I have been looking at the XRL mechanism lately and had some questions 
about how it works. I have read both the XRL documentation on the XORP 
site as well as looked at the code, but a bit of confirmation from those 
who know the code in detail would be of assistance. Pointers to docs 
(RTFM) or particular code files that should be investigated also 
appreciated.

1. I'm a bit unclear in how processes interact with the finder to invoke 
XRLs. From what I have read, I think this is the process, but any 
comments or corrections would be much appreciated. The following assumes 
the STCP XRL transport. Let's also assume the XRLs used in the "XORP 
Inter-Process Communication Library Overview" document on the XORP site.
    a. First, a client process makes a TCP connection to 127.0.0.1 (does 
it actually connect to "localhost", going through DNS resolution on 
that, or just to the address directly) on port 19999 (Finder's well 
known port?).
    b. Client sends a request packet to the Finder. The packet containss 
the XRL. Say the XRL is 
"finder://fea/fti/0.1/add_route?net:ipv4net=10.0.0.1/8&gateway:ipv4=192.150.187.1".
    c. The Finder does the resolution and returns a response packet to 
the client over the connection. The response packet contains the same 
sequence number as in the request.
    d. The response data is itself another complete encoded XRL, this 
time resolved. Per the documentation, this would be something like: 
"stcp://192.150.1.5:1992/fti/0.1/add_route?net:ipv4net=10.0.0.1&gateway:ipv4=192.150.1.1".
    e. The client parses this XRL and extracts the addressing information.
    f. The client opens a TCP connection (because of the "stcp" scheme 
in the XRL) to 192.150.1.5 (won't this typically be 127.0.0.1?), port 1992.
    g. The client sends a request packet to the server (in this case the 
FEA process). The request contains the encoded, resolved XRL.
    f. The server sends back a response packet. This packet again has 
matched sequence numbers to the request.
    g. I'm not sure what the response contains? In this case, it would 
seem that no response data is really required, though I haven't looked 
at the add_route API to know for sure. If data is required, is it 
returned in some sort of XRL form, or just as raw XRL atoms?

2. How does a process register with the Finder? I know that it probably 
opens a connection to the Finder and sends it one or more XRLs that 
define the address and port on which it is listening, but I'm not sure 
what those are. Are those XRLs sent on a special connection to the 
finder, or just over the same one on which resolution happens? Do XRLs 
invoked on the Finder itself go through the two-hop resolution process?

3. How many outstanding XRL requests are allowed by a process at one 
time? The IPC library seems to have some limits, but it isn't clear what 
happens when those are exceeded.

4. The IPC Lib Overview document at one point says: "In addition to 
handle XRL registrations and resolutions, the Finder is capable of 
notifying XRL Targets about events it is aware of, like the birth and 
death of other XRL Targets. The Finder exposes an XRL interface for this 
purpose and is able to invoke XRLs on XRL Targets to perform the 
notiļ¬cation. A special tunneling mechanism exists in the communication 
protocol used to communicate with the Finder for this purpose. The 
details of this communication will be expanded upon later on [XXX in a 
later edit to this document]."

Are there any more documents for this? Can somebody give an overview of 
how this works?

Thanks,

-- Dave