计算机(Computer)网络有两种类型。一种是客户端服务器模型(Client server model),其中所有计算机都连接到便于文件共享的服务器计算机。另一种类型的计算机网络是对等(Peer to Peer)网络。点对点意味着没有专用服务器。顾名思义,它们作为对等点连接——直接相互连接,而不必连接到服务器。本文介绍了通过有线网络和Internet(Internet)进行的点对点文件共享。
什么是对等(Peer)((Peer) P2P )(P2P)网络
当涉及到术语对等网络(也称为P2P 网络(P2P networks))时,出现了一张图片 - 几台直接相互连接的计算机。它们可以通过USB或以太网(Ethernet)电缆连接。假设有A、B、C三台计算机,如果A连接B,B连接C,那么A的用户可以很方便的访问连接到C的文件和打印机,前提是C计算机允许文件和打印机共享。它就像Windows操作系统中的家庭组(Homegroup)网络。
还可以使用集线器实现对等网络,这样您就不需要额外的以太网(Ethernet)卡来启用文件和打印机共享。理想情况下,集线器可以是具有多个LAN端口或 USB 集线器的路由器。请参阅下图了解它的外观。
通过对(Over Peer)等网络共享文件
对等(Peer-to-peer)网络可以在本地或通过使用Internet实现。在后一种情况下,计算机不使用以太网(Ethernet)电缆连接。相反,它们使用正常的Internet连接来相互连接。如果您一直在使用 BitTorrent,那么您就是这样一个点对点网络的一部分。两种类型的P2P(P2P)网络中的文件共享几乎以相同的方式发生。让我们先来看看普通的P2P家庭网络。
阅读:(Read:) 什么是 Torrent 文件(What are Torrent files)。
在基于 Windows 的P2P网络中,公用文件夹已被共享。它们在My Network下可见。如果没有,请转到每台计算机并共享您希望共享的文件和外围设备。
您可以通过右键单击文件夹并转到“共享(Share)”选项卡来选择要共享的文件夹。在不同版本的Windows(Windows)中,共享(Share)选项卡的名称可能不同。您可以通过勾选复选框来启用文件夹共享。在共享选项卡上显示的下拉列表中,选择所有人(Everyone)。您还可以从共享(Share)选项卡上的下拉列表中选择计算机,然后单击共享(Share)以与选定的计算机共享文件夹。
简而言之,有线对等网络中的文件和文件夹共享过程比您想象的要容易。只要将计算机连接到集线器,它们就会连接。
在互联网上通过(Internet)P2P传输文件
这就是BitTorrent的用武之地。协议BitTorrent用于从Internet下载大文件。对于BitTorrent,一旦您开始下载,您的计算机就会成为Internet(Peer)上点对点(Peer)网络的一部分(Internet)。
需要明确的是,当可以通过BitTorrent(BitTorrent)下载大文件时,它不会托管在单台计算机上。它以不同部分的形式分布在多台计算机上。当您使用 .torrent 文件下载文件时,您会连接到多台计算机,并且您的BitTorrent客户端会从形成群(swarm)(或与该下载相关的一组计算机)的不同计算机下载不同的片段。
只要您正在下载,您的计算机也是该群的一部分,因为它与使用Internet的不同计算机建立了直接连接。此外,只要您的BitTorrent客户端正在运行,它就是在播种(seeding),即将下载的文件的一部分上传到Internet,以便同时尝试下载该文件的其他人可以从您的任何BitTorrent客户端下载它上传。这是对其他用户从其中接收文件的对等(peers)点(托管下载部分的计算机,直接连接,无需中间服务器)的补充。
这解释了点对点网络以及外行语言的文件或打印机共享。(This explains Peer to Peer networking and file or printer sharing in layman’s language.)
Peer to Peer Networking (P2P) and File Sharing explained
Computer networks are of two types. Оne is the Client server model where all computers are connected to a server computer that facilitates file sharing. The other type of computer network is Peer to Peer. Peer to peer means the absence of a dedicated server. As the name suggests, they are connected as peers – directly to each other instead of having to connect to a server. This article explains peer-to-peer file sharing over wired networks and the Internet.
What are Peer to Peer (P2P) Networks
When it comes to the term peer-to-peer network, also known as P2P networks, a picture appears – of a couple of computers connected directly to each other. They can be connected via USB or via Ethernet cables. Suppose there are three computers A, B, and C, if A connects to B and B connects to C, the users of A can easily access files and printers connected to C, provided the computer C allows for file and printer sharing. It is just like the Homegroup network in Windows operating system.
A peer-to-peer network can also be implemented using a hub so that you do not need extra Ethernet cards to enable file and printer sharing. A hub could ideally be a router that has more than one LAN port or a USB hub. See the image below for how it looks.
File Sharing Over Peer To Peer Networks
Peer-to-peer networks can be implemented locally or via the use of the Internet. In the latter case, computers are not connected using Ethernet cables. Rather, they use normal Internet connections to connect to each other. If you have been using BitTorrents, you have been part of such a peer-to-peer network. File sharing in both types of P2P networks happens almost in the same way. Let us take a look at normal P2P home networks first.
Read: What are Torrent files.
In Windows-based P2P networks, the public folders are already shared. They are visible under My Network. If not, go to each computer and share the files and peripherals you wish to share.
You can select which folders to share by right-clicking on the folder and going to the Share tab. The Share tab may be named differently in different versions of Windows. You enable folder sharing by ticking the check box. In the drop-down list that appears on the share tab, select Everyone. You can also select computers from the drop-down list on the Share tab and click Share to share a folder with select computers.
In short, the process of file and folder sharing in wired peer-to-peer networks is easier than you think. The computers are connected as soon as you connect them to the hub.
File Transfering via P2P on the Internet
This is where BitTorrent comes in. The protocol, BitTorrent, is used to download large files from the Internet. In the case of BitTorrent, as soon as you initiate a download, your computer becomes a part of the Peer to Peer network on the Internet.
To be clear, a large file is not hosted on a single computer when it is available for download via BitTorrent. It is spread over multiple computers in form of different parts. When you use a .torrent file to download a file, you connect to more than one computer, and your BitTorrent client downloads different segments from different computers that form a swarm (or a group of computers related to that download).
Your computer too, is a part of that swarm as long as you are downloading as it establishes a direct connection to different computers using the Internet. Also, as long as your BitTorrent client is running, it is seeding, i.e., uploading parts of the downloaded file to the Internet so that others who are trying to download the file at the same time, may download it from whatever your BitTorrent client is uploading. This is in addition to the peers (computers hosting parts of download, connected directly, without the need of a server in middle) from where the other user is receiving the file.
This explains Peer to Peer networking and file or printer sharing in layman’s language.