[ovs-discuss] Modifying IP address bits
Jason Thorpe
jasonthorpe1 at outlook.com
Tue Jan 7 04:11:11 UTC 2014
Hi Justin
Thanks for replying
> <jasonthorpe1 at outlook.com<mailto:jasonthorpe1 at outlook.com>> wrote:
> is it possible to modify specific bits of an IP address when setting
> flow rules for a switch? (using add-flow and
> actions=mod_nw_{src,dst} ).
>
> That won't work, since that action is expecting a specific IP address.
>
> basically, I am looking for setting actions on the IP address to change
> some source/destination. like modifying all IPs from 192.168.0.* to
> 192.168.1.* . or can I just use wildcards for this purpose?
>
> I hadn't really thought about it before, but I suppose you could load
> the IP address into a register, then modify the appropriate bits with
> the move action, and then use the move action to copy the contents of
> the register into NXM_OF_IP_DST.
I need to do this for many IP addresses. What I am trying to do here is to replicate the Modelnet bitflip behaviour where the 23rd bit of the source and destination addresses are flipped [10.128.0.1 -> 10.0.0.1]. So out of the options I have for achieving this:
1. modifying the source code
2. using the registers you mentioned above
3. using a controller and then flipping the bits where required
which one do you recommend that I go with?
More information about the discuss
mailing list