[ovs-discuss] GRE key value mismatch (strange gre key translation from declared value to the actual gre packet value)

Christos Argyropoulos cargious at netmode.ntua.gr
Thu Jan 19 19:45:55 UTC 2012


Hi there,
i am facing the following strange behavior (Open vSwitch 1.4.90 and 1.2.2).
*
Adding a GRE interface with GRE key value=1 to my OVS creates packets 
with GRE key value equal to 0x30760001
*
root at ovs1:~# ovs-vsctl -- add-port br0 gre100_2 tag=2830 -- set 
interface gre100_2 type=gre options=remote_ip=147.102.13.59,key=1,csum=true

19:16:19.506382 IP ovs1.lab.netmode.ece.ntua.gr > 
darthvader.netmode.ece.ntua.gr: GREv0, off 0x0, key=0x30760001, length 
54: ARP, Request who-has 192.168.29.60 tell 192.168.29.59, length 28

*Adding a GRE interface with GRE key value=100 to my OVS creates packets 
with GRE key value equal to 0x30130064*

19:19:21.557011 IP ovs1.lab.netmode.ece.ntua.gr > 
darthvader.netmode.ece.ntua.gr: GREv0, off 0x0, key=0x30130064, length 
54: ARP, Request who-has 192.168.29.60 tell 192.168.29.59, length 28
*
Info taken from "ovs-vsctl show" command* for the second case
  Port "gre100_2"
             tag: 2830
             Interface "gre100_2"
                 type: gre
                 options: {csum="true", key="100", 
remote_ip="147.102.13.59"}

*Info taken from "vs-ofctl dump-flows br0" command*
NXST_FLOW reply (xid=0x4):
  cookie=0x0, duration=9007.608s, table=0, n_packets=3191, 
n_bytes=134670, priority=0 actions=NORMAL

I do understand that the last 16 bits of the key in the produced packets 
corresponds to the value i defined,_/but i can not understand the "3013" 
prefix to the GRE key value of the produced packets. /_


I understand that  the first 16bit part of the GRE value is reduced, 
when the last 16bit part is augmented...
Algorithm of the strange translation:

key definition=1
gre key inside packets= 0x30760001 (0x3076-0x64+1=0x3013)

key definition=100
gre key inside packets= 0x30130064


First part 16bit
(0x3076-0x64+0x1=0x3013)
Second part 16bit
(0x0001+0x0064-0x1=0x64)


Regards,
Christos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20120119/fdca2c57/attachment.html>


More information about the discuss mailing list