[ovs-dev] Where to add GTP tunnel headers in datapath flow table of open vSwitch
Ajmer Singh
ajmersingh.tu06 at gmail.com
Wed Mar 9 05:24:34 UTC 2016
Hi Jesse, first of all thanks for your response. I have been waiting
someone to respond since 11 days :)
for this problem, I have declared a structure just to map standard GTPv1
header.
struct gtp_header{
unsigned char ver:3;
char prot_type:1;
char resrvd:1;
char extn_hdr_flag:1;
char seqn_no_flag:1;
char npdu_flag:1;
char msg_type;
short msg_length;
u32 teid;
};
I have now question related to mapping of ofp_header->type (OFPT_) with
OFPRAW_contants
struct ofp_header {
uint8_t version; /* An OpenFlow version number, e.g. OFP10_VERSION.
*/
uint8_t type; /* One of the OFPT_ constants. */
ovs_be16 length; /* Length including this ofp_header. */
ovs_be32 xid; /* Transaction id associated with this packet.
Replies use the same id as was in the request to facilitate pairing. */
};
OFP_ASSERT(sizeof(struct ofp_header) == 8);
ofphdrs_decode(): openVswitch/lib/ofp-msg.c
this function assumes that openflow header type contains only below enum
constants. My query is why it is not taking care of lot many openflow
messages (PACKET_OUT, FLOW_MOD etc..). your response is much appreciated.
OFPT_VENDOR
OFPT10_STATS_REQUEST
OFPT10_STATS_REPLY
OFPT11_STATS_REQUEST
OFPT11_STATS_REQUEST
thanks
ajmer
On Wed, Mar 9, 2016 at 3:56 AM, Jesse Gross <jesse at kernel.org> wrote:
> On Sun, Feb 28, 2016 at 10:29 PM, Ajmer Singh <ajmersingh.tu06 at gmail.com>
> wrote:
> > Hi,
> >
> > We are working on open Vswitch 2.4 and the requirement is to add GTP
> tunnel
> > headers in flow table so that onos controller can add flows for GTP
> packets
> > and the switch captures GTP packets as well. What we have identified so
> far:
> > 1. Struct sk_buff :-> the structure containing the received packet
> > 2. Struct sw_flow_key ->structure to extract flow key
> > 3. Struct flow_table -> actual flow table resides at switch side
> > 4. Struct sw_flow -> temp structure containing flows to match against
> > flow_table
> >
> > our findings for GTP tunnel header addition:
> > 1. no need to make changes in struct sk_buff since it has a variable
> > element "data". this will contain GTP data also.
> > 2. need to make changes in sw_flow_key; have to add GTP specific headers
> >
> > our query is; we need to add GTP headers in flow_table structure:
> > struct flow_table {
> > struct table_instance __rcu *ti;
> > struct table_instance __rcu *ufid_ti;
> > struct mask_cache_entry __percpu *mask_cache;
> > struct mask_array __rcu *mask_array;
> > unsigned long last_rehash;
> > unsigned int count;
> > unsigned int ufid_count;
> > };
> > we are facing difficulty in finding the structure where we can add GTP
> > specific headers: following is the GTP specific fields:
> > enum oxm_ofb_match_fields_experimenter {
> > OFPXMT_GTP_TEID = 40, /* Tunnel Id */
> > OFPXMT_GTP_VERSION = 41, /* GTP Version */
> > OFPXMT_GTP_MSG_TYPE = 42, /* GTP Message Type */
> > OFPXMT_GTP_TUNNEL_TYPE = 43 /* Type of Tunnel */
> > };
> >
> > can anyone help in updating this structure?
>
> As you said, tunnel headers go in struct sw_flow_key. At least some of
> the fields you list above have existing members that you should be
> able to use, such as tunnel ID. There is no need to modify struct
> flow_table.
>
> There are numerous people who have said that they are planning on
> working on GTP in the past. I would recommend searching the mailing
> list and attempting to work together.
>
More information about the dev
mailing list