Saturday, September 11, 2004

P2P Server在网络游戏领域的应用

前言

peer-to-peer (P2P,对等网络计算)并非一种全新的技术。虽然 P2P 这个术语现在才被提及。 P2P 基本技术的存在时间至少和 USENET(1979年)、FidoNet(1984年) 这两种非常成功的分布式对等网络技术一样长,甚至更长些。在最初的 P2P 应用出现时,许多使用该技术的人们甚至不会使用计算机。

什么是P2P?并没有确切的定义,业界有不同的观点或理解。最受认同的是如下描述:P2P使得任何网络设备可以为其他网络设备提供服务(Peer-to-peer technology enable any network-aware device to provide services to another network-aware device)。


一 基本原理

经过大量的研究与探索,点石软件对于P2P技术应用在服务器上以有效节省运行开支,已经有了一整套的解决方案,简称为P2P Server。以下谨在原理方面做一些简单介绍。

P2P技术能够应用在Server上的前提是分布式服务器架构。在分布式服务器解决了灵活扩展、负载均衡以及同步等问题的基础上,将其中的某些服务器下放到客户的机器上,就形成了P2P Server架构,如图所示:


图示Client Server为一个普通的用户,在他的PC机上运行了服务器软件。


二 P2P与传统应用的区别和优势

大多数情况下,我们使用一种称之为客户机/服务器(Client/Server,简称C/S)的网络模式。比如流行的WWW,各种网络游戏等。它们的共同特点是都需要有一个中央服务器来处理绝大部分的运算工作。客户端和服务段处在完全不同的角色中。客户端更被动,通常是发送一个请求。而服务端处在一个支配的地位,获取这个请求,进行计算,然后返回一个结果来相应这个请求。

这类网络应用模型有着一个明显的缺点就是:随着服务的客户数目的增多,服务端所需要占用的资源也随之增加,显而易见最终制约了client的数目的增长。(这种集中式的模型似乎违背了Internet的初衷,the ARPANET)。并且,我们需要许多隐藏在Internet深处的服务的支持才能获取我们需要的服务,如DNS,如路由。这也就是为什么即便每台机器都开设一个web server,也无法被全部被访问到。(由于IP地址的限制,不可能每台机器都有一个静态的IP。或是由于内部网络的原因,也许即便你有一个静态不变的内部地址,也可能没有一个路由到达你的机器或是访问被防火墙过滤)。并且由于现在的Internet过分的依赖于DNS和网关,只要其中某个服务出了问题,相应的其他任何服务就都无法获得。

而P2P技术,使用很少的资源消耗,却能提供高可靠性的服务。P2P可以消除单个资源带来的瓶颈,可以控制和实现网上各节点的负荷平衡。除了优化运算性能外,P2P本身的机理就可以防止单点运算失败后带来的危害。企业使用P2P,各对等点上的分布式运算能力可以代替费用很高的数据中心。为了数据的检索和备份,也可以让各对等点分担存贮。此外,P2P的基础设施支持直接访问和共享空间,使远程维护得以实现。

对于网络游戏运营商来说,由于服务器的部分功能转移到了用户的机器上,有效利用了用户的计算机及带宽资源,运营商在服务器及带宽上的投资可获得极大的节省。除此之外,由于P2P Server架构令到主运营商能够方便的将某些特定功能的服务器放到联盟运营商的机房内,因此可能导致一种新的商务模式:联盟运营。对于诸多的中小运营商来说,这无疑是极有吸引力的。


三 目前网络游戏行业的P2P应用现状

日渐庞大的游戏客户端、补丁和升级等文件的下载,对网络游戏服务商的硬件系统形成压力。特别是比较受欢迎而运行服务器端又集中的网络游戏,如何承受大量用户的同时下载,是日渐凸显出来的一个问题。P2P Server能解决此问题,为网络游戏运营商节约带宽和硬件投资的同时,迅速将文件发布到用户。共享用户在下载较大文件的时候,同时也为其他用户提供了下载服务,共享用户越多,文件下载速度越快。

对于网络游戏开发和运营而言,高额成本服务器及带宽资源成本是令多数服务网游厂商头痛的一件事情,而在另一个方面,当游戏网民在玩网络游戏时,只会使用极少量的计算资源和带宽资源,造成了极大的资源浪费现象。而P2P技术最大的优势在于充分利用边缘性的计算资源以降低对中央服务器计算能力的消耗,这就为两者的充分有效结合奠定了良好的技术基础。

6 comments:

  1. Anonymous3:06 PM

    Hi there Arcadia. You know some of these blog sites have more info on them than regular websites. I've been searching websites looking for mp3 music sharing related info, I decided to try blog sites. And it seems like everybody but me has one. Anyway, I'm trying to improve my site at http://www.p2p-mp3-filesharing.com and needed more substantive information I could use. Got sidetracked a wee bitl. Had fun though. Thanks Arcadia, Mike

    ReplyDelete
  2. Anonymous5:21 PM

    Hi Arcadia, I was looking for peer to peer related info for my site at http://www.p2p-mp3-filesharing.com and thought I would check out some blog sites. I get sidetracked easily these days....getting old...lol. It was an interesting read. Thanks, mike

    ReplyDelete
  3. Anonymous4:00 PM

    Hi and hello there Arcadia, I get sidetracked easily these days. After spending many hours checking out websites looking for peer to peer related info. I decided to try some blog sites. I found much more usable and updated information on the blog related sites than the regular websites...this is very cool. I gotta get me one of these when I find the time. My site at http://www.p2p-mp3-filesharing.com needed some updated info. After that, I thought I would check out some of the other kind of blog sites. Some are pretty cool. It's been fun. Thanks Arcadia, mike

    ReplyDelete
  4. Anonymous9:34 PM

    Hey Arcadia, nice blog site. Seems everybody has one of these blog sites except me. Even my sister has one, but she just likes to complain about everything....and I really mean everything. You know, the world sucks, etc...lol. She started it after her boyfriend dumped her. Originally I started out searching websites looking for mp3 music sharing related info to improve the traffic at my site http://www.p2p-mp3-filesharing.com; then I decided to try blog sites. There are so many of them it's unbelievable. I never heard of or knew what a blog was until last year. Anyway, I'm trying to improve my site at http://www.p2p-mp3-filesharing.com and was originally looking for relevant information I could use. Got sidetracked a bit....lol. It was interesting. Thanks Arcadia, Mike

    ReplyDelete
  5. Anonymous4:53 PM

    Hi Arcadia, I was looking for peer to peer related info for my site at http://www.p2p-mp3-filesharing.com and thought I would check out some blog sites. I get sidetracked easily these days....getting old...lol. It was an interesting read. Thank You

    ReplyDelete
  6. Anonymous12:09 AM

    Hi Arcadia,
    I was looking for information about peer to peer file sharing when I came across your blog. P2P Server在网络游戏领域的应用 doesn't really cover what I was after but it sure looks like it'll be useful. I'm off to find more resources on peer to peer file sharing. Good luck and keep it up.

    ReplyDelete