Giter VIP home page Giter VIP logo

mpls-linux's Introduction

---
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

mpls-linux's People

Contributors

acmel avatar adrianbunk avatar alanstern avatar arndb avatar avikivity avatar axellin avatar broonie avatar bzolnier avatar davem330 avatar dhowells avatar ebiederm avatar gregkh avatar heicarst avatar herbertx avatar htejun avatar hverkuil avatar ickle avatar jmberg avatar jmberg-intel avatar joeperches avatar kaber avatar lenb avatar neilbrown avatar ozbenh avatar pmundt avatar ralfbaechle avatar rddunlap avatar rjwysocki avatar tiwai avatar torvalds avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.