Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Small Peer to Peer Program for school (http://www.programmingforums.org/showthread.php?t=8775)

bigguy Mar 8th, 2006 10:49 PM

Small Peer to Peer Program for school
 
Hello everybody. My teacher asked me to try and mak a small p2p program where students could dl their projects from home and work on them. This is what I'm needing so far.

1. Allow peopel outside to search all the computers on the network that has the p2p program installed. I don know how to do this I need the results to display in a listbox and then the user can dbl clikc them and it will start to dowbload to the My Projetcs Folder. Then I need it where if for some reason the computers are turned off and no1 can search ofr them then any1 who is online and has the progrsam installed and has what the person is searching for i will be able to download form them?

If you don't understand let me know because I dont think I was very clear.
lol Thanks again yall

ReggaetonKing Mar 8th, 2006 11:04 PM

Good luck with this one man!

bigguy Mar 8th, 2006 11:59 PM

Thanks alot.

HOW ABOUT NEXT TIME YOU HELP A LIL BIT????? HMMM? THINK YOU CAN DO THAT????? WHY I OUGHTA.

No I'm joking I know this is prolly gonan be hard, but it could be fun to. Thanks again, Try to leave me soem help next time though.lol

Infinite Recursion Mar 9th, 2006 8:07 AM

I'd probably go with C# for this.... but its just a personal opinion.

Quote:

1. Allow peopel outside to search all the computers on the network that has the p2p program installed. I don know how to do this
You could scan the network for the port that your program is using, and if that port is open and listening place them in a list of systems that are running the software.

Quote:

I need the results to display in a listbox and then the user can dbl clikc them and it will start to download to the My Projetcs Folder.
When you double click a system in the listbox, that system will process the request and send the file to the IP address where the request originated... which in turn will be saved to the specified directory - in binary.

Quote:

Then I need it where if for some reason the computers are turned off and no1 can search ofr them then any1 who is online and has the progrsam installed and has what the person is searching for i will be able to download form them?
You could have a central database where fully qualified domain names are stored of systems that are running your software... also a field that tracks the locations of the boxes so that the user can select one in close proximity.


Maybe that's enough to get you started.

bigguy Mar 9th, 2006 8:25 AM

I don't want to have a centralized server. I want it where it will search EVERYBODY or EVERYTHING that is online that has the program. I don't know if yall have heard of a p2p called Ares but thats what it does. it just searches all the computers that has the program installed looks in My Shared Folder, and then displays results in the Listbox

Also i dont know C# you think vb.net would be ok?

King Mar 9th, 2006 10:04 AM

VB.Net will probably get the job done. I am assuming you know sockets in VB? If not you have a lot of learning to do. You might also want to learn how to read/write to a database in VB using SQL statements. I have no clue what your programming level is, but that project would be a huge for one person.

Arevos Mar 9th, 2006 10:11 AM

Quote:

Originally Posted by bigguy
I don't want to have a centralized server. I want it where it will search EVERYBODY or EVERYTHING that is online that has the program.

It is impossible to get such robustness in a completely decentralised P2P network amongst home computers. Unlike servers, which say online near 100% of the time, users often turn their computers off for long periods. This results in loss of connections that will inevitably result in loss of network integrity.

Even creating a P2P network that manages to route most of the packets, most of the time, is not an easy task. Routing algorithms that allow for both redundacy and efficiency are not something a beginner can get to grips with straight away. Decentralised P2P networks are not trivial to develop.

jayme Mar 9th, 2006 10:27 AM

Quote:

Originally Posted by bigguy
I don't want to have a centralized server. I want it where it will search EVERYBODY or EVERYTHING that is online that has the program. I don't know if yall have heard of a p2p called Ares but thats what it does. it just searches all the computers that has the program installed looks in My Shared Folder, and then displays results in the Listbox

Also i dont know C# you think vb.net would be ok?

You obviously don't understand how p2p works. ALL p2p networks require a centralized server. All peers first connect to a centralized server, opening the required ports of each peer. The server then sends a list of all the other connected peers. Once this is done, the connection between the central server and all the peers stays open, but the data being sent between peers doesnt need to be passed through the central server. This is also known as decentralized communication. I'm not going to explain it because it would be a lot easier to just google for it. Go look at a few p2p programs, since they are almost all open-source for legal reasons. Here's a little picture that might give you an idea if you can understand it.

http://img357.imageshack.us/img357/5015/untitled4hd.jpg
The first connection made is between the peer and the central server, after that, each peer has an open connection between one another, allowing data to pass through the network even if you have a router or in some cases, a firewall. Think of msn, aim, or any other messenger program. They use this method for sending files to one another so that the central msn server(s) don't get any of the load.

Arevos Mar 9th, 2006 10:57 AM

Quote:

Originally Posted by jayme
You obviously don't understand how p2p works. ALL p2p networks require a centralized server.

This is incorrect. There are a great number of P2P networks that require no centralised server. In such P2P networks, the user must connect through an IP address of a node already on the network. Often, one can find a long list of almost-always-on nodes compiled by volunteers. When given such a list, the P2P program tries each IP address in turn until it succeeds in getting at least one connection. Once a connection has been made, the P2P program can then integrate itself in an ad-hoc fashion into the network.

However, the problem with the approach is that it requires a lot of redundancy. You need at least one of the peers on the list to accept connections. In a large P2P network with millions of nodes, and a list of thousands of "gateway" IP addresses, this poses no problem. On a smaller network, more problems arise.

MBirchmeier Mar 9th, 2006 11:37 AM

Quote:

Originally Posted by Arevos
This is incorrect. There are a great number of P2P networks that require no centralised server. In such P2P networks, the user must connect through an IP address of a node already on the network. Often, one can find a long list of almost-always-on nodes compiled by volunteers. When given such a list, the P2P program tries each IP address in turn until it succeeds in getting at least one connection. Once a connection has been made, the P2P program can then integrate itself in an ad-hoc fashion into the network.

However, the problem with the approach is that it requires a lot of redundancy. You need at least one of the peers on the list to accept connections. In a large P2P network with millions of nodes, and a list of thousands of "gateway" IP addresses, this poses no problem. On a smaller network, more problems arise.

I would argue that this supports Jayme's argument actually. The list of volunteers are essentially nodes, that have chosen to behave as a centralized server (or in this case centralized servers), I guess that in essence makes them a series of de-centralized servers, but either way a lot of information needs to be known, and is usually stored in one easy to access place.

Aside from the argument of whether or not something is truly a 'centralized' server perhaps you could get around this restriction by using a pre-existing centralized server. Google Talk (Google chat?) uses an open standard, and I'd imagine if you took the time and effort layering a P2P transfer on top of the existing framework, something similar to Aol Instant Messengers (AIM) file swap.

-MBirchmeier
note: I know in early version of AIM such a transfer was possible, in addition to 'send' file functionality a 'get' file functionality could be setup as well to keep a direcotry of shared files. I believe this functionality was at one time removed for security reasons, but it may have been added back in since.


All times are GMT -5. The time now is 7:42 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC