Network File Download Based on Multi-threaded

Author
CuiShuiLong
Advisor
XuGaoChao
School
Jilin University
Major
Software Engineering
Classification
TP311.52 Software Development
Degree
Master's thesis
Year
2009
Downloads
388
Citations
4

Request the full text

Abstract

Linux as the Internet era of the most popular free operating system, more and morepeople favor it. But at the same time under the platform of the download software is rarely,and supports of multi-threaded breakpoint continuingly download little. The system notonly supports the breakpoint continuingly functionality, multi-threaded download, HTTPtunnelandinaccordancewiththeprincipleofthenatureofthefirewallwithapenetratingDownload tools, the primary task is accurately, a byte can not go wrong. Forsingle-threaded to complete it is relativelysimple, but multi-threadingis taken into accountthe relatively more on, for example, distribution of tasks between threads, the contents ofthe paper splicing, mutually exclusive ways to access files and so on. And the thread to beable to record accurately the breakpoint information for the next resume. Followed by thefast, if the network is smooth, so fast, single-threaded and multi-threading is not muchdifference, but the present situation is especiallycrowded network, multi-threaded so it canplay a strong point, if a thread is blocked in several other were also normal, butnoninterference. Multi-threaded download line to take full advantage of the bandwidth andimprovetheefficiencyofdownload.The design is under Linux systems POSIX (Portable Operating System Interface) as astandard multi-threaded. The origin of multi-threaded multi-CPU machines, developed intoa more advanced programming ideas. It is mainly characterized by the concept of parallelprocessing. Thread is included in the process of an entity; it has run its own clues, tocompletecertaintasks,andprocesses toachievea similarconcurrencywithotherthreads tocompletetheprocessofcollaborativetasks.Processoftenreferredtoaslightweightthreads.Useoneofthereasonsformulti-threadedprocessiscompared,itisavery"thrifty"modeofoperation of the multi-tasking. We know that inthe Linux system, start a new process mustbeallocatedtoitsseparateaddressspace,theestablishmentofalargenumberofdatatablesto safeguard its code segment, stack and data segment, which is an "expensive"multi-tasking work. And a process running on multiple threads, among them use the sameaddress space, sharing most of the data, start a thread has spent far less than the space ittakes to start a process space, and thread switch between the time required for each other isfar less than the process of switching between the time required. Of course, in the specific system, the data may have a greater difference. The reason for the use of multi-threadedthread between the two is a convenient communication mechanism. Different process, theyhave separate data space, it is necessary to transfer data only through the means ofcommunication, not only in this way is time-consuming and inconvenient. Thread is not,under the same process of sharing data between threads of space, so a data thread can bedirectly used for other threads, not only of speed, convenience, and improved downloadperformance.The beginning of this article describes some of the associated technical, threadcreation and exit, thread synchronization and mutual exclusion, the security thread, and itsrelated API call, which is the basis for the realization of parallel downloads. In this paper,based on the request / response model of HTTP protocol, in the download prior to theHTTPservertosendtheHEADrequest,theserverreceivedarequest,theconcurrentreturnon the resources in response to download message header, through the analysis of theresponse messages, the Content Analysis -Length entity header of the content domain, thesize of the file can be downloaded on the file partition, for each thread a piece of paper todownload the distribution of tasks, this process is sent through the GET request to theserver to achieve, before that, by calculating each start a thread to download the locationand end location, a number of threads to download each receiving different tasks, do notrepeat each other before, so that the whole document can be divided into N blocks,respectively, can be downloaded, after the completion of each task thread , the recyclingofresources,duringwhichtheuseofwrittendocumentstoavoidduplicationwriteMutex.Breakpoint Continuingly prior to the realization of large files in accordance withpre-divided into N size block of transmission at the same time to create N threads toconnect the target server-side. When the server received a connection termination request,inform the client can transfer files. Termination when a customer can receive the news oftransferring files, the first transmission to the server sending data block (including the firstfew in the beginning of block) request termination when the server received the request,send data to the client transmit information, client data and then transmit the informationspecified in the data block to the server-side, server-side data transfer to update theinformation block. In the margins of the download to check the local information todetermine the numbers of bytes have been downloaded. We can create a temporary file fordownload information, such as the number of bytes has been downloaded and so on. Tocheck the output file exists, if it exists, and then get its size, and has been downloaded as apartof.Eachtransmissionisstopped,ifnotwrittenintothewillofitstemporaryfile.Inthis way, even if the network has been broken, it does not matter because we have alreadydownloaded content and thelocationhas beenrecorded,the next downloadfrom the recordstart position of the breakpoint to continue the download, this is the BreakpointContinuingly. Therefore, users do not have to worry about sub-large files, downloadmulti-thread synchronization, if the half-way network, part of the file would have causedlossoftimetowasteandtheInternettodownloadthecostofwaste.It also conducted a study on the firewall, through the firewall on the way to interceptpackets, found weaknesses in the firewall and to make use of HTTP tunneling technology,the network packet in the process of encapsulation, so that it will have to penetrate thenature of the firewall. HTTP tunnel that can penetrate not only penetrate the personalfirewall, but also penetrate the network firewall. Here the main advantage of the credibilityofcrediblecommunicationportuserstopenetratefirewalls.In short, the design of multi-threading technology, can be very good in the Linuxsystem for file downloads, in parallel to achieve a multi-threaded download, breakpointcontinuinglyfunctionality,andtopenetratethenatureofthefirewall.

Table of contents

Summary 4-7 Chapter 1 Introduction 7-11 1.1 Background 7 1.2 Research 7-9 1.3 This research 9-10 1.4 chapters arranged 10-11 Chapter 2 introduces related technologies 11-23 2.1 Multithreading introduces 11-14 2.1.1 basic concept of threads 11-12 2.1.2 thread creation and exit its function calls 12 2.1.3 thread mutex and function calls 12-13 2.1.4 thread synchronization and its function call 13-14 2.2 HTTP protocol introduced 14-20 2.2.1 Overview 14-15 2.2.2 HTTP URL 15 2.2.3 HTTP requests 15-17 2.2.4 HTTP response 17-19 2.2.5 message header 19-20 2.3 Firewall principle 20-23 2.3.1 Firewall Profile 20 2.3.2 Firewall Category 20-21 2.3.3 firewall weaknesses 21-22 2.3.4 HTTP tunneling technology 22-23 Chapter 3 architecture and overall design 23-33 3.1 architecture 23-24 3.1.1 conceptual model 23-24 3.1.2 components used 24 3.2 overall design 24-33 3.2.1 Class Design 25-28 3.2.2 Basic Operations 28-33 Chapter 4 function realization and system testing 33-44 4.1 downloaded in parallel to achieve 33-35 4.2 penetrate the firewall to achieve 35-38 4.3 HTTP Implementation 38-41 4.4 system test 41-44 Chapter 5 Conclusions and follow-up work prospects 44-46 5.1 Thesis conclusions 44-45 5.2 follow-up prospects 45-46 References 46-48 Thanks 48-49 Summary 49-52 Abstract 52-54

Related dissertations

  1. Research and Application on Android System Architecture
  2. The Design of Telecom Installed and Maintenance System for iPhone
  3. The Design of Video Software System on DaVinci DM6446
  4. Design and Implementation of Monitoring and Evaluation System for a Dedicated Communications Network
  5. Research on Quad Rotor Helicopter Control System for Bridge Inspection
    WangXiaoLi ·Chongqing Jiaotong University ·2013 ·Master's thesis
  6. Design of High-Speed Multi-Threaded Slitting-Welding-Rewinding Integrated Production Line
    HuangRenQing ·Tianjin University ·2012 ·Master's thesis
  7. Design and Implementation of Embedded Web Server Monitoring System Based on Cortex-M3
    LinXiaoJun ·Taiyuan University of Technology ·2013 ·Master's thesis
  8. Key Issues Study of Monitoring Platform for Logistic Transport Vehicles Based on Internet of Things
    ZhangDi ·Chongqing University ·2012 ·Master's thesis
  9. On the Web Server Performance Testing
  10. Research on Video Based Real-time Multiple Face Detection, Recognition and Tracking Methods
    WuDanYang ·Shenyang University of Technology ·2013 ·Master's thesis
  11. Research and Design on High-speed Press Quality Image Detection System
  12. Research and application of image restoration algorithm of diffuse multi-core architecture system based on
    WangZuo ·Yunnan University ·2013 ·Master's thesis
  13. The border gateway protocol based on Linux implementation and parallel reconstruction
  14. The Design and the Application of Remote Screen Control System
    MaoZhiJie ·Guangdong University of Technology ·2012 ·Master's thesis
  15. Design and Implementation of Data Processing of the Large Capacity of Network Resource Management System
    LiuMengDong ·Shandong University ·2013 ·Master's thesis
  16. Software Design of Real-Time Detection System Oriented Press Mounting
    LiMingGui ·Guangdong University of Technology ·2013 ·Master's thesis
  17. The HTTP protocol multithreaded network download framework research and Implementation Based on
  18. Research of System for Malfunction Precautionary on Mobile Communication
  19. Design of Gas Data Collection and Management System Based on the.NET Framework
    WangXianBing ·Dalian University of Technology ·2013 ·Master's thesis
  20. Network multimedia player system server software design