[ovs-discuss] Processing FlowMods

Ashish Varma ashishvarma.ovs at gmail.com
Tue Jun 19 17:52:02 UTC 2018


In the function "miniflow_extract", a miniflow structure gets populated
based on the fields received in the packet.
("struct miniflow" is a sparse representation of the "struct flow"
structure. See ovs/lib/flow.h)

The code inside "miniflow_extract" puts the sctp field (if present) in the
miniflow structure:

        } else if (OVS_LIKELY(nw_proto == IPPROTO_SCTP)) {
            if (OVS_LIKELY(size >= SCTP_HEADER_LEN)) {
                const struct sctp_header *sctp = data;

                miniflow_push_be16(mf, tp_src, sctp->sctp_src);
                miniflow_push_be16(mf, tp_dst, sctp->sctp_dst);
                miniflow_push_be16(mf, ct_tp_src, ct_tp_src);
                miniflow_push_be16(mf, ct_tp_dst, ct_tp_dst);
            }
        }

"miniflow_push_be16" stores the value of the sctp ports in the miniflow
structure.






On Sat, May 26, 2018 at 10:57 AM, Pedro Henrique <phamorimrezende at gmail.com>
wrote:

> Worked fine! Thanks.
> Another question. In *miniflow_extract* function (lib/flow.c),  the OVS
> uses different packets.h structs (lib/packets.h) depending on the traffic.
> For instance, if the traffic is SCTP, the *sctp_header *struct will be
> used (around Line 917 of flow.c file)*. *Now, here is my problem. I'm not
> finding where the *sctp_header *struct fields (such as: *sctp_src* and
> *sctp_dst*) are being written. I thought these fields were being filled
> out on *packet_set_sctp_port* (packets.c) or *flow_compose_l4 *(flow.c)
> functions. However, after debugging the code, the  *packet_set_sctp_port*
> function is not being called at all and the *sctp_header* struct of *flow_compose_l4
> *is not being accessed. Please, where is the function responsible to fill
> out the *sctp_header* fields?
>
> PS: I turned off the kernel datapath and am using only the userspace path.
> Moreover, the SCTP traffic is being sent between the end hosts perfectly,
> no problem at all.
>
> Thanks in advance,
>
>
>
>
>
> 2018-05-21 14:07 GMT-04:00 Ashish Varma <ashishvarma.ovs at gmail.com>:
>
>> Try debugging from functions:
>>
>>         ofputil_pull_ofp11_match  -->
>>                                    oxm_pull_match
>>
>> "ofputil_match_from_ofp11_match" is called for "OFPMT_STANDARD" case
>> which is deprecated in the openflow 1.4 standard.
>>
>> Thanks,
>> Ashish
>>
>> On Mon, May 21, 2018 at 10:32 AM, Pedro Henrique <
>> phamorimrezende at gmail.com> wrote:
>>
>>> Dear members,
>>>
>>> I'm looking for the OVS's function(s) responsible for processing the
>>> match fields from the OpenFlow FlowMod message, which is sent by the the
>>> SDN controller. I thought it was this function from lib/ofp-util.c:
>>> "ofputil_match_to_ofp11_match(const struct match *match, struct
>>> ofp11_match *ofmatch)". However, this function is not being called,
>>> according to some debug code I inserted on it.
>>>
>>> P.S.: I'm using OVS 2.9.0 and OpenFlow 1.4.
>>>
>>> Thank you,
>>>
>>> --
>>> Pedro Henrique Amorim Rezende
>>>
>>> _______________________________________________
>>> discuss mailing list
>>> discuss at openvswitch.org
>>> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
>>>
>>>
>>
>
>
> --
> Pedro Henrique Amorim Rezende
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20180619/48bbd599/attachment.html>


More information about the discuss mailing list