0

Once i had asked about how uploading a file actually works. Based on responses given to me, i was convinced that uploading a file always consists of an initiation process from a private network to outside as it happens on downloading, with a single difference. rather than GET command, POST is used.

But, consider that i have launched a torrent client and lets assume i completed downloading a file. I am gonna seed the file and share with others now.

1) Does not this mean 'uploading' ? which invalidates the case above?

2) If this is 'uploading', isn't it 'a connection/several connections opened from the outside to my private network thus, torrent client requires port forwarding', not a request which we have made?

  In short, who launches the connection during upload process? 
4
  • 1
    If your question is do you "upload" the downloaded file, then the answer is yes (seeding). A lot of torrent applications are uPNP enabled and alot of routers these days will have uPNP enabled too, so a rule is usually automatically added to your router to forward to your machine. Oct 14, 2014 at 18:44
  • 1
    There is no difference between download and uploading when it comes to a torrent file besides the fact one sending the data and the other receives data. There is also no such thing as a "private torrent" be sure to only download/upload data you have the rights to.
    – Ramhound
    Oct 14, 2014 at 18:50
  • Maybe i am unable to express what's confusing my mind. Seeding a file on torrent apps requires port forwarding which is allowing incoming connections from outside to my network which also refers to 'connections started from outside'. However, i was told that even uploading is a connection request from inside. Which one is true?
    – Ozgun S
    Oct 14, 2014 at 18:56
  • Like the first comment, it is used by uPnP. Go make a research on the term and ask again if you're still confused. Oct 14, 2014 at 18:59

2 Answers 2

1

Seeding torrents no longer requires forwarding ports. There are many advanced techniques to “circumvent” NAT, e.g. NAT Hole Punching. Naturally, most of these need a fully connected third party to mutually negotiate.

That being said, in the simplest case, with a port forwarded, the remote side initiates the connection.

You also need to keep in mind that upload and download is just a matter of perspective. This is of course completely unrelated to NAT and whatnot. If you download something from a server, the server uploads something to you. TCP connections work both ways, both the local and remote end send and receive data.

2
  • 1) Who is the remote? the one uploading or the one requesting? 2) you told that it no longer requires port forwarding, though, i still get slow speed by enabling incoming connections on the router even uPnP is activated on the client, why then?
    – Ozgun S
    Oct 14, 2014 at 20:01
  • Remote is always "not you". You need to let go of your concepts of up- and download. How stuff works depends on which protocol you use. With HTTP, it's like you know. But unlike HTTP (a classic client/server protocol), the Torrent protocol is a peer-to-peer protocol, were both sides are "active". As for ports: Forwarding gives better performance, yes.
    – Daniel B
    Oct 14, 2014 at 21:49
0

Uploading works as follows, regardless of the technique used.

First you have a client and a server. The server just listens for any incoming signal.

The client connects to the server saying: "hi, I want to use you." The server responds: "sure, go ahead, and start a connection to this port" (the client now becomes the sender part, instead of the initial job of the server).

The client initiates a command stating to the server that it wants to upload anything, say... a file.

The server accepts and prepares to receive the file.

The client now starts sending the file as how TCP/IP would do it: sending 1 packet waiting for the server to respond that it has received it, then sending the next 2, waiting for the response, etc. This process is continued until the file has been transmitted. This stage is seen as uploading from a client's perspective, and downloading from a server's perspective.

In a torrent it works the same way. You first download the file from different clients who upload their data to you then you start uploading to other clients and they download from you.

A server in a torrent is a machine who keeps track of who has which bits of the file and where someone can download from. Instead of telling to the client, you can download from me, it says, you can download from client x, the same way as it will refer other clients to your client.

Note that with a torrent, you do not start uploading when your download is complete, but rather as soon as you have something to offer. Say you downloaded 10kb of a 1mb file, then someone else can already download those 10kb from you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .