Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jul 2011 10:28:50 +0400
From:      Eygene Ryabinkin <rea@freebsd.org>
To:        Daniel Braniss <danny@cs.huji.ac.il>
Cc:        freebsd-net@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: broadcast oddity
Message-ID:  <jqVj%2B6q2ZvXWBaNJI89PeFrlHGM@%2BH3ezQp0vJIrviWzhz8TlqRT2d0>
In-Reply-To: <E1QjTAs-000IjW-Ba@kabab.cs.huji.ac.il>
References:  <E1QioQt-000MJQ-T9@kabab.cs.huji.ac.il> <20110718203215.GM54929@MacBook-Eygene-Ryabinkin.local> <E1Qj4uZ-0005nH-SR@kabab.cs.huji.ac.il> <20110719172455.GP54929@MacBook-Eygene-Ryabinkin.local> <E1QjTAs-000IjW-Ba@kabab.cs.huji.ac.il>

next in thread | previous in thread | raw e-mail | index | archive | help

--tsOsTdHNUZQcU9Ye
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Wed, Jul 20, 2011 at 12:34:38PM +0300, Daniel Braniss wrote:
> from the diskless:
> els-01# ifconfig
> vr0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 15=
00
>         options=3D8280b<RXCSUM,TXCSUM,VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKST=
ATE>
>         ether 00:0d:b9:22:57:18
>         inet 132.65.91.1 netmask 0xfffff000 broadcast 132.65.95.255
>         media: Ethernet autoselect (100baseTX <full-duplex>)
>         status: active
> lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>         options=3D3<RXCSUM,TXCSUM>
>         inet 127.0.0.1 netmask 0xff000000=20
> els-01# netstat -rn
> Routing tables
>=20
> Internet:
> Destination        Gateway            Flags    Refs      Use  Netif Expire
> default            132.65.80.1        UG          0    16606    vr0
> 127.0.0.1          link#4             UH          0       36    lo0
> 132.65.80.0/20     link#1             U           0    86612    vr0
> 132.65.91.1        link#1             UHS         0       12    lo0
>=20
> from the non-diskless:
> wrap-1# ifconfig
> sis0: flags=3D8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric=
 0 mtu=20
> 1500
>         options=3D83808<VLAN_MTU,WOL_UCAST,WOL_MCAST,WOL_MAGIC,LINKSTATE>
>         ether 00:0d:b9:00:72:a8
>         inet 132.65.80.181 netmask 0xfffff000 broadcast 132.65.95.255
>         media: Ethernet autoselect (100baseTX <full-duplex>)
>         status: active
> sis1: flags=3D8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>         options=3D83808<VLAN_MTU,WOL_UCAST,WOL_MCAST,WOL_MAGIC,LINKSTATE>
>         ether 00:0d:b9:00:72:a9
>         media: Ethernet autoselect (none)
>         status: no carrier
> lo0: flags=3D8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>         options=3D3<RXCSUM,TXCSUM>
>         inet 127.0.0.1 netmask 0xff000000=20
>=20
> wrap-1# netstat -rn
> Routing tables
>=20
> Internet:
> Destination        Gateway            Flags    Refs      Use  Netif Expire
> default            132.65.80.1        UGS         0    16936   sis0
> 127.0.0.1          link#4             UH          0       76    lo0
> 132.65.80.0/20     link#1             U           0    67433   sis0
> 132.65.80.181      link#1             UHS         0        0    lo0

The only difference I see is the absence of the 'S' flag on the default
route for the diskless case.  Will try to create the testbed.

> > Yes, it is.  But ip_output.c has the following code,
> > {{{
> >                 if (rte->rt_flags & RTF_GATEWAY)
> >                         dst =3D3D (struct sockaddr_in *)rte->rt_gateway;
> >                 if (rte->rt_flags & RTF_HOST)
> >                         isbroadcast =3D3D (rte->rt_flags & RTF_BROADCAS=
T);
> >                 else
> >                         isbroadcast =3D3D in_broadcast(dst->sin_addr, i=
fp);
> > }}}
> >=20
> > So, if the route that is selected is the gateway, then there will be
> > no broadcast on the L2.  At least in my understanding of the code.
> > Thus, I am interested in the routing tables and route flags.
>=20
> so it boils down to a problem in selecting the route?

More-or-less so: for default gateways there will never be any
L2-broadcasts, for host routes the L2-broadcasts are governed by the
'B' route flag and for other routes the destination address governs
the behaviour (INADDR_ANY & INADDR_BROADCAST as the destination will
enable L2-broadcast unconditionally /but most likely we will hit the
default route earlier for this case/, interface broadcast address
/132.65.95.255 in your case/ will enable L2-brodcast via the
corresponding interface).
--=20
Eygene Ryabinkin                                        ,,,^..^,,,
[ Life's unfair - but root password helps!           | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]

--tsOsTdHNUZQcU9Ye
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iF4EAREIAAYFAk4pGKIACgkQFq+eroFS7Pu6QAD+JAIkX+Rv5wNg4mFn3+nh9ost
FXzLZwEAjbdAiLqWAn0A/iyXAYHFpLK5DE5RfQCrSxcFojKaOkotKazyrncZpvU+
=b8c0
-----END PGP SIGNATURE-----

--tsOsTdHNUZQcU9Ye--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?jqVj%2B6q2ZvXWBaNJI89PeFrlHGM>