[Twisted-Python] suggestion for a file transfer protocol

I'm trying to develop a simple application that let communicate two computers in a LAN for transferring files. My idea is that: using dbus/zeroconf each machine can see other's service and can connect with it (I need something without authentication or so) having a lan with 2 machines A asks B if he can send a file if B accepts, begin transferring if B refuse, send an error back It would be nice to transfer big files (not loaded all in memory) and the ability to stop/resume the upload/download and the integrity check. Is there a protocol that let me do this stuff or is better to implement a protocol on my own? (I'd like that the system is flexible to further extend for example, implement shared folders and so on) In the latter case it's convenient to use one port or two ports like ftp does?

On 2010.05.11 12:20:27 +0200, Gabriele Lanaro wrote:
I'm trying to develop a simple application that let communicate two computers in a LAN for transferring files. My idea is that:
using dbus/zeroconf each machine can see other's service and can connect with it (I need something without authentication or so)
It's a good concept, as long as all machines are on the same subnet and they all have a zeroconf client installed. I've had very bad experience with the old version of dbus-python that ships with RHEL 5. It just doesn't work reliably. But if you're on a more modern distrobution with newer versions of everything, maybe it'll all work great.
having a lan with 2 machines
A asks B if he can send a file
if B accepts, begin transferring if B refuse, send an error back
It would be nice to transfer big files (not loaded all in memory) and the ability to stop/resume the upload/download and the integrity check.
Is there a protocol that let me do this stuff or is better to implement a protocol on my own? (I'd like that the system is flexible to further extend for example, implement shared folders and so on)
If a pre-built program like scp or rsync doesn't do exactly what you want, and you want the ability to extend it later, then I think it's reasonable to do your own protocol.
In the latter case it's convenient to use one port or two ports like ftp does?
I prefer to only use one port if possible, because it's simpler. And it simplifies dealing with firewalls, if you ever have to do that. As long as you split large files into reasonably small chunks so the data packets don't cause excessive latency for the control packets, it should work fine. -- David Ripton dripton@ripton.net

You can do with Pb and Consumer/Producer. Things that use low level interfaces such as sendfile on linux will be more efficient and you may want to consider setting up an http server and just handing out links. 2010/5/11, Gabriele Lanaro <gabriele.lanaro@gmail.com>:
I'm trying to develop a simple application that let communicate two computers in a LAN for transferring files. My idea is that:
using dbus/zeroconf each machine can see other's service and can connect with it (I need something without authentication or so)
having a lan with 2 machines
A asks B if he can send a file
if B accepts, begin transferring if B refuse, send an error back
It would be nice to transfer big files (not loaded all in memory) and the ability to stop/resume the upload/download and the integrity check.
Is there a protocol that let me do this stuff or is better to implement a protocol on my own? (I'd like that the system is flexible to further extend for example, implement shared folders and so on)
In the latter case it's convenient to use one port or two ports like ftp does?
-- Nosūtīts no manas mobilās ierīces -- Konrads Smelkovs Applied IT sorcery.

Thank you very much for you help, the twisted community is really helpful! For now I'll use PB and ConsumerProducer and if it's not sufficient I'll hack around the BitTorrent protocol (using the twisted implementation in the BitTorrent client). Thank you very much for the help! - Gabriele 2010/5/11 Konrads Smelkovs <konrads@smelkovs.com>
You can do with Pb and Consumer/Producer. Things that use low level interfaces such as sendfile on linux will be more efficient and you may want to consider setting up an http server and just handing out links.
2010/5/11, Gabriele Lanaro <gabriele.lanaro@gmail.com>:
I'm trying to develop a simple application that let communicate two computers in a LAN for transferring files. My idea is that:
using dbus/zeroconf each machine can see other's service and can connect with it (I need something without authentication or so)
having a lan with 2 machines
A asks B if he can send a file
if B accepts, begin transferring if B refuse, send an error back
It would be nice to transfer big files (not loaded all in memory) and the ability to stop/resume the upload/download and the integrity check.
Is there a protocol that let me do this stuff or is better to implement a protocol on my own? (I'd like that the system is flexible to further extend for example, implement shared folders and so on)
In the latter case it's convenient to use one port or two ports like ftp does?
-- Nosūtīts no manas mobilās ierīces
-- Konrads Smelkovs Applied IT sorcery.
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (3)
-
David Ripton
-
Gabriele Lanaro
-
Konrads Smelkovs