Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When applying a group action to a frame, the action set is executed first #11

Closed
YuvalAdler opened this issue Jan 27, 2013 · 4 comments
Closed

Comments

@YuvalAdler
Copy link
Contributor

Hi,

I've noticed a behavior which I think is not according to the spec, wanted to hear your opinion:

Let's say I have the following CLI commands:

group-mod cmd=add,type=all,group=1 weight=0,port=any,group=any output=2
flow-mod cmd=add,table=0 eth_type=0x0800 write:push_vlan=0x8100,output=3 apply:group=1

For the above configuration, I would assume that a matching frame will be sent to port 2 without the vlan header.
Moreover, when reversing the "write" and "apply" command as:

flow-mod cmd=add,table=0 eth_type=0x0800 apply:group=1 write:push_vlan=0x8100,output=3

The vlan header is not pushed to the frame exiting from port 2.

According to the spec ('Instructions' chapter):
"The instructions of the set execute in the order speci fied by this above list"
The 'above' list indicates that "apply" should be executed first.

The fix should be easy if I'm not mistaken, just changing action_set_clone() function to only init the list without copying it.

Thanks.

@ZoltanLajosKis
Copy link

You are right, this is a bug according to OpenFlow 1.3 (but not for previous versions).

In OF 1.1. and OF 1.2 the only instruction constraints were that Goto is the last, and Clear is done before Write. The relation of Write and Apply was unspecified. When OF 1.3 introduced the Meter instruction, defining the minimum set of constraints become unfeasible, so a proper ordering was defined instead. (Which "accidentally" also affects the Write to Apply relation).

@ederlf
Copy link
Collaborator

ederlf commented Jan 27, 2013

Yes, we noticed the problem this last week, while creating some tests for
oftest.

Also, there are problems with goto not being the last instructions
executed. The solution is to check the execution order on execute_entry in
udatapath/pipeline.c. (There ate some checks already,)
Maybe it's better to order the instructions while unpacking them, ensuring
a proper order execution.

On Sun, Jan 27, 2013 at 12:16 PM, Zoltán Lajos Kis <notifications@github.com

wrote:

You are right, this is a bug according to OpenFlow 1.3 (but not for
previous versions).

In OF 1.1. and OF 1.2 the only instruction constraints were that Goto is
the last, and Clear is done before Write. The relation of Write and Apply
was unspecified. When OF 1.3 introduced the Meter instruction, defining the
minimum set of constraints become unfeasible, so a proper ordering was
defined instead. (Which "accidentally" also affects the Write to Apply
relation).


Reply to this email directly or view it on GitHubhttps://github.com//issues/11#issuecomment-12754626.

Eder Leão Fernandes, Jr Researcher
Converged Networks Business Unit
CPqD - Center for Research and Development in Telecommunications
Tel.:+55 19-3705-5932 / Cel.: +55 19-8300-6776

@ederlf
Copy link
Collaborator

ederlf commented Jan 28, 2013

I pushed a fix, where the instruction set is ordered to execute in the specified order. I did some tests and it seems to be working fine.

@YuvalAdler
Copy link
Contributor Author

I opened a new pull request due to a crash on my PC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants