Need to create a file-sharing client like Gnutella, where to start?

I am a newbie and I am excited about how Ruby works :slight_smile:

I am planning to develop a file-sharing client similar to Gnutella using
Ruby. I think I need to learn something related to networking in Ruby
and I am not sure where to start off…

What are the things I should know (related to Ruby) before starting this
project? Can you point me to some good sources to know these things
more?

Any good pointers will be appreciated… Thanks!

FYI, I have Java and PHP background.

Bharadwaj S. wrote in post #1053068:

I am a newbie and I am excited about how Ruby works :slight_smile:

I am planning to develop a file-sharing client similar to Gnutella using
Ruby. I think I need to learn something related to networking in Ruby
and I am not sure where to start off…

What are the things I should know (related to Ruby) before starting this
project? Can you point me to some good sources to know these things
more?

First you need the general concepts: how TCP/IP works, what sockets are
and how to use them, and so on. The relevant classes in Ruby are just
wrappers around the underlying C API. And of course you need to
understand all the security pitfalls of networked applications and how
to avoid them, before exposing your application to the Internet at
large.

I don’t know of a book which teaches those concepts and Ruby programming
at the same time, but perhaps others here do.

The best book I know on the fundamentals of network programming is “Unix
Network Programming Volume 1” by the late Richard Stevens. You are
likely to find this very heavy going if you are new to computing and
programming in general, but you are unlikely ever to outgrow it :slight_smile:

On Sat, Mar 24, 2012 at 3:02 PM, Bharadwaj S.
<[email protected]

wrote:

more?

The best book I know on the fundamentals of network programming is “Unix
Network Programming Volume 1” by the late Richard Stevens. You are
likely to find this very heavy going if you are new to computing and
programming in general, but you are unlikely ever to outgrow it :slight_smile:

hmm… Can you tell me any specific implementation that has been already
done in this area?

Provided that this is for strictly legal purposes, you might want to
checkout the standard library docs.
http://www.ruby-doc.org/stdlib-1.9.3/
http://pleac.sourceforge.net/pleac_ruby/sockets.html

here is one on socket programming

this is a ruby p2p app in six lines
https://groups.google.com/group/comp.lang.ruby/msg/8fc335f67f99536c?hl=en

hope this helps. I really hope this is for research/legal purposes,
which
is my assumption :slight_smile:

Andrew

Brian C. wrote in post #1053069:

Bharadwaj S. wrote in post #1053068:

I am a newbie and I am excited about how Ruby works :slight_smile:

I am planning to develop a file-sharing client similar to Gnutella using
Ruby. I think I need to learn something related to networking in Ruby
and I am not sure where to start off…

What are the things I should know (related to Ruby) before starting this
project? Can you point me to some good sources to know these things
more?

First you need the general concepts: how TCP/IP works, what sockets are
and how to use them, and so on. The relevant classes in Ruby are just
wrappers around the underlying C API. And of course you need to
understand all the security pitfalls of networked applications and how
to avoid them, before exposing your application to the Internet at
large.

I don’t know of a book which teaches those concepts and Ruby programming
at the same time, but perhaps others here do.

The best book I know on the fundamentals of network programming is “Unix
Network Programming Volume 1” by the late Richard Stevens. You are
likely to find this very heavy going if you are new to computing and
programming in general, but you are unlikely ever to outgrow it :slight_smile:

hmm… Can you tell me any specific implementation that has been already
done in this area?

You said that I need to learn concepts like TCP/IP, sockets etc. What
are those other things I need to learn along with them?

Just asking, can this thing be completed in a month duration?
(I have never developed an application before, that’s why…).

Bharadwaj S. wrote in post #1053083:

You said that I need to learn concepts like TCP/IP, sockets etc. What
are those other things I need to learn along with them?

Programming, data structures and algorithms, protocol design (unless you
are writing a client to work with an existing protocol, in which case
you’ll need to study the particular protocol you want to implement).
Then there are cryptographic concepts (for example if you are going to
use a Tiger Tree to identify which parts of the file are to be
transferred), and miscellaneous things like perhaps a GUI toolkit or web
framework, if it needs a user interface.

Just asking, can this thing be completed in a month duration?
(I have never developed an application before, that’s why…).

To do the whole thing from scratch sounds like a tall order to me, but
then again I don’t know exactly what you are trying to produce, or why,
and what level of sophistication or polish you are looking for. I’m
guessing it’s a school project, or else why wouldn’t you just use an
existing file sharing client?

Brian C. wrote in post #1053091:

To do the whole thing from scratch sounds like a tall order to me, but
then again I don’t know exactly what you are trying to produce, or why,
and what level of sophistication or polish you are looking for. I’m
guessing it’s a school project, or else why wouldn’t you just use an
existing file sharing client?

Well, like you guessed it’s a College project… I guess we have to go
with some existing client and protocol for its design. We don’t know
details much about the project, but I guess it’s something like a -
software which is like DC++ but doesn’t require any specific server
allocated for it. After some search, I found that Gnutella is pretty
similar to what we have been told to do and our instructor asked us to
use any Object Oriented language.

Despite knowing Java, I liked Ruby a LOT, and I wanted to try doing this
thing in this comparatively new language.

Do I need to check out some existing implementation of something like
this and start off from somewhere, or Do I need to study all that
(including Ruby and protocols) and start from scratch? Second one
doesn’t seem like a good idea to me, at this point of time.

Any suggestions in this regard? Many thanks for help offered till now!!
:slight_smile:

Bharadwaj S. wrote in post #1053709:

Brian C. wrote in post #1053091:

Do I need to check out some existing implementation of something like
this and start off from somewhere, or Do I need to study all that
(including Ruby and protocols) and start from scratch? Second one
doesn’t seem like a good idea to me, at this point of time.

Any suggestions in this regard? Many thanks for help offered till now!!
:slight_smile:

p2P with udp & tcp socket :
GitHub - preston/journeta: A dirt simple library for peer discovery and message passing between Ruby applications on a LAN.

with drb :
s2s/p2p.rb at master · glurp/s2s · GitHub
(see the code in header…)

Warning with ruby & multicast :
Multicast and windows - Ruby - Ruby-Forum

With JRuby, JGroups framework (java framework) should be easy to use
http://www.jgroups.org/

ZeroMQ shold be good, but i have not try it
Ruby Binding - zeromq

It is very easy to do p2p one a local network.
On internet, firewall and NAT traversing is a challenge!
Upnp should be the solution, but i have not find ressources
in Ruby.

Regis