The Random Periodic Switching

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

Abstract— Peer-to-peer networks have been commonly used for tasks such as file sharing or file distribution. The early model for content distribution is a centralized one, in which the service provider simply sets up a server and every user downloads files from it. Experimental studies show that for a file download service capacity fluctuation takes minutes to several hours depending on the level of network. Due to this impact negative factors can be find out namely the spatial heterogeneity and the temporal fluctuation. So to overcome this problem we can analyse a simple distributed algorithm to effectively remove these negative factors, thus reducing the average download time One of the common approach is to analyse the average download time average service capacity. Parallel downloading and random periodic switching technique to solve this negative impact factor[1]. The different peers cooperate by mutually exchanging the different chunks of the file, each peer being client and server at the same time.

Keywords- peer, parallel downloading, random switching, fluctuation, performance, balancing,

Introduction

P2P technology tries to solve the issue of scalability by making the system distributed. Each computer (peer) in the network can act as both a server and a client at the same time. When a peer completes downloading some files from the network, it can become a server to service other peers in the network. It is obvious that as time goes on, the service capacity of the entire network will increase due to the increase in the number of servicing peers. With this increasing service capacity, theoretical studies have shown that the average download time for each user in the network is much shorter than that of a centralized network architecture in ideal cases [2], [3]. In other words, users of a P2P network should enjoy much faster download.

Research in peer-to-peer networks has so far mainly focused on content storage and lookup, but fewer efforts have been spent on content distribution. By capitalizing on the bandwidth of peer nodes, cooperative architectures offer great potential for addressing some of the most challenging issues of today’s Internet: the cost-effective distribution of bandwidth-intensive content to thousands of simultaneous users both Internet-wide and in private networks. Cooperative content distribution networks are inherently self-scalable, in that the bandwidth capacity of the system increases as more peers arrive: each new peer requests service from, but also provides service to, the other peers. The network can thus spontaneously adapt to the demand by taking advantage of the resources provided by every peerThis work was supported in part by NSF CAREER Award CNS-0545893.A subset of results reported in this paper has appeared in the proceedings of Conference in Information Science and Systems (CISS) 2006 [1]

Related Work

Prior to our research and that conducted by the authors in[4], there has been a number of techniques developed to improve download performance[1]. One simple technique used by web browsers [5] and by some FTP clients [6] involves the opening of multiple connections to a single server. In this technique, download time is decreased because the client consumes network bandwidth more aggressively [7] when opening parallel connections to a single server. While this scheme is simple to implement, the aggressiveness can cause an unfair allocation of network resources[2]. Moreover, parallel connections add extra overhead to the server by requiring the server to maintain multiple connections. Because the server can only open a limited number of simultaneous connections, the number of distinct clients that the server can handle will decrease by a factor proportional to the average number of parallel connections opened per client.

[1]While the paraloading scheme is first formalized by [4], the earliest implementation of a paraloading client we found is a Perl script that is part of the CPAN library called the Parallel User Agent written by Marc Langheinrich. The PUA is a simple script that allows users to downloadmultiple files in parallel from different sources. However, unlike the paraloading scheme proposed by Rodriguez, the PUA does not support parallel access of an individual file from multiple servers as does the paraloading scheme.[2]Balakrishnan et al. [7] have proposed a technique to solve this unfairallocation problem by introducing a "Congestion Management" layer between the application and the transport layer to coordinate parallel flowsconnected to a single server.The authors of [4] propose a dynamic parallel-access scheme where clients and servers connect via unicast TCP. Application-level negotiations are used to request different parts of a document from mirror servers.The results presented by Rodriguez et al. have shown good speedup over single connection downloading.Ernst W. Biersack, Pablo Rodriguez, Pascal Felber proposed and compare the performance of the Linear, Tree k and PTree k architecture. We first investigate how the time needed to serve N peers varies as a function of the number of peers N and the number of chunks C.The Linear and PTree k architectures both assume that the upload and download rates are the same. In practice, this is often not the case (e.g., the upload rate of ADSL lines is only a fraction of the download rate). In such cases, the performance will be limited by the upload rate and some of the download bandwidth capacity will remain unused. The Tree k Architecture assumes that nodes can upload data at a rate k times higher than the download rate, which is exactly the opposite to what ADSL offers[8]. The tree approach is therefore particularly ill-suited for such environments. From these results we can conclude that, for most typical file-transfer scenarios, PTree k provides significant benefits over the other two architectures studied in this paper

Methodolodgy

3.1 Parallel downloading

iParallel downloading (PD) has been adopted by a number of Internet file downloading applications. With the wide deployment of content distribution networks and peer-to-peer networks, PD is expected to be more commonly used for file distribution. There have been experiments showing that PD results in higher aggregated downloading throughput and therefore shorter downloading time experienced by clients. However, these experimental studies focused on the performance experienced by a particular user and did not consider the impact of PD on the network when it is largely deployed. With the wide deployment of content distribution networks (CDNs) and peer-to-peer (P2P) networks, PD is expected to be more commonly adopted for file distribution, especially when the volume of a file is large.

