如何在 opendaylight 中检索 dpid
How to retrieve the dpid in opendaylight
我正在研究 opendaylight,我在文档的任何部分都没有找到的一件事是如何获取开关的 Dpid(这些开关称为 openflow:1、openflow:2 等)通过 opendaylight 提供的 URL 从控制器中的拓扑中获取信息。
所以我的问题是,opendaylight 的数据存储区是否实际存储了这些开关信息(DatapathID),以及是否有使用控制器提供的 URL 获取这些 dpids 的方法。
您可以在节点上使用DCN 获取dpId,另一种方法是从操作DataStore 的清单中读取。 DCN 的示例是 here line (81). You find method defination of MDSALUtil.getDpnIdFromNodeName
here(along with few otherways).
您也可以从 restconf 中检索 DPID。所以 GET 到:
http://${ODL_IP}:8181/restconf/operational/opendaylight-inventory:nodes
你会收到这样的回复:
{"nodes":{"node":[{"id":"openflow:82225698597705"
注意长字符串只是mac地址的十进制转换
(在这种情况下为 4a:c8:a9:8e:6b:49)
在您阅读的文档中,openflow:1,等等。这可能是
来自使用 mac 的网络模拟工具 "mininet"
地址这么简单(例如 00:00:00:00:00:01)
我正在研究 opendaylight,我在文档的任何部分都没有找到的一件事是如何获取开关的 Dpid(这些开关称为 openflow:1、openflow:2 等)通过 opendaylight 提供的 URL 从控制器中的拓扑中获取信息。
所以我的问题是,opendaylight 的数据存储区是否实际存储了这些开关信息(DatapathID),以及是否有使用控制器提供的 URL 获取这些 dpids 的方法。
您可以在节点上使用DCN 获取dpId,另一种方法是从操作DataStore 的清单中读取。 DCN 的示例是 here line (81). You find method defination of MDSALUtil.getDpnIdFromNodeName
here(along with few otherways).
您也可以从 restconf 中检索 DPID。所以 GET 到:
http://${ODL_IP}:8181/restconf/operational/opendaylight-inventory:nodes
你会收到这样的回复:
{"nodes":{"node":[{"id":"openflow:82225698597705"
注意长字符串只是mac地址的十进制转换 (在这种情况下为 4a:c8:a9:8e:6b:49)
在您阅读的文档中,openflow:1,等等。这可能是 来自使用 mac 的网络模拟工具 "mininet" 地址这么简单(例如 00:00:00:00:00:01)