[英]Updating OpenFlow group table bucket list in OpenDaylight
I have a mininet (v2.2.2) network with openvswitch (v2.5.2), controlled by OpenDaylight Carbon. 我有一个由OpenDaylight Carbon控制的带有openvswitch(v2.5.2)的小型网络(v2.2.2)。 My application is an OpenDaylight karaf feature. 我的应用程序是OpenDaylight karaf功能。 The application creates a flow (for multicasts) to a group table (type=all) and adds/removes buckets as needed. 该应用程序创建到组表(类型=全部)的流(用于多播),并根据需要添加/删除存储桶。 To add/remove buckets, I first check if there is an existing group table: 要添加/删除存储桶,我首先检查是否存在现有的组表:
InstanceIdentifier<Group> groupIid = InstanceIdentifier.builder(Nodes.class)
.child(Node.class, new NodeKey(NodId))
.augmentation(FlowCapableNode.class)
.child(Group.class, grpKey)
.build();
ReadOnlyTransaction roTx = dataBroker.newReadOnlyTransaction();
Future<Optional<Group>> futOptGrp = rwTx.read(LogicalDatastoreType.OPERATIONAL, groupIid);
If it doesn't find the group table, it is created (SalGroupService.addGroup()). 如果找不到组表,则会创建它(SalGroupService.addGroup())。 If it does find the group table, it is updated (SalGroupService.updateGroup()). 如果找到组表,则会对其进行更新(SalGroupService.updateGroup())。
The problem is that it takes some time after the RPC call add/updateGroup() to see the changes in the data model. 问题在于,RPC调用add / updateGroup()之后要花费一些时间才能看到数据模型中的更改。 Waiting for the Future<RPCResult<?>>
doesn't guarantee that the data model has the same state as the device. 等待Future<RPCResult<?>>
不能保证数据模型具有与设备相同的状态。
So, how do I read the group table and bucket list from the data model and make sure that I am indeed reading the same state as the current state of the device? 那么,如何从数据模型中读取组表和存储区列表,并确保确实读取与设备当前状态相同的状态?
I know that 我知道
But I cannot figure out how to combine these. 但是我不知道如何将它们结合起来。 Thank you 谢谢
EDIT: Or do I have to use write transactions in stead of RPC calls? 编辑:还是我必须使用写事务来代替RPC调用?
I dropped using RPC calls for writing flows and switched to using writes to the config datastore. 我放弃了使用RPC调用来写流,而转而使用对配置数据存储的写操作。 It will still take some time to see the changes appear in the actual device and in the operational datastore but that is ok as long as I use the config datastore for both reads and writes. 仍然需要一些时间才能看到更改出现在实际设备和可操作的数据存储区中,但是可以,只要我将config数据存储区用于读取和写入即可。
However, I have to keep in mind that it is not guaranteed that changes to the config datastore will always make it to the actual device. 但是,我必须牢记,不能保证对配置数据存储的更改将始终使之成为实际设备。 My flows are not that complicated in the sense that conflicts are unlikely to happen. 就冲突不太可能发生的意义而言,我的流程并不那么复杂。 Still, I will probably check consistency between operational and configuration datastore. 不过,我可能会检查操作和配置数据存储之间的一致性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.