I would like to understand how the Metadata are calculated in an Open Flow rule.
cookie=0x6900000, duration=228925.519s, table=17, n_packets=384, n_bytes=35436, priority=10,metadata=0xf30000000000/0xffffff0000000000 actions=write_metadata:0xc000f30000000000/0xfffffffffffffffe,goto_table:211
Example: I have a flow very similar to this. How are exactly the Metadata are Calculated.
And how to Intrepret the Metadata Values and Mask
Some says new_metadata = old_metadata & ~mask | value & Mask
Honestly i do not understand it, could some one explain it
The purpose of the
value
andmetadata
fields in thewrite_metadata
action are explained in the Open vSwitch documentation:The preceding explanation is indeed equivalent to:
In other words, we first erase bits of the old metadata value set to 1 in the mask (
old_metadata & ~mask
) and then set to 1 the bits of the value that are also set to 1 in the mask (| (value & mask)
).