0% found this document useful (0 votes)
25 views

CN_Project Report_G2_updated_wo_op (1)

Uploaded by

ayushjena007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

CN_Project Report_G2_updated_wo_op (1)

Uploaded by

ayushjena007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

External Project Report on

Computer Networking
(CSE3034)

[ Peer-To-Peer (P2P)
Distributed File Sharing
System]

Submitted
by
Ipsita Senapati Reg. No.: 2141019242
Yaashi Majumdar Reg. No.: 2141013054
Ayush Kanta Jena Reg. No.: 2141010020
Shashank Sekhar Padhi Reg. No.: 2141016005
Subham Maharana Reg. No.: 2141013031

B. Tech. CSE 5th Semester (Section 007 )

INSTITUTE OF TECHNICAL EDUCATION AND RESEARCH


(FACULTY OF ENGINEERING)
SIKSHA ‘O’ ANUSANDHAN (DEEMED TO BE UNIVERSITY), BHUBANESWAR,
ODISHA
Declaration
We, the undersigned students of B. Tech. of (Computer Science & Engineering) Department hereby
declare that we own the full responsibility for the information, results etc. provided in this PROJECT
titled “(Peer-To-Peer (P2P) Distributed File Sharing System)” submitted to Siksha ‘O’ Anusandhan
(Deemed to be University), Bhubaneswar for the partial fulfillment of the subject Computer
Networking (CSE 3034). We have taken care in all respect to honor the intellectual property right
and have acknowledged the contribution of others for using them in academic purpose and further
declare that in case of any violation of intellectual property right or copyright we, as the
candidate(s), will be fully responsible for the same.

Ipsita Senapati Yaashi Majumdar


Registration No.:
Registration No.:
2141013054
2141019242

Ayush Kanta Jena Subham Maharana


Registration No.: Registration No.:
2141010020 2141013031
Shashank Sekhar Padhi
Registration No.:
2141016005

DATE: 11/01/2024
PLACE: Institute of Technical Education and Research

ii
Abstract

This project offers new solutions to problems caused by centralized data sharing through
the development of powerful peer-to-peer (P2P) data sharing applications (Java). Legacy
data sharing models rely on centralized servers and often experience capacity issues and
are vulnerable to a single failure.
To solve these limitations, the project is exploring the creation of P2P distribution that
would allow users to share and download files directly between computers.
The aim of the project is to provide connectivity and efficiency between users through a
console-based interface. Users are asked to interact with the system by accessing a
variety of things, such as shared route information, IP addresses for mapping, and
filenames for downloading.
This project demonstrates real-time visualization of results from the console to enable
users to receive timely feedback on the success or failure of joint operations. This type
of interaction is important to create a good understanding and user-friendly
environment that facilitates the use of P2P information sharing.
Additionally, the system integrates core features such as peer discovery, socket-based
file transfer and management. Respect the unity of the thread. The user interface
provides information management experience by allowing users to share information,
collect information among friends, and initiate downloads.
Java was chosen as the main language for this project due to its extensive
communication and multi-threading support, which is necessary to facilitate seamless
communication, compatibility, and concurrent work in a P2P environment.

iii
Contents

Serial Chapter No. Title of the Chapter Page No.


No.

1. 1 Introduction

2. 2 Problem Statement

3. 3 Methodology

4. 4 Implementation

5. 5 Results and interpretation

6. 6 Conclusion

7. References

iv
Introduction

 In the ever-evolving landscape of digital connectivity, traditional file-sharing models


have long relied on centralized servers as intermediaries for facilitating the exchange
of data between users. However, this paradigm comes with inherent limitations,
including scalability challenges, potential single points of failure, and the need for
extensive server infrastructure. In response to these shortcomings, the Peer-to-Peer
(P2P) Distributed File Sharing System presented herein reimagines the file-sharing
ecosystem by embracing decentralization.

 The primary goal of this project is to empower users to share and download files
directly from one another's machines, bypassing the need for a central server. Built
using Java, a versatile and robust programming language, the system leverages key
principles of networking, file I/O, and multithreading to create a seamless and
efficient peer-to-peer communication environment.

 File management is a central aspect of the project, facilitated through a console-


based user interface. Users can share their files, browse available files from peers,
and initiate downloads—all within an intuitive console environment. The use of
threads ensures concurrent handling of multiple uploads and downloads, enhancing
the responsiveness of the system and providing users with a fluid and dynamic file-
sharing experience.

 As technology continues to emphasize decentralization and distributed


architectures, the P2P Distributed File Sharing System becomes a timely exploration
into the practicalities and possibilities of such systems. Beyond the technical
implementation, the project addresses user-centric design principles, aiming to make
the file-sharing process accessible to users with varying levels of technical expertise.
 This introduction sets the stage for a comprehensive exploration of the project,
outlining its objectives, the technology stack employed, and the pivotal role it plays
in redefining conventional file-sharing norms. The subsequent sections will delve into
the system's features, implementation details, results, and conclude with reflections
on its implications for the future of decentralized and collaborative digital
environments.
The basic overview of a peer-to-peer network system architecture is shown below:

1
Problem Statement
I. Explanation of problem with identification of element/object to be entered through console by
the user and the result to be reflected in the form of file content/database/in the console.
The primary challenge addressed by this project lies in the development of a Peer-to-Peer(P2P)
Distributed File Sharing using Java, where users can seamlessly share and download files directly
between their machines without relying on a central server. The core problem involves establishing
an intuitive console-based user interface that prompts user to enter various elements or objects,
such as file paths for sharing, IP addresses for peer connection, and file names for downloads.
These inputs are crucial for initiating and managing file transfers within the P2P network.
Furthermore, the system is designed to reflect results in real-time through the console, providing
users with feedback on the success or failure of their file- sharing actions. This includes notifications
on shared files, active downloads/uploads, and the status of the P2P connections. The challenge
extends to ensuring that the console-based interaction is clear, user-friendly, and effectively
captures and communicates the system’s actions and outcomes.

II. Highlighting the constraints.


Several constraints must be considered during the implementation of the P2P Distributed File
Sharing System:
1. Security Consideration: Ensuring the security of file transfers and peer connections is
paramount. Implementation should include mechanisms for secure communication, user
authentication, and protection against potential threats like unauthorized access.
2. Scalability: As the number of peers in the P2P network grows, the system must scale efficiently.
The design should be robust enough to handle a large number of concurrent file transfers and
maintain responsiveness.

3. Error Handling: The system needs to implement robust error-handling mechanisms to gracefully
manage unexpected situations, such as file not found, connection failures, or data corruption
during transfers.

4. User Experience: The console-based user interface should be designed to provide clear
instructions and feedback to users. It should accommodate users of varying technical proficiency
and guide them through the file-sharing process seamlessly.

5. Cross-Platform Compatibility: The system should be designed with consideration for cross-
platform compatibility, ensuring that it operates consistently across different operating systems and
environments.

By addressing these constraints, the P2P Distributed File Sharing System aims to provide a reliable,
secure, and user-friendly solution for decentralized file sharing.

2
Methodology
Entire project is designed using Java where I have used the concepts of Socket
Programming and Multi-threading. For establishing the connections between the Server
and the
Clients, I have used TCP/IP protocol using the sockets.
Major Components of the Project:
 Server and
 Client
Server (Central Index Server):
This server indexes the content of all the peers (i.e., Clients) that register with it. It also
provides
search facility to peers.
Server Functionalities:
 Registry and
 Search
Client:
As a client, the user specifies a file name with the indexing server using "lookup". The
indexing
server returns a list of all other peers that hold the file. The user can pick one such peer and
the
client then connects to this peer and downloads the file.
Major function of the peer:
 Download
As a server, the peer waits for requests from other peers and sends the requested file when
receiving
a request. The Peers (i.e., Clients) here, act as both the client and the server. This server is
different
from the central index server which only indexes the files. But, the server functionality of
the peer
can be used to download the files from its directory. The peer acts a client to download the
files
from other peers into its directory.
The peers provide the following interface to the users:
1. Register – registers the file into the server
2. Search – searches the server for a file and returns the list of Clients
3. Download – downloads the file from another Client

3
Implementation
I. Program

4
5
6
Results & Interpretation
I. Output screenshots with respect to inputs justifying the
outcomes alongwith small explanations.

Server:
We Start our execution by executing the Server –

Now Server will open its Socket and waits for the Clients to get connected
Client:
We will register 3 clients(Peers) on to the Server as per the project requirement
For Client1 -

For Client2-

Now, we will enter the directory of the files for each client along with the port number and the
peerid
For Client1 –

For Client2 –

7
Once all the clients have registered on to the server, the total available filenames at each of the
clients will be registered in the Server –

For Searching the Files and Downloading it to the desired folder:


Go to the desired Client (Say suppose, Client 2 ) to where you want to download the file to.
Give the name of the desired file that you want to download from the list of the files available in
the Server along with corresponding port number and the peerid–

Once the file gets downloaded-

8
Conclusion
Peer-to-Peer is a decentralized version of the simplest form of network architecture.
Computer systems can communicate with all other computer systems.

The main focus of the peer-to-peer network model is on communication between


computer systems.

Peer-to-peer network architecture allows each computer system to communicate


directly with every other computer system, so no centralized server is used.
In a P2P network, when two devices are communicating, one device acts as a client
and the other device becomes a server, and vice versa.

A centralized directory network architecture is similar to a client-server architecture


in that there is a large central server that provides directory services to peers.
In the query flood approach, communication is actually between peers, not between
the central system and the peers.

Systems using heterogeneous systems do not treat all connected peers equally, but
peers with higher bandwidth and network connectivity are served with higher
bandwidth.
Priority.

Peer-to-peer network architectures are not very secure, and data and other shared
resources are easily discovered and used by unauthorized users.
Because each computer system functions as an independent server and client, each
computer system user must be trained to perform administrative tasks.

1
References

[1] Computer Networks, Andrew S. Tannenbaum, Pearson India.

[2] Java Network Programming by Harold, O’Reilly (Shroff Publishers).

[3] https://www.geeksforgeeks.org/p2p-peer-to-peer-file-sharing/

[4] https://en.wikipedia.org/wiki/Peer-to-peer_file_sharing

[5] https://www.scaler.com/topics/p2p-file-sharing/

You might also like