Search code examples
network-programmingbittorrentlibtorrent

libtorrent bind to local ip on


there is a question in my mind searching for 2 month in the internet but never get a answer of it. please help me to know the answer of my question.

we have small ISP network and setup a torrent cache server provided by a company which working so nicely. but the system is very costly so we want to implement the same thing to save some money so that we can provide more cheap internet service to our client.

they have setup a Private IP route in our core route 10.12.250.0/24 route to 106.xx.88.10

103.xx.88.10 is cache server ip and also added those private ip to the server 10.12.250.1 to 10.12.250.254

my question how client are getting private ip at the time of downloading and uploading the torrent?

http://imagebin.ca/v/2ZIu7uD9Ysvl check the image of the torrent client

they are not using local peer discovery protocol. the IP are coming from a tracker which is added to a magnet link whenever client download the torrent they get peer from private ip

The idea of cache is very simple they are using multiple libtorrent instances to save thousands of torrent in the server


Solution

  • To find swarms that a local torrent cache can join there are several possible approaches, some of which require the ability to inspect and analyze all network traffic flowing through the ISP's network

    • implement BEP 22, requires client support
    • implement BEP 14, requires client support, requires multicast routing beyond the customer's local network
    • sniff infohashes and listening ports from various bittorrent subprotocols:
      • http tracker announces
      • udp tracker announces
      • dht announces
      • bittorrent-over-TCP peer connections
      • bittorrent-over-µTP peer connections