在 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拓扑
这将创建非常相似的拓扑快乐程式码实验室。
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
运行演示
这将运行的IPv6多播代理, mcproxy
中,“BorderRouter”节点上,然后启动在INET层组播功能测试发送者和接收者在模拟“线程”和“WiFi”的节点,分别。
如果您愿意,您可以调换发送方和接收方节点,并且该示例也同样有效。
下面的每组命令都应该从并行、独立的 shell 中运行。
边界路由器
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.