A functional simulation

50 views
Skip to first unread message

Frédéric Gaillard

unread,
May 6, 2014, 9:43:17 AM5/6/14
to phantom-...@googlegroups.com
First, I want to tell you that I am not a Linux specialist, nor the networks, nor the C language development, just a developer who took the time to read enough material to reach its goal.
I managed to build a network of virtual machines for testing the operation of the C implementation of the protocol phantom.
Some have suggested using AWS to build a simulation and I consider this possibility, but the conditions of free use are such that I would have a few hours per month available for my tests which is not acceptable in a context studied.
At first I did research in network simulators but I found nothing conclusive as I headed towards a virtualization solution. I found a well-suited solution, it is Cloonix: http://clownix.net/
I'm running the simulation on an i5 2500k 8 GiB with 30 VM. Each VM has 200MiB RAM allocated
Before testing the phantom protocol, I checked with a set of programs that IPv6 connectivity working through a tun interface.
I converted the test programs to the POSIX 2011 standard with the same restrictions as in phantom code.
I also used netcat for bandwidth measurements.
The result is mixed, the bandwidth used by each VM is 150MiB before the network stabilizes which is not always the case, some VM never comes to building a tunnel. When it works, I get to have a rate of 200KiB / s which is not unusual in a local network.
There are certainly areas for improvement in this reference implementation, I think a rewrite with java and/or vala.
If you are interested and that this project is not dead, just reply.

Ben Giles

unread,
May 6, 2014, 9:33:26 PM5/6/14
to phantom-...@googlegroups.com
I'm all for continued work on the project. What's your rationale behind a rewrite and further one not in C? I don't have much of an opinion I'm just curious.

--
You received this message because you are subscribed to the Google Groups "Phantom Protocol" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phantom-protoc...@googlegroups.com.
To post to this group, send email to phantom-...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantom-protocol.
For more options, visit https://groups.google.com/d/optout.

Joe Hillenbrand

unread,
May 6, 2014, 11:26:37 PM5/6/14
to phantom-...@googlegroups.com
C is like competing in the MotoGP without a helmet or pads. If you slip up or crash, you're fucked! With the security requirements and implications of a project like this, I wouldn't trust something that wasn't type-safe nor had static guarantees. If I had time to work on this, I would use Haskell or Idris. C is the reason I refuse to use Tor, GNUnet, or Tox.

Vala and Java are not improvements over C. Vala is just a thin wrapper over C and just as unsafe. Java is a monolithic nightmare that has had tons of security issues over it's lifetime and is controlled by an asshole named Oracle. Plus the JVM adds a barrier to distribution, installation, and runnability.

If you still want a fast and reliable systems-level language for a project like this and don't want to learn the benefits of type-safe functional programming, then I recommend Nimrod, Go, Rust, or Julia (in that order).

Good luck.

Frédéric Gaillard

unread,
May 7, 2014, 2:49:14 AM5/7/14
to phantom-...@googlegroups.com
Hi benkant,

As I said, I'm not an expert in C language.
In addition, a complete rewrite seems to me the best way to understand all of the existing code.

Frédéric Gaillard

unread,
May 7, 2014, 3:49:31 AM5/7/14
to phantom-...@googlegroups.com
Hi JoE,

Thank you for your interest. You have a position a little cut on programming languages, but it is only your opinion, not mine. 
"Do not use the C, it's evil," but most operating systems are written in C and Tor also.
"Java is a monolithic nightmare" I2P : https://geti2p.net/en/ is written in Java, but you do not use I2P I guess.
It is easy to criticize individual choices, but as you wrote you do not have time to devote to this work as I believe that my choices are as valid as your opignions.
Regarding the choice of language, I let you see the following links so that you have an idea of what is actually used, not only languages made for and by students who have not yet proven real utility against those existing.

Joe Hillenbrand

unread,
May 7, 2014, 10:06:39 AM5/7/14
to phantom-...@googlegroups.com

Yes, you obviously know more about the subject than me.

Do whatever you want. Make the same mistakes as everyone else and get fucked just the same.

Ben Giles

unread,
May 7, 2014, 3:21:29 AM5/7/14
to phantom-...@googlegroups.com
I can see the appeal in that case. I wonder if the next person that comes along not being an expert in Java will not be able to understand and try a rewrite in something else.

Would a language agnostic formal definition of the protocol be prudent?

Joe mentioned not trusting C code, which I appreciate, but there's more to safety than preventing NOP sled rides and the like. It's at least as important that the protocol is provably correct.

Perhaps not this specifially, but something like it:


That said if you just want to hack away I understand that. A spec is useless if you never get any further.


--

Joe Hillenbrand

unread,
May 7, 2014, 12:00:08 PM5/7/14
to phantom-...@googlegroups.com
If you're looking for provably correct, then a dependently-typed language, like Idris or Agda, would be a good bet.

Here's a great talk on the subject: https://www.youtube.com/watch?v=m6iqZkbG-o4

Frédéric Gaillard

unread,
May 8, 2014, 11:50:15 AM5/8/14
to phantom-...@googlegroups.com
 Thank you friends for all your good jokes. 
At first I tried to take you seriously, but after reading all messages from this group I understood.
As they say in my country "Adviser but not paying."
There are two years, you did not protested against the fact that the POC-implementation is written in C and now it should start from scratch, 
prove that the protocol is mathematically correct using language as Idris then code in nimrod or go.
You spent all this time on a thesis on self-introspection? Too bad it gave enough time to realize what you preach.
Yes this is a joke, and a good one.

Ben Giles

unread,
May 8, 2014, 6:44:36 PM5/8/14
to phantom-...@googlegroups.com, phantom-...@googlegroups.com
I actually think your initial proposal was sound for your purposes. My suggestion for formal definition was to highlight that there's more to correctness and safety than implementation language as was suggested.

If you want to get a handle on the protocol and provide a readable implementation for a good proportion of people your reasoning is sound in my opinion.


grarpamp

unread,
May 15, 2014, 1:26:25 AM5/15/14
to phantom-...@googlegroups.com
If any of your work required patching Phantom
to compile on your platform or to fix bugs, can
you please post those patches both here and
then see about getting them committed?
I guess this applies to anyone working with Phantom
since it would help move things along.
Thanks :)

grarpamp

unread,
May 15, 2014, 1:51:28 AM5/15/14
to phantom-...@googlegroups.com
On Tue, May 6, 2014 at 11:26 PM, Joe Hillenbrand <joeh...@gmail.com> wrote:
> Tox

If you do not mean 'tox.im', 'blog.libtoxcore.so', etc,
can you please provide a link as that project name
is new to me.

If so, Tox may not be a general purpose transport into which
users may plug any IPv6 enabled app like Phantom is. So its
purpose and goals may be different. And there may be some
technical (dht/sybil) or other issues for Phantom to consider,
draw from, and/or avoid in its own development.
http://www.tox-chat.com/
Reply all
Reply to author
Forward
0 new messages