Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
Software The Internet

p2psim: Roll Your Own P2P Protocol 108

Anonymous Coward writes "p2psim is a free, multi-threaded, discrete event simulator developed at MIT to evaluate and investigate p2p protocols. You can quite easily add your own p2p protocol and compare it with others to make sure it runs well before you write the real thing. p2psim runs in Linux and FreeBSD."
This discussion has been archived. No new comments can be posted.

p2psim: Roll Your Own P2P Protocol

Comments Filter:
  • by tcopeland ( 32225 ) * <(tom) (at) (thomasleecopeland.com)> on Monday November 24, 2003 @12:03PM (#7548091) Homepage
    ...at least, in terms of duplicated code clumps as reported by CPD [sf.net].

    Here's [infoether.com] the report... not bad at all.
    • This tool seems like a stripped down version of NS2 [isi.edu]. With NS2 you can roll your own protocol and implement it using their reasonably powerfull scripting language (oTcl .. pronounce Oh - tickle) or create your own C++ code to do the job. They have every wired protocol I can think of implemented, 95 percent of wireless ones (including some satellite) and it also comes with NAM; a GUI to show you the nodes and flow and such. Runs on *nix and windows with cygwin
      • If concurrency and running your software on multiple hosts in parallel are very important and you don't mind picking up another language, you could try Erlang [erlang.org]. Recent conference proceedings can be found here [erlang.se] and here [erlang.se].

        You don't even have to write your code in Erlang. You could wrap C code with a wrapper which uses sockets to communicate with the rest of the Erlang environment. Erlang runs on *nix, Windows, BSD, VxWorks and Mac OS X.
    • Very interesting. So Robert T. Morris has cleaned up his coding since the days of the Morris Worm [worm.net]

      Read the above link and then read RTM's bio page [mit.edu]. Same guy?

  • by TheBrownShow ( 454945 ) on Monday November 24, 2003 @12:04PM (#7548107)
    Hmmm, both p2p and "rolling your own" are two things that people could make a lot of money off of if they just made it legal :-)
  • by Zanek ( 546281 ) on Monday November 24, 2003 @12:06PM (#7548127) Homepage
    They need to implement older protocols like Gnutella's and Fasttracks.
    It would be interesting to see if there simulator comes close to real world performance of these networks after that !
    Yay, we have networks simulating networks. Kazaa Reloaded !
    • Yay, we have networks simulating networks. Kazaa Reloaded !

      Once I was playing The Sims (Hot Date I believe) and I went to town to pick up some flowers and in one of the stores I found a copy of The Sims. So I had my sim buy the game and install it on his computer, oh the hours of fun my sim had playing The Sims. Thank god it wasn't The Sims Online my sim was playing though, I dont know if my poor athlon could simulate that!

      Anyway I was gonna say something cheeky about neo but I'll leave that for the
    • Speaking of older protocols.

      Can anyone post a summary of the currently used P2P protocols (and the clients that implement them)with some pros and cons of each?
  • by DJProtoss ( 589443 ) on Monday November 24, 2003 @12:08PM (#7548153)
    I mean, does it contain a simulated RIAA that will come and sue you for distribution of copyrighted simulated material?
    • Why bother with a simulated one? I'm sure the real Gestapo.....er.......RIAA will be glad to lend their 'services' to the simulation.
    • I mean, does it contain a simulated RIAA that will come and sue you for distribution of copyrighted simulated material?

      Yeah. It's not so bad though. You can pay them off with monopoly money.
    • by gnu-generation-one ( 717590 ) on Monday November 24, 2003 @03:21PM (#7549868) Homepage
      "How complete is it? I mean, does it contain a simulated RIAA that will come and sue you for distribution of copyrighted simulated material?"

      Anybody who uses genetic algorithms, who 'breeds' computer programs rather than writing them, will tell you that the secret to success is good predators.

      So yes, if you wanted to design a system for rating the quality of P2P protocols, one of the most important steps in that simulation is to have evolving predators, who try and intercept others' data, who try to slow the system down, who try to leech without sharing, etc. A system where data can be traced to an originator might score less than a system resiliant to this kind of attack.

      The testbed mentioned in the article doesn't contain this sort of capability, but if you're involved in designing such networks, then it would be useful to dedicate a lot of effort to trying to attack the protocol using RIAA methods.

      Read more [infoanarchy.org] about what a P2P application should have in its design.

  • by Chris_Jefferson ( 581445 ) on Monday November 24, 2003 @12:08PM (#7548154) Homepage
    I've seen this program a short while ago, so feel I can comment :)

    While it is a good idea, and can be worked on it does have some small problems, mainly that it isn't quite "dirty" enough. It tends to believe people will behave better than you'd expect them to, not be evil leechers and also not have very dodgy net connections which go up and down every 10 minutes (which to be fair happens to alot of people on ADSL and such like, their uploads get saturated and all their download connections drop because their ACKs aren't getting out)

    Having said that, this is a good program, and I hope will be improved as one of the hardest parts about p2p networks is keeping up a good solid network without it taking up a significant proportion of the network, and nowadays few people want to risk running a server if they can avoid it...
    • by jd ( 1658 )
      They probably assume you'll use their RON (Robust Overlay Network) software. :)


      Of course, you can always use ns-2 to simulate the low-level nuts-asnd-bolts, and use its noise generator to dirty the connections.

  • by ospirata ( 565063 ) on Monday November 24, 2003 @12:08PM (#7548159)
    Does p2psim simulates RIAA suing you? This would be the "de facto" p2p simulator.
  • by the real darkskye ( 723822 ) on Monday November 24, 2003 @12:11PM (#7548196) Homepage
    Do you have to pay a virtual SCO for every virtual linux node on the virutal network?

    Its a virtual post, but I have karma to burn off.
  • Here's an idea (Score:5, Interesting)

    by shish ( 588640 ) on Monday November 24, 2003 @12:12PM (#7548200) Homepage
    How about, instead of having a few dozen networks, we just come up with one? It works fine for things like the phone system and email (even though there're seperate companies, they're one network), so why not just have one protocol with everything built in?
    • Re:Here's an idea (Score:4, Insightful)

      by gorilla ( 36491 ) on Monday November 24, 2003 @12:20PM (#7548300)
      That works fine, if there are only one set of goals. But if you have more than one set of goals, you'll find that if you optimize for one set, you'll make it worse for the other set.
    • Re:Here's an idea (Score:5, Interesting)

      by SkArcher ( 676201 ) on Monday November 24, 2003 @12:28PM (#7548383) Journal
      Patience grasshopper, such is inevitable, but it will take some time

      Look at the english railways - for a long time, seperate companies used their own parallel rail network, often running different gage track (different width) and having to step around one anothers infrastructure, creating clumsy and non user friendly railway stations and services.

      Eventually rail regulation came in, standardising all rail networks to one standard gage, allowing rolling stock and engines to work on any rail companies track and making the whole exercise better for customers and more profitable for the companies.

      Sooner or later, p2p filesharing (and maybe chat client) protocol will become standardised, and it will simply be a matter of which piece of software you use to connect to a complete network.

      Mind you, it'll probably be the one without any advertsising, and will lead to the end of civilisation as the marketing droids know it, but some sacrifices must be made for the good of the internet :)

      Wow! Look at that, a transport analogy for the internet and computers that isn't about cars! Thats got to be a first :)
      • Re:Here's an idea (Score:1, Insightful)

        by Anonymous Coward
        Whatever you do, don't look at the American railroad system. Which fell apart because the federal government paved interstates everywhere and let freight trucks run pretty much for free on them.
      • Wow! Look at that, a transport analogy for the internet and computers that isn't about cars! Thats got to be a first :)

        As a Brit and regular victim of the rail service here I'd suggest not using them as an analogy of anything you want to get better :)
      • One must learn the Tao of innovation.

        Unfortunately standards are not usually able to break free from the force of mediocracy due to concerns about compatibility and current limited toolsets. Because of this, as soon as a standard is set, another cutting-edge technology will probably ignore the standard and introduce greater functionality at a reduced compatibility and with the burden of requiring a new toolset.

        Take railroads for example....a quick google search on railroad standards will land you on this
      • Look at the english railways - for a long time, seperate companies used their own parallel rail network, often running different gage track (different width) and having to step around one anothers infrastructure, creating clumsy and non user friendly railway stations and services.

        Eventually rail regulation came in, standardising all rail networks to one standard gage, allowing rolling stock and engines to work on any rail companies track and making the whole exercise better for customers and more profitabl
    • Because nobody's trying to sue the PSTN or SMTP providers out of business. It's also easy for those two protocols to be tapped if somebody is suspected of doing something illegal with them.

      P2P is currently trying to accomlish two goals, moving files arround, and also hiding identities...

      • But even person to person messaging (which SMTP is an example of) isn't a single protocol. SMTP, the various IM protocols, and even the crufty old talkd protocol are all different solutions for the same problem - send a message from one person to another. Each of them has different optimizations, with SMTP being best for reliability, IM being best for speed and not caring about where a user is connect, and talkd being best for speed but without having to have a server, but with knowledge of where a user is
    • kazaa and others have a 'fasttrack' network, but they are not secure(and not anonymous, for that matter). The problem with 1 network is that you are limited to the features of that network... give it some time, and then lets look at a unified p2p network
    • by cgenman ( 325138 ) on Monday November 24, 2003 @02:41PM (#7549538) Homepage
      P2P as a network protocol is evolving into something that actually works, as opposed to the state that it was at previously. It used to be that you connected to a single fault point, selected a single file from another user, and began downloading. Oh, do that while praying that neither of you got be cut off.

      Then download resuming was added. Gnutella removed the central point of failure. Downloading from multiple sources was added. Kazaa added the concept of the supernode. eDonkey allows you to upload files that you haven't finished downloading yet. Soon we will probably see beginning-of-download randomization, so that complete files can be downloaded on a network even if nobody has finished getting it yet. .torrent is adding accountability to the mix, which adds great legal uses, along with better HTML integration.

      What more will we see in a protocol? Who knows. Encryption? Better IM capabilities? Webcams? Plug-ins? Preview from remote computer? While we still haven't figured out what the parameters of the network should be we shouldn't agree on the holy standard of the one true network.

      "If we knew what we were doing it wouldn't be research"

      • i would suggest encryption... somewhere between freenet and kazaa lies a nice medium, of a funtional yet secure p2p network...

        one other cool thing about freenet, that is interesting is that it has 'freesites' or basicly, webpages that are distributed over the network... imagine a bittorrent world wide web, over an encrypted connection. Fast, distributed, secure. SWEET.
      • There are technological challenges to be overcome, but that's just work. But I expect political/legal issues will begin to play a role also. Technically, there's nothing stopping you from building a spark gap transmitter. Legally, you're not allowed to. Technically, you could mix up a batch of high explosives to help you mine your back yard. Legally, I wouldn't recommend it.

        Who's going to write these laws? The people who get the most votes. Who's going to vote for them? Will they think about or pri
    • ...or how about at least give the creator of a P2P community a framework to help him build one from scratch, and pick and choose specific protocols and other attributes based on his/her needs? Ideally not much programming knowledge should be required.

      Check out our U-P2P [sf.net] effort, it is going in that direction.

    • How about, instead of having a few dozen networks, we just come up with one?

      <SHAMELESS AUTO ANALOGY>
      Try this on for size:

      How about, instead of having a few dozen models of cars, we just come up with one?

      </SHAMELESS AUTO ANALOGY>

      So, would it be a four door sedan? 18-wheel rig? California convertible? With my five kids, that one four-door, 18-wheel, convertible California convertible car had better seat seven!

      I'm reminded of a Simpsons episode where Homer is given the chance (by a long lo

    • " How about, instead of having a few dozen networks, we just come up with one? It works fine for things like the phone system and email (even though there're seperate companies, they're one network), so why not just have one protocol with everything built in?"

      I can tell you the exact reason why this won't happen.

      The RIAA

      P2P as we know it today has evolved around the need to constantly evade whatever measures the RIAA comes up with. It's an electronic cold-war so to speak. While it may be a good thing for

  • Protocol Stub (Score:5, Informative)

    by Lizard_King ( 149713 ) on Monday November 24, 2003 @12:17PM (#7548275) Journal
    In addition to a cool sim, p2psim gives you a stubbed out protocol to play around with. Build your own and guage efficiency! Check it:

    protocols/sillyprotocol.h and protocols/sillyprotocol.C contain the outline of a new, but unimplemented peer-to-peer protocol. Implement join() and lookup() to your liking. Look at the other protocols (in the protocols/ directory) for more example code. Then run your SillyProtocol as follows:

    p2psim/p2psim example/silly-prot.txt example/silly-top.txt example/silly-events.txt


    Kudos to a great release and the promotion of additional research and general purpose learning.
  • Meta p2p? (Score:4, Insightful)

    by Pope Raymond Lama ( 57277 ) <gwidion@NospAM.mpc.com.br> on Monday November 24, 2003 @12:53PM (#7548576) Homepage
    I imagine the technology used to simulate p2p netwroks can also be embeded in an app that could have a dynamic user configurable protocol one could change on the fly.

    That would be the ultimate chaotic p2p network, and would be something ultimately funny to see go live.
  • by mcc ( 14761 ) <amcclure@purdue.edu> on Monday November 24, 2003 @01:04PM (#7548692) Homepage
    Does anyone know what a good sort of p2p "kit" is, say if you want to include p2p networking (like, the ability to create and work with a self-managing p2p network) in an application but don't want to write your own p2p protocol/network code?

    I know there must be a couple. What are some good ones?

    I heard Sun has one? What's it called? "JXTA"? Has anyone worked with that, is it any good? Can it work with nodes that are behind NAT?
    • by yaphadam097 ( 670358 ) on Monday November 24, 2003 @01:54PM (#7549117)

      I heard Sun has one? What's it called? "JXTA"? Has anyone worked with that, is it any good? Can it work with nodes that are behind NAT?

      I am just starting a project using JXTA. So far I am very impressed with the technology, although it is perhaps a bit bloated (This is my impression of the code and is not based on any comparison with other P2P protocols, since I haven't used any others ;-) JXTA does support tunneling over HTTP which gets you around most firewalls and NAT and such. It also has a real interesting architecture where certain nodes can be promoted to act as relays. Among other uses, this could allow a public machine to act as a proxy for messages to peers behind a firewall/NAT.

      • Yeah JXTA's nice, but you still need to do some programming to get something useful out of it, as it is a framework, not a network per se. It has indeed a nice pipe-based architecture.

        I'm being redundant with my a previous post of mine, but you might want to check out U-P2P [sf.net]. You can set up a Napster-style P2P network without any programming. We're working on a Gnutella adapter too.

  • by gerf ( 532474 ) <edtgerf@gmail.com> on Monday November 24, 2003 @01:07PM (#7548718) Journal
    Can someone have some AI build a better P2P? Once you think about it, wouldn't that be the easiest way to come up with the next bestest efficient P2P protocol?
  • I have a great new P2P protocol. You get instant exchange of 10's of CD's at a time. It's called "in person". Generally, you have to provide money to the other person, e-mailing back and forth, etc. They burn you the CD's you want, and then you meet "in person", and exchange the money for their time in producing the CD's for you. It's great!
  • MITs p2psim is a little late on the scene - check out all the other p2p sims available in the summary paper in the p2pjournal: http://p2pjournal.com/issues/November03.pdf Think about using the NeuroGrid simulator if you want to simulate something other than just a boring DHT :-)

Mathematics is the only science where one never knows what one is talking about nor whether what is said is true. -- Russell

Working...