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 12:28:18 -0800
Reply-to: rt@xxxxxxxxxxxxxx

* andrearo@xxxxxxxxxxxx <andrearo@xxxxxxxxxxxx> [031105 14:41]:
> On Wed, 5 Nov 2003, Todd Goodman wrote:
> > * Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx> [031105 12:02]:
> > > > Yes, the way he was doing it (SIOCADDMULTI).
> > >
> > > SIOCADDMULTI isn't mentioned in the patch. Do you suggest that we add
> > > this ioctl call to freeciv? How portable is it?
> >
> > If you're going to use multicast then it's the right way to do it.
> 
> Why?

Because I don't think it will work on a BSD and probably won't work on a
Solaris system unless you do it?

> 
> > > > > so that you don't spam the whole internet.
> > > >
> > > > You don't have to adjust your OS.  The server and clients do it
> > > > programatically.  You set TTL to 1 so you don't send anything off LAN.
> > > >
> > > > There's nothing the user needs to do (unless their OS doesn't support
> > > > multicast, in which case it doesn't matter what you do as this feature
> > > > wouldn't work...)
> > >
> > > > There's a pretty good chance that traffic to 224.0.0.1 will never make
> > > > it off the local network no matter what you set the TTL to as the router
> > > > isn't supposed to forward it regardless.
> > >
> > > And this IMHO a feature. And equivalent to setting TTL to 1. So what
> > > is the advantage of your solution?
> >
> > It's a feature, but IMNHO it's wrong to try to use multicast to send to
> > every host on the local network.
> >
> > You can set the TTL to a configurable value (default 1) and use a
> > different multicast group.
> >
> > That's the point of multicast, send it to a group of destinations that
> > want to receive it, but not to every station on the LAN.
> >
> 
> I agree with Todd here, the reason to use multicasting is so that only
> hosts which have joined the multicasting group shall get the packet.
> There's no reason to broadcast the packet to every host on the LAN.
> 
> Try this:
> andreas@linux:~> export FREECIV_MULTICAST_GROUP="237.0.0.1"
> 
> Then start the patched Freeciv, and while looking for LAN servers,
> run "netstat --groups" :
> 
> andreas@linux:~> netstat --groups
> IPv6/IPv4 Group Memberships
> Interface       RefCnt Group
> --------------- ------ ---------------------
> eth0            2      237.0.0.1
> lo              1      ipv6-allnodes
> 
> As you can see, the interface eth0 has joined the 237.0.0.1 group.
> After the client and server are done sending packets to each other, the
> interface eth0 leaves the group 237.0.0.1. This is group management is
> handled by the operating system kernel, and is invisible to the user.

I think adding the group automatically might just be a Linux thing though.

> 
> I can't imagine an OS not supporting multicasting, it's a important part
> of IPv4.

Well it's more "recent" than all the base IPv4 stuff as it was only added
in the 4.3BSD networking code.

But I agree that might not be "recent" to anyone else.

I wouldn't have been surprised if Windows didn't support it because
Winsock is an abomination when they could have used a nice
well-established interface instead.  But that's just MNHO.

Todd

> 
>  Andreas Røsdal



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