On Mon, Aug 27, 2012 at 7:14 PM, Ben Pfaff <[email protected]> wrote: > On Mon, Aug 27, 2012 at 03:46:47PM +0530, bhaskar jain wrote: > > I am having great difficulty in setting the cookie field using ovs-oftl > > tool. The value seems to be set sometimes and not other times. > > What is the correct way to set this value in the flow definition for OF > 1.0 > > switch. > > Did you read the documentation? > > Yes, but the "cookie=value/mask" explanation was missing in the 1.0 spec. Thanks for the reply but I am still not clear with this field.
I just want to create few flows with my pre-defined cookie values and then use those cookie values to mod/del the flows. Am writing few unit-tests and would like to use this identifier for the tests. If you could please explain if it is possible to set the cookie value with add-flow definition. Appreciate your help. > An opaque identifier called a cookie can be used as a handle to > iden‐ > tify a set of flows: > > cookie=value > A cookie can be associated with a flow using the > add-flow, > add-flows, and mod-flows commands. value can be any 64-bit > num‐ > ber and need not be unique among flows. If this field is > omit‐ > ted, a default cookie value of 0 is used. > > cookie=value/mask > When using NXM, the cookie can be used as a handle for > querying, > modifying, and deleting flows. value and mask may be > supplied > for the del-flows, mod-flows, dump-flows, and > dump-aggregate > commands to limit matching cookies. A 1-bit in mask > indicates > that the corresponding bit in cookie must match exactly, > and a > 0-bit wildcards that bit. A mask of -1 may be used to > exactly > match a cookie. > > The mod-flows command can update the cookies of flows that > match > a cookie by specifying the cookie field twice (once with a > mask > for matching and once without to indicate the new value): > > ovs-ofctl mod-flows br0 cookie=1,actions=normal > Change all flows' cookies to 1 and change their > actions > to normal. > > ovs-ofctl mod-flows br0 cookie=1/-1,cookie=2,actions=normal > Update cookies with a value of 1 to 2 and change > their > actions to normal. > > The ability to match on cookies was added in Open vSwitch > 1.5.0. > -- With best regards, Bhaskar.
_______________________________________________ openflow-discuss mailing list [email protected] https://mailman.stanford.edu/mailman/listinfo/openflow-discuss
