ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
交换机端口是Port子类的实例,存储在交换机类的portMap数据结构中。端口具有的属性继承自OpenFlow的ofp_phy_port数据结构。OVX添加了如下信息支持网络虚拟化: // T1 extends Switch, T2 extends Link protected MACAddress mac // the hardware address of the port protected Boolean isEdge // true if this port is an edge protected T1 parentSwitch // the switch that this port belongs to protected LinkPair<T2> portLink // if not an edge, the Links to/from this port 关于ofp_phy_port的详细结构可以参考OpenFlow规范。如果没有链路依赖该端口,则标记isEdge为true。另外,Ports也由一个state属性,是ofp_phy_port一部分,与Port类的FSM无关,但是其值会影响到Port子类的FSM。这将在下一篇讨论。 OVX实现了如下两种Port子类: **PhysicalPort (extends Port &lt;PhysicalSwitch, PhysicalLink>)**:是PhysicalSwitch的一个端口。端口值及其属性来自交换机的功能回应消息( Features Reply)。PhysicalPort维护了一种自身到虚拟端口的映射ovxPortMap。每个PhysicalPort最多可以为每个租户网络承载一个OVXPort。 所有组件: * `Map<Integer, HashMap<Integer, OVXPort>> ovxPortMap` * `PortState pstate`:端口FSM状态 **OVXPort (extends `Port<OVXSwitch, OVXLink>`)**:OVXSwitch的端口。OVXPort通过管理配置实例化。 组件: * `Integer tenantId`:该端口所在的OVXSwitch的所在虚拟网络的租户ID; * `PhysicalPort physicalPort`: * `PortState pstate`:端口FSM状态。