Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: (PR#6707) Announce server on LAN
Home

[Freeciv-Dev] Re: (PR#6707) Announce server on LAN

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: andrearo@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6707) Announce server on LAN
From: "Todd Goodman" <tsg@xxxxxxxxxxxxx>
Date: Wed, 5 Nov 2003 11:05:19 -0800
Reply-to: rt@xxxxxxxxxxxxxx

* Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx> [031105 12:17]:
> On Wed, Nov 05, 2003 at 06:02:02AM -0800, Todd Goodman wrote:
> > * Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx> [031105 07:04]:
> > > On Mon, Nov 03, 2003 at 11:05:37AM -0800, Todd Goodman wrote:
> > > > * Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx> [031103 11:30]:
> > > > > In addition the URL states:
> > > > > 
> > > > >    In any case, range 224.0.0.0 through 224.0.0.255 is reserved for
> > > > >    local purposes (as administrative and maintenance tasks) and
> > > > >    datagrams destined to them are never forwarded by multicast
> > > > >    routers.
> > > > > 
> > > > > So if we choose 224.0.0.1 we know that all hosts are on this group AND
> > > > > we know that the TTL is irrelevant since the packets are routed.
> > > > > 
> > > > > The only problem I see is that the server is behind a router. So how
> > > > > do you define LAN?
> > > > > 
> > > > > If all this is correct I'm favoring as the default a scan in 224.0.0.1
> > > > > with no special TTL and (optionally if you want to code it) "an export
> > > > > mode" where you can input a special multicast group and optionally a
> > > > > TTL.
> > > > 
> > > > But why would you send all hosts on the local network Freeciv specific
> > > > packets?
> > > 
> > > Because it is multicast.
> > 
> > But it isn't broadcast.
> > 
> > The whole point of multicast is to send to a subset of addresses on the
> > Ethernet without resorting to broadcasting.
> > 
> > The all hosts address is mainly so that routers can send packets that all
> > hosts would like to receive (supposedly all hosts would want to receive
> > an indication that they can send traffic off the local network via that
> > router.)
> 
> I want to minimize the requirements for freeciv. This means that it is
> bad that a user have to run a special program before he can play
> freeciv or that the user has to install extra software or (the worst)
> have to recompile his kernel/OS.

I agree.  You don't have to do that.

To use multicast, the OS has to support it.  I'd think you'd want an
autoconf check to ensure it's supported.

If not supported (like on Windows) then disable the multicast check or
do something else.

If supported, make the SIOCADDMULTI ioctl() call to add whatever
multicast group we want to use that isn't the all-hosts (224.0.0.1)
group.

Then set the TTL to the configured value (default and usually 1.)

> 
> Also portabiltiy is important. Searching for SIOCADDMULTI and "win32"
> or "winsock" didn't reveal
> anything. 
> http://msdn.microsoft.com/library/en-us/winsock/winsock/wsaioctl_2.asp
> mentions SIO_RCVALL_MCAST and adds:
> 
>    Setting this ioctl requires Administrator privilege on the local
>    computer. SIO_RCVALL_MCAST is available only in Windows 2000 and
>    later versions of Windows.
> 
> It doesn't looks to me like there is an easy way to add this feature
> for win32 systems.

Well, it looks like you can do that on 2000 and later and you're gonna
receive every multicast frame on the LAN.

It's not real surprising that Windows doesn't support IETF standards...

> 
> The current patch doesn't add new requirements and may just not work
> if your OS don't support multicast or your switch drop these packets
> or any other problem happens. While I would prefer a solution where
> you can at compile or runtime detect that there is multicast enable
> the patch is ok.

Except for sending to every host on the LAN and abusing multicasting.

Note that if you have multiple interfaces you really need to do an
IP_MULTICAST_IF setsockopt() first to ensure it goes out the interface
you want...

You'd do an IP_MULTICAST_TTL setsockopt() to set the TTL for use with
multicast sends.

> 
> Speaking of which: if I ping 224.0.0.1 I should get a reply from
> myself?! Yes/no? If yes we can use this to test if the software
> supports multicast at all.

If your IP stack loops back 224.0.0.1 in software then you will.  If
not, you really can't rely on receiving what you send with Ethernet...

I don't think it's a reliable test.

I'd think a better test would be for SIOCADDMULTI and the like...

> 
> > > > That seems like a good way to get administrators mad at Freeciv and any
> > > > users running it.
> > > 
> > > Not from 1 byte packets.
> > 
> > You know different administrators than I do.  :-)
> 
> You mean that the administrators really succeeded in killing all p2p
> traffic? Here they had to use bandwidth limits.

Administrators that sniff packets going between "special" hosts like
mail servers, other servers, etc.

Not to mention the problems that would occur if a host complains to its
syslog if it received something unknown on the all-hosts multicast
address (I don't know of anything that does, but it's been known to
happen...)

Todd


> 
>       Raimar
> 
> -- 
>  email: rf13@xxxxxxxxxxxxxxxxx
>  "Python is executable pseudocode. Perl is executable line noise"
>     -- Bruce Eckel



[Prev in Thread] Current Thread [Next in Thread]