Detecting and Blocking of BitTorrent Transmission

Author
GuoBin
Advisor
GuoDongWei
School
Jilin University
Major
Software Engineering
Classification
TP393.093 File transfer program (FTP)
Degree
Master's thesis
Year
2006
Downloads
287
Citations
1

Request the full text

Abstract

BitTorrent was presented by Bram Cohen in 2002 for distributingfiles. Because of its excellent performance, BitTorrent becameworld-famous in a very short time and it became the most popular wayfor downloading files.BitTorrent is an advanced P2P protocol. It differs from the classicP2P protocol a lot. The most special feature is that, it keepsdownloaders uploading pieces of files to each other, so they can makethe best of the bandwidth and reduce the bandwidth load for the peerinitially sharing the files. Generally speaking, the more the peers are,the higher the downloading speed can be, so BitTorrent is quite fit forsharing big files such as software and movies.The act of BitTorrent transmission refers to five entities: files tobe shared, metainfo file, web server, tracker server and BitTorrentclient. The metainfo (.torrent) file is a BEncoding described text file,including the description and index of the files to be shared. Somecertain parts of the metainfo file can be SHA1 hashed into 20 bytes,which is the only identifier of the BitTorrent task and we name itinfo_hash. The web server runs an ordinary web service, and usersmay publish or download metainfo files here. The tracker server keepsa few of peer lists corresponding to each BitTorrent tasks.Here is an example of a typical process of BitTorrent transmission:User A wanted to share some files, then he created a metainfo file forthem and published the metainfo file on the web. After that, user Bintended to download the files which user A was sharing. So, user Bdownloaded the metainfo file and opened it with a certain BitTorrentclient. As soon as he clicked to run the current BitTorrent task, theclient sent several status reports to every tracker server over HTTP andin a second, each tracker returned a list of peers who weredownloading the same thing. And afterwards, user B’s client sentseveral handshake messages to the peers on the list, got connected andstarted to download. After he finished downloading, he shouldcontinue to upload data to the other peers. The piece downloadingstrategy, the queuing algorithm and the chocking algorithm guaranteedthe excellent performance of the BitTorrent transmission.There is no doubt that BitTorrent is an advanced technology fordistributing files. But the unlimited using of BitTorrent will result inthe exhaustion of bandwidth. If there are some BitTorrent downloadersin an Ethernet, the other users will suffer from a low-speed connection.On the other hand, though BitTorrent can be used in distributingimages of Linux disc or netgame clients, it also helps people to sharepirate copy of software and movies. So, it is necessary to monitor andlimit the using of BitTorrent.In order to detect the BitTorrent transmission, we should sniff allof the data packets, and distinguish BitTorrent packets from the crowd.Since most of the BitTorrent packets do not have evident characters,there is no direct way to know which packet is created by BitTorrentand which is not, so we have to identify them indirectly. Fortunately,there are two categories of packets which can be easily recognized tobe BitTorrent packets. They are the status report from peer to trackerand the handshake between peers. From the two categories of packets,we can get some IPs and ports which is running BitTorrent. We canalso know which port is listening port, and which connection isBitTorrent connection. We may take it for granted that connection,with a listening port in one end, is BitTorrent connection, and we canalso consider every packets on a BitTorrent connection to beBitTorrent packets. Interpreted with BitTorrent protocol, the packetscould give us more details. From the relationship between peers andthe details, we can know a lot about the whole structure of theBitTorrent network, such as the IPs and ports of a connection, theinfo_hash of the task they are running, the trackers they are using, thepeers they have connected, the speed of their downloading anduploading. Further more, we can identify the HTTP downloading ofmetainfo files by matching some certain strings. If we copy everypacket in the downloading procedure and compose them together inorder, then what we get is a whole metainfo file. The metainfo filecontains the directory names and file names of what is sharing, and thecorresponding info_hash can also be transpired from the metainfo.Based on the recognition of BitTorrent transmission, we may takevarious actions to block it. The most easy and practical way is that,configure the network device, so it is able to drop the packets whosedestination is a tracker server. If that works, though we can not blockall of the BitTorrent transmission, users may have great difficulty inbeginning the downloading. To block all of the BitTorrent packets, wehad better develop a kind of network device which can recognize theBitTorrent packets and then drop them, using the monitoring techniquedescribed above. But before that, we could also take other steps, whichis different in approach but equally satisfactory in the result. If wefound that a status report was sent from peer to tracker server, we willcounterfeit an ACK packet and send it back to the peer. Then the peerwill think that there is no other peer downloading the same thingtogether, so the downloading can not begin. If we found that ahandshake message was sent from a peer to another peer, we will alsocounterfeit an ACK packet and send it back to the peer who originallysent it. In that packet, the flag RST will be set, so the BitTorrentconnection will be killed silently. To carry it out, we should deploy aPC near the switch. The PC must have two Ethernet cards, one forreceiving all of the packets passing through the switch, and the otherfor sending counterfeit packets. The technique of sending counterfeitpackets is just like session-hijacking, which is often used by hackers.But what we want to do is break the BitTorrent connection and thenormal use of network is not likely to be influenced.According to the theory of detecting and blocking of BitTorrenttransmission described in this text, I programmed to carry them out.They are BtMonitor for detecting and BTwall for blocking. The twoprograms are base on Windows, and the IDE is Microsoft VisualC++ .NET 2003. And I have used WinPcap, which is an open sourcelibrary, to capture packets. As long as we deploy the two programscorrectly, the functions of BitTorrent detecting and blocking will workwell and that also proves the theory represented above to be true.

Table of contents

The first chapter 7 - 14 1.1 traditional resource sharing 7-8 1.2 P2P networks, resource sharing 8-10 1.3 BITTORRENT resource sharing; nbsp the regulatory objective necessity nbsp 10-11 1.4 the BITTORRENT transmission behavior; 11-12 1.5 This article contents 12-13 1.6 of this article arrangements 13-14 the second chapter BITTORRENT agreement Detailed 14-30 2.1 the transmission basic process 14-16 2.2 BENCODING 16-17 2.3 METAINFO FILE 17-20 2.4 client and server 20-22 2.5 PEER ID 22-23 2.6 transfer process of Xiangjie 23-27 2.7 correlation algorithm 27-29 2.7.1 fragment selection algorithm 27-28 2.7.2 queuing algorithm 28 2.7.3 blocking algorithm 28-29 2.8 DHT 29-30 the Chapter BITTORRENT transmission behavior monitoring 30-54 3.1 monitoring methods outlined 30 3.2 identification of the interaction between the PEER and TRACKER 30-31 <br / > 3.3 identify PEER and PEER interaction between 31-33 3.4 extraction task The name 33-34 3.5 Monitoring program implementation 34-50 <br / > 3.5.1 program 34-35 3.5.2 based platform 35 3.5.3 the overall structure of the program 35-37 <br / ,> 3.5.4 BitTorrent parser construction the 37-44 the 3.5.5 protocol analyzer construct 44-46 the 3.5.6 Metainfo file parser constructor 46-50 3.6 program interface display 50-54 the fourth chapter BITTORRENT transmission behavior plugging 54-69 4.1 early closure schemes 54 4.2 restrict access to the server 54-55 the 4.3 interference PEER TRACKER access 55-57 4.4 Disconnect PEER and PEER connection nbsp 57-58 4.5 blocking the realization of the program; the 58-67 the 4.5.1 program's function 58 4.5.2 based platform 58 4.5.3 program structure 58-59 4.5.4 plugging-module the 59-67 4.6 interface shows 67-69 Chapter Summary and Outlook and to References 69-71 71-75 ABSTRACT 75-78 Acknowledgements 78-79 tutors and Author 79

Related dissertations

  1. Design and Implementation of P2P-VoD System Based on BitTorrent
    ZhuangYingJie ·Northeastern University ·2011 ·Master's thesis
  2. Research on Kev Technologies of Content Distribution in P2P Network
    ZhangJianWei ·Zhejiang University ·2013 ·Doctoral dissertation
  3. Research on and Design of Private Tracker Resource Platform Based on P2P
    XuXiaoGuang ·Yanshan University ·2013 ·Master's thesis
  4. Measurement and Security Research on P2P File Sharing System
    SuMaZuo ·Harbin Institute of Technology ·2013 ·Doctoral dissertation
  5. Research on Optimization of P2P System Based on Behavior Measurement
    YeZuo ·Harbin Institute of Technology ·2011 ·Doctoral dissertation
  6. Big Customer Network Management System Development and Design
  7. Research on Technologies of Data Scheduling and Transmission Layer Optimization in P2P Streaming Systems
    YaoBin ·Zhejiang University ·2013 ·Master's thesis
  8. Design and Implementation of P2P Content Distribution System Based on Network Coding
    XieChengQiang ·Southwest Jiaotong University ·2013 ·Master's thesis
  9. Modeling and Analyzing VoD System Based on BitTorrent
  10. For operators of P2P file-sharing business platform
  11. The Research and Implementation of a Network Coding Based P2P Content Distribution System rlncBT
    XuJiaYan ·Suzhou University ·2008 ·Master's thesis
  12. Microfinance Wholesale Mechanism Research and Construction Analysis
  13. The Investigation Report of P2P Lending
  14. Risk Management of P2P Network Financing Mode
    WangSheng ·Zhejiang Sci-Tech University ·2014 ·Master's thesis
  15. The Construction of P2P Networks Lending Risk Management System in China
    LuoYang ·Zhejiang Sci-Tech University ·2014 ·Master's thesis
  16. The Construction of Tourist Culture in A Web
    YeJingQiu ·Central China Normal University ·2012 ·Master's thesis
  17. The Applied Research of Electronic Integrated Marketing Communication on Festival and Special Event
    WangYaZuo ·Dongbei University of Finance ·2013 ·Master's thesis
  18. Drivers of Sustainable Growth of International New Ventures
  19. Research on the Shareholding Control Mechanism of Corporation in the Network View
    HuZe ·Ningbo University ·2012 ·Master's thesis
  20. Venture Capital Firms’Network and Investment Efficiency of Listed Companies
    RuanKeShu ·Xiamen University ·2014 ·Master's thesis