Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

a network simulator in perl

by howard40 (Beadle)
on Mar 01, 2001 at 08:55 UTC ( [id://61516]=perlmeditation: print w/replies, xml ) Need Help??

for a long time i've been batting the ideas around in my head for a sort of "network simulation" in perl... not anything for anaylzing and debugging real-world networks, but rather a simplified toy to play with, where you could have a few "nodes", link them together with certain types of "connections" and then assigning traffic values to the nodes and see how the model would handle routing traffic in between the nodes, where hangups and jams would occur... etc....

a way of simulating simplified models of real world networks for fun... perhaps it could even be turned into a game of sorts, where traffic spikes would occur at random times at random points of the network, and you had to race to add more connections, or reroute traffic before any one of the nodes became swamped and stopped reponding... hehe

oh well... i haven't seen any stragegy games about the internet (or networks in general), and i was curious if anyone else has seen anything remotely similar to that... i love sim games, and it would be a great challenge to impement one in perl

Replies are listed 'Best First'.
Re: a network simulator in perl
by gumpu (Friar) on Mar 01, 2001 at 13:57 UTC

    If you like sim games you might want to try Galaxy. It's basically a turn based war game set in a large galaxy. However there is also a economic component. This is based on shipping cargo from planet to planet, in order to inhabit and develop uninhabited planets.

    You can set-up automatic routes between planets that make ships, ship cargo back and forth. The routes can be seen as internet routes and the ships as network packets. It's quite a challenge to do the economic development well. There are different kinds of cargo, and you can design different kind of ships, speedy ones or one slow ones with a big cargo bay.

    It's all in C but it should be fun to make something similar in Perl

    Have Fun

      An addition for the idea of gumpu, I also like this kind of game. I had a look but all of them are coded in C.
      I was thinking to make a Perl version just for fun, but I always stuck when it came to AI or economical/fight simultation.

      lmarecha
Re: a network simulator in perl
by jepri (Parson) on Mar 02, 2001 at 01:18 UTC
    There was in fact a board game, produced by (I think) Steve Jackson games. It was called Hackers, and was great fun. Out of print now, I recommend finding a copy. It was a err.. sort of network simulator. Yes. Definately a simulator :)

    The only trouble with trying to find it on the net is that you end up with a lot of links to this fascinating article.

    Your game sounds like a good idea! I'd like to see it when it's done.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

Re: a network simulator in perl
by rpc (Monk) on Mar 01, 2001 at 23:12 UTC
    I think this would be pretty easy to do with Linux's tuntap device: a userland interface to ethernet interfaces.
    This allows you to use a filehandle (/dev/tunX) to write raw packets to the wire.
    You could have a Perl daemon that creates/maintains several nodes on your network, each listening on a separate IP..or something :)

    Relevant dox can be found in /usr/src/linux/Documentation/network/tuntap.txt

      oh no no :)

      i was talking about a network simulator purely for fun, not utilizing any networking hardware or making any actual connections over any real networks... kind of like the galaxy game, only stripped down... the planets are nodes, and wires can be strung between the planets, carrying cargo (bits), and you can play with the system, to see how it reacts to new nodes, new connections, or knocking out connections in certain places ...

      i love simulators... like simcity... :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://61516]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-26 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found