CN102291458B - Method for peer-to-peer (p2p) server framework - Google Patents

Method for peer-to-peer (p2p) server framework Download PDF

Info

Publication number
CN102291458B
CN102291458B CN201110230706.3A CN201110230706A CN102291458B CN 102291458 B CN102291458 B CN 102291458B CN 201110230706 A CN201110230706 A CN 201110230706A CN 102291458 B CN102291458 B CN 102291458B
Authority
CN
China
Prior art keywords
tracker
server
peer
master
channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201110230706.3A
Other languages
Chinese (zh)
Other versions
CN102291458A (en
Inventor
李茗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LeTV Information Technology Beijing Co Ltd
Original Assignee
LeTV Information Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LeTV Information Technology Beijing Co Ltd filed Critical LeTV Information Technology Beijing Co Ltd
Priority to CN201110230706.3A priority Critical patent/CN102291458B/en
Publication of CN102291458A publication Critical patent/CN102291458A/en
Application granted granted Critical
Publication of CN102291458B publication Critical patent/CN102291458B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method for a peer-to-peer (p2p) server framework with infinite horizontal expansion. The method comprises the following steps of: erecting a tracker server as a central tracker; performing two reconstructions on a firstly-built server framework along with the increase of the number of terminal peer; and respectively introducing a team speak (TS) server and a Master. By the method, the p2p server framework can be dynamically adjusted according to the number of terminals, and an effect that the p2p server framework can be infinitely and horizontally expanded is achieved at low cost.

Description

A kind of p2p server architecture method
Technical field
The present invention relates to a kind of p2p server architecture method, belong to multiple crossing domains such as computer network, Streaming Media, Video processing.
Background technology
P2P(Peer-to-Peer) " point-to-point " technology is otherwise known as, it makes full use of client's upstream bandwidth, in descending taking, also take upstream bandwidth, for other users provide resource, realize acceleration and the expansion of network, rely on computing capability and the bandwidth of participant in network, rather than be all gathered on less several station servers relying on.P 2 p technology has been removed the thought of central server, at utmost utilizes available bandwidth to reach data transmission at a high speed.
In prior art, comprise multiple terminal node peer in p2p system, represent client node, major function is that video playback (live, program request) and data are downloaded.In p2p system, also there is a class tracker server, be mainly used in recording position, the resource information of peer, in internal memory, safeguard relevant database, the related protocol forwarding capability that simultaneously provides peer inquiry, resource query and NAT to pass through.Be similar to directory service.And TS server, its major function is to provide the selection of peer to tracker.In p2p system, utilize section server to cut into slices to video flowing simultaneously, generate small video file (only live broadcast system use) one by one, the support of section server is cut into slices to MMS, RTSP, RTMP protocol streams.
Above-mentioned NAT passes through the FAQs relating in TCP/IP network, the problem connecting between the main frame in the privately owned TCP/IP network in having used NAT device.It comprises the several frequently seen mode of passing through: NAT/ALG mode, MIDCOM mode, STUN mode, TURN mode etc.
Whether server possesses horizontal extension ability is to weigh the important indicator of a cover system.Especially true for extensive, ultra-large p2p operation system.But using at present the most extensively p2p system is all to adopt based on CDN(content distributing network) network acceleration scheme.The horizontal extension ability of its server is very limited, and is a problem of existing p2p systems face.
Summary of the invention
In order to solve the problems of the technologies described above, the invention provides a kind of p2p server architecture method, can be understood as the one of existing flow medium live system framework is improved.
Above-mentioned p2p service architecture comprises tracker server, and tracker selects server (TS server), Master, and above-mentioned comprising the following steps:
Step 1, set up a tracker server as central tracker, all terminal peer communicate by letter with described central tracker; The quantity of the central tracker real-time judge terminal peer of described central authorities, in the time that the quantity of terminal peer is increased to threshold value N1 platform, execution step two;
Step 2, start many tracker servers, each tracker server is set up TCP with tracker selection server and is connected, and IP address registration is separately selected on server at tracker, and regularly reporting node load to count to tracker selection server, tracker selects server in internal memory, to set up and safeguard the database about tracker.
Another is more fully in execution mode, and described tracker selects the quantity of server real-time judge terminal peer, in the time that the quantity of terminal peer is increased to threshold value N2 platform, and execution step three;
Step 3, startup Master, described Master is for safeguarding the information about tracker server; Start all tracker servers, all tracker servers are set up TCP with Master and are connected, and the IP address of oneself is registered on Master, and timing report node load to count to Master;
Start all tracker and select server, all tracker selection servers are set up TCP with Master and are connected, and timing sends tracker request to Master, Master receives after request the IP of each tracker preserving, node load distribution of information to the TS filing a request.
Further, in above-mentioned steps two, terminal peer selects server domain name to send to dns server fixing tracker by DNS Protocol, request analysis tracker selects the IP address of server, dns server passes through intelligently parsing, select tracker to select server and by its IP address loopback to terminal peer, every selecteed probability of TS is equal to, therefore thereby reached tracker and select the load balancing of server cluster.
In an optional execution mode, in above-mentioned steps three, terminal peer selects server ip address to select server to send message to tracker by known tracker, applies for an available tracker server; Tracker select server by the node load getting from Master at most but the IP address loopback of a tracker that does not exceed the load upper limit to the peer that sends request.
According to of the present invention one preferred embodiment, in above-mentioned steps one, each terminal peer registers on central tracker by all channel channel that specify message format that self nodal information, this locality are had, and nodal information is defined as following four-tuple:
< unique identifier, WAN side IP, WAN side slogan, current time stamp >,
Channel information definition is following five-tuple:
The gateway address > of node under the information that is defined node under type, rank value, channel of node in Intranet, channel under < unique identifier MD5 value, channel.
Further, in described step 1, the communication process of terminal peer and tracker server is:
Terminal peer reports the nodal information of oneself to tracker server, tracker server is set up the also database of Maintenance Point information in internal memory;
Terminal peer is by the information reporting of all channel that self has entity video data to tracker, and tracker sets up and safeguard the database of channel information equally in internal memory;
When peer plays certain channel, T just sends resource request message to tracker server at set intervals, tracker is according to the MD5 of channel, and in database, inquiry has other peer of same channel, their nodal information is fed back to the peer filing a request.
Accompanying drawing explanation
Fig. 1 is the schematic diagram of the framework method for the first time to p2p service architecture method in technical scheme of the present invention;
Fig. 2 is the sequential chart of the framework method for the first time to p2p service architecture method in technical scheme of the present invention;
Fig. 3 is the schematic diagram of the first reconstruct structure method to p2p service architecture method in technical scheme of the present invention;
Fig. 4 is the sequential chart of the first reconstruct structure method to p2p service architecture method in technical scheme of the present invention;
Fig. 5 is the schematic diagram of the reconstructing method for the second time to p2p service architecture method in technical scheme of the present invention;
Fig. 6 is the sequential chart of the reconstructing method for the second time to p2p service architecture method in technical scheme of the present invention.
Embodiment
In order to set forth better aim of the present invention, illustrate in greater detail technical scheme provided by the invention below in conjunction with embodiment.
A kind of p2p service architecture method that the invention provides wireless horizontal extension, described method comprises:
Step 1, referring to accompanying drawing 1, first only set up a tracker server as central tracker server, all terminal peer all with this central tracker server communication (referring to accompanying drawing X, the tracker of these central authorities is the tracker+TS+Master in figure X), report nodal information, report resource information, resource bid is all by UDP, and communicate by letter with NAT Server built-in in tracker by TCP.
In above-mentioned steps one, each peer registers on central tracker by all channels (channel) of specifying message format that self nodal information, this locality are had, and nodal information is defined as following four-tuple;
< unique identifier, WAN side IP, WAN side slogan, current time stamp >
Channel information definition is following five-tuple:
Under < unique identifier MD5 value, channel node in Intranet be defined type (Leader[refers to possesses public network ip or first enters the node of p2p system a LAN] or Follower[in same LAN, non-first enters the node of p2p system, is referred to as Follower]), the gateway address > of node under the information, channel of node under rank value, channel
By reference to the accompanying drawings 2, further describe the communication process of terminal peer and tracker:
First tracker starts, and when each terminal peer starts, reports the nodal information of oneself to tracker, and tracker sets up the also database of Maintenance Point information in internal memory;
Terminal peer is by the information reporting of all channel that self has entity video data to tracker, and tracker sets up and safeguard the database of channel information equally in internal memory;
When terminal peer plays certain channel, T at set intervals, sends resource request message to tracker, and tracker is according to the MD5 of channel, in database, inquiry has the other-end peer of same channel, their nodal information is fed back to the terminal peer filing a request;
Between terminal peer and terminal peer, start to set up p2p and be connected, undertaken after TCP NAT passes through, can carrying out Point-to-Point Data transmission each other by the NAT Server in tracker.
The quantity of the tracker of central authorities real-time judge terminal peer, along with the increase of peer, in the time that the quantity of terminal peer is increased to threshold value N1 platform, the tracker of (referring to accompanying drawing X, the preferred value of N1 is 100,000) separate unit central authorities can not satisfy the demand, and conference initiating failure is crossed in load.
Therefore need to carry out step 2, in step 2, carry out reconfiguration system for the first time, introduce the concept of tracker cluster, and newly add a tracker selector equipment (being called TS), as shown in Figure 3.
Detailed operation flow process with reference to accompanying drawing 4 description of step two:
First TS starts;
Each tracker starts, and sets up TCP with TS and is connected, the IP address of oneself is registered on TS, and regularly report node load to count to TS, and TS sets up and safeguard the database about tracker in internal memory;
Each peer sends request message by known TS IP address to TS, applies for an available tracker server.TS by registered node load at most but the IP address loopback of a tracker that does not exceed the load upper limit to the peer that sends request;
Peer and the tracker learning from TS communicate, and reciprocal process is constant.
But have the generation of kind of situation: if back-end system only has separate unit TS, once TS fault or the machine of delaying will cause the paralysis of p2p system because peer cannot obtain the address of tracker, cannot with the point-to-point transmission data of other peer.
At this, the present invention further proposes step 3, in step 3 kind, system is carried out to reconstruct for the second time.In this step, need to carry out the expansion of TS, introduce the concept of TS cluster, on each TS, all store the also information of all tracker of Dynamic Maintenance, peer is no longer by concrete IP address, but sending tracker request message by domain name to TS, dns server, by intelligently parsing, arrives domain name Random Maps the IP of a certain TS, the probability that any TS is selected by peer is equal to, and has also just reached the load balancing of TS for peer.
If directly carry out TS expansion on original framework, arbitrary tracker will keep TCP to be connected with all TS, supposes to have N platform tracker, and an often newly-increased TS, will increase N bar and connect, and this is worthless.Therefore the strategy adopting is: a newly-increased Master equipment, tracker no longer reports but the Master that alters course reports to TS, in Master, safeguard the database about tracker, each TS initiates TCP to Master and connects, and regularly send request to Master, obtain current all tracker information.Like this, a newly-increased TS, has only increased a TS and has been connected with the TCP of Master.System architecture after reconstruct as shown in Figure 5 for the second time.
6 carry out in more detail reconstruct workflow for the second time and describe by reference to the accompanying drawings at this.
First Master starts;
Each tracker starts, and sets up TCP with Master and is connected, the IP address of oneself is registered on Master, and regularly report node load to count to Master;
Each TS starts, and set up TCP with Master and be connected, and timing sends tracker request to Master, Master receives after request that, by the <IP of each tracker preserving, node load > set is distributed to the TS filing a request;
Each peer sends to dns server by DNS Protocol by fixing TS domain name, the IP address of request analysis TS, dns server is by intelligently parsing, select a TS and by its IP address loopback to peer, every selecteed probability of TS is equal to, therefore reached the load balancing of TS cluster;
Peer sends message by known TS IP address to TS, applies for an available tracker server.TS by the node load getting from Master at most but the IP address loopback of a tracker that does not exceed the load upper limit to the peer that sends request;
Peer and the tracker obtaining communicate, and reciprocal process is constant.
The method that the present invention proposes is utilized ripe technology the most fully, simplifies greatly system, and between subsystem, coupling is as far as possible low, reduce system is relied on as far as possible, pursuit entire system optimum, but not single-point optimum, thus reach the infinitely effect of horizontal extension of p2p server architecture.
Method and system of the present invention is not limited to the embodiment described in embodiment, and those skilled in the art's technical scheme according to the present invention draws other execution mode, belongs to equally technological innovation scope of the present invention.

Claims (7)

1. a p2p service architecture method, described p2p service architecture comprises tracker server, and tracker selects server, and master server Master, is characterized in that, comprises the following steps:
Step 1, set up a tracker server as central tracker, all terminal peer communicate by letter with described central tracker; The quantity of described central tracker real-time judge terminal peer, in the time that the quantity of terminal peer is increased to threshold value N1 platform, execution step two;
Step 2, start many tracker servers, each tracker server is set up TCP with tracker selection server and is connected, and IP address registration is separately selected on server at tracker, and regularly reporting node load to count to tracker selection server, tracker selects server in internal memory, to set up and safeguard the database about tracker; Terminal peer selects server domain name to send to dns server fixing tracker by DNS Protocol, request analysis tracker selects the IP address of server, dns server passes through intelligently parsing, select tracker to select server and by its IP address loopback to terminal peer, every tracker selects the selecteed probability of server to be equal to, thereby has reached the load balancing of tracker selection server cluster;
Described tracker selects the quantity of server real-time judge terminal peer, in the time that the quantity of terminal peer is increased to threshold value N2 platform, and execution step three;
Step 3, startup Master, described Master is for safeguarding the information about tracker server; Start all tracker servers, all tracker servers are set up TCP with Master and are connected, and the IP address of oneself is registered on Master, and timing report node load to count to Master;
Start all tracker and select server, all tracker selection servers are set up TCP with Master and are connected, and regularly sending tracker request to Master, Master selects server by the IP of each tracker preserving, node load distribution of information to the tracker filing a request after receiving request.
2. the method for claim 1, is characterized in that:
In above-mentioned steps three, terminal peer selects server ip address to select server to send message to tracker by known tracker, applies for an available tracker server; Tracker select server by the node load getting from Master at most but the IP address loopback of a tracker that does not exceed the load upper limit to the peer that sends request.
3. the method for claim 1, is characterized in that:
In above-mentioned steps one, each terminal peer is by specifying message format that self nodal information is registered on central tracker, and nodal information is defined as following four-tuple:
< unique identifier, WAN side IP, WAN side slogan, current time stamp >.
4. method as claimed in claim 3, is characterized in that:
Each terminal peer registers on central tracker by all channel channel that specify message format further this locality to be had, and channel information definition is following five-tuple:
The gateway address > of node under the information that is defined node under type, rank value, channel of node in Intranet, channel under < unique identifier MD5 value, channel.
5. method as claimed in claim 3, is characterized in that:
In described step 1, the communication process of terminal peer and tracker server is:
Terminal peer reports the nodal information of oneself to tracker server, tracker server is set up the also database of Maintenance Point information in internal memory;
Terminal peer is by the information reporting of all channel that self has entity video data to tracker, and tracker sets up and safeguard the database of channel information equally in internal memory.
6. method as claimed in claim 5, is characterized in that:
When peer plays certain channel, T just sends resource request message to tracker server at set intervals, tracker is according to the MD5 of channel, and in database, inquiry has other peer of same channel, their nodal information is fed back to the peer filing a request.
7. method as claimed in claim 2, is characterized in that: described N1 is 100,000, and described N2 is 1,000,000.
CN201110230706.3A 2011-08-12 2011-08-12 Method for peer-to-peer (p2p) server framework Expired - Fee Related CN102291458B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110230706.3A CN102291458B (en) 2011-08-12 2011-08-12 Method for peer-to-peer (p2p) server framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110230706.3A CN102291458B (en) 2011-08-12 2011-08-12 Method for peer-to-peer (p2p) server framework

Publications (2)

Publication Number Publication Date
CN102291458A CN102291458A (en) 2011-12-21
CN102291458B true CN102291458B (en) 2014-06-18

Family

ID=45337559

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110230706.3A Expired - Fee Related CN102291458B (en) 2011-08-12 2011-08-12 Method for peer-to-peer (p2p) server framework

Country Status (1)

Country Link
CN (1) CN102291458B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103561013B (en) * 2013-10-29 2016-07-13 越亮传奇科技股份有限公司 The data distribution systems of Streaming Media
CN106936796B (en) * 2015-12-30 2019-11-29 华耀(中国)科技有限公司 A kind of server load balancing method and apparatus based on SNI
CN106331090A (en) * 2016-08-23 2017-01-11 国家电网公司 IPv6 trusted network-based reconfigurability implementation method
CN108322496A (en) * 2017-01-17 2018-07-24 北京京东尚科信息技术有限公司 Image file distribution method and system, computer readable storage medium, electronic equipment
CN115022657B (en) * 2022-05-30 2023-12-26 上海哔哩哔哩科技有限公司 Scheduling method and device of live broadcast server

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5483535A (en) * 1995-01-17 1996-01-09 Zeta Music Partners Communications network interface, and adapter and method therefor
CN101098271A (en) * 2006-06-29 2008-01-02 腾讯科技(深圳)有限公司 Expandable P2P flow media system
CN101714987A (en) * 2009-11-16 2010-05-26 中国电信股份有限公司 P2P playing method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046806B (en) * 2006-03-30 2010-07-21 腾讯科技(深圳)有限公司 Search engine system and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5483535A (en) * 1995-01-17 1996-01-09 Zeta Music Partners Communications network interface, and adapter and method therefor
CN101098271A (en) * 2006-06-29 2008-01-02 腾讯科技(深圳)有限公司 Expandable P2P flow media system
CN101714987A (en) * 2009-11-16 2010-05-26 中国电信股份有限公司 P2P playing method and system

Also Published As

Publication number Publication date
CN102291458A (en) 2011-12-21

Similar Documents

Publication Publication Date Title
US10171523B2 (en) Multi-tier push service control architecture for large scale conference over ICN
Zhang et al. Unreeling Xunlei Kankan: Understanding hybrid CDN-P2P video-on-demand streaming
CN102231762B (en) Peer-to-peer (p2p) server architecture capable of being unlimitedly and horizontally expanded
US9432408B2 (en) Signalling gateway, method, computer program and computer program product for communication between HTTP and SIP
US20110246608A1 (en) System, method and device for delivering streaming media
US20100250701A1 (en) Conditional protocol control
CN108234207B (en) Fault positioning method and device based on Content Delivery Network (CDN)
CN103825975A (en) Cdn node distribution server and system
CN102291458B (en) Method for peer-to-peer (p2p) server framework
CN101282281A (en) Medium distributing system and apparatus as well as flow medium play method
CN102231761A (en) Peer-to-Peer (P2P) data interaction method
CN104509073A (en) Discovering ip multicast group memberships in software defined networks
EP2744168B1 (en) System, method and live streaming optimizer server for live content distribution optimization over a content delivery network
Lederer et al. Towards peer-assisted dynamic adaptive streaming over HTTP
CN103139656A (en) Method of managing cluster type dynamic network distribution trees of video live broadcast distribution network
CN101662508B (en) Method for data transmission based on point-to-point protocol, device and system thereof
US10601910B2 (en) Method for broadcasting a piece of content in an it network
Guo et al. P2Cast: peer-to-peer patching for video on demand service
Ramakrishnan et al. Adaptive video streaming over ccn with network coding for seamless mobility
US20130159547A1 (en) Data transfer system
CN109040199A (en) A kind of method, system and storage medium for distributing resource data
CN102387062A (en) Method for improving transmission rate of peer-to-peer (p2p) node in crossing network by dynamic bridging contact
CN101286928B (en) Method for realizing P2P stream media system based on bandwidth guaranty technique
Wang et al. An efficient relay node selection scheme to improve the performance of P2P-based VoIP applications in Chinese internet
Ramadha et al. Design and implementation named data networking-based video streaming system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140618

Termination date: 20170812