Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: RE: multiple servers on the same (loopback) interface
From: "Hu, Yong" <yhu@bnl.gov>
To: "'Jameson Graef Rollins'" <jrollins@ligo.caltech.edu>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Wed, 10 Jul 2013 14:01:09 +0000
Hi Jamie,

In fact, "ports can be specified in the CA_ADDR_LIST list" is DOCUMENTED: http://www.aps.anl.gov/epics/base/R3-14/8-docs/CAref.html

...

All Channel Access (CA) configuration occurs through EPICS environment variables. When searching for an EPICS environment variable EPICS first looks in the environment using the ANSI C getenv() call. If no matching variable exists then the default specified in the EPICS build system configuration files is used.

Name				Range					Default
EPICS_CA_ADDR_LIST	{N.N.N.N N.N.N.N:P ...}		<none>

...

If a client needs to communicate with two servers that are residing at different port numbers then an extended syntax may be used with the EPICS_CA_ADDR_LIST environment variable. Each host name or IP address in the EPICS_CA_ADDR_LIST may be immediately followed by a colon and an IP port number without intervening whitespace. Entries that do not specify a port number will default to EPICS_CA_SERVER_PORT.

C shell	setenv EPICS_CA_ADDR_LIST "1.2.3.255 8.9.10.255:10000"

...


N.N.N.N:P is the IP_address:port_number

Yong

-----Original Message-----
From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Jameson Graef Rollins
Sent: Tuesday, July 09, 2013 9:07 PM
To: tech-talk@aps.anl.gov
Subject: Re: multiple servers on the same (loopback) interface

On Tue, Jul 09 2013, Jameson Graef Rollins <jrollins@ligo.caltech.edu> wrote:
> Hey, folks.  I'm trying to run multiple IOCs on the same host and 
> network interface and I'm looking for tips to help get it working 
> cleanly.  I'm aware of some of the issues of servers sharing the same 
> interface [0].  However, I assume there must be a way to support this 
> situation, since I imagine it must be common.  But I'm having a lot of 
> trouble getting it to work.

Someone offline has pointed me to an undocumented solution that seems to work fine, and I wanted to share it here for others that may be interested.

Apparently addresses specified in EPICS_CA_ADDR_LIST can include colon-separated port specifiers, i.e. N.N.N.N:PORT.  This means one can instantiate the servers on different ports:

EPICS_CAS_INTF_ADDR_LIST=localhost EPICS_CAS_SERVER_PORT=58900 ./test/testioc.py TEST0:
EPICS_CAS_INTF_ADDR_LIST=localhost EPICS_CAS_SERVER_PORT=58901 ./test/testioc.py TEST1:

and specify both to the client:

0$ EPICS_CA_ADDR_LIST='localhost:58900 localhost:58901' caget -t TEST0:FOO
0
0$ EPICS_CA_ADDR_LIST='localhost:58900 localhost:58901' caget -t TEST1:FOO
0
0$ 

The client therefore doesn't need to know which channels are at which port.  This also works for localhost, so dummy network interfaces aren't required.  This is a nice simple solution to the problem.
Unfortunately, it appears that this behavior (that ports can be specified in the CA_ADDR_LIST list) is undocumented.  At least I can't find reference to it in any of the CA documentation that I've found so far.  If anyone sees a problem with this method please let me know.

Thanks so much for everyone's suggestions.

jamie.


Replies:
RE: multiple servers on the same (loopback) interface Jameson Graef Rollins
References:
multiple servers on the same (loopback) interface Jameson Graef Rollins
Re: multiple servers on the same (loopback) interface Jameson Graef Rollins

Navigate by Date:
Prev: Re: Another strange CA observation Benjamin Franksen
Next: RE: multiple servers on the same (loopback) interface Jameson Graef Rollins
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: multiple servers on the same (loopback) interface Jameson Graef Rollins
Next: RE: multiple servers on the same (loopback) interface Jameson Graef Rollins
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·