The file is divided into chunks of equal-size pieces and the downloading peer connects to all four source peers and downloads each piece from each source peer simultaneously. Parallel Downloading is one of the ways to reduce the download time. If the file F is divided into k chunks of equal size, and k simultaneous connections are used, the capacity for this download session becomes c1+c2+…..+ck, where Ci is the service capacity of ith connection. Intuitively, this parallel downloading seems to be optimal in all cases. But, it is worth noting that the download time for parallel downloading is given by max{t1+t2+…..+tk} rather than ,F/(c1+c2+….+ck) where ti is the download time of a chunk over ith connection. This is because the chunk that takes the longest time to complete determines the entire download session. The difference among the various parallel downloading schemes is not as pronounced when all clients perform parallel downloading.

Parallel downloading when performed by all or a large proportion of clients can actually lead to a degradation of the performance experienced by clients. In cases where parallel downloading clients do experience a performance improvement, such an advantage is typically at the expense of clients without the parallel downloading capability. There is the possibility that there were other parallel downloading clients retrieving files from the TuCows or the Squid servers. If such clients did exist, however, their number would have been very small relative to the much larger number of clients retrieving over a connection to a single server. But parallel downloading is better then the single download.

To illustrate that parallel downloading is better than single download, we consider the following simple example. Assume that there are only two source peers in the network, and c1, c2 are the service capacities of the two source peers. Without loss of generality, we assume that c1 ≤ c2. If parallel downloading is used for downloading a file of size from the network, the download time Tp is given by

Example: File sizes are 10 MB, 20 MB and service capacities of these peers are 200mbps, 100mbps and the download time is

Tp is max = 10 MB , 10 MB ≈ 8 seconds 200mbps 100mbps

For the case of single download, the average download time is for the above example is

Ts ≈ 12 seconds > Tp

In a multi-user network, maintaining just a few Parallel connections four to six is better than having parallel connections to all possible source peers. Hence, if there is an algorithm that can increase the performance of each individual connection among such a few parallel connection, then each individual user may achieve the download time predicted by (1) or even better.

In parallel download, the file is divided into four equal-sized pieces and the downloading peer connects to all four source peers and downloads each piece from each source peer simultaneously. Intuitively, parallel downloading should perform better than single link downloading because (i) it utilizes more than one link at the same time and (ii) if the connection is poor, parallel downloading reduces the amount of data getting through that bad source peer.

Since there is only a single user, it utilizes all the service capacity the network can provide (c1+c2+c3+c4). Example File size is 150 MB and total service capacity of the network is (c1+c2+c3+c4) = (100kbps+250kbps+400kbps+50 kbps) and the average download time Tp is

TP = 150 MB/800kbps ≈ 25 minutes

Parallel downloading degrades fast when there is a large degree of heterogeneity. It is more likely that one of the parallel connections is "poor" with very small capacity. Thus, even though the size of chunk (37.5 MB) is smaller than the whole file (hence reducing the risk of staying with the bad source peer for too long), this is still not as good as the idea of averaging capacities all the time. Parallel downloading with large chunks (30 MB per chunk), when the competition in the system is high. This is because the average download time for parallel downloading is still determined by the slowest link. Single peers download using parallel download. The source of this extra overhead is in opening and maintaining more TCP connections. This translates into more TCP flows competing in the network and in more packets injected in the network.

In a system where there are already many downloading peers, parallelism actually increases the level of competition even more; hence the service capacity of a slow source peer is further divided among its downloading peers. Parallel downloading may not reduce the download time to the predicted value in all cases. Instead, the performance of parallel download depends upon the distribution of the underlying service capacities and could be much worse than the ideal case.

Parallel downloading technique may not achieve minimum average download time when there is an only one user in the network. Parallel downloading technique is not enough to reduce the average download time. So this thesis use random periodic switching technique in addition to parallel downloading technique that utilize the spatial diversity of the network to improve per-user performance in terms of the average download time. These techniques remove these negative factors, spatial heterogeneity of service capacities in different source peers and the temporal fluctuation in service capacity of a single source peer.

3.2 Random periodic switching

Random periodic switching very simple distributed algorithm used. This technique uses two schemes permanent connection, random periodic switching. In permanent connection source selection function does not change in time. In random periodic switching the downloader randomly chooses a source peer at each time slot, independently of everything else. That effectively removes correlations in the capacity fluctuation and the heterogeneity in space.

In this section, analyze a very simple, distributed algorithm and show that it effectively removes correlations in the capacity fluctuation and the heterogeneity in space, thus greatly reducing the average download time. As the algorithm will be implemented at each downloading peer in a distributed fashion, without loss of generality, only focus on a single downloader throughout this section.

In our model, there are possible N source peers for a fixed downloader. Let Ci(t) (t=0,1,2,… and i=1,2,3,…,N) denote the available capacity during time slot t of source peer i .Let U(t)є{1,2,...N} be a source selection function for the downloader. If U(t) =i , this indicates that the downloader selects path i and the available capacity it receives is Ci(t)during the time slot t. We assume that each Ci(t) is stationary in t and Ci(t) of different source peers i=1,2,3,…N are independent. We however allow that they have different distributions, i.e.,are different for different i (heterogeneity). For any given i, the available capacity Ci(t) is correlated over time t . As before, when each connection has the same probability of being chosen, the average service capacity of the network is given by

In this setup, we can consider the following two schemes:

Permanent connection,

Random periodic switching.

3.3 permanent connection

For the first case, the source selection function does not change in time. When the searching phase is over and a list of available source peers is given the downloader will choose one of them randomly with equal probability. In other words, U(t)=U where U is a random variable uniformly distributed over {1,2,…N}.

For example, if the downloader chooses u (u є {1,2,…N}).at time 0, then it will stay with that source peer (U (t)=u) permanently until the download completes.

3.4 random periodic switching

The downloader randomly chooses a source peer at each time slot, independently of everything else. In other words, the source selection function U(t) forms an i sequence of random variables, each of which is again uniformly distributed over{1,2,….,N}.

Fig no.6 Operation of source selection function U (t) for random periodic switching

In this figure, source 1 is selected at time 1, source N is selected at time 2, and so on.

Let us define an indicator function.

Here analyzed the performance of two different schemes that utilize the spatial diversity of the network to improve per-user performance in terms of the average download time. Two schemes are (i) parallel downloading and (ii) random periodic switching. The parallel downloading may perform well if the capacity of each possible source peer is known so as to allocate larger chunks to faster connections and smaller chunks to slower connections.

But this method is not practical as one cannot know a priori the service capacity of all source peers. In addition, the service capacity is stochastically fluctuating all the time, and our analysis show that the performance of parallel downloading depends much upon the heterogeneity of the service capacities in different source peers if the chunks are equal in size.

The idea of time-based switching scheme is in fact not new. Such strategy has been implemented in Bit Torrent but with some other purpose in mind. In Bit Torrent application, by using its optimistic choking/unchoking algorithm, a peer changes one of its servicing neighbors with the lowest upload capacity every 10 seconds in hope to find some peers offering higher service capacity. However, the idea of switching source peer periodically in the Bit Torrent’s optimistic choking/unchoking algorithm is to discover new potential sources rather than to explicitly remove the negative impact of temporal correlations and spatial heterogeneity in service capacity.

This study leads us to believe that the random switching decision should be based on time rather than "bytes" because we are interested in the download time, not the average capacity itself. Indeed, any algorithm based on bytes or a fixed amount of data will suffer the curse of a bad source peer in that it has to wait until that amount of data is completely received from the "bad" source peer. On the other hand, when the decision is based on time, do not need to wait that long as we can jump out of that source peer after a fixed amount of time (one period).

Example: Downloading files are A, B, C, D. the sizes of the files are 32MB, 50 MB, 10MB, 5 KB respectively .Service capacity of each files are 10 kb/sec, 14 kb/sec, 11 kb/sec, 10 kb/sec respectively. These four files are downloaded parallel (parallel downloading technique).First file D will complete the download. Downloader will select one of them in the remaining files A or B or C randomly with equal probability. Downloader may choose file A then it will stay with that file A permanently until the download completes (Random periodic switching-permanent connection scheme).Remaining files are B, C. Downloader may choose B for a particular time slot. After particular seconds downloader choose C for the particular seconds. The source selection function changed for particular time slot until the download completes (Random periodic switching-random periodic switching scheme).

At the time of files downloading simultaneously error detection also made using the following checksum algorithm.

Way - Hash Algorithm(MD5)

Secure Hash Algorithm (SHA-1)

implementation

The Peer to peer file sharing approach is implemented using the distributed algorithms along with MD5 and SHA-1 security algorithms in the network; The Minimizing file download time in a peer to peer network is implemented using the sun Microsystems’s Java Language.

Parallel downloading technique and random periodic switching techniques are implemented by using the thread concept and random class in java. For parallel downloading simultaneous connections are done by using the thread. In this thesis the number of threads can be select from the list of threads. When the number of thread increases download time decreases. Many threads can run concurrently within a program and these threads can run concurrently, either asynchronously or synchronously. Each thread does the following job concurrently 1.connection to source peer, searching for the files, downloading, send the request, receive the response, and create the proxy server if needed. Download time is reduced because all these jobs are run concurrently. In random periodic switching down loaders source selection function change at a particular time this can be done by using the random function.

Conclusion

The conclusion of this work focuses on reducing the average download time through peer-peer network. In contrast to the commonly-held practice focusing on the notion of average capacity, This have shown that both the spatial heterogeneity and the temporal correlations in the service capacity can significantly increase the average download time of the users in the network, even when the average capacity of the network remains the same. So we use, parallel downloading, Random periodic switching as well as their combination, when compared to traditional downloading these techniques significantly reduce the download time. Parallel downloading and random periodic switching remove these negative factors spatial heterogeneity and temporal correlations in service capacity.

Error detection also made by using the SHA and MD5 algorithm. If any modification or error in the downloaded data then these algorithms considerably detects the error and it will show that error has been occurred in the data. So integrity of the data can also be checked.

Acknowledgement

We thank the Sri Subramanya College of Engineering & Technology for the motivation and encouragement for giving the opportunity to do this research work as successful one.



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now