Hi, Tanvir
NXM_NX_PKT_MARK is heavily dependent on Linux kernel packet processing.
And it is not the matter of ryu itself, I'll show an example only
with Open vSwitch.
It was very hard for me to examine the actual working case, but
I found following seems working:
- setup Open vSwitch and veth, veth (*1)
(external) -- eth0 -- br0(ovs) -- veth0 == veth1
- set ip address to veth1
- set default route to veth1 gateway (next hop)
```
iptables -t mangle -A PREROUTING -j LOG
ovs-ofctl -O OpenFlow13 add-flow br0 "actions=set_field:1->pkt_mark,flood"
```
Then we see a log like this:
```
Jul 06 08:04:35 ubuntu kernel: IN=veth1 OUT=
MAC=ff:ff:ff:ff:ff:ff:00:50:56:c0:00:08:08:00 SRC=192.168.40.1
DST=255.255.255.255 LEN=44 TOS=0x00 PREC=0x00 TTL=128 ID=23523 PROTO=UDP
SPT=57424 DPT=8612 LEN=24 MARK=0x1
```
You can see MARK=0x1 is set, which is out of openflow
pipeline processing.
*1) If you are really unfamilar with this setup, hints are:
ip link add veth0 peer name veth1
ovs-vsctl add-br br0 -- set bridge br0 protocols=OpenFlow13
ovs-vsctl add-port br0 veth0
ovs-vsctl add-port br0 eth0
ip link set veth1 up
ip link set veth0 up
ip link set br0 up
On 2016/07/04 22:54, [email protected] wrote:
> Hi Hiroaki KAWAI
>
> Thanks for your prompt response. It helps me a lot :)
>
> 1. Although I do not have the clear idea about the NXM_NX_PKT_MARK, I have
> understood from my reading of the nicira extension that there is a
> possibility of packet marking. Would you please inform me specifically which
> openflow message of the nicira extension can be used to mark the data packet ?
>
> 2. Regarding the set_field action: thanks to show the second alternative
> approach. Following link also tells the same.
> http://www.brocade.com/content/html/en/configuration-guide/fastiron-08040-sdnguide/GUID-6DD519A6-EF27-489D-B78B-EC310287A05E.html
>
> But, I am searching one example in which set_fieldAction command has been
> used to mark the data packet to get the clear idea. Do you have/know any
> references ?
>
> thanks again, and again, Hiroaki. Honestly speaking it helps me a lot :)
>
> -Tanvir
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 1 Jul 2016 21:08:50 +0900
> From: Hiroaki KAWAI <[email protected]>
> Subject: Re: [Ryu-devel] mark the data packet
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=iso-2022-jp; format=flowed;
> delsp=yes
>
> Hi Tanvir,
>
> Then, we're talking about Linux specific sk_buf.mark,
> not a packet marking in general.
> In ryu library, you can find NXM_NX_PKT_MARK in
> ryu/ofproto/nicira_ext.py, and it should not be
> hard to use.
> https://github.com/osrg/ryu/blob/master/ryu/ofproto/nicira_ext.py#L385
>
> BTW, set_field action to metadata field can be used
> to mark a packet as far as the packet is traveling
> in openflow pipeline.
>
>
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
>
> ------------------------------
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
>
> End of Ryu-devel Digest, Vol 56, Issue 4
> ****************************************
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel