|
From: Blat F. <pet...@ho...> - 2001-03-02 19:15:11
|
>With my new-found confidence in coding, I'd like to implement a network >simulator. (I'll probably do it in MFC, because that's what I use at >work.) Cool. I still remember the gold old days when I used to write code on my Amiga 500. [Erik's design snipped] >Erik has a good design, but I don't want to implement most of those >features >yet. I think that's overkill right now. > >I got the motivation to do the simulator a few days ago, after reading >about >a similar test with Freenet: > >*digs for a link* >http://freenet.sourceforge.net/index.php?page=icsi-revised > >Scroll about halfway down and look for Performance. Nice graphs :-) >I'd like to do those kinds of tests for Blocks. Cool. > >First, I need to understand how Blocks works, in an informal >protocol-inspecific way. >(I had just fired up Visio and opened up some of the files in >libblocks...and had brain-lock. This is going to take some time.) > >At first, I'd like to look at the 'connection' mechanism, irrespective of >routing blocks or bandwidth constraints. I want to confirm that, for an >arbitrary network size and *one* central connection point, can the network >accommodate that number of hosts? When hosts start to leave the network, >will the network fragment? Possibly. This is tied to the number of interconnections between nodes. > >I'll start writing a simulator to answer these questions. What rules >should >the simulator use again? It's been a while: > >1) Messages route no farter than 6 hops Yup, 6 hops max. >2) Hosts advertise themselves to other hosts. (When? How far are they >routed?) They are advertised by other servers when they receive a connection, and by themselves once per hour if they have less than 10 connections. This is to try and stop network fragmentation. >3) When an existing host sees a new host on the network...somebody will >choose to connect to someone else under some condition. (When and under >what conditions?) If we see a server ad from advertising a server which is not immediately adjacent we do the following calculation... x=rand(255)-(16-n)*25 if x>0 we connect to the server >4) What a host has ten or more connections already and a new host connects >to them, the existing host will give the new host a list of possible other >connections and then ask the other host to disconnect. (When will the new >host disconnect, and when will he stay on anyway?) Whenever any server recieves a connection it sends a list of recent server ads to its new friend. The server ads are just a small list (10) of previous servers. The new server ip/port is added then added to the top of this list. > >That should get me started. I'm going to go try to remember how to do a >linked list. :) The fun stuff is the advert routing, but the connection stuff is quite interesting as well. Graphs would be cool! :-) ttfn PG. _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. |