Discussion:
MPLS patches
(too old to reply)
Mihai Chelaru
2008-01-03 15:53:54 UTC
Permalink
Hi,

I've uploaded at ftp://ftp.netbsd.org/pub/NetBSD/misc/kefren/mpls/
patches for -current (of about one week ago) I use in order to get MPLS
working(kernel and LDP daemon). I'd like to commit that sooner better
than later :)

Opinions ?
--
TIA,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christos Zoulas
2008-01-03 16:21:25 UTC
Permalink
Post by Mihai Chelaru
Hi,
I've uploaded at ftp://ftp.netbsd.org/pub/NetBSD/misc/kefren/mpls/
patches for -current (of about one week ago) I use in order to get MPLS
working(kernel and LDP daemon). I'd like to commit that sooner better
than later :)
Opinions ?
Looks fine.

- some ints should be size_t's [clen for example]
- KNF:
void foo(void)
should be:
void
foo(void)
- You should not add MBUFTRACE to GENERIC
- a define<space> should be define<tab>
- Is there a way to avoid all the #ifdefs or abstract them better?
- Missing kernel RCSID's and /* $NetBSD$ */ header lines.
- #ifdef TAGS for protecting header files, don't follow convention.
- __attribute__((foo)) -> __attribute__((__foo__))
- casts to void* in the first argument of memset are not needed.
- some lines wrap > 80 chars.
- the third argument of memcpy() should be sizeof(arg1) not sizeof(type1).
- the copyright/license in ldpd files is BSD but formatted strangely. I'd
replace it with the standard formatting.
- ldpd should use syslog to print errors, and not homegrown error routine
that prints to stdout or perror.

I did not look at ldpd in detail, but I can after you fix the above...

Thanks for doing all this great work!

christos


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-10 08:12:14 UTC
Permalink
Post by Christos Zoulas
- some ints should be size_t's [clen for example]
void foo(void)
void
foo(void)
- You should not add MBUFTRACE to GENERIC
- a define<space> should be define<tab>
- Is there a way to avoid all the #ifdefs or abstract them better?
- Missing kernel RCSID's and /* $NetBSD$ */ header lines.
- #ifdef TAGS for protecting header files, don't follow convention.
- __attribute__((foo)) -> __attribute__((__foo__))
- casts to void* in the first argument of memset are not needed.
- some lines wrap > 80 chars.
- the third argument of memcpy() should be sizeof(arg1) not sizeof(type1).
- the copyright/license in ldpd files is BSD but formatted strangely. I'd
replace it with the standard formatting.
- ldpd should use syslog to print errors, and not homegrown error routine
that prints to stdout or perror.
I did not look at ldpd in detail, but I can after you fix the above...
I fixed most of them.
--
Thanks,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-01-03 16:47:41 UTC
Permalink
Post by Mihai Chelaru
Hi,
I've uploaded at ftp://ftp.netbsd.org/pub/NetBSD/misc/kefren/mpls/
patches for -current (of about one week ago) I use in order to get MPLS
working(kernel and LDP daemon). I'd like to commit that sooner better
than later :)
I will take a look at the code later today, but I already have a
question: how do I set up a MPLS network to test and see if MPLS in
NetBSD works? :-) Is there a manual anywhere?

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-03 17:59:00 UTC
Permalink
Why is there MPLS code in ip_output.c? I don't think that it belongs.
IP input/output routines are complicated enough as it is. ISTM, MPLS
should look to IP like any other link-layer.
Hi,

Well, I need to check if the destination family is AF_MPLS and prepend
shim in this case. Am I missing something ?
Is it strictly necessary to wrap the #includes in an #ifdef like this?
+#ifdef MPLS
+#include <netmpls/mpls.h>
+#include <netmpls/mpls_var.h>
+#endif /* MPLS */
I don't know. Is the #include part only that is disturbing ? I've seen
the same syntax is used for {FAST_}IPSEC case.
Also, in ip_output.c, is this really right?
- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * Copyright (C) 1995 - 2001 AYAME Project, WIDE Project.
No, there is a whole licensing mess that I will fix before anything else.
It is not very desirable for MPLS to disable fast-forwarding. Why is
it necessary?
-#if defined(IPSEC)
- /* ipflow (IP fast forwarding) is not compatible with IPsec. */
+#if defined(IPSEC) || defined(MPLS)
+ /* ipflow (IP fast forwarding) is not compatible with IPsec nor MPLS. */
m->m_flags &= ~M_CANFASTFWD;
#else
I wanted output to be done via ip_output() for the above reasons.
Dave
--
Thanks,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-01-03 17:40:13 UTC
Permalink
Post by Mihai Chelaru
Hi,
I've uploaded at ftp://ftp.netbsd.org/pub/NetBSD/misc/kefren/mpls/
patches for -current (of about one week ago) I use in order to get MPLS
working(kernel and LDP daemon). I'd like to commit that sooner better
than later :)
Why is there MPLS code in ip_output.c? I don't think that it belongs.
IP input/output routines are complicated enough as it is. ISTM, MPLS
should look to IP like any other link-layer.

