What happens when I download the same torrent file using BitTorrent in two different pcs and using the same internet connection? - bittorrent

If I have two laptops and connect them to the same internet connection then download the same torrent file using a BitTorrent software, what do the trackers see? and how will the torrent software behave??
Let's say in Laptop A I start downloading the torrent file then after 30 minutes, I download the same torrent file on Laptop B.
Will the two laptop become peers and send each other data? Will Laptop B get data from Laptop A?
Will the trackers in the torrent file think that there is only one laptop/one peer trying to download the file?
Or will the tracker only see one public IP address since they are using the same internet connection?

Will the two laptop become peers and send each other data? Will Laptop B get data from Laptop A?
Assuming that two BitTorrent clients are behind the same NAT:
If the torrent is public (the private flag is not set) and both clients support
Local Peer Discovery, they can find each other that way.
If the NAT support Hairpinning and preserve the same external and internal port for at least one of the clients, there is a good chance that they can connect to each other that way too.
Will the trackers in the torrent file think that there is only one laptop/one peer trying to download the file?
Or will the tracker only see one public IP address since they are using the same internet connection?
They will share the same IP. If the tracker can differ between them with the help of the port they connect from and the different peer_ids they use, depends on the specific implementation the tracker use.

Related

While working, How do you share codes, files between two devices?

While working, I'm always having problems related to data sharing.
For example:
I have a computer connected to the printer but my laptop is not and I want to print a file, how do I easily move that file to the printer computer?
How to share a file from my mobile to laptop?
What I'm doing right now is moving the file using a USB disk, e-mail address or facebook.
You as developers, what are you doing for such purposes?
What I do is using network because its fast and safe.
But if I have a good internet connection I would suggest you to use Ziggs.io - Smoothly Share Content Between Devices.
The bad fact about Ziggs is that you need an internet connection to use it.
What I like about it that you don’t have to register, you can share files up to 500 MB per file and they don’t store messages.
More about Ziggs from their website:
What is Ziggs?
Ziggs is a platform that exists to facilitate peoples communications
Ziggs is like a meeting point with your devices, it helps you to
transfer contents between these devices smoothly.
Drag-and-drop PDFs,
images, videos, APK apps and other files directly into Ziggs.
Messages
are delivered directly from your device to the connected clients.
Ziggs doesn't store any type of data and doesn't require your personal
information.
Ziggs uses smart solutions based on client-side to share channel conversation history with new clients.
Exists channel clients will act as seeds, helps new clients to follow up with the conversation.
I've built my own cloud for this exact function:
https://www.github.com/TheWlr9/LocalCloud
However, this question should've been posted on some forum page, and not Stack Exchange.

How much do BitTorrent and WebTorrent have in common?

I recently heard about WebTorrent and decided to try one of those audio player javascript demos to see if I could make it play a random MP3 from BitTorrent network. It didn't work and I contacted the author to find out that those are "two separate networks". This made me wonder - how much do those two networks have in common? For example, do they use the same .torrent file specification and one file can be found both under WebTorrent and BitTorrent under the same InfoHash? Are there any torrent discovery websites like ThePirateBay for WebTorrent that I could use to see what's already there?
WebTorrent is based in BitTorrent, they follow the same torrent file spec.
WebTorrent in the browser can only connect to WebRTC peers, WebTorrent in NodeJS can only connect to TCP/UDP peers. WebTorrent Hybrid (NodeJS) client can connect to both using a headless electron process. WebTorrent Desktop is a desktop app that can connect to both networks.
You might be interested in reading the FAQ
There's no website for WebRTC-network torrents discovery, yet.

Tun/Tap interface based tunnel: How is it working?

