[WT-support] [?? Probable Spam] Re: Rotator program

Peter Stuge peter at stuge.se
Thu Nov 4 09:42:29 CET 2010


Bob Wilson, N6TV wrote:
> That issue is documented in the Win-Test FAQ.

Great FAQ entry!


> It's usually caused a Huwei modem driver problem, not a Win-Test or
> PstRotators problem.

What does that modem driver do? If anyone has access to such a setup,
please use netstat to find out what programs are listening on which
ports in the system when the problematic driver is active and
Win-Test (or it's friends) can not be started with the error.


Looking at the error codes:

winerror.h:#define WSAEACCES 10013L
winerror.h:#define WSAENOTSOCK 10038L

..they respectively mean that the program trying to bind to the port
does not have permission to do so (e.g. because another program has
bound to that port already) or that the program tried to tell the
winsock library to operate on a non-socket. The latter is unlikely
since the same code works in other circumstances. The former happens
if "address reuse" is not enabled by the program, or disallowed by
Windows.

Normally, only one program at a time binds to a network port (9871)
and receives incoming data. I don't know for sure how the Win-Test
family of programs wants to use networking but it seems that both
wtDxTelnet and wtRotators (maybe also Win-Test itself) should be able
to receive messages sent by the other programs.

I believe this is done using broadcast UDP (which is why the IP
address has to end with .255, that's the broadcast address) and
"address reuse" enabled in every program, so that they can all
receive the same messages. In practis it's a kind of "message bus"
with broadcasting offloaded onto the Windows networking stack.

However, it seems to me that broadcast UDP is not a great fit for IPC
since it is kind of fragile. I guess Win-Test is quite likely to stay
a Windows-only program so it might make sense to instead use named
pipes for local IPC, or maybe to implement a simple client/server
message bus using unicast UDP or even TCP. Maybe even reuse an
existing implementation. The authors could look for BSD licensed
libraries that can be used with closed source products. Well, that
may be a future improvement.


Looking further at what there is right now, specifically the registry
key mentioned in the FAQ, it is documented thus by MS:

DisableAddressSharing

Value Type: REG_DWORD

Default: 0

Description: This parameter is used to prevent address sharing
(SO_REUSEADDR) between processes so that if a process opens a socket,
no other process can steal data from it. A similar effect can be
achieved if an application uses the new socket option
SO_EXCLUSIVEADDRUSE. This setting allows administrators to secure
older applications that are not aware of this option.


Since the Win-Test programs rely on Windows to broadcast messages on
the Win-Test "message bus" they must use SO_REUSEADDR. (Otherwise
only one program could be receiving at a time; not useful.)

Especially the fact that even MS point out that using sockets this
way can be considered a security problem is a hint that this might
be a somewhat problematic approach.


Bob Wilson, N6TV wrote:
> You could try *adding* the parameter and setting it to 0, as the
> Windows 7 default may be to DisableAddressSharing if no entry is
> present.

I think you're right. It fits with the returned error code, the
spirit of MS' description of the registry value and your observations
in the August email. It's also more secure, for some value of secure.

Although it's a slightly aggressive change to the networking stack by
MS I can completely understand why they did it; it's quite unusual
for programs without malicious intent to use broadcast UDP and
address reuse like Win-Test and friends do.


> Are you trying to run both wtRotators and PstRotatorAz at the same
> time?

I don't think this can cause the winsock error. It might cause a
serial port conflict, but since all programs who want to participate
on the Win-Test "message bus" must allow address reuse, this should
be fine.


> Do you have more than one copy of PstRotatorAz or wtRotators
> running?  Check the task manager.

Same, only one instance of the two programs can access the physical
hardware on the serial port, but I think it would be fine to have as
many as you want of both programs running at the same time
network-wise.


> Did you give PstRotatorAz "full privileges" on the firewall, or
> *only*Win-Test, wtRotators and wtDxTelnet?  Try giving them
> *all* "full privileges", and make sure port 9871 is not blocked, or
> try disabling "auto-protect".

Very good advice! The Windows firewall can be quite a hassle. And the
exotic way Win-Test uses networking also makes it much easier to run
into trouble with the firewall. I would not hesitate even to disable
the firewall completely, at least for troubleshooting.


//Peter


More information about the Support mailing list