这是来自https://github.com/osrg/ryu/blob/master/ryu/topology/switches.py#L429的类 Switches 的代码
Switches 类中我特别感兴趣的成员变量如下。
self.dps = {} # datapath_id => Datapath class
self.port_state = {} # datapath_id => ports
self.ports = PortDataState() # Port class -> PortData class
self.links = LinkState() # Link class -> timestamp
self.is_active = True
这些是 RYU 用于缓存拓扑详细信息的成员变量。我试图弄清楚如何使用以下变量表示拓扑。
1) dps 是将 datapath_id 映射到 datapath 类的字典?
- Can someone explain to me what is a datapath_id and a datapath class?
2) port_state 是一个将数据路径 ID 映射到端口的字典
- As per my understanding on a switch without a VLAN all the ports will belong to the same datapath id? In case of a switch with VLAN ports on the switch can have multiple datapath id's. Is my understanding correct?
3) ports 又是一个将 Port 类映射到 PortData 类的字典?
- what does this mean?
4) links 又是一个字典,将 Link 类映射到时间戳
- again what does this mean?
我正在尝试了解 RYU 控制器如何使用上述结构存储拓扑信息。任何有助于理解或解释的帮助将不胜感激。