Is it strictly necessary to wrap the #includes in an #ifdef like this?

+#ifdef MPLS
+#include <netmpls/mpls.h>
+#include <netmpls/mpls_var.h>
+#endif /* MPLS */

Also, in ip_output.c, is this really right?

- * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * Copyright (C) 1995 - 2001 AYAME Project, WIDE Project.

It is not very desirable for MPLS to disable fast-forwarding. Why is
it necessary?

-#if defined(IPSEC)
- /* ipflow (IP fast forwarding) is not compatible with IPsec. */
+#if defined(IPSEC) || defined(MPLS)
+ /* ipflow (IP fast forwarding) is not compatible with IPsec nor MPLS. */
m->m_flags &= ~M_CANFASTFWD;
#else

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Joerg Sonnenberger
2008-01-03 16:59:31 UTC
Permalink
Post by Mihai Chelaru
Opinions ?
In ether_input, you disable the check for maximum frame size, why?

In ip_output, you are destroying the indentation. I don't like the chunk
for 480/493 (in_broadcast). Have you tested that the checksumming is
done correctly?

I wonder if some of the code above is cleaner if MPLS_IS_TAGGED is
always defined and just returns false for the !MPLS case.

Joerg

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Joerg Sonnenberger
2008-01-03 18:12:28 UTC
Permalink
Post by Joerg Sonnenberger
In ether_input, you disable the check for maximum frame size, why?
Hi,
Over ethernet, MPLS uses a 4 size header prepended between data and network
layer. I wanted to be sure that ether_input() won't drop these baby giant
frames.
You could also change the check macro to correctly deal with this.
Post by Joerg Sonnenberger
Have you tested that the checksumming is
done correctly?
Yes, mostly, I haven't seen much problems (except HW cksumming I've fixed
sometime ago).
If possible make it work without the additional hard-wired case for
disabling HW cksumming.

Joerg

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-03 18:32:25 UTC
Permalink
Post by Joerg Sonnenberger
If possible make it work without the additional hard-wired case for
disabling HW cksumming.
Will a NIC compute cksum for a packet that isn't IP from ethertype of
view ? I admit I'm clueless regarding HW checksumming chapter.
--
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Manuel Bouyer
2008-01-03 18:51:11 UTC
Permalink
Post by Mihai Chelaru
Post by Joerg Sonnenberger
If possible make it work without the additional hard-wired case for
disabling HW cksumming.
Will a NIC compute cksum for a packet that isn't IP from ethertype of
view ? I admit I'm clueless regarding HW checksumming chapter.
Probably not. But note that some deal properly with vlan header prepended,
so they migh in theory deal with the MPLS header too.
--
Manuel Bouyer <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-03 18:10:17 UTC
Permalink
Post by Joerg Sonnenberger
Post by Mihai Chelaru
Opinions ?
In ether_input, you disable the check for maximum frame size, why?
Hi,

Over ethernet, MPLS uses a 4 size header prepended between data and
network layer. I wanted to be sure that ether_input() won't drop these
baby giant frames.
Post by Joerg Sonnenberger
In ip_output, you are destroying the indentation. I don't like the chunk
for 480/493 (in_broadcast).
Indentation check is on TODO list for all the code.
Post by Joerg Sonnenberger
Have you tested that the checksumming is
done correctly?
Yes, mostly, I haven't seen much problems (except HW cksumming I've
fixed sometime ago).
Post by Joerg Sonnenberger
I wonder if some of the code above is cleaner if MPLS_IS_TAGGED is
always defined and just returns false for the !MPLS case.
I don't know. Why should it ? Code is #ifdef MPLS'ed everywhere currently.
Post by Joerg Sonnenberger
Joerg
--
Thanks,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Darren Reed
2008-01-09 12:37:05 UTC
Permalink
Post by Mihai Chelaru
Post by Joerg Sonnenberger
If possible make it work without the additional hard-wired case for
disabling HW cksumming.
Will a NIC compute cksum for a packet that isn't IP from ethertype of
view ? I admit I'm clueless regarding HW checksumming chapter.
It depends on the card.

