[openbeosnetteam] Re: Interfaces

  • From: "Waldemar Kornewald" <wkornew@xxxxxxx>
  • To: openbeosnetteam@xxxxxxxxxxxxx
  • Date: Wed, 12 Jul 2006 14:38:50 +0200

On 7/12/06, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:

> > That reminds me: how does PPPoE come into play here? Is it just
> > another
> > interface on the ethernet device? So should ifconfig hide it under
> > the
> > ethernet device then in your opinion?
> Like Bruno said, it's an independent net_device. All PPP interfaces

That's not what Bruno said, and that's not how BONE does it. In BONE,
it's just another datalink path to the ethernet net_device. This is how
the bone.conf lines look like:
                dl protos {
                        6 IFT_ETHER {
                                0 bone_arp framings/bone_ether_frame
                                1 ppp/bone_pppoe framings/bone_ether_frame
                        }
                        ...
                }

As far as I understand, this looks similar to our PPP stack. The ethernet frame handling code looks at the ETHER_TYPE and if it's PPPoE it passes everything to the PPPoE handler. If It's IPv4 it's passed to the IPv4 handler, and so on.

There is no ppp net_device loaded when I use PPPoE. Even though there
exists such a device, I have no idea when it comes into play.

Well, that's strange because above the device layer PPP is the same protocol. If the PPP module is not loaded then the PPPoE module must contain a copy of the complete PPP stack...

> are named "ppp0", "ppp1", and so on, no matter if you're using a
> modem
> or a PPPoE device. When loaded, the PPPoE module simply registers a
> handler with the ethernet module. BTW, the way I'm currently doing it
> is not thread-safe (the PPPoE<->ethernet device registration, I
> mean).

Well, in the new stack, it can't be done in a not thread-safe manner,
anyway.

It was just me being lazy. I should've fixed this a long time ago, but I still have a few code cleanups to do. Just, I don't know when...

> Now that you mention it, the current ethernet module only shows an
> ethernet device as "up" when some protocol is active (IPv4, for
> example). The problem is that PPPoE will only work when the interface
> is "up", so you have to configure your interface to some unused
> address like 192.168.0.1 even if it's only connected to a DSL modem
> (and thus can't even use IPv4).
> This is very annoying because unconfigured interfaces just won't work
> with PPPoE and the user won't be informed of the exact error.

Huh? Whatever you did before, this problem won't exist anymore, AFAICT.
You will just create an interface in the AF_INET domain for PPPoE that
will use the ethernet net_device, the protocol chain stays active as
long as there is an interface configured.

I'm not sure you understood my concern. Did you ever try RASPPPOE on Windows? It requires the NIC to have an IP address. This is a similar problem. When I try to send a packet through an unconfigured interface the ethernet module just rejects the packet. The problem is that I can't mark PPPoE as an active protocol independently of IPv4. I can only bring the whole device up/down. Our new netstack should make this more independent.

I think I've mentioned this many times: For PPP and other on-demand
connection types we need an easy method for adding "unspecified"
routes, so when there is no route for some packet we can activate an
unspecified route (i.e.: connect the on-demand interface) and then
send the packet. Currently, the only way to do this seems to be to
create a fake IP address and then convert all IP packets to the real
IP after having connected...IOW: I can't connect *before* the device
is instructed to send a packet.

And why did you specifically talk about AF_INET? That depends on the
protocol modules that are used for the PPP interface. I think I've
overmodularized the PPP stack...is there any point in having it
modular, at all?
BTW, you once wanted PPP to create a net_device for every interface
even if it's not connected (instead of creating them on-demand). Is
this what you plan for the new netstack? The way you talk about PPPoE
gives me this impression. Well, the advantage could be that you don't
need a special pppconfig command because ifconfig could issue the
up/down actions.

How will protocols register themselves with the net_device? One party
(protocol or, preferrably, the device) has to know the link-layer type
IDs for the respective protocol (IPv4, IPv6, PPPoE). For example,
ethernet has different packet type IDs than PPP and other devices.
Will protocol IDs be hard-coded in the device or will it be possible
to add new handlers by supplying the device's protocol type ID?

Bye,
Waldemar Kornewald

Other related posts: