BASIC MULTICAST FORWARDING PLUGIN FOR OLSRD
by Erik Tromp (erik.tromp@nl.thalesgroup.com, erik_tromp@hotmail.com)
Version 1.5.3
1. Introduction
---------------
The Basic Multicast Forwarding Plugin floods IP-multicast and
IP-local-broadcast traffic over an OLSRD network. It uses the
Multi-Point Relays (MPRs) as identified by the OLSR protocol
to optimize the flooding of multicast and local broadcast packets
to all the hosts in the network. To prevent broadcast storms, a
history of packets is kept; only packets that have not been seen
in the past 3-6 seconds are forwarded.
2. How to build and install
---------------------------
Download the olsr-bmf-v1.5.3.tar.gz file and save it into your OLSRD
base install directory.
Change directory (cd) to your OLSRD base install directory.
At the command prompt, type:
tar -zxvf ./olsr-bmf-v1.5.3.tar.gz
then type:
make build_all
followed by:
make install_all
Next, turn on the possibility to create a tuntap interface (see also
/usr/src/linux/Documentation/networking/tuntap.txt):
mkdir /dev/net # if it doesn't exist already
mknod /dev/net/tun c 10 200
Set permissions, e.g.:
chmod 0700 /dev/net/tun
To configure BMF in OLSR, you must edit the file /etc/olsrd.conf
to load the BMF plugin. For example, add the following lines:
LoadPlugin "olsrd_bmf.so.1.5.3"
{
# No PlParam entries required for basic operation
}
3. How to run
-------------
After building and installing OLSRD with the BMF plugin, run the
olsrd daemon by entering at the shell prompt:
olsrd
Look at the output; it should list the BMF plugin, e.g.:
---------- LOADING LIBRARY olsrd_bmf.so.1.5.3 ----------
OLSRD Basic Multicast Forwarding (BMF) plugin 1.5.3 (Feb 24 2008 17:58:02)
(C) Thales Communications Huizen, Netherlands
Erik Tromp (eriktromp@users.sourceforge.net)
Checking plugin interface version: 5 - OK
Trying to fetch plugin init function: OK
Trying to fetch parameter table and it's size...
Sending parameters...
"NonOlsrIf"/"eth0"... NonOlsrIf: OK
Running plugin_init function...
OLSRD Basic Multicast Forwarding (BMF) plugin: opened 5 sockets
---------- LIBRARY olsrd_bmf.so.1.5.3 LOADED ----------
4. How to check if it works
---------------------------
Enter the following command on the command prompt:
ping 224.0.0.1
All OLSR-BMF hosts in the OLSR network should respond. For example,
assume we have three hosts, with IP addresses 192.168.151.50,
192.168.151.53 and 192.168.151.55. On host 192.168.151.50 we enter
the following ping command:
root@IsdbServer:~# ping 224.0.0.1
PING 224.0.0.1 (224.0.0.1) 56(84) bytes of data.
64 bytes from 192.168.151.50: icmp_seq=1 ttl=64 time=0.511 ms
64 bytes from 192.168.151.53: icmp_seq=1 ttl=64 time=4.67 ms (DUP!)
64 bytes from 192.168.151.55: icmp_seq=1 ttl=63 time=10.7 ms (DUP!)
64 bytes from 192.168.151.50: icmp_seq=2 ttl=64 time=0.076 ms
64 bytes from 192.168.151.53: icmp_seq=2 ttl=64 time=1.23 ms (DUP!)
64 bytes from 192.168.151.55: icmp_seq=2 ttl=63 time=1.23 ms (DUP!)
64 bytes from 192.168.151.50: icmp_seq=3 ttl=64 time=0.059 ms
64 bytes from 192.168.151.53: icmp_seq=3 ttl=64 time=2.94 ms (DUP!)
64 bytes from 192.168.151.55: icmp_seq=3 ttl=63 time=5.62 ms (DUP!)
64 bytes from 192.168.151.50: icmp_seq=4 ttl=64 time=0.158 ms
64 bytes from 192.168.151.53: icmp_seq=4 ttl=64 time=1.14 ms (DUP!)
64 bytes from 192.168.151.55: icmp_seq=4 ttl=63 time=1.16 ms (DUP!)
We can see the response from the originating host (192.168.151.50)
(it is normal behaviour for hosts sending multicast packets to
receive their own packets). We can also see the responses by the
other hosts (correctly seen as DUPlicates by ping).
Note: when using an older version of ping than the standard from
iputils-20020927, as found in most current Linux distributions, you may want
to test BMF by specifying the output interface to the ping command:
ping -I bmf0 224.0.0.1
Older versions of 'ping' (e.g. as found in iputils-20020124) may bind to the
autoselected source address, which may be incorrect. Since BMF re-uses
one of the existing IP addresses for the "bmf0" network interface, the
older-version ping command may 'autobind' to the wrong interface.
See also the note in the iputils-20020927/RELNOTES file:
"* Mads Martin J�rgensen <mmj@suse.de>: ping should not bind to autoselected
source address, it used to work when routing changes. Return classic
behaviour, option -B is added to enforce binding."
5. How does it work
-------------------
In the IP header there is room for only two IP-addresses:
* the destination IP address (in our case either a multicast
IP-address 224.0.0.0...239.255.255.255, or a local broadcast
address e.g. 192.168.1.255), and
* the source IP address (the originator).
For optimized flooding, however, we need more information. Let's
assume we are the BMF process on one host. We will need to know which
host forwarded the IP packet to us. Since OLSR keeps track of which
hosts select our host as MPR (see the olsr_lookup_mprs_set(...) function),
we can determine if the host that forwarded the packet, has selected us as
MPR. If so, we must also forward the packet, changing the 'forwarded-by'
IP-address to that of us. If not, we do not forward the packet.
Because we need more information than fits in a normal IP-header, the
original packets are encapsulated into a new IP packet. Encapsulated
packets are transported in UDP, port 50698. The source address of the
encapsulation packet is set to the address of the forwarder instead of
the originator. Of course, the payload of the encapsulation packet is
the original IP packet. For an exact specification of the encapsulation
format, refer to paragraph 10 below.
For local reception, each received encapsulated packets is unpacked
and passed into a tuntap interface which is specially created for
this purpose.
There are other flooding solutions available that do not use
encapsulation. The problem with these solutions is that they cannot
prevent duplicates of forwarded packets to enter the IP stack. For
example, if a host is receiving flooded (unencapsulated, native IP)
packets via two MPR hosts, there is no way to stop the reception of
the packets coming in via the second MPR host. To prevent this, BMF
uses a combination of encapsulated flooding and local reception via
a tuntap interface.
Here is in short how the flooding works (see also the
BmfEncapsulatedPacketReceived(...) function; details with respect to
the forwarding towards non-OLSR enabled hosts are omitted):
On all OLSR-enabled interfaces, setup reception of packets
on UDP port 50698.
Upon reception of such a packet:
If the received packet was sent by myself, drop it.
If the packet was recently seen, drop it.
Unpack the encapsulated packet and send a copy to myself via the
TunTap interface.
If I am an MPR for the host that forwarded the packet to me,
forward the packet to all OLSR-enabled interfaces *including*
the interface on which it was received.
6. Advanced configuration
-------------------------
All configuration of BMF is done via the "LoadPlugin" section in
the /etc/olsrd.conf file.
The following gives an overview of all plugin parameters that can be
configured:
LoadPlugin "olsrd_bmf.so.1.5.3"
{
# Specify the name of the BMF network interface.
# Defaults to "bmf0".
PlParam "BmfInterface" "mybmf0"
# Specify the IP address and mask for the BMF network interface.
# By default, the IP address of the first OLSR interface is copied.
# The default prefix length is 32.
PlParam "BmfInterfaceIp" "10.10.10.234/24"
# Enable or disable the flooding of local broadcast packets
# (e.g. packets with IP destination 192.168.1.255). Either "yes"
# or "no". Defaults to "yes".
PlParam "DoLocalBroadcast" "no"
# Enable or disable the capturing packets on the OLSR-enabled
# interfaces (in promiscuous mode). Either "yes" or "no". Defaults
# t
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
OLSR路由协议实现代码 (539个子文件)
oparse.c 83KB
oscan.c 82KB
NetworkInterfaces.c 63KB
nameservice.c 52KB
Bmf.c 52KB
olsrd_httpinfo.c 42KB
http.c 41KB
interface.c 37KB
lparser.c 37KB
build_msg.c 31KB
olsrd_secure.c 29KB
ifnet.c 29KB
cfgfile_gen.c 28KB
ifnet.c 27KB
kernel_routes.c 26KB
lvm.c 25KB
tc_set.c 23KB
main.c 23KB
quagga.c 23KB
net.c 22KB
link_set.c 22KB
lstrlib.c 22KB
net.c 22KB
ltests.c 20KB
olsrd_conf.c 20KB
lapi.c 19KB
scheduler.c 19KB
lq_packet.c 18KB
lbaselib.c 18KB
liolib.c 18KB
routing_table.c 18KB
lcode.c 18KB
quagga.try1.c 17KB
ipc.c 17KB
mid_set.c 16KB
nodes.c 16KB
process_package.c 16KB
lauxlib.c 16KB
olsrd_txtinfo.c 15KB
ldebug.c 15KB
ltable.c 15KB
parser.c 15KB
mpr.c 15KB
lq_plugin.c 14KB
olsr_spf.c 14KB
olsrd_dyn_gw.c 14KB
ldo.c 14KB
lgc.c 14KB
olsr.c 13KB
ohs_cmd.c 13KB
avl.c 13KB
kernel_routes.c 12KB
os_unix.c 12KB
admin_interface.c 12KB
print_packet.c 12KB
main.c 12KB
plugin.c 12KB
hna_set.c 12KB
net_olsr.c 12KB
llex.c 11KB
packet.c 11KB
compat.c 11KB
neighbor_table.c 11KB
PacketHistory.c 11KB
process_routes.c 11KB
olsrd_pgraph.c 10KB
ipc_frontend.c 10KB
md5.c 10KB
olsrd_dot_draw.c 10KB
plugin_loader.c 10KB
glua.c 10KB
net.c 10KB
link_layer.c 10KB
netsimpcap.c 10KB
Packet.c 9KB
interfaces.c 9KB
lq_plugin_default_ff.c 8KB
apm.c 8KB
olsr_cookie.c 8KB
mapwrite.c 8KB
ldblib.c 8KB
test.c 7KB
olsrd_arprefresh.c 7KB
two_hop_neighbor_table.c 7KB
ltablib.c 7KB
olsrd_plugin.c 7KB
lq_plugin_default_fpm.c 7KB
lundump.c 6KB
duplicate_set.c 6KB
lq_plugin_default_float.c 6KB
mantissa.c 6KB
kernel_routes.c 6KB
mpr_selector_set.c 6KB
hysteresis.c 6KB
lstate.c 6KB
lq_mpr.c 6KB
callbacks.c 6KB
lmathlib.c 6KB
olsrd_dyn_gw_plain.c 5KB
rebuild_packet.c 5KB
共 539 条
- 1
- 2
- 3
- 4
- 5
- 6
huangxiaomingood
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页