|
From: Michael S. Jr. <m...@ms...> - 2001-03-02 01:01:23
|
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.)
For review, here's a snippet from Erik's original simulator post back in
August 2000:
----cut from Erik----
Here`s a more detailed proposal:
- turn based simulation
- everything that`s unique (adverts, files etc.)
should also have unique representations in the
simulation
- Java, AWT GUI (for visual representation:
canvas with 1 pixel per node, 1 pixel between
each, lines between pixels visualize file
transfers / routes)
- Reason for Java: cross-platform, easy to use
Required data:
global:
- number of good nodes
- readvertising frequency
- individual advert size
- optional: number of bad nodes
- flooders
- DoSers (don`t use Blocks, but
attack a certain IP-can`t be
locked out, might focus on
prominent nodes)
- fakers
- filters
- analyzers / hoppers
- ?
individual:
for these numbers we need a distribution table,
e.g.: 56 kbps; 5%; 64 kbps: 10% ..
or randomly picked from a range:
0-4h:10%; 4-12h:25%
- speed of nodes
- uptime
- number of local files
- file requests / hour
- cache size
- non-ad-routing: how many % don`t route ads?
- "prominence":
how well the nodes are known, e.g.
50-100% know this node:1%
30-50% know this node:4%
10-30% know this node:10%
0-10% know this node:85%
(when a node reconnects, the prominent
connection points are connected to more
often).
- cancel frequency: when and how likely
will the user cancel the download?
when=at which speed threshold, e.g.
at <50% of maximum speed: 1%
at 40-50% of max speed: 3%
..
at 5-10% of max speed: 40%
at 0-5% of max speed: 60%
- ?
Optional:
frustration - after a certain number of cancels
and failed downloads, the user is frustrated
and quits the network. A threshold for this
could be defined.
Implementation:
The nodes are generated as a vector of objects.
In a loop, each nodes can generate several
actions (request, upload, disconnect, continue
downloading of a requested file, cancel, send
advert, send file etc.), actions that regard
other nodes are put in their event queue which
is processed as soon as possible, according to
the bandwidth that the node can use per turn.
Afer one loop is complete, a number of new nodes
is generated randomly and added to the vector.
The display is updated. Repeat on user request
(step by step) or automatically.
Gatherable data:
How many nodes d/l at x % of their max speed?
How many d/ls fail?
What is the average bandwidth required by adverts?
How is it distributed?
Which regions of the network are congested and how
could this be alleviated?
How many evil nodes can we tolerate?
etc.
----end cut from Erik----
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.
I'd like to do those kinds of tests for Blocks.
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?
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
2) Hosts advertise themselves to other hosts. (When? How far are they
routed?)
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?)
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?)
That should get me started. I'm going to go try to remember how to do a
linked list. :)
--Spence
bl...@ms...
|