Google 致力于为黑人社区推动种族平等。查看具体举措
此页面由 Cloud Translation API 翻译。
Switch to English

OpenWeave +快乐跨网络组播Inet层HOWTO

在GitHub上查看源代码

您已决定要尝试使用OpenWeave进行跨网络多播。该使用方法指南说明了如何使用Happy网络仿真工具来设置虚拟拓扑,该拓扑演示了如何在具有组播代理的两个不同网络上使用OpenWeave的Inet层。

下载并构建mcproxy

IPv6多播代理守护程序mcproxy用于在两个不相交的IPv6网络链路上代理/转发/路由IPv6多播流量。

虽然克隆和构建mcproxy守护程序可执行文件的位置不是特别重要,但是请注意在下面的步骤6中创建它的位置,因为它是相对或绝对路径。

git clone https://github.com/mcproxy/mcproxy.git mcproxy
sudo apt-get install qt5-qmake qt5-default
cd mcproxy/mcproxy
qmake
make

下载,构建和安装快乐

git clone https://github.com/openweave/happy.git happy
sudo apt-get install bridge-utils python-lockfile python-psutil python-setuptools
cd happy
sudo make install

下载并构建openweave-core

git clone https://github.com/openweave/openweave-core.git openweave-core
cd openweave-core
./configure
make

建立快乐拓扑

这将创建一个与Happy Codelab非常相似的拓扑。

happy-network-add ThreadNetwork thread
happy-network-address ThreadNetwork fd00:0000:0000:0006::
happy-network-add WiFiNetwork wifi
happy-network-address WiFiNetwork fd00:0000:0000:0001::
happy-network-address WiFiNetwork 192.168.1.0
happy-node-add ThreadNode
happy-node-add WiFiNode
happy-node-add BorderRouter
happy-node-join ThreadNode ThreadNetwork
happy-node-join WiFiNode WiFiNetwork
happy-node-join BorderRouter ThreadNetwork
happy-node-join BorderRouter WiFiNetwork
happy-network-route --prefix fd00:0000:0000:0006:: ThreadNetwork BorderRouter
happy-network-route --prefix fd00:0000:0000:0001:: WiFiNetwork BorderRouter
happy-network-route --prefix 192.168.1.0 WiFiNetwork BorderRouter

为Happy拓扑创建mcproxy配置

在上面我们在步骤4中创建的Happy拓扑中,这将在“ wpan0”上的模拟“ Thread”网络接口与“ wlan0”上的模拟“ WiFi”网络接口之间创建IPv6多播代理配置。

尽管在创建mcproxy.conf文件的位置并不是特别重要,但是请注意在第6步中创建该文件的位置,因为它是相对或绝对路径。

cat > mcproxy.conf << EOF
protocol MLDv2;
pinstance myProxy: wpan0 ==> wlan0;
EOF

进行示范

这将在“ BorderRouter”节点上运行IPv6多播代理mcproxy ,然后分别在模拟的“ Thread”和“ WiFi”节点上启动Inet层多播功能测试发送方和接收方。

如果愿意,可以转置发送方和接收方节点,该示例也将同样起作用。

以下每组命令应从并行的独立外壳运行。

边界路由器

happy-shell BorderRouter
<path-to-mcproxy-from-step1>/mcproxy -f <path-to-mcproxy-config-from-step5>/mcproxy.conf

接收者

happy-shell WiFiNode
openweave-core/src/test-apps/TestInetLayerMulticast -6 --udp -I wlan0 -g 5 --group-expected-rx-packets 5 --group-expected-tx-packets 0 -l

发件人

happy-shell ThreadNode
openweave-core/src/test-apps/TestInetLayerMulticast -6 --udp -I wpan0 -g 5 --group-expected-rx-packets 0 --group-expected-tx-packets 5 -L

输出量

发件人

openweave-core/src/test-apps/TestInetLayerMulticast -6 --udp -I wlan0 -g 5 ... -L
Weave Node ready to service events; PID: 50845; PPID: 46482
Using UDP/IPv6, device interface: wpan0 (w/o LwIP)
Will join multicast group ff15::5
1/5 transmitted for multicast group 5
2/5 transmitted for multicast group 5
3/5 transmitted for multicast group 5
4/5 transmitted for multicast group 5
5/5 transmitted for multicast group 5
Will leave multicast group ff15::5
WEAVE:IN: Async DNS worker thread woke up.
WEAVE:IN: Async DNS worker thread exiting.
WEAVE:IN: Async DNS worker thread woke up.
WEAVE:IN: Async DNS worker thread exiting.

接收者

openweave-core/src/test-apps/TestInetLayerMulticast -6 --udp -I wlan0 -g 5 ... -l
Weave Node ready to service events; PID: 50826; PPID: 46499
Using UDP/IPv6, device interface: wlan0 (w/o LwIP)
Will join multicast group ff15::5
Listening...
UDP packet received from fd00::6:8693:b7ff:fe5a:1dc1:4242 to ff15::5:4242 (59 bytes)
1/5 received for multicast group 5
UDP packet received from fd00::6:8693:b7ff:fe5a:1dc1:4242 to ff15::5:4242 (59 bytes)
2/5 received for multicast group 5
UDP packet received from fd00::6:8693:b7ff:fe5a:1dc1:4242 to ff15::5:4242 (59 bytes)
3/5 received for multicast group 5
UDP packet received from fd00::6:8693:b7ff:fe5a:1dc1:4242 to ff15::5:4242 (59 bytes)
4/5 received for multicast group 5
UDP packet received from fd00::6:8693:b7ff:fe5a:1dc1:4242 to ff15::5:4242 (59 bytes)
5/5 received for multicast group 5
Will leave multicast group ff15::5
WEAVE:IN: Async DNS worker thread woke up.
WEAVE:IN: Async DNS worker thread exiting.
WEAVE:IN: Async DNS worker thread woke up.
WEAVE:IN: Async DNS worker thread exiting.