Tun/Tap interface based tunnel
Can someone tell me how such a tunnel is created and works?
I have tried Googling the answer, but there are very few ressources and they are primarily very technical.
I know that packets sent through such an interface gets injected into the OS network stack and look like packets received from an external host. Also, packets received on this interface gets passed to a user-space program.
However, what I do not understand the following:
Why does such a tunnel involve the use of setting up network connections? Is the programs on either side of the tunnel neccessarily running on the same host, or can they be running on different hosts? Does the network stack deliver tap or tun packages through TCP/UDP?
Both Tun and Tap interfaces deliver data from one host to another. The main difference is the features (pros/cons) that you get when you are using Tun or Tap.
Data delivered via Tap interface gets injected at layer2 of OSI stack and data delivered via Tun interface gets injected and layer3. There is no better/worse choice here - each is suited for specific purpose. You can read a very good explanation here.
Now to answer your questions:
Why does such a tunnel involve the use of setting up network connections?
You want to deliver packets from one host to another regardless the interface type (tun/tap). To do so you capture those packets, encapsulate them and then you need to send over encapsulated data to the remote end. To do this you need to set up a network connection.
Is the programs on either side of the tunnel neccessarily running on the same host, or can they be running on different hosts?
You are creating a VPN connection between two different hosts, so yes - there will be software running on both hosts which will handle the encapsulation/decapsulation.
Does the network stack deliver tap or tun packages through TCP/UDP?
TCP/UDP are layer4 protocols, so from point of view of TCP/UDP stack it does not matter at all if the packet came to your host via tun or tap interface.
EDIT: Clarification about the follow up questions:
Since you are asking about Tun/Tap adapters, let's take a step back. When you run a VPN, you have a computer A behaving as if it is directly connected to network N, even though it might be somewhere far away. To make this happen, you run a VPN software. You have to run this VPN software in two places - one in the computer A and another in computer (or network device) connected to the network N. When running a VPN software in the computer A, you have a choice of creating a Tun or Tap adapter.
Q1: Yes - delivered means sent and received.
Q2: Yes - means that VPN connection is like a pipe, and there is VPN software running at both ends.
Q3: When VPN software is running in the computer A, it creates what is called a virtual network adapter. This virtual network adapter, in the eyes of OS, behaves like a normal network adapter. Just instead of sending data over the wire or waves, it caputers the data, encapsulates it and sends over some other adapter in the system.

Linux Tunnell Through Nat Via Custom Proxy

I am currently working on some design concepts that would see me have the requirements for the following type of system.
In short I am looking at ways to Tunnel a connection through NAT similar to VPN but without the complexity.
I have a small embedded linux device that sits behind a home LAN that I would like to be able to interface with through an API that I have created.
Currently the setup I have is as follows:
Device A (Embedded Linux) - Public IP
Device B (Amazon Server)
I am using a REST/Json api to control Device A from Device B.
I am looking for a protocol or solution that would allow me to send two way communication from Device A and B possibly by adding a third proxy server to handle this "Tunnelled" connection.
Notes:
Would preferably like to avoid complex VPN's and the need for the NAT device to support VPN Passthough.
Traffic between Device A and B is small and not highly sensitive but some security like SSL would be nice.
This is a multinode system, Hence, There are many Device A's.
Any advice as to where I should be looking would be greatly appreciated.
Regards
pjf

Does .NET Peer to Peer Technology allows communication behind a router?

Recently i had a case where i was trying to establish a p2p connection using Microsoft PNRP technology between two applications. One application was on Lan and another was on same Lan (diff computer but same Service provider) but was behind a WiFi router. Since, I registered the two peers in all clouds(Global & local links) on respective system but when i tried to resolve the another i could not find the respective peers. As far as i know those peers must be discoverable since i also registered them in global cloud (Internet). How can i achieve the aforesaid scenario ?
Using PNRP in this way depends on a couple of technologies, the most important of which is Teredo tunnelling. You've probably run into a restriction of Teredo tunnelling and how it works behind firewalls.
To summarise it, Teredo routes IPv6 traffic over UDP packets sent to a specific port with IPv4. Because of this only certain kinds of NAT are supported for direct connections. You'll probably find that each of your systems can resolve themselves and other services, but not each other within the firewall if they're on different networks.
The easiest way for you to resolve this will be to either make the computers connect to completely different networks, or have them on the same network (as PNRP also supports link-local discovery).
More information can be found on Wikipedia.

Resources