For some, hardware checksum is programmed by start/end offsets into
the packet.

Darren


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-03 17:32:40 UTC
Permalink
Great work!!
If you wrote your code based the AYAME MPLS stack , would you please
add the credit about it?
I know the ayame is very old code and now 90% of the patch are your
work, but I (and other ayame-project members) feel happy if you
mention about our work.
I am very disappointed that I totally erased the AYAME copyright from
several files by mistake sometime when I imported from one host to
another. I'll add it back this evening and re-upload the patches, sorry
again about discomfort.

I want to make it clear again for everyone that this patch is based on
great work done by AYAME team.
--
Thanks for understanding,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-03 20:32:43 UTC
Permalink
I can already run ospfd on NetBSD without using MPLS or ldpd.
What advantages does MPLS have over what I can do today?
In NetBSD now ? Probably none. Maybe yes, only if you have an already
MPLS enabled network and want to take some load from your routers (this
is also doubtable). Also maybe if you want to control the exit point of
packets with a certain destination from MPLS domain in case your NetBSD
is edge LSR.
I believe that MPLS may be useful for a pet project, but I do not know
if I could justify adding MPLS to the kernel.
First of all I don't think the overhead is that much. Also there will be
no MPLS code in your kernel unless you want too. I don't plan to enable
it in GENERIC, INSTALL etc. I think the patch has options MPLS in
GENERIC but this will be fixed.
How do you think it is justified?
I think it's justified for future developments in this area that I want
to happen in NetBSD. I'm pretty interested to continue the work in this
area.
or just setup them manually.
How do I do that? Can you give some examples?
Currently, ldpd is set to listen on a PF_ROUTE socket for intersting
routes and first of all, advertise to its neighbours about prefixes
added/removed and second of all if it's necessary changes that route to
point to an MPLS neighbour. So, in order to answer your question, adding
normal IPv4 routes should be enough. This is not very smart for the
moment but I hope to integrate ldpd with openbgpd sooner or later and
get rid of this behaviour.
--
Thanks,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-03 18:12:42 UTC
Permalink
Post by David Young
I will take a look at the code later today, but I already have a
question: how do I set up a MPLS network to test and see if MPLS in
NetBSD works? :-) Is there a manual anywhere?
Not much to set up. Just compile a kernel with options MPLS, start ldpd
and use a routing protocol to distribute routes (I use ospfd in quagga)
or just setup them manually.
--
Thanks,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-03 20:38:31 UTC
Permalink
Well, there are lots of who wonder about the applicability of MPLS
anywhere...
Has the MPLS implementation been tested for interoperability with Cisco
or Juniper routers?
I've tested it with Cisco only. Sorry, had no Jups available for testing.
Does ospfd speak and use LDP with this code?
No, we would have to import/write an OSPF daemon in our repository first
and I don't think this will happen too soon.
What about BGP/MPLS VPNs?
I hope to get those working helped by openbgpd. No work has been done
towards this yet. Just kernel and ldp. Also I have to implement VRF
support in NetBSD but that's another sad story :/
(I'm not attacking -- these are things that are
necessary when using MPLS in network cores.)
Correct.
--
Thanks,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Steven M. Bellovin
2008-01-03 20:12:16 UTC
Permalink
On Thu, 3 Jan 2008 13:49:35 -0600
Post by Mihai Chelaru
Post by David Young
I will take a look at the code later today, but I already have a
question: how do I set up a MPLS network to test and see if MPLS in
NetBSD works? :-) Is there a manual anywhere?
Not much to set up. Just compile a kernel with options MPLS, start
ldpd and use a routing protocol to distribute routes (I use ospfd
in quagga)
I can already run ospfd on NetBSD without using MPLS or ldpd.
What advantages does MPLS have over what I can do today?
Well, there are lots of who wonder about the applicability of MPLS
anywhere...

Has the MPLS implementation been tested for interoperability with Cisco
or Juniper routers? Does ospfd speak and use LDP with this code? What
about BGP/MPLS VPNs? (I'm not attacking -- these are things that are
necessary when using MPLS in network cores.)


--Steve Bellovin, http://www.cs.columbia.edu/~smb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-01-03 19:49:35 UTC
Permalink
Post by Mihai Chelaru
Post by David Young
I will take a look at the code later today, but I already have a
question: how do I set up a MPLS network to test and see if MPLS in
NetBSD works? :-) Is there a manual anywhere?
Not much to set up. Just compile a kernel with options MPLS, start ldpd
and use a routing protocol to distribute routes (I use ospfd in quagga)
I can already run ospfd on NetBSD without using MPLS or ldpd.
What advantages does MPLS have over what I can do today?

I believe that MPLS may be useful for a pet project, but I do not know
if I could justify adding MPLS to the kernel. How do you think it
is justified?
Post by Mihai Chelaru
or just setup them manually.
How do I do that? Can you give some examples?

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Steven M. Bellovin
2008-01-03 23:28:17 UTC
Permalink
On Thu, 03 Jan 2008 22:38:31 +0200
Post by Mihai Chelaru
Well, there are lots of who wonder about the applicability of MPLS
anywhere...
Has the MPLS implementation been tested for interoperability with Cisco
or Juniper routers?
I've tested it with Cisco only.
That itself is an important step. If that works, I suspect the code is
very much worth having as an optional component to NetBSD, though the
other items I mentioned are necessary for production use.



--Steve Bellovin, http://www.cs.columbia.edu/~smb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Alaric Snell-Pym
2008-01-22 22:23:39 UTC
Permalink
Post by Steven M. Bellovin
On Thu, 03 Jan 2008 22:38:31 +0200
Post by Mihai Chelaru
Well, there are lots of who wonder about the applicability of MPLS
anywhere...
Has the MPLS implementation been tested for interoperability with Cisco
or Juniper routers?
I've tested it with Cisco only.
That itself is an important step. If that works, I suspect the code is
very much worth having as an optional component to NetBSD, though the
other items I mentioned are necessary for production use.
I have a couple of Cisco routers sitting idle here, and am on the
verge of having a machine I can run NetBSD on to test them against...

In particular, it's a Xen box, with virtual interfaces glued to the
external one via a bridge(4). When I get a moment, maybe this week,
I'm going to clone my old 4.0RC2 domU and upgrade it to -current,
then I'll merge in Mihai's patches and have a play!

ABS

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/?author=4



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Alaric Snell-Pym
2008-01-23 12:33:00 UTC
Permalink
Post by Alaric Snell-Pym
In particular, it's a Xen box, with virtual interfaces glued to the
external one via a bridge(4). When I get a moment, maybe this week,
I'm going to clone my old 4.0RC2 domU and upgrade it to -current,
then I'll merge in Mihai's patches and have a play!
In particular, my plan is to set up the following.

alpha and beta are Cisco 2611 routers. netbsd is my netbsd box. <=>
is an MPLS link. <-> is a normal IP link.

Physical topology:

my Apple laptop <-> alpha <=> netbsd <=> beta <-> outside IPv4 route

1) Seeing how well my laptop can talk to the Internet
2) Seeing how well my laptop can talk to services running on the
netbsd box
3) Seeing how well the netbsd box can talk to the Internet

I only have one physical interface on the netbsd box, so I'll either
set up VLANs (I have a switch that can demutiplex them to the two
routers) or just run two subnets on the same LAN.

...anything else I should check?

ABS

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/?author=4



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Henning Brauer
2008-01-03 22:47:33 UTC
Permalink
Post by Mihai Chelaru
What about BGP/MPLS VPNs?
I hope to get those working helped by openbgpd. No work has been done
towards this yet. Just kernel and ldp. Also I have to implement VRF support
in NetBSD but that's another sad story :/
we'd be interested in such changes.
people have asked for teh ability to distribute bgp/mpls stuff with
openbgpd before, even without kernel support. nobody has stepped up
toactually write code, I personally have not enough interest and no
usage case either. nontheless, if there's interest I'm certainly open
for diffs and willing to help.
--
Henning Brauer, ***@bsws.de, ***@openbsd.org
BS Web Services, http://bsws.de
Full-Service ISP - Secure Hosting, Mail and DNS Services
Dedicated Servers, Rootservers, Application Hosting - Hamburg & Amsterdam

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-01-04 09:44:41 UTC
Permalink
Post by Mihai Chelaru
Hi,
I've uploaded at ftp://ftp.netbsd.org/pub/NetBSD/misc/kefren/mpls/
patches for -current (of about one week ago) I use in order to get MPLS
working(kernel and LDP daemon). I'd like to commit that sooner better
than later :)
I have a couple more comments.

MPLS decap/encap appears to be intricately entwined with ether_output,
ip_output, ip_input, et cetera. That doesn't seem right. Instead, I
think that there should be a pseudo-interface, mpls0, whose input/output
routines do decap/encap, respectively. This de-clutters the IPv4/IPv6
stacks and the ethernet code, and it provides a location for tapping
packets with tcpdump before encapsulation and after decapsulation.

There are several fragments of code like this,

if (m->m_len < sizeof (struct ip) &&
(m = m_pullup(m, sizeof(struct ip))) == NULL)
return ENOBUFS;

that should be written like this,

if (M_UNWRITABLE(m, sizeof(struct ip)) &&
(m = m_pullup(m, sizeof(struct ip))) == NULL)
return ENOBUFS;

instead.

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-04 11:42:19 UTC
Permalink
Post by David Young
MPLS decap/encap appears to be intricately entwined with ether_output,
ip_output, ip_input, et cetera. That doesn't seem right. Instead, I
think that there should be a pseudo-interface, mpls0, whose input/output
routines do decap/encap, respectively. This de-clutters the IPv4/IPv6
stacks and the ethernet code, and it provides a location for tapping
packets with tcpdump before encapsulation and after decapsulation.
Hi,

I had an idea at one moment to create an pseudo-interface for every
neighbor and route packets through those pseudo-interfaces. Also one
single interface was a pre-option. But I don't think this will be very
intuitive and I didn't see any vendor reporting something similar to
this so I assume no one does it.

Also this raises another problem: I could do this if NetBSD would have a
clear difference between control and forwarding but this is not the case
and I don't want to change the ifa/p for a route without a very strong
reason.

Btw, tcpdump decapsulates the MPLS frames and reports the inner IP
packets generating an output like this:

13:32:20.880484 MPLS (label 20, exp 0, [S], ttl 64)
IP (tos 0x0, ttl 64, id 17838, offset 0, flags [none], proto
UDP (17), length 71) 193.28.151.120.50013 > 193.28.151.5.53: [udp sum
ok] 29453+ PTR? 2.116.208.68.in-addr.arpa. (43)

Are you interested in catching IP packets before shim push/pop for some
other reasons ?
Post by David Young
There are several fragments of code like this,
if (m->m_len < sizeof (struct ip) &&
(m = m_pullup(m, sizeof(struct ip))) == NULL)
return ENOBUFS;
that should be written like this,
if (M_UNWRITABLE(m, sizeof(struct ip)) &&
(m = m_pullup(m, sizeof(struct ip))) == NULL)
return ENOBUFS;
instead.
I'm not sure about that. True, I should check M_READONLY but in a
mandatory way where I actually want to write data into that mbuf. But
should I check if it's readonly for cases like the m_push_inet{6}()
where I prepend and modify only the prepended data ?
Post by David Young
Dave
--
Thanks,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-01-04 21:49:20 UTC
Permalink
Post by Mihai Chelaru
Post by David Young
MPLS decap/encap appears to be intricately entwined with ether_output,
ip_output, ip_input, et cetera. That doesn't seem right. Instead, I
think that there should be a pseudo-interface, mpls0, whose input/output
routines do decap/encap, respectively. This de-clutters the IPv4/IPv6
stacks and the ethernet code, and it provides a location for tapping
packets with tcpdump before encapsulation and after decapsulation.
Hi,
I had an idea at one moment to create an pseudo-interface for every
neighbor and route packets through those pseudo-interfaces. Also one
single interface was a pre-option. But I don't think this will be very
intuitive and I didn't see any vendor reporting something similar to
this so I assume no one does it.
Last night, I scanned the web for MPLS configuration
examples, and all that I found was Cisco IOS, which was not
very compelling, and a discussion on an OpenSolaris forum
which, albeit vague, did mention an MPLS pseudo-interface,
<https://www.opensolaris.org/jive/thread.jspa?messageID=33315>.

I don't think that the word "intuitive" really applies to MPLS,
and it is a vague word that deserves to be defined in any discussion,
<http://www.asktog.com/papers/raskinintuit.html>. I think that it will
be helpful if MPLS uses familiar abstractions in familiar ways; using a
pseudo-interface to add/subtract encapsulation is familiar to users of
VLANs and tunnels.
Post by Mihai Chelaru
Also this raises another problem: I could do this if NetBSD would have a
clear difference between control and forwarding but this is not the case
and I don't want to change the ifa/p for a route without a very strong
reason.
You seem to have a precise meaning in mind, but what you have written
is vague. Can you elaborate on this lack of control/forwarding separation
as it applies to ifa/ifp and MPLS?
Post by Mihai Chelaru
Btw, tcpdump decapsulates the MPLS frames and reports the inner IP
13:32:20.880484 MPLS (label 20, exp 0, [S], ttl 64)
IP (tos 0x0, ttl 64, id 17838, offset 0, flags [none], proto
UDP (17), length 71) 193.28.151.120.50013 > 193.28.151.5.53: [udp sum
ok] 29453+ PTR? 2.116.208.68.in-addr.arpa. (43)
Are you interested in catching IP packets before shim push/pop for some
other reasons ?
Yes, I am. I also believe it makes the system a lot more transparent
and comprehensible to use a pseudo-interface. We have the opportunity to
apply a packet filter or to tap packets. Tapping packets is an essential
aid for troubleshooting.

(IMO, a deficiency of IPSec in NetBSD is that it does not use
pseudo-interfaces, even when it does tunnel-like things like IPSEC_NAT_T.)
Post by Mihai Chelaru
Post by David Young
There are several fragments of code like this,
if (m->m_len < sizeof (struct ip) &&
(m = m_pullup(m, sizeof(struct ip))) == NULL)
return ENOBUFS;
that should be written like this,
if (M_UNWRITABLE(m, sizeof(struct ip)) &&
(m = m_pullup(m, sizeof(struct ip))) == NULL)
return ENOBUFS;
instead.
I'm not sure about that. True, I should check M_READONLY but in a
mandatory way where I actually want to write data into that mbuf. But
should I check if it's readonly for cases like the m_push_inet{6}()
where I prepend and modify only the prepended data ?
No, you don't need to use it if you will only read the data. I suggest
extracting a const pointer to the data with mtod, then.

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Mihai Chelaru
2008-01-07 12:20:21 UTC
Permalink
Post by David Young
Last night, I scanned the web for MPLS configuration
examples, and all that I found was Cisco IOS, which was not
very compelling, and a discussion on an OpenSolaris forum
which, albeit vague, did mention an MPLS pseudo-interface,
<https://www.opensolaris.org/jive/thread.jspa?messageID=33315>.
I don't think this project got anywhere near design finishing. I did
also read the rest of the threads in that category.
Post by David Young
I don't think that the word "intuitive" really applies to MPLS,
and it is a vague word that deserves to be defined in any discussion,
<http://www.asktog.com/papers/raskinintuit.html>. I think that it will
be helpful if MPLS uses familiar abstractions in familiar ways; using a
pseudo-interface to add/subtract encapsulation is familiar to users of
VLANs and tunnels.
Hehe, nice lecture, still I don't think that Picard(or was it Data ?) or
a lady that didn't know how to handle the mouse is an appropiate example
in this case. Anyhow, I'll try to explain below in detail why using
encap/decap interface(s) is not something I'd like.
Post by David Young
Post by Mihai Chelaru
Also this raises another problem: I could do this if NetBSD would have a
clear difference between control and forwarding but this is not the case
and I don't want to change the ifa/p for a route without a very strong
reason.
You seem to have a precise meaning in mind, but what you have written
is vague. Can you elaborate on this lack of control/forwarding separation
as it applies to ifa/ifp and MPLS?
Because you want to use an interface [X] that will be seen from control
plane, I quickly see some problems:

- No control coming from interface regarding encapsulation (think about
cell-mode)
- if one set a route to point to an interface:next-hop pair, he expects
that to be honored. This will not be the case with these interfaces
(route interface will be changed to mplsX)
- double lookup on non-MPLS encapsulation: in order to have a reason
for MPLS PI to exist we need to route-lookup once for INET in order to
deliver that packet to MPLS PI, and once in MPLS PI code in order to
know how and where should I deliver the frame from MPLS point of view.
- I'll end up keeping a mirror of all routing tables where I should
keep the PROTO->MPLS associations (remember, we need to separate PROTO
from MPLS in PROTO routing table in order to keep reason for MPLS
pseudo-interface existence, where PROTO may be INET or something else).
So, mpls_interface will get a packet, together with it's adress family
and relookup in that address family mirror table to see how it should be
encapsulated.
- double lookup for MPLS encapsulated packets that we receive.
- shim-pop-pushed instead of MPLS swapping. Fast label swapping is
considered one of the MPLS advantages. Also RFC3031 explicitly calls the
forwarding mechanism "Label Swapping"
- loss of forwarding speed
- it will not simplify the code in ether_output() because we still need
to handle AF_MPLS frames there


[X] - How many pseudo-interfaces do you want anyway ? These are the
options as they come to my mind right now:
- only one used for both decap and encap. decap if packet is not
tagged, encap else. Still this is no good solution if you want to tap
because you'll see here both in and out. Also you'll really have no idea
where that packet comes from and where it goes and you'll have packets
coming from mpls0 and going out to mpls0.
- one pseudo-interface per non-pseudo-interface. This seems more
appropiate as we may know where that packet comes and where it goes.
Also, I think I can live with information passed via tags between
pseudo-interfaces and real-interfaces. But this case raises another
question: if we do it for MPLS why don't we do it for every ethernet
protocol ? Since when an interface should be used only for carrying IP
only frames ?
- one decap interface and one pseudo-interface per neighbour
- one pseudo-interface per non-pseudo-interface and one PI per neighbour

Personally I don't like the latter two, because I don't want to pollute
interface space with one iface per neighbour. Think how it will be to
create an interface per OSPF neighbour for example. Also, their
management will be almost impossible and I don't think that ldp daemon
should mix with this interface management(including but not restricted
to creating/destroying). For all the cases, someone that worked with
MPLS on Cisco or Junipers for example, will not feel "familiar" with
these pseudo-interfaces.
Post by David Young
Yes, I am. I also believe it makes the system a lot more transparent
and comprehensible to use a pseudo-interface. We have the opportunity to
apply a packet filter or to tap packets. Tapping packets is an essential
aid for troubleshooting.
(IMO, a deficiency of IPSec in NetBSD is that it does not use
pseudo-interfaces, even when it does tunnel-like things like IPSEC_NAT_T.)
Note that MPLS is not encrypting packets and tcpdump prints the inner
packets for common cases, so payload tapping is still possible.

But there is another problem: you asked for this pseduo-interface(s)
because you expect to tap packets on it(them). But you can't really know
what you will tap because MPLS shim doesn't contain information
regarding the inner protocol. Tcpdump may only guess here after a
protocol analysis but there are a lot of non-IP[6] things that can live
inside an MPLS frame.
Post by David Young
No, you don't need to use it if you will only read the data. I suggest
extracting a const pointer to the data with mtod, then
I'll constify where is the case.
--
Thanks,
Mihai

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2008-01-16 07:49:09 UTC
Permalink
Post by Mihai Chelaru
Why is there MPLS code in ip_output.c? I don't think that it belongs.
IP input/output routines are complicated enough as it is. ISTM, MPLS
should look to IP like any other link-layer.
Well, I need to check if the destination family is AF_MPLS and prepend
shim in this case. Am I missing something ?
It is not very desirable for MPLS to disable fast-forwarding. Why is
it necessary?
-#if defined(IPSEC)
- /* ipflow (IP fast forwarding) is not compatible with IPsec. */
+#if defined(IPSEC) || defined(MPLS)
+ /* ipflow (IP fast forwarding) is not compatible with IPsec nor MPLS. */
m->m_flags &= ~M_CANFASTFWD;
#else
I wanted output to be done via ip_output() for the above reasons.
I am pretty sure that if you use an MPLS pseudo-interface to push/pop
MPLS labels, then you can take advantage of IPv4/IPv6 fast-forwarding
in the same kernel where you use MPLS, and you can avoid modifying the
IP stack at all.

I am working on a more detailed proposal for changes.

Dave
--
David Young OJC Technologies
***@ojctech.com Urbana, IL * (217) 278-3933 ext 24

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...