Merge lp://qastaging/~epics-core/epics-base/rsrvbindiface into lp://qastaging/~epics-core/epics-base/3.15
- rsrvbindiface
- Merge into 3.15
Status: | Merged |
---|---|
Merged at revision: | 12728 |
Proposed branch: | lp://qastaging/~epics-core/epics-base/rsrvbindiface |
Merge into: | lp://qastaging/~epics-core/epics-base/3.15 |
Diff against target: |
2686 lines (+1058/-707) 34 files modified
documentation/RELEASE_NOTES.html (+29/-0) src/ca/client/CAref.html (+13/-20) src/ca/client/addrList.h (+1/-1) src/ca/client/iocinf.cpp (+6/-5) src/ca/client/udpiiu.cpp (+13/-0) src/ca/legacy/pcas/generic/caServerI.cc (+33/-0) src/ca/legacy/pcas/generic/caServerI.h (+2/-0) src/ca/legacy/pcas/io/bsdSocket/caServerIO.cc (+17/-0) src/ca/legacy/pcas/io/bsdSocket/caServerIO.h (+2/-0) src/ca/legacy/pcas/io/bsdSocket/casDGIntfIO.cc (+18/-59) src/ioc/db/dbChannel.c (+21/-15) src/ioc/rsrv/camessage.c (+8/-31) src/ioc/rsrv/caserverio.c (+1/-1) src/ioc/rsrv/caservertask.c (+726/-234) src/ioc/rsrv/cast_server.c (+76/-97) src/ioc/rsrv/online_notify.c (+15/-197) src/ioc/rsrv/server.h (+22/-9) src/libCom/bucketLib/bucketLib.c (+2/-2) src/libCom/env/envDefs.h (+2/-0) src/libCom/env/envSubr.c (+14/-1) src/libCom/osi/os/Darwin/osdSock.h (+1/-0) src/libCom/osi/os/Linux/osdSock.h (+1/-0) src/libCom/osi/os/RTEMS/osdSock.h (+1/-0) src/libCom/osi/os/WIN32/osdSock.h (+2/-1) src/libCom/osi/os/cygwin32/osdSock.h (+1/-0) src/libCom/osi/os/default/osdNetIntf.c (+23/-30) src/libCom/osi/os/freebsd/osdSock.h (+1/-0) src/libCom/osi/os/iOS/osdSock.h (+1/-0) src/libCom/osi/os/solaris/osdSock.h (+1/-0) src/libCom/osi/os/vxWorks/osdSock.h (+1/-0) src/std/filters/arr.c (+1/-1) src/std/filters/dbnd.c (+1/-1) src/std/filters/sync.c (+1/-1) src/std/filters/ts.c (+1/-1) |
To merge this branch: | bzr merge lp://qastaging/~epics-core/epics-base/rsrvbindiface |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ralph Lange | Needs Fixing | ||
Andrew Johnson | Approve | ||
EPICS Core Developers | Pending | ||
mdavidsaver | Pending | ||
Review via email: mp+282249@code.qastaging.launchpad.net |
This proposal supersedes a proposal from 2015-12-21.
Commit message
Description of the change
Updates to RSRV, mainly to allow binding to a specific network interfaces via. EPICS_CAS_
Along the way support for name lookup via IPv4 multicasting is added, but not enabled by default. Use by adding an mcast address to EPICS_CA_ADDR_LIST.
One potentially troublesome change is to allow osiSockDiscover
mdavidsaver (mdavidsaver) wrote : Posted in a previous version of this proposal | # |
mdavidsaver (mdavidsaver) wrote : | # |
Rebased against 3.15
Andrew Johnson (anj) wrote : | # |
When building for VxWorks 5.5.2 (which we still support):
../udpiiu.cpp: In method `udpiiu:
../udpiiu.cpp:169: passing `int *' as argument 4 of `setsockopt(int, int, int, char *, int)'
The fix is to cast &flag to (char *) [I tried (void *), but the C++ rules don't allow that].
Later, same target-arch:
../../.
../../.
../../.
../../.
../../.
../../.
../../.
../../.
../../.
On line 135 change bind() arg #2 to be (struct sockaddr *) &addr->sa (cast is needed to drop const).
Line 201 is not standard C code, a declaration appears after other statements in block; swapped with preceding line.
Line 579 needs another cast to (char *).
The result builds on all my standard architectures.
Question: Is 'rsrv_grap_tcp' a typo for 'rsrv_grab_tcp'?
Could your point about there being a broadcast route through lo conceivably apply to other OSs too? If so I would prefer that we use some other conditional in the libCom/
More to come, I'll try to do some testing this afternoon.
mdavidsaver (mdavidsaver) wrote : | # |
On 01/20/2016 02:10 PM, Andrew Johnson wrote:
> Question: Is 'rsrv_grap_tcp' a typo for 'rsrv_grab_tcp'?
I'm going to go with, yes.
mdavidsaver (mdavidsaver) wrote : | # |
On 01/20/2016 02:10 PM, Andrew Johnson wrote:
> Could your point about there being a broadcast route through lo conceivably apply to other OSs too?
I suspect so as it seems like a reasonable thing to do. However, I
couldn't find any reference, and am not in a position to test any other
targets except RTEMS (where it isn't useful).
> ... I would define some macro in osi/os/
Seems reasonable.
Andrew Johnson (anj) wrote : | # |
I'm not quite sure what this means, but on my Windows & Cygwin box:
ECLIPSE$ route PRINT -4 127*
=======
Interface List
12...ac 16 2d 0d 54 de ......Intel(R) 82579LM Gigabit Network Connection
1....
13...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
11...00 00 00 00 00 00 00 e0 Microsoft 6to4 Adapter
=======
IPv4 Route Table
=======
Active Routes:
Network Destination Netmask Gateway Interface Metric
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
=======
Persistent Routes:
None
It's likely that Cygwin would see those same routes, and it uses the osi/os/default implementation (how would I test that?). We might want to add similar code to the osi/WIN32/
Andrew Johnson (anj) wrote : | # |
Seems to be working for me on VxWorks 6.9, I can connect to PVs, and outgoing CA client connections still work OK too (although I didn't test setting CA_ADDR_LIST).
Also works with a second network interface configured at 10.0.0.2 (but not actually connected to anything):
iocanj> casr 2
Channel Access Server V4.13
No clients connected.
Server interface 0.0.0.0:5064
UDP receiver 1 0.0.0.0:5064
Beacon destination 10.0.0.255:5065
Beacon destination 164.54.11.255:5065
There are currently 1288 bytes on the server's free list
7 client(s), 0 channel(s), 0 event(s) (monitors) 0 putNotify(s)
0 small buffers (16384 bytes ea), and 0 jumbo buffers (16408 bytes ea)
The server's resource id conversion table:
Bucket entries in use = 0 bytes in use = 16404
Bucket entries/hash id - mean = 0.000000 std dev = 0.000000 max = 0
The server's array size limit is 16408 bytes max
Channel Access Address List
10.0.0.255:5065
164.54.11.255:5065
value = 19 = 0x13
The "Server interface 0.0.0.0:5064" and "UDP receiver 1 0.0.0.0:5064" lines are slightly confusing in the above status message, although I guess they do make sense. At least the casr command now shows the dynamically allocated TCP port number (which used to only show up at iocInit, making it hard to look up later on).
when running on an IOC without DNS properly configured the two entries in the CA Address list at the bottom take a minute or two each to print while waiting for the DNS search to time out; in my experience network administrators don't add names for their broadcast IP addresses to DNS, so why are we querying DNS before printing just the numbers in that list? I guess there might be host IPs in there too, but in this case I would be happy with just printing the numbers even for them. You probably haven't touched this part of the code though...
Pointing EPICS_CAS_
When I pointed EPICS_CAS_
Starting iocInit
#######
## EPICS R3.15.3-DEV $$Date: Sun 2015-11-22 18:10:40 +0100 $$
## EPICS Base built Jan 20 2016
#######
Warning: RSRV has empty beacon address list
CAS: Socket bind 164.54.11.255:5064 error was "S_errno_EINVAL"
Thread tShell0 (0x6f6c70) can't proceed, suspending.
Users are going to try putting broadcast addresses in EPICS_CAS_
How might I go about testing the multi-cast support?
This branch at least needs an entry in the Release Notes explaining what's new and how to configure the new features. I'm not sure if there's a suitable place in the AppDevGuide for more detail or not, although I think we...
Ralph Lange (ralph-lange) wrote : | # |
So this branch was overtaking my rebase on GitHub... need to rearrange.
I pushed the fix for the issue with compiling on MinGW to the 3.15 branch (http://
Do we need more detailed test instructions?
Remember that we wanted to trigger a serious testing campaign for this, so we should have some kind of rough test plan that we want people to run.
mdavidsaver (mdavidsaver) wrote : | # |
> Do we need more detailed test instructions?
We do, so I'll write something up.
- 12737. By Andrew Johnson
-
Fix build for vxWorks 5.5.2
Andrew Johnson (anj) wrote : | # |
Committed fixes for building on VxWorks 5.5.2.
- 12738. By mdavidsaver
-
minor
fix typo
expand error message
skip redundant (and misleading) print of beacon address list - 12739. By mdavidsaver
-
rsrv: fixup beacon address list handling
should be based on client interface list,
not server. - 12740. By mdavidsaver
-
rsrv: loopback mcast beacons
- 12741. By mdavidsaver
-
don't use EPICS_CA_ADDR_LIST for server interface list
keep existing behavior, and server binds wildcard
when only client address list is specified. - 12742. By mdavidsaver
-
update release notes
- 12743. By mdavidsaver
-
pcas: listen for mcast search request
mdavidsaver (mdavidsaver) wrote : | # |
Fixed incorrect broadcast address list construction. Made the "no addresses" error message longer. Added release notes. Teach PCAS to listen for mcast search requests as well.
mdavidsaver (mdavidsaver) wrote : | # |
> ... the two entries in the CA Address list ...
This isn't actually the CA address list, but rather the beacon address list printed a second time. The first uses ipAddrToDottedIP(), and the second is now removed.
FYI the only place I've found the actual CA address list (for the dbCa context) is buried in "dbcar '' 8".
mdavidsaver (mdavidsaver) wrote : | # |
> ... How might I go about testing the multi-cast support? ...
Set:
EPICS_CAS_
mdavidsaver (mdavidsaver) wrote : | # |
Since this branch allows 127.255.255.255 to be discovered and included in the default address list (for Linux), some configurations will result in more spurious duplicate PV warnings when IOC and client are on the same system. I go back and forth about whether this is acceptable or not. Thoughts?
- 12744. By Andrew Johnson
-
Fix build for vxWorks 5.5.2 (again)
Andrew Johnson (anj) wrote : | # |
You broke the generation of beacon anomalies at IOC startup somehow.
There is a tool build as part of src/ca called casw which monitors for and displays beacon anomalies, using exactly the same code that the clients use. When I start a regular 3.14 softIoc with casw running I get the expected anomalies displayed, but when starting a softIoc from this branch it shows nothing.
The IOC is sending out beacons at the usual exponentially-
localhost:5064 2016-01-21 12:56:35.851115672
tux.aps.
localhost:5064 2016-01-21 12:56:35.871209057
tux.aps.
localhost:5064 2016-01-21 12:56:35.911352969
tux.aps.
localhost:5064 2016-01-21 12:56:35.991482300
tux.aps.
localhost:5064 2016-01-21 12:56:36.151682412
tux.aps.
localhost:5064 2016-01-21 12:56:36.471809095
tux.aps.
localhost:5064 2016-01-21 12:56:37.111908997
tux.aps.
localhost:5064 2016-01-21 12:56:38.392053916
tux.aps.
localhost:5064 2016-01-21 12:56:40.952238006
tux.aps.
localhost:5064 2016-01-21 12:56:46.072448531
tux.aps.
I tried starting the IOC with EPICS_CAS_
- 12745. By mdavidsaver
-
rsrv: beaconCounter not updated
mdavidsaver (mdavidsaver) wrote : | # |
> You broke the generation of beacon anomalies at IOC startup somehow.
Good catch, and now fixed. I had checked that beacons were sent, but didn't look at the contents. The counter wasn't being copied into the packet buffer, so it was always sending a count of 0.
Another (intentional) change is that beacons are sent with the "address" field set to zero, so carepeater will fill it in based on the source address. With the switch to an unconnected socket this gives the correct result (verified with casw and wireshark).
Andrew Johnson (anj) wrote : | # |
Beacons fixed, thanks.
Trying multicast name resolution:
tux$ EPICS_CAS_
Starting iocInit
#######
## EPICS R3.15.3-DEV $$Date: Sun 2015-11-22 18:10:40 +0100 $$
## EPICS Base built Jan 21 2016
#######
CAS address list can not contain 0.0.0.0 and other addresses, ignoring...
iocRun: All initialization complete
epics>
I get the same output from 'casr 2' without the warning message by omitting the 0.0.0.0 interface address, so I'll assume including it was just a mistake in your instructions above.
Searches from the same subnet succeed with EPICS_CA_
If I configure the IOC to only use the localhost interface, why does it still send beacons through my primary interface?
tux$ EPICS_CAS_
Starting iocInit
#######
## EPICS R3.15.3-DEV $$Date: Sun 2015-11-22 18:10:40 +0100 $$
## EPICS Base built Jan 21 2016
#######
iocRun: All initialization complete
epics> casr 2
Channel Access Server V4.13
No clients connected.
Server interface 127.0.0.1:5064
UDP receiver 1 127.0.0.1:5064
UDP receiver 2 127.255.
Beacon destination 127.255.
Beacon destination 164.54.11.255:5065
...
I had expected that explicitly setting the interface would also configure the beacons to be sent through the same interface(s), although I do realize the original code didn't work like that and it can be done manually. I'd be OK with leaving that change for later if there are objections to fixing it here though.
I also have some minor modifications to casr which I'll finish off next week.
Ralph Lange (ralph-lange) wrote : | # |
> Trying multicast name resolution:
>
> tux$ EPICS_CAS_
> EPICS_CA_
> Starting iocInit
> #######
> ## EPICS R3.15.3-DEV $$Date: Sun 2015-11-22 18:10:40 +0100 $$
> ## EPICS Base built Jan 21 2016
> #######
> CAS address list can not contain 0.0.0.0 and other addresses, ignoring...
> iocRun: All initialization complete
> epics>
>
> I get the same output from 'casr 2' without the warning message by omitting
> the 0.0.0.0 interface address, so I'll assume including it was just a mistake
> in your instructions above.
>
> Searches from the same subnet succeed with EPICS_CA_
> EPICS_CA_
Hm.
Shouldn't there be a way to specify: "bind to all available network interfaces, plus the extra multicast address".
It look s like the settings from Michael's instructions were trying to do this, but the "0.0.0.0" was rejected. (Which might be wrong.)
Do searches from the same subnet with broadcasts or directed to the IOCs IP work in this configuration?
- 12746. By mdavidsaver
-
rsrv: fix wildcard check ordering
filter out mcast addresses before wildcard uniqueness check.
mdavidsaver (mdavidsaver) wrote : | # |
Ha, I should be more careful about testing exactly the examples I give.
> EPICS_CAS_
Triggered the error.
> EPICS_CAS_
Didn't.
Now fixed so that ordering shouldn't matter.
Also, EPICS_CAS_
To actually trigger this error (now cantProceed) include the wildcard address and a specific interface address.
mdavidsaver (mdavidsaver) wrote : | # |
> Do I need to have our network admins configure something for searches to work across subnets?
I'm fairly certain that I'm doing the right thing on the socket level. But I just don't know how what additional work is needed at the router/switch level. As I think about it, this is probably a good tech-talk question.
For layer 2 devices (hubs and dumb switches) multicasts and broadcasts are quite similar. In the presence of layer 3 (routers and "smart" switches) things will be different. I'm not sure how to test this situation. Note that how this works, and what configuration is needed, may well depend on which mcast address is used.
- 12747. By mdavidsaver
-
rsrv: oops
improper rebase
- 12748. By mdavidsaver
-
rsrv: more beacon address fixups
should really be based on *server* config
as beacons should be sent to clients attempting
to connect to the server.By default send beacons to bcast addresses
from the interface address list.
mdavidsaver (mdavidsaver) wrote : | # |
More changes to beacon address list population (I think I've got it this time).
https:/
Details most tested configurations with expected results.
Andrew Johnson (anj) wrote : | # |
I have a set of changes which significantly tidy up the output from casr. Should I commit them here, or to 3.16 after this branch has been merged up?
Here's some new output:
epics> casr
Channel Access Server V4.13
2 client(s) connected.
epics> casr 1
Channel Access Server V4.13
2 client(s) connected:
CA-client at 164.54.9.24:57238 'tux.aps.anl.gov':
User 'anj', V4.13, Priority = 0, 2 Channel(s)
CA-client at 164.54.8.21:33434 'venus':
User 'anj', V4.11, Priority = 0, 1 Channel(s)
CAS-TCP server 0.0.0.0:5064
CAS-UDP name server 0.0.0.0:5064
2 CAS-beacon destinations:
127.
164.
epics> casr 2
Channel Access Server V4.13
2 client(s) connected:
CA-client at 164.54.9.24:57238 'tux.aps.anl.gov':
User 'anj', V4.13, Priority = 0, 2 Channel(s)
Channel: 'anj:exit'
Channel: 'anj:exit.
CA-client at 164.54.8.21:33434 'venus':
User 'anj', V4.11, Priority = 0, 1 Channel(s)
Channel: 'anj:exit.A'
CAS-TCP server 0.0.0.0:5064
CAS-UDP name server 0.0.0.0:5064
2 CAS-beacon destinations:
127.
164.
epics> casr 3
Channel Access Server V4.13
2 client(s) connected:
CA-client at 164.54.9.24:57238 'tux.aps.anl.gov':
User 'anj', V4.13, Priority = 0, 2 Channel(s)
Channel: 'anj:exit'
# on eventq=1, access=rw
Channel: 'anj:exit.
2 filters (1 pre eventq, 0 post eventq)
final field_type=
# on eventq=1, access=rw
CA-client at 164.54.8.21:33434 'venus':
User 'anj', V4.11, Priority = 0, 1 Channel(s)
Channel: 'anj:exit.A'
# on eventq=1, access=rw
CAS-TCP server 0.0.0.0:5064
CAS-UDP name server 0.0.0.0:5064
2 CAS-beacon destinations:
127.
164.
epics> casr 4
Channel Access Server V4.13
2 client(s) connected:
CA-client at 164.54.9.24:57238 'tux.aps.anl.gov':
User 'anj', V4.13, Priority = 0, 2 Channel(s)
Task Id = 0x7f1e2c005680, Socket FD = 7
10.30 secs since last send, 10.30 secs since last receive
Unprocessed request bytes = 0, Undelivered response bytes = 0
State = up
Channel: 'anj:exit'
# on eventq=1, access=rw
Channel: 'anj:exit.
2 filters (1 pre eventq, 0 post eventq)
final field_type=
# on eventq=1, access=rw
CA-client at 164.54.8.21:33434 'venus':
User 'anj', V4.11, Priority = 0, 1 Channel(s)
Task Id = 0x7f1e2c005f80, Socket FD = 9
11.35 secs since last send, 11.35 secs since last receive
Unprocessed request bytes = 0, Undelivered response bytes...
Ralph Lange (ralph-lange) wrote : | # |
No strong preference.
But since the changes are probably in one source file and thus easy to separate from the functional changes, why not here.
mdavidsaver (mdavidsaver) wrote : | # |
Well I think the answer is simple and none technical. Commit it if you have time to update the wiki ;)
Andrew Johnson (anj) wrote : | # |
Ok; the changes are mostly in rsrv/caserverta
I did notice that casr() no longer prints a log_one_client() report for the UDP (i.e. name-server) clients. There used to be only one such client thread, but now the number can vary, with one or two threads for each interface. I had removed the UDP reporting code from the log_one_client() routine since it was no longer being used, but I just put it back in case we want to add these threads back into the report. I think I know how to do that if it's wanted.
How are the multicast monitors supposed to work? There isn't a separate thread started for them, the code just joins every primary UDP socket to the multicast group(s) configured. Isn't that going to cause multiple search replies from any IOC that has two interfaces say if both receive a copy of the same multicast search request? We might need a way to configure which multicast addresses get joined to which interfaces if this starts to be used much.
- 12749. By Andrew Johnson
-
Improve casr() output
Andrew Johnson (anj) wrote : | # |
I added 2 comments to the wiki page in bold red, the beacon list for Test #2 seems wrong, and Test #6 gives me different results (the interface on 0.0.0.0 is still open, so clients in the same subnet can still connect without having to use the multicast address).
I think I'm done with this now; apart from multi-cast it builds and works fine.
mdavidsaver (mdavidsaver) wrote : | # |
> How are the multicast monitors supposed to work? ... Isn't that going to cause multiple search replies from any IOC that has two interfaces say if both receive a copy of the same multicast search request?
The best I can say is probably not, at least on Linux. I haven't found any clear description, of all that is involved here, so I could be completely wrong. As I understand it, as with any ip packet, a multicast packet is always received on a specific interface, and won't be forwarded absent some specific routing rule ("ip mroute" is empty by default). So an mcast should only be delivered to sockets bound to the interface it was received on, and joined to the group.
Linux might have some additional hoops to jump. I find some references to needing to disable reverse path filtering (rp_filter), though this isn't enabled by default w/ debian 8.
Once the test-plan wiki page is deemed correct, and the code to match, we had discussed putting out a request for testing on tech-talk. I'd like to have this tested in a more realistic setting.
mdavidsaver (mdavidsaver) wrote : | # |
> the beacon list for Test #2 seems wrong
Not surprising. For some reason I'm getting confused about whether this should match the server or client interface address list. I've "fixed" this at least twice now and two parity flips means I need some outside input. Can you fix the wiki page to what you think it should be?
mdavidsaver (mdavidsaver) wrote : | # |
A given socket will only send multicast packets out a single interface (as determined by the local routing table or IP_MULTICAST_IF). So no duplication there.
There probably should be some way of configuring IP_MULTICAST_TTL though. Would you care to pick a EPICS_CA_* name for this Andrew?
mdavidsaver (mdavidsaver) wrote : | # |
> Test #6 gives me different results ...
... Due to the way my test system is configured :P You result is the correct one.
mdavidsaver (mdavidsaver) wrote : | # |
> ... We might need a way to configure which multicast addresses get joined to which interfaces if this starts to be used much.
> ... as determined by the local routing table or IP_MULTICAST_IF ...
Yes, to allow full flexibility the both client and server address lists would need to be configured with pairs of multicast+interface address. However, I'm inclined to forgo this unnecessary until someone describes a situation where this is necessary, or even helpful.
Andrew Johnson (anj) wrote : | # |
Beacons should be related to the server interfaces in use. In the past they weren't, originally because there were no EPICS_CAS_ variables, although later I think Jeff just re-used the contents of EPICS_CA_ADDR_LIST for rsrv's beacon list unless you explicitly set EPICS_CAS_
Starting a softIoc with all defaults, I get this:
tux$ bin/linux-
...
CAS-TCP server on 0.0.0.0:5064 with
CAS-UDP name server on 0.0.0.0:5064
Sending CAS-beacons to 2 addresses:
127.
164.
If I set EPICS_CAS_
tux$ EPICS_CAS_
...
CAS-TCP server on 164.54.9.24:5064 with
CAS-UDP unicast name server on 164.54.9.24:5064
CAS-UDP broadcast name server on 164.54.11.255:5064
Sending CAS-beacons to 1 address:
164.
Setting it to localhost I get this:
tux$ EPICS_CAS_
...
CAS-TCP server on 127.0.0.1:5064 with
CAS-UDP unicast name server on 127.0.0.1:5064
CAS-UDP broadcast name server on 127.255.
Sending CAS-beacons to 1 address:
127.
I can add addresses to the beacon list:
tux$ EPICS_CAS_
...
CAS-TCP server on 127.0.0.1:5064 with
CAS-UDP unicast name server on 127.0.0.1:5064
CAS-UDP broadcast name server on 127.255.
Sending CAS-beacons to 2 addresses:
127.
224.0.2.9:5065
Those all look correct to me so far, beacons are being sent to the broadcast addresses of the interfaces that my servers are listening on, plus any others I explicitly specify. However if I set EPICS_CA_
tux$ EPICS_CAS_
...
Warning: RSRV has empty beacon address list
...
CAS-TCP server on 127.0.0.1:5064 with
CAS-UDP unicast name server on 127.0.0.1:5064
CAS-UDP broadcast name server on 127.255.
Sending CAS-beacons to 0 addresses:
In this case it still seems to be copying the initial beacon list from the EPICS_CA_ADDR_LIST instead of the interface list because I can put addresses in the beacon list by adding them to EPICS_CA_ADDR_LIST, e.g:
tux$ EPICS_CAS_
bin/linux-
...
CAS-TCP server on 127.0.0.1:5064 with
CAS-UDP unicast name server on 127.0.0.1:5064
CAS-UDP broadcast name server on 127.255.
Sending CAS-beacons to 1 address:
224.0.2.9:5065
A different issue: If I put a multicast address in EPICS_CAS_
tux$ EPICS_CAS_
- 12750. By mdavidsaver
-
rsrv: decouple some client/server config
the automatic beacon address list should follow
the server interface address list, and not be
effected by any client config.Also, don't populate the interface address list
from EPICS_CAS_BEACON_ ADDR_LIST as this will
almost never contain local interface addresses.
mdavidsaver (mdavidsaver) wrote : | # |
> Beacons should be related to the server interfaces in use.
Ok, auto beacon list is no longer tied to client auto address list.
Also, the server interface list will no longer use the beacon address list as a fallback.
Andrew Johnson (anj) wrote : | # |
Thanks, I think this makes much more sense. The behavior change does need documenting though, in the Release Notes entry and probably in CAref.html as well. I can update the Wiki page to match if you like.
mdavidsaver (mdavidsaver) wrote : | # |
> The behavior change does need documenting though, in the Release Notes entry and probably in CAref.html
Which raises the question: what about PCAS?
> I can update the Wiki page to match if you like.
Please do. And you may assume in future that I would always like.
- 12751. By mdavidsaver
-
pcas: no fallbacks for beacon address list
Don't mix client and server configuration
by defaulting the server beacon list to use
the client address list. - 12752. By mdavidsaver
-
ca: update CAref.html with changes to beacon address list
Note that server beacon address list will no longer
consider client address list as a fallback. - 12753. By mdavidsaver
-
update release notes
- 12754. By mdavidsaver
-
rsrv: EPICS_CAS_
IGNORE_ ADDR_LIST - 12755. By mdavidsaver
-
libCom: fix debug print formats in osiSockDiscover
BroadcastAddres ses() - 12756. By mdavidsaver
-
rsrv: "casr 1" shows ignore list
- 12757. By mdavidsaver
-
update release notes
mdavidsaver (mdavidsaver) wrote : | # |
> Beacons should be related to the server interfaces in use.
I made the corresponding change to PCAS as well.
I also made an attempt to teach RSRV about EPICS_CAS_
Updated CAref.html and release notes.
Andrew Johnson (anj) wrote : | # |
Unfortunately I think your PCAS changes have broken something. I can run the base-3.15 excas example with no arguments and I get no errors, but if I run it from this branch I get the following errors, printed at the exponentially-
../../.
../../.
../../.
The IP address in that error message is the broadcast address of my local subnet. Connections to the excas PVs from a local client do succeed, so I think it is listening on the primary interface properly. Running casw while starting the server shows beacons coming from localhost but not from the machine's regular IP address (the opposite of running the base-3.15 version of excas).
I updated the Wiki page to remove my last red question and fix the expected casr output there, and fixed the CAS-beacon list in Test #6.
About the wiki page, I don't think we really need to set EPICS_CA_ADDR_LIST or AUTO_ADDR_LIST when starting the IOC in most of these tests, dbCa will always connect to local channels through the internal channel provider anyway, it doesn't use the network at all. Test #5 and maybe #6 could keep those settings though.
- 12758. By Andrew Johnson
-
Show UDP name server status in casr 2+ output
- 12759. By mdavidsaver
-
pcas: don't send beacons w/ connect()d socket
use sendto() and leave the origin field to 0.0.0.0
so it will be filled in by the receiving repeater
mdavidsaver (mdavidsaver) wrote : | # |
Ok, I think this is fixed as well. PCAS was sending beacons from a connect()d UDP socket as RSRV was. Now changed to use sendto() and leave the origin interface field zero'd, as RSRV now does.
Andrew Johnson (anj) wrote : | # |
CAS beacon issue fixed, will merge after Ralph's approval.
- 12760. By Ralph Lange
-
pcas: fix compilation on MSC Windows
Ralph Lange (ralph-lange) wrote : | # |
On Windows, I am not getting any of the thread's messages, type
CAS-TCP server on 10.5.1.1:5064 with
CAS-UDP unicast name server on 10.5.1.1:5064
CAS-UDP broadcast name server on 10.5.1.255:5064
Have these messages been removed again?
Ralph Lange (ralph-lange) wrote : | # |
More testing:
cygwin does show the messages.
MSVC 12.0 (both 64 and 32 bit) and MinGW32 do not.
Ralph Lange (ralph-lange) wrote : | # |
Rough test for the PCAS changes
On 64bit Linux:
The CA Gateway (trunk) compiles, the (very few) unit tests succeed.
However, beacons and reconnection behavior are not tested by these tests yet.
- 12761. By Andrew Johnson
-
Report UDP client status on Windows
Andrew Johnson (anj) wrote : | # |
Ah yes, the code for casr() does use ifdef _WIN32 and doesn't call log_one_client() from that section of code. I just committed a fix.
Ralph Lange (ralph-lange) wrote : | # |
Sorry if I wasn't clear enough.
The Windows builds show *no* thread related messages, none at all.
[...]
iocRun: All initialization complete
epics> casr 1
Channel Access Server V4.13
No clients connected.
Sending CAS-beacons to 2 addresses:
172.
192.
epics> casr 2
Channel Access Server V4.13
No clients connected.
Sending CAS-beacons to 2 addresses:
172.
192.
epics> casr 3
Channel Access Server V4.13
No clients connected.
Sending CAS-beacons to 2 addresses:
172.
192.
epics>
- 12762. By Ralph Lange
-
rsrv: populate the server list - also on Windows builds
Ralph Lange (ralph-lange) wrote : | # |
Bummer: the server list was empty (not being populated) on Windows.
I just committed a fix.
Ralph Lange (ralph-lange) wrote : | # |
I did a complete test on my windows box, report is as follows.
The cygwin target needs fixing. I'm not sure what's happening there.
Please also add tests on the behavior when another IOC is already running.
It is not covered by the test plan, but I have seen IOCs hanging or exiting.
These tests are pretty tedious. Excellent candidate for automation...
---- snip ----
Test Report rsrvbindiface on Windows 7
Test Plan https:/
Version 2016-02-16T14:44
Tested 2016-02-25T09:00 by Ralph
Version lp:~epics-core/epics-base/rsrvbindiface revision 12762
Targets MSVC 12.0 (amd64), MSVC (x86), Cygwin (x86_64), MinGW32 (x86)
Machine Latitude E7240 (intel i3) running Windows 7
Test #1 Defaults
client get pass pass pass pass
epicsParamShow pass pass pass pass
casr 1 pass pass pass pass
dbcar "" 8 pass pass pass pass
Note on Cygwin:
- warning at boot time
Warning: Duplicate EPICS CA Address list entry "169.254.
- casr and dbcar (UDP search destination) show this interface address (link-local)
in addition to the two regular interfaces
Test #2 Client address list only
client get pass pass pass pass
epicsParamShow pass pass pass pass
casr 1 pass pass pass pass
dbcar "" 8 pass pass pass pass
Note on Cygwin:
- warning at boot time
Warning: Duplicate EPICS CA Address list entry "169.254.
- casr shows this interface address in addition to the two regular interfaces
Test #3 Client and Server on a single interface
client get pass pass FAIL pass
epicsParamShow pass pass FAIL pass
casr 1 pass pass FAIL pass
dbcar "" 8 pass pass FAIL pass
Failure on Cygwin:
- error at boot time
CAS: UDP Socket bcast bind error: "Cannot assign requested address"
IOC hangs after that message
Test #4 Client and Server on multiple interfaces
client get pass pass FAIL pass
epicsParamShow pass pass FAIL pass
casr 1 pass pass FAIL pass
dbcar "" 8 pass pass FAIL pass
Failure on Cygwin:
- error at boot time
CAS: UDP Socket bcast bind error: "Cannot assign requested address"
IOC hangs ...
- 12763. By mdavidsaver
-
win32: include ws2tcpip.h from osdSock.h
Needed to get some additional definitions
including IP_ADD_MEMBERSHIP - 12764. By mdavidsaver
-
cygwin inherits winsock broadcast behavior
- 12765. By mdavidsaver
-
rsrv: use SOCKERRNO
Must use OSI SOCKERRNO for correct handling
of errors w/ winsock
mdavidsaver (mdavidsaver) wrote : | # |
> Please also add tests on the behavior when another IOC is already running.
Good point. Provisionally I think the instruction would be to repeat all tests with a second IOC running w/ default config. Just fixed an mistake here were I used 'errno' instead of 'SOCKERRNO'.
> CAS: UDP Socket bcast bind error: "Cannot assign requested address"
This is a failure to bind a UDP socket to an interface broadcast address. So it seems likely that cygwin is (unavoidably) letting the winsock behavior show through. In caservertask.c, I'vee replaced the three '!defined(_WIN32)' with '!(defined(_WIN32) || defined(
> IPv4 Multicast name lookup not supported by this target
The direct cause is that the macro IP_ADD_MEMBERSHIP is not defined in caservertask.c, which is the test I picked for OS support of multicast. I've added an include of "ws2tcpip.h" to WIN32/osdSock.h, which I think is reasonable.
mdavidsaver (mdavidsaver) wrote : | # |
> These tests are pretty tedious. Excellent candidate for automation...
Agreed, just not sure how given the requirement for superuser, and the OS differences in network configuration. How can the effect of linux tap interfaces be achieved on windows/macos? What sort of virtual NIC should be used?
Eric Norum (wenorum) wrote : | # |
Tuntap is available as an add-on for OS X — I use it with a Verilog simulator to test the ethernet-
> On Feb 25, 2016, at 8:42 AM, mdavidsaver <email address hidden> wrote:
>
> How can the effect of linux tap interfaces be achieved on windows/macos?
--
Eric Norum
<email address hidden>
Andrew Johnson (anj) wrote : | # |
I was doing manual testing here using a combination of localhost and my workstation's primary IP address (i.e. `hostname`); would using just those two be sufficient for automated testing? That would avoid the need for running as root, and I suspect might work on all OSs.
Ralph Lange (ralph-lange) wrote : | # |
Testing using a VM is fine, and interfaces are a dime a dozen on those.
Andrew Johnson (anj) wrote : | # |
Ok, but requiring that does preclude automated testing on Jenkins (the APS one at least).
mdavidsaver (mdavidsaver) wrote : | # |
> would using just those two be sufficient for automated testing?
The test process as currently written wants two interfaces which would be found with EPICS_CA_
> at would avoid the need for running as root
On reflection I was making an implicit assumption that the test code would have to change the network configuration, which isn't strictly required. Rather it could inspect, and SKIP if the host doesn't meet some requirements.
Andrew Johnson (anj) wrote : | # |
Are you working on some automated tests for this branch, or should I merge it?
mdavidsaver (mdavidsaver) wrote : | # |
I have some ideas, but haven't started writing. Go ahead and merge.
Ralph Lange (ralph-lange) wrote : | # |
I did a partial test.
- The multicast issue seems to be fixed.
- Cygwin still fails miserably
Test results as follows
---- snip ----
Test Report rsrvbindiface on Windows 7 - ONLY PARTIAL TEST
Test Plan https:/
Version 2016-02-16T14:44
Tested 2016-02-26T20:00 by Ralph
Version lp:~epics-core/epics-base/rsrvbindiface revision 12765
Targets MSVC 12.0 (amd64), MSVC (x86), Cygwin (x86_64), MinGW32 (x86)
Machine Latitude E7240 (intel i3) running Windows 7
Test #1 Defaults
starting second IOC pass pass pass pass
client get pass pass pass pass
epicsParamShow pass pass pass pass
casr 1 pass pass pass pass
dbcar "" 8 pass pass pass pass
Note on Cygwin:
- warning at boot time
Warning: Duplicate EPICS CA Address list entry "169.254.
- casr and dbcar (UDP search destination) show this interface address (link-local)
in addition to the two regular interfaces
Test #2 Client address list only
starting second IOC pass pass pass pass
client get pass pass pass pass
epicsParamShow pass pass pass pass
casr 1 pass pass pass pass
dbcar "" 8 pass pass pass pass
Note on Cygwin:
- warning at boot time
Warning: Duplicate EPICS CA Address list entry "169.254.
- casr shows this interface address in addition to the two regular interfaces
Test #3 Client and Server on a single interface
starting second IOC pass pass FAIL pass
client get pass pass FAIL pass
epicsParamShow pass pass FAIL pass
casr 1 pass pass FAIL pass
dbcar "" 8 pass pass FAIL pass
Failure on Cygwin:
- error at boot time
[cas warnings in case of second IOC]
CAS: UDP Socket bcast bind error: "Cannot assign requested address"
IOC hangs after that message
Test #4 Client and Server on multiple interfaces
starting second IOC skip skip FAIL skip
client get skip skip FAIL skip
epicsParamShow skip skip FAIL skip
casr 1 skip skip FAIL skip
dbcar "" 8 skip skip FAIL skip
Failure on Cygwin:
-...
Ralph Lange (ralph-lange) wrote : | # |
Re: Automation
I would not test this as part of a unit test, but move it into a separate job.
In that case it can be executed on a selected (group of) builder(s), which can easily be configured to be the VM kind with two interfaces.
mdavidsaver (mdavidsaver) wrote : | # |
> #if !(defined(_WIN32) || defined(
So clearly __CYGWIN32__ is not the right macro to test. Can you try some others (maybe __CYGWIN__) and/or send me the output of:
> touch empty.c
> cpp -dM empty.c
Andrew Johnson (anj) wrote : | # |
> So clearly __CYGWIN32__ is not the right macro to test.
We define our own flags for most architectures, please look for and use those instead of trying to guess what the compiler might define:
tux% cd configure/os
tux% grep OP_SYS_CPPFLAGS *
CONFIG.
CONFIG.
CONFIG.
CONFIG.
CONFIG.
CONFIG.
CONFIG.
CONFIG.
CONFIG.
CONFIG.
CONFIG.
mdavidsaver (mdavidsaver) wrote : | # |
I'm not guessing Andrew, I copied shareLib.h. Should I change this to 'CYGWIN32' as well?
mdavidsaver (mdavidsaver) wrote : | # |
There is also https:/
Andrew Johnson (anj) wrote : | # |
This might explain some strange Cygwin DLL build issues in the past.
I am changing all the Cygwin macro tests to use __CYGWIN__, and will add a comment deprecating our CYGWIN32 macro.
Ah, if I run "cpp -dM -m32 empty.c" it defines __CYGWIN32__ as well as __CYGWIN__ so they evidently removed that when they added 64-bit support. There is no __CYGWIN64__ macro.
Needs compatibility testing