rand00 / conntest

MirageOS unikernel to test networking
GNU Lesser General Public License v2.1
17 stars 7 forks source link

Instead of using `Lwt.async` + `Lwt_mvar` when receiving `UDP` datagram, use an `Lwt_stream.t` #4

Open rand00 opened 1 year ago

rand00 commented 1 year ago

This line is currently made async, to avoid the S.UDP.listen callback to block when the conntest protocol is slower than UDP datagrams can be received. If an Lwt_stream was used instead of an Lwt_mvar, there would be no need for this.

As the protocol has an acknowledge mechanism (done each n packets), this stream will be guaranteed not to grow in size indefinately. This just allows the conntest protocol to run a bit out of sync from when UDP datagrams are received.

Switch out these types for the sink field in the Udp_flow.t type

prernadabi23 commented 1 year ago

Hello @rand00, I am an Outreachy applicant. I would Like to work on this issue.

rand00 commented 1 year ago

Hi @prernadabi23 - welcome to the project, that would be great (: Feel free to ask any questions on this issue

prernadabi23 commented 1 year ago

Thank you @rand00, So, how do I proceed with the issue? Do I just have to replace " Lwt_stream" in place of "Lwt_mvar"?

rand00 commented 1 year ago

Have you already tried to compile conntest?

So it's a couple of changes, but the primary one is indeed what you said. If you start to change this type of the sink field, the compiler will help you to see where you need to change things in other places

rand00 commented 1 year ago

Btw. when you want to iterate quickly on compiling a MirageOS unikernel, it's useful not to run mirage configure and make depend (takes a lot of time), but only:

mirage build -f mirage/config.ml
prernadabi23 commented 1 year ago

Is it possible to compile it in Windows or will I have to use Ubuntu/Linux?

rand00 commented 1 year ago

We've had some discussion these days about how to do it on Windows, as many Outreachy applicants use that. I think the easiest solution will be if you install Ubuntu via Windows Subsystem for Linux (WSL). There is a guide here

rand00 commented 1 year ago

As you havn't installed ocaml yet - forgot to mention that we have this Outreachy MirageOS introduction: https://github.com/mirage/mirage/issues/1402