google / gopacket

Provides packet processing capabilities for Go
BSD 3-Clause "New" or "Revised" License
6.27k stars 1.12k forks source link

openflow support #58

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
How the best add openflow support to gopacket?

I can create decoder for openflow that cat switch based on header version to 
next decoder specific to header openflow version. Does it right?

Original issue reported on code.google.com by v...@selfip.ru on 26 Jan 2015 at 11:46

GoogleCodeExporter commented 9 years ago
I think that sounds like a good approach, yes.  Feel free to send me some code, 
and I can review it and let you know.

Original comment by gconnell@google.com on 26 Jan 2015 at 5:53

GoogleCodeExporter commented 9 years ago
Thanks. I'm write some code (prepare for all stuff, copy/paste from 
specification).
https://github.com/vtolstov/gopacket-openflow/blob/master/layers/openflow.go

Firstly type Openflow struct {...} 
Each openflow message can contains some actions and messages, But each Action 
have distinc payload. All action have only header that contains type and len, 
all other fields determine by action type. How can i deal with this?

I need to create ActionOutput, ActionEnqueue and so types, that have 
ActionHeader type? or i need to create Action like interface and each Action 
type need to satisfy this interface... ?

Original comment by v...@selfip.ru on 26 Jan 2015 at 9:23

StephenKing commented 9 years ago

Hi, openflow would be interesting for us. What do you think, how much work it is to finish the parser? I'm thinking of letting a student work on a project that makes use of this library and analyzes OpenFlow traffic.

StephenKing commented 9 years ago

Ping @vtolstov

gconnell commented 9 years ago

I currently don't have the cycles to work on this, but I'd be happy to review code to support it.

vtolstov commented 9 years ago

I'm add basic pr #58 to allow commenting on it.

notti commented 5 years ago

pr #93 is the current startig point for this issue

notti commented 5 years ago

If anyone wants to give it a try, #93 could be used as base.

lebauce commented 5 years ago

FYI, I started an implementation based on loxigen : https://github.com/lebauce/goloxi

Usage of this library to register a gopacket layer type can be found here : https://github.com/lebauce/skydive/blob/openflow-gopacket/flow/layers/openflow.go

vtolstov commented 5 years ago

@lebauce hi! do you need some help?

lebauce commented 5 years ago

Testing it would be super helpful (I only tested it against Openvswitch)

vtolstov commented 5 years ago

can you create pr? i can test it and provide feedback?

lebauce commented 5 years ago

All the logic is in https://github.com/lebauce/goloxi (which is a generated using https://github.com/lebauce/loxigen), only the layer type would be in the gopacket repository ~ 150 lines. It seems that, for now, all the gopacket decoders reside in the repository itself. It would be the first layer that makes use of an external library for parsing. @gconnell What do you think ?

lebauce commented 5 years ago

@vtolstov That been said, I can definitely create a branch so that you can test it. Feedback would be very much appreciated.