frenetic-lang / ocaml-packet

Serialization for some common network packets, including ethernet frames, IP, TCP, and ARP.
Other
10 stars 2 forks source link

Protocol Factorization (DNS) #26

Open dsheets opened 10 years ago

dsheets commented 10 years ago

I noticed that DNS packet processing was added in #6. Is there any plan for separating protocol parsers/marshalers into libraries of their own? We also have mirage/ocaml-dns which contains a number of missing features like packet decompression support.

Do you foresee ocaml-packet's protocols being factored into libraries of their own? Would you consider using some or all of ocaml-dns? If you're not satisfied with ocaml-dns (I'm not either...), what could change to make it more usable to you? Is there some common core of functionality that both projects could use? ocaml-dnsproto?

reitblatt commented 10 years ago

Cool! Actually, @adferguson is the only one using DNS AFAIK, so he has a better understanding of the use case. I'd love to reuse your DNS (and other app level) library, but since we currently don't have any code using it, it's really hard to answer your question/not high on the current priority list.

adferguson commented 10 years ago

hi David,

given that DNS is such a difficult protocol to implement "correctly" (if there even is such a thing), indeed, it is almost certainly worth re-using ocaml-dns if it has been battle-tested already.

for my use cases (*), I only need the protocol, and not the client library and server implementations which ocaml-dns provides. also, my initial use case was actually mDNS, which is almost exclusively UDP-based and bans many of the exotic features of the DNS protocol; hence, it was much easier to just write the little bit I needed.

anyway, if there were an "ocaml-dnsproto" which simply exposed an interface to serialize & parse to/from Cstruct so it can interact nicely with the existing code here, then that would definitely be the best way forward since I'm unlikely to expand upon the little bit of DNS support here except as needed. in the near term, I expect to ensure I can answer basic A records with this code (to redirect "guest" network clients to a login page, as at an airport or hotel), but that's really all.

thanks, Andrew

(*) and quite likely also for others using this library, since it is directed at authors of OpenFlow controllers.

arjunguha commented 10 years ago

Yeah, it would be best to reuse their code. I'd actually like to see ocaml-openflow break its dependency on packet. It is only used to parse the body of a packet_in message, which we simply shouldn't do in ocaml-openflow. Let Frenetic and FlowLog parse the packet_in body using whatever combination of libraries suits them.

jnfoster commented 10 years ago

We should also talk about unifying the two ocaml-openflows?

-N

On Fri, Jan 10, 2014 at 9:58 AM, Arjun Guha notifications@github.comwrote:

Yeah, it would be best to reuse their code. I'd actually like to see ocaml-openflow break its dependency on packet. It is only used to parse the body of a packet_in message, which we simply shouldn't do in ocaml-openflow. Let Frenetic and FlowLog parse the packet_in body using whatever combination of libraries suits them.

— Reply to this email directly or view it on GitHubhttps://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033593 .

arjunguha commented 10 years ago

there is only one ocaml-openflow

what

On Fri, Jan 10, 2014 at 10:00 AM, Nate Foster notifications@github.comwrote:

We should also talk about unifying the two ocaml-openflows?

-N

On Fri, Jan 10, 2014 at 9:58 AM, Arjun Guha notifications@github.comwrote:

Yeah, it would be best to reuse their code. I'd actually like to see ocaml-openflow break its dependency on packet. It is only used to parse the body of a packet_in message, which we simply shouldn't do in ocaml-openflow. Let Frenetic and FlowLog parse the packet_in body using whatever combination of libraries suits them.

— Reply to this email directly or view it on GitHub< https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033593>

.

— Reply to this email directly or view it on GitHubhttps://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033771 .

adferguson commented 10 years ago

https://github.com/mirage/ocaml-openflow

adferguson commented 10 years ago

note that the original repo has newer commits: https://github.com/crotsos/ocaml-openflow

arjunguha commented 10 years ago

oh i thought he was referring to the lwt/async distinction

On Fri, Jan 10, 2014 at 10:08 AM, Andrew Ferguson notifications@github.comwrote:

https://github.com/mirage/ocaml-openflow

— Reply to this email directly or view it on GitHubhttps://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32034524 .

jnfoster commented 10 years ago

Look, I like Highlander as much as the next guy but...

https://github.com/crotsos/ocaml-openflow

On Fri, Jan 10, 2014 at 10:06 AM, Arjun Guha notifications@github.comwrote:

there is only one ocaml-openflow

what

On Fri, Jan 10, 2014 at 10:00 AM, Nate Foster notifications@github.comwrote:

We should also talk about unifying the two ocaml-openflows?

-N

On Fri, Jan 10, 2014 at 9:58 AM, Arjun Guha notifications@github.comwrote:

Yeah, it would be best to reuse their code. I'd actually like to see ocaml-openflow break its dependency on packet. It is only used to parse the body of a packet_in message, which we simply shouldn't do in ocaml-openflow. Let Frenetic and FlowLog parse the packet_in body using whatever combination of libraries suits them.

— Reply to this email directly or view it on GitHub<

https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033593>

.

— Reply to this email directly or view it on GitHub< https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033771>

.

— Reply to this email directly or view it on GitHubhttps://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32034381 .

arjunguha commented 10 years ago

that's the one with music by Queen, right?

On Fri, Jan 10, 2014 at 10:13 AM, Nate Foster notifications@github.comwrote:

Look, I like Highlander as much as the next guy but...

https://github.com/crotsos/ocaml-openflow

On Fri, Jan 10, 2014 at 10:06 AM, Arjun Guha notifications@github.comwrote:

there is only one ocaml-openflow

what

On Fri, Jan 10, 2014 at 10:00 AM, Nate Foster notifications@github.comwrote:

We should also talk about unifying the two ocaml-openflows?

-N

On Fri, Jan 10, 2014 at 9:58 AM, Arjun Guha notifications@github.comwrote:

Yeah, it would be best to reuse their code. I'd actually like to see ocaml-openflow break its dependency on packet. It is only used to parse the body of a packet_in message, which we simply shouldn't do in ocaml-openflow. Let Frenetic and FlowLog parse the packet_in body using whatever combination of libraries suits them.

— Reply to this email directly or view it on GitHub<

https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033593>

.

— Reply to this email directly or view it on GitHub<

https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033771>

.

— Reply to this email directly or view it on GitHub< https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32034381>

.

— Reply to this email directly or view it on GitHubhttps://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32034944 .

jnfoster commented 10 years ago

http://www.youtube.com/watch?v=VEJ8lpCQbyw

On Fri, Jan 10, 2014 at 10:14 AM, Arjun Guha notifications@github.comwrote:

that's the one with music by Queen, right?

On Fri, Jan 10, 2014 at 10:13 AM, Nate Foster notifications@github.comwrote:

Look, I like Highlander as much as the next guy but...

https://github.com/crotsos/ocaml-openflow

On Fri, Jan 10, 2014 at 10:06 AM, Arjun Guha notifications@github.comwrote:

there is only one ocaml-openflow

what

On Fri, Jan 10, 2014 at 10:00 AM, Nate Foster < notifications@github.com>wrote:

We should also talk about unifying the two ocaml-openflows?

-N

On Fri, Jan 10, 2014 at 9:58 AM, Arjun Guha < notifications@github.com>wrote:

Yeah, it would be best to reuse their code. I'd actually like to see ocaml-openflow break its dependency on packet. It is only used to parse the body of a packet_in message, which we simply shouldn't do in ocaml-openflow. Let Frenetic and FlowLog parse the packet_in body using whatever combination of libraries suits them.

— Reply to this email directly or view it on GitHub<

https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033593>

.

— Reply to this email directly or view it on GitHub<

https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32033771>

.

— Reply to this email directly or view it on GitHub<

https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32034381>

.

— Reply to this email directly or view it on GitHub< https://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32034944>

.

— Reply to this email directly or view it on GitHubhttps://github.com/frenetic-lang/ocaml-packet/issues/26#issuecomment-32035030 .