Skip to content
This repository

MPLS enabled version of Linux kernel. Based on original work of James Leu (http://sourceforge.net/projects/mpls-linux/) but almost completely rewritten!

branch: mpls-rc
Octocat-spinner-32 Documentation Merge tag 'mfd-fixes-3.9-1' of git://git.kernel.org/pub/scm/linux/ker… March 15, 2013
Octocat-spinner-32 arch perf,x86: fix wrmsr_on_cpu() warning on suspend/resume March 17, 2013
Octocat-spinner-32 block Merge branch 'for-3.9/core' of git://git.kernel.dk/linux-block February 28, 2013
Octocat-spinner-32 crypto Merge tag 'lzo-update-signature-20130226' of git://github.com/markus-… February 28, 2013
Octocat-spinner-32 drivers Merge tag 'char-misc-3.9-rc2' of git://git.kernel.org/pub/scm/linux/k… March 15, 2013
Octocat-spinner-32 firmware firmware: remove last vestiges of dabusb November 21, 2012
Octocat-spinner-32 fs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel… March 17, 2013
Octocat-spinner-32 include net: ipv6: Enable creation of IPv6 MPLS routes May 24, 2013
Octocat-spinner-32 init final removal of CONFIG_EXPERIMENTAL March 12, 2013
Octocat-spinner-32 ipc ipc: don't allocate a copy larger than max March 08, 2013
Octocat-spinner-32 kernel kernel: Define MPLS sysctl interface March 20, 2013
Octocat-spinner-32 lib lib: Introduced NLA_PROHIBIT flag March 20, 2013
Octocat-spinner-32 mm mm/fremap.c: fix possible oops on error path March 14, 2013
Octocat-spinner-32 net net: ipv6: Enable creation of IPv6 MPLS routes May 24, 2013
Octocat-spinner-32 samples Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/li… February 19, 2013
Octocat-spinner-32 scripts Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/gi… March 15, 2013
Octocat-spinner-32 security Fix: compat_rw_copy_check_uvector() misuse in aio, readv, writev, and… March 12, 2013
Octocat-spinner-32 sound ALSA: hda - Fix missing EAPD/GPIO setup for Cirrus codecs March 15, 2013
Octocat-spinner-32 tools Merge tag 'usb-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/… March 13, 2013
Octocat-spinner-32 usr gen_init_cpio: remove redundant empty line November 19, 2012
Octocat-spinner-32 virt hlist: drop the node parameter from iterators February 27, 2013
Octocat-spinner-32 .gitignore .gitignore: remove stale entry for generated version.h December 17, 2012
Octocat-spinner-32 .mailmap Viresh has moved June 20, 2012
Octocat-spinner-32 COPYING [PATCH] update FSF address in COPYING September 10, 2005
Octocat-spinner-32 CREDITS Randy has moved March 08, 2013
Octocat-spinner-32 Kbuild kbuild: Fix missing system calls check on mips. November 09, 2011
Octocat-spinner-32 Kconfig kbuild: migrate all arch to the kconfig mainmenu upgrade September 19, 2010
Octocat-spinner-32 MAINTAINERS Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/ker… March 15, 2013
Octocat-spinner-32 Makefile Linux 3.9-rc3 March 17, 2013
Octocat-spinner-32 README MPLS specific README file May 24, 2013
Octocat-spinner-32 README.linux MPLS specific README file May 24, 2013
Octocat-spinner-32 REPORTING-BUGS REPORTING-BUGS: add get_maintainer.pl blurb August 18, 2009
README
---
MPLS BASICS:

Multi Protocol Label Switching (MPLS) represents a simple technology, which is
today indispensable in network cores. MPLS protocol adds a 32-bit header
(Figure 1) between the second and the third network layer headers. 
Within these 32 bits, 20 bits are reserved for the label, 3 bits for
the Traffic Class (TC) field, 1 bit for the Bottom of Stack (S) field
and the remaining 8 bits are reserved for the Time to Live (TTL) field.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Label
|                Label                  | Exp |S|       TTL     | Stack
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Entry

                    Label:  Label Value, 20 bits
                    Exp:    Experimental Use, 3 bits
                    S:      Bottom of Stack, 1 bit
                    TTL:    Time to Live, 8 bits

                              Figure 1

A traffic class carried by means of a MPLS packet is defined based on the TC field.
Definition of an S field enables assigning of several labels to the packets. In the
label grouping, only the lowest label, closest to the IP packet, has S bit set to 1.
All other labels in the label stack have S set to 0. TTL field is used just like a
TTL field of the IP packet.

---
BUILDING: 

MPLS can be built as a kernel module, or it can be built in a kernel.

To build MPLS first you need to run:

$ make menuconfig

and enable MPLS compiling from:

Network setup -> Networking options -> MPLS (Experimental)

If you're running Debian based system, nice HOW-TO on compiling and installing custom kernel
can be found here:

https://help.ubuntu.com/community/Kernel/Compile

---
RUNNING: 

To be able to run MPLS, you will need modified iproute2 programme which can be downloaded from:

https://github.com/i-maravic/iproute2

Creation of MPLS tunnel ingress points is done with:

# ip link add tunnel_name type mpls push 300 192.168.2.2

or with

# ip route add 1.2.3.4 mpls push 300 192.168.2.2

To get more comprehensive explanation use:

$ ip link add tunnel_name type mpls help

or

$ ip route help

In order to be able to receive MPLS packets, interface must be MPLS enabled. This is done with:

# ip link set eth0 mpls on

To be able to receve MPLS packets recursively mpls0 interface must be brought up!

To build MPLS tunnel cross connect and egress points use:

# ip -M route add 200 mpls swap 300 dev eth0 192.168.3.3

MPLS SNMP stats are located in:

/proc/net/mpls_stats

MPLS sysctl parameters are located in:

/proc/sys/net/mpls

MPLS fully supports net namespaces.

IP-MPLS multipath routes are suported

Reserved labels, except the RouterAlert label, are handled properly.

---
TODO:
1. Firewall support
2. ICMPv6 message sending, when TTL is exceeded or packet can't be forwarded because of MTU,
   from the inside of MPLS tunnel
3. MPLS multipath
3. Bridging support
Something went wrong with that request. Please try again.