DLEP Plugins

From OLSR.org Wiki
(Redirected from DLEP)
Jump to: navigation, search

What is DLEP?

The DLEP protocol was proposed to the IETF Manet group and deals with communication between a router and a local radio, attached over an IP network.

DLEP allows radio and router to automatically discover each other. Most of the functionality is designed to transmit link layer data like datarate, signal quality and frame statistics from the radio to the router. This way the router can use a link layer aware metric with an external radio.

DLEP is not designed to be talked over the wireless link between two radios.

How does OONF implement DLEP?

OONF contains a subsystem plugin called OONF Layer2 Plugin which stores link layer data about network interfaces and neighbors behind these interfaces.

The OONF DLEP implementation is done by two generic plugins called dlep-radio and dlep-router. Together these plugins mirror the content of a oonf-layer2 database over an IP connection into another database.

All DLEP connections between radio and router are interface specific, you always need one plugin instance per interface you want DLEP working on.

The DLEP-radio plugin does not gather link layer data itself, you need other plugins for this (e.g. the NL80211 Listener Plugin).

Both DLEP-radio plugin and DLEP-router plugin share a lot of code. Because of this they also share a single directory in the source code.

Configuration

Both the DLEP-radio and the DLEP-router have their own configuration section.

dlep_radio

dlep_radio is a named configuration section that needs the name to be the Layer2 database interface DLEP will transmit to the DLEP router.

The section has ten settings.

Key Default Type Limits
datapath_if string <mandatory parameter>
discovery_mc_v4 224.0.0.109 netaddr ipv4, unspecified
discovery_mc_v6 ff02::6D netaddr ipv6, unspecified
discovery_port 22222 integer 1-65535, no fractions
discovery_bindto fe80::/10 ACL ipv4, ipv6
session_port 12345 integer 1-65535, no fractions
local_heartbeat_interval 1.0 clock >=0.1
proxied false boolean
not_proxied true boolean

datapath_if defines the communication interface DLEP-radio should use to talk to the DLEP router. It is a mandatory parameter.

discovery_mc_v4 defines the IPv4 multicast used for receiving router discovery packets.

discovery_mc_v6 defines the IPv6 multicast used for receiving router discovery packets.

discovery_port defines the UDP port used for router discovery.

discovery_bindto defines the IP addresses which the DLEP UDP Discovery socket will be bound to.

session_port defines the UDP port used for router discovery.

session_bindto defines the IP addresses which the DLEP TCP Session socket will be bound to.

local_heartbeat_interval defines the interval in seconds between two heartbeats.

proxied defines if DLEP-radio transmits the data of proxied MACs behind 802.11s nodes.

not_proxied defines if DLEP-radio transmit the data of direct neighbors.

dlep_router

dlep_router is a named configuration section that takes the Layer2 database interface DLEP will use to put the incoming data into.

The section has eight settings.

Key Default Type Limits
datapath_if STRING
discovery_mc_v4 224.0.0.109 netaddr ipv4, undefined
discovery_mc_v6 ff02::6D netaddr ipv6, undefined
discovery_port 22222 integer 1-65535, no fractions
discovery_bindto fe80::/10 ACL ipv4, ipv6
discovery_interval 1.0 clock >=0.1
local_heartbeat_interval 1.0 clock >=0.1
single_session true BOOL
connect_to - netaddr
connect_to_port 0 BOOL between 1 and 65535

datapath_if is the interface the DLEP router received data from the DLEP radio. If not set the plugin uses the section name as the communication interface.

discovery_mc_v4 defines the IPv4 multicast used for sending router discovery packets.

discovery_mc_v6 defines the IPv6 multicast used for sending router discovery packets.

discovery_port defines the UDP port used for router discovery.

discovery_bindto defines the IP addresses which the DLEP UDP Discovery socket will be bound to.

discovery_interval defines the interval in seconds between to discovery beacons.

local_heartbeat_interval defines the interval in seconds between two heartbeats.

single_session restricts the DLEP-router to communicate with a single DLEP-radio per interface.

connect_to establishes a direct connection to the IP address in the parameter with a DLEP-radio without UDP based discovery.

connect_to_port sets the port number for the direct connection to a DLEP-radio.

Configuration examples

The following configurations will create a DLEP connection between a radio and a router.

DLEP-radio configuration

[dlep_radio=wlan0]
        datapath_if          eth0

This configuration will tell the radio that it should communicate with the dlep-router through the interface eth0 and that it should transmit the link layer data of interface wlan0 and its neighbors.

DLEP expects that wlan0 and eth0 will be bridged for the normal traffic so the routers can directly talk to each other with unicast and multicast.

DLEP-router configuration

[dlep_router=eth0]

This configuration will tell the router that it should communicate with a dlep-radio through the interface eth0 and replicate its link layer data for this interface.

The DLEP router will expect that all traffic (both unicast and multicast) sent into eth0 (except the DLEP traffic itself) will reach other routers on the end of the radio connections.

DLEP-radio on an embedded router with OpenWRT

You can use the DLEP-radio plugin together with a 802.11s configured mesh interface to build a full DLEP radio node with OpenWRT.

802.11s is necessary because 802.11 Adhoc Mode does not support bridging, which is necessary for DLEP. You SHOULD deactivate the layer-2 frame forwarding in the Openwrt wireless configuration similar to the following example:

...
config wifi-iface
        option device radio0
        option mesh_id mymesh1
        option mode mesh
        option network lan
        option mesh_fwding 0

The following example is a DLEP radio configuration file for such a radio:

[global]
        fork            no
        failfast        no
        plugin          dlep_radio
        plugin          layer2info
        plugin          nl80211_listener

[log]
        syslog          true
        stderr          false
#        file            /var/log/dlep.log
#        info            all
#        debug           all

[telnet]
#       port            2009

[dlep_radio=br-lan]
        source          wlan0
        not_proxied     false
        proxied         true

[nl80211_listener]
        if              wlan0
        interval        1.0

[layer2_viewer]

In addition to the DLEP and wireless settings you should add a couple of firewall rules to block STP, the DLEP discovery multicasts and communication to the local radio services over the wireless link.

You can use ebtables/iptables for this:

# block traffic forwarded with management interface
ebtables -A FORWARD -i eth0.1 -j DROP
ebtables -A FORWARD -o eth0.1 -j DROP

# do not communicate directly with wlan0
ebtables -A INPUT  -o wlan0 -j DROP
ebtables -A OUTPUT -o wlan0 -j DROP

# block STP for wlan0
ebtables -A FORWARD -o wlan0 -d BGA -j DROP

# block DLEP discovery
iptables  -A FORWARD -p udp --dport 2001 -j DROP
ip6tables -A FORWARD -p udp --dport 2001 -j DROP

ifup lan

The port 2001 for DLEP is a temporary selection until a regisration of the IANA.