Summary of the invention
The objective of the invention is to reduce the use of conference system to the bandwidth of enterprise's outlet bandwidth, Intranet by making up a real-time P2P transmission network, minimizing to the influence of system, ensures the real-time transfer of data when a node withdraws from.
The technical solution used in the present invention is: a kind of system and method that utilizes P2P jump seed to realize the IP network real time communication comprises: Control Server, transmission server and client; Control Server is divided into some broadcasting groups with client, and client-side information and broadcasting group information are managed; The broadcasting group comprises an issue broadcasting group and at least and receives the broadcasting group, comprises the data source client in the issue broadcasting group; Transmission server, the multi-medium data of reception data source client is sent to reception broadcasting group with the multi-medium data that receives; The data source client is carried out subpackage to data and is sent; In issue broadcasting group, the data source client is finished in the mode of broadcasting in the group of data and is distributed; For receiving the broadcasting group, transmission server is sent to reception broadcasting group one by one with the packet of data source client transmissions, each the reception client that receives in the broadcasting group receives packet successively in turn, become the seed of each packet successively in turn, then the packet that receives is finished in the mode of broadcasting in the group of data and distributed; The minimum broadcasting group of distance of reception broadcasting group middle distance outlet route is the one-level group, or when identical apart from the distance that exports route, what broadcasting group member quantity was maximum is the one-level group, and all the other broadcasting groups are the child group of this one-level group; The data source client is sent to the one-level group one by one by the data that transmission server sends, client in the one-level group receives packet successively in turn, on the one hand, the data that the packet that receives is finished in the group in the mode of broadcasting are distributed, on the other hand, each client becomes the seed of packet successively, and the packet that receives is sent to the son group, the seed that becomes each packet successively in turn of client in its sub-group is broadcast to other interior clients of son group with the packet that receives; Issue broadcasting group has father's group, son group or brother's group; The data source client is sent to father's group or son group with the data subpackage in the issue broadcasting group, on the one hand, each client in father's group or the son group receives packet successively in turn, become the seed of each packet successively in turn, the data that the packet that receives is finished in the group in the mode of broadcasting are distributed then; On the other hand, client as seed in the father organizes is sent to brother's group with packet, each client in the fraternal group receives packet successively in turn, becomes the seed of each packet successively in turn, and the packet that receives is broadcast to other interior clients of brother's group.
The data source client is to each package number, and client, transmission server be by the numbering of packet and the number of members in the broadcasting group, sends to that member in the broadcasting group by getting surplus determination data bag, finishes the transmission of data.
The present invention has following beneficial effect:
1, adopts the spread spectrum system that is similar to radio communication, adopt the participant to share the seed of same Media Stream, be reduced in single participant and go offline the quality influence of P2P Streaming Media.
2, adopt broadcasting prescription formula, minimizing takies the network physical flow, and the interior airtime time-delay of group is very little, is adapted to real-time Data Transmission.
3, according to the network delay comparison, choose optimal path between the broadcasting group, reduce network delay.The topological structure of Intranet is considered in communication between the i.e. broadcasting group, reduces time delay, can effectively reduce the pressure of network internal to the enterprises wide area network simultaneously.
4, the P2P networking is controlled by central server, is not holding autonomous networking by participation, and this has reduced on the one hand to node variation causing time-delay, makes that also this P2P network is a reliable network that retractility is extremely strong simultaneously.
5, adopt technique scheme, this invention is in conjunction with the P2P characteristics, divide a P2P group by the member that can use the broadcasting intercommunication, group is interior by the jump seed, be broadcast to all members in the net, each group membership is being seeds when server or upper level broadcasting group are taken data, at this moment arrive other all members by broadcast data, when this member when using this group membership's data, be again the node of P2P, this mode has determined, any data only occur once on external interface, on in-house network physics netting twine, occur twice (obtaining from the outside once to reach broadcasting once), effectively controlled, and outlet bandwidth has been controlled in strictness network bandwidth requirements.
Embodiment
A kind of P2P of utilization jump of the present invention seed realizes that the system and method for IP network real time communication is the P2P system that serves when being applicable to network implementation, be suitable for the transfer of data of serving in real time with multimedia conferencing and other the Internet, this method utilize to be introduced multicast and dynamic seed technology, effectively reduces the time delay of system and seed and switches influence to real time data.Specific implementation is an example with the large multimedia conference, shows specific implementation occupation mode of the present invention.Now specifically describe as follows in conjunction with the accompanying drawings:
One, system constitutes
See also Fig. 1, the transmission of P2P system of the present invention responsible meeting real time data in multimedia conferencing, system is by the P2P Control Server, and transmission server and P2P client three parts are formed.
The responsible route selecting of client being divided into groups to safeguard and carry out the P2P client of P2P Control Server, when client changes, the P2P Control Server is responsible for control transmission server and P2P client, change the data Distribution status, regulate route between P2P broadcasting group and group, make transfer of data under unbroken situation, continue to provide real time data stream.
The data that transmission server sends the data source client are sent to the member that P2P client or one-level group jumping mode transmit data to the broadcasting group one by one.Transmission server need be safeguarded the heartbeat with the P2P client, and is unusual or when sending data failure, notice P2P Control Server is regulated strategy in the heartbeat of P2P client.Data transfer server is responsible for changing strategy notice P2P client simultaneously.The P2P client is responsible for receiving data, and will give all members of same broadcasting group from the data broadcasting that transmission server or upper level broadcasting winding is received, and is responsible for being distributed to the reception member of next stage broadcasting group.
At first, two notions that need to distinguish are: the transmission of IP packet, refer to send at the packet of main frame of IP to another main frame, and be the mode that man-to-man IP packet sends.The IP multicast is IPv4﹠amp; All hosts can both efficiently transfer data to by multicast and will organize interior other main frames in the standard definition of v6, broadcasting group.
Below in conjunction with accompanying drawing each system is described in detail respectively:
Two, P2P Control Server
P2P Control Server, P2P Control Server are responsible for safeguarding P2P broadcasting group data, realize its function by the control to P2P client and P2P broadcasting group data, and corresponding data formation comprises:
The P2P client data:
The data field title |
Type |
Explanation |
m_userID |
32 integers |
Client user ID |
m_IP |
128 integers |
The Intranet IP of client supports IPv6 |
m_mask |
128 integers |
The Intranet IP subnet mask of client |
m_publicIP |
128 integers |
The public network IP of client Connection Service device is supported IPv6 |
m_ttl |
32 integers |
The IP network routing times |
m_p2pGroupID |
32 integers |
Under ID number of P2P broadcasting group |
P2P broadcasting group data structure:
The data field title |
Type |
Explanation |
m_p2pGroupID |
32 integers |
ID number of P2P broadcasting group |
m_members |
The tabulation of P2P client data |
Member's tabulation of this broadcasting group |
m_parent |
P2P broadcasting group data pointer |
Father's group of this broadcasting group |
m_isSameParent |
The Boolean type |
It is identical whether sign reorganization organizes ttl with the father |
m_children |
The data list of P2P broadcasting group, sub-Groups List |
Sub-Groups List is organized in this broadcasting, writes down all son groups |
m_IP |
128 integers |
Broadcasting group broadcast address |
m_multicastPort |
32 integers |
Broadcasting group data broadcasting IP port numbers |
m_discvPort |
32 integers |
Broadcast the IP port numbers of shaking hands |
m_parentPort |
32 integers |
Receive the IP port numbers that father's broadcasting group sends to this node data |
m_childPort |
32 integers |
Receive the IP port numbers that sub-broadcasting group sends to this node data |
When the P2P client was linked into transmission server, client member's public network IP just obtained, and the member is with oneself Intranet IP and Mask(mask) value passes to transmission server, indicts the P2P Control Server by transmission server, sets up the P2P client data.
The P2P Control Server is by Intranet IP and Mask, determine this P2P client whether with other clients at the same network segment, incorporate the machine of the same network segment into same broadcasting group.
If the public network address of P2P broadcasting group is identical, then can determine these machines within same local area network (LAN), at first attempt whether can intercoming mutually by multicast, if can, these members are merged into a P2P broadcasting group.If can not communicate by letter, by IP bag TTL(Time to Live), determine the distance of two group memberships apart from the outlet route, of TTL minimum is set to the one-level group.For the identical group of TTL, think group of peers, choose maximum one of member and do the one-level group, other all become its child group, but the nominal attribute is the peer-group of father's group, can upgrade to father's group, if the member of father's group has withdrawed from, this group can upgrade to father's group, convenient upgrading.The organizational form of broadcasting group, according to the customer network structure, high more the closer to the seniority in the family of the broadcasting group that exports route, be responsible for obtaining data and be distributed to next stage broadcasting group (that is: son group) from upper level broadcasting group, group of peers under same father's group is called brother's group.
After the physical packets mode of above-mentioned broadcasting group is determined,, divide, the broadcasting group is comprised issue broadcasting group and receives the broadcasting group according to function in order to describe technical scheme of the present invention in the aspect.Wherein, issue broadcasting group is the broadcasting group that includes the data source client.According to different network topology structures, issue broadcasting group can have father's group, son group or brother's group, has father's group, son group or brother's group equally and receive the broadcasting group.
When P2P broadcasting group structure, when P2P client member changes, P2P Control Server notification transmission server, and notify all relevant P2P clients by transmission server, dynamically adjust the structure of P2P broadcasting group, the member condition of P2P client, transmission and client are adjusted immediately, ensure that real-time Data Transmission is unimpeded.
Three, transmission server
The connection and the heartbeat of transmission server maintain customer end, the state-maintenance of responsible client, responsible data with the distribution of data source client send other one-level group to or do not add the P2P client of broadcasting group.The mode of distribution will be described in detail as follows.
1, one-level father's group of at first getting rid of the P2P group at data source place, these group data are responsible for direct P2P distribution by data source place client.
2, for other P2P group, according to group membership's number the serial number of packet is got surplusly, this packet is sent to which number member of this broadcasting group according to this remainder decision.
3, for the client that does not add P2P broadcasting group, direct packet distribution.
Because of transmission server is responsible for the data distribution, according to the serial number of source data packet, dynamically different members is set to the seed of P2P, allow it that data are distributed to same group membership or next stage group membership.
Because this P2P mode mainly in the face of real time data, as the RTP packet, therefore is specially adapted to Streaming Media and UDP message, heartbeat can prevent the drift of UDP mouth, ensures that transmission is efficient.Connect for TCP, heartbeat still needs, and is used to prevent the diagnosis of TCP line interruption.
Four, P2P client
The P2P client comprises three partial functions: first: the data collection of P2P broadcasting group; Second: assist the transmission service, real time data is sent to relative client; The 3rd: have the data source function, be responsible for source data is sent to father's group, son group and the transmission server of issue broadcasting group, this client with data source function is called the data source client.
The data structure of P2P client is similar with Control Server, and different is that child group and father that the P2P client is only preserved own place broadcasting group organize information, do not have the data message of other groups.
When the P2P client connects transmission server, send this machine local IP and Mask to transmission server, by the transmission server Control Server of passing on, transmission server is given the P2P client with its P2P broadcasting group information loopback, and the P2P client is got in touch with this group membership by the broadcasting mouth of shaking hands, answer Control Server with those client multicast successes, server can divide these clients at same group, issues group change information, and client adding broadcasting winding is subjected to the data-message from the broadcasting group.Simultaneously, client still keeps when data are imperfect, to the transmission server request for data, ensureing the reliability of real time data with the heartbeat of transmission server.
Client can be accepted from the data of transmission server or the data of upper level group, and client is responsible for the data from transmission server or upper level group are broadcast to same group client by broadcasting IP and port.Client also will by packet in proper order number and the number of members of son group, change that member that packet sends to the son group by getting surplus decision, send the data to each son group.For example, in client stream medium data is sent, the sequence number that adopts the RTP bag is as packet number, the child group of group has 7 members under own, and sequence number is that 1 bag sends to first sub-group membership, and sequence number is that 2 bag sends to second sub-group membership, by that analogy, sequence number is that 7 bag sends to the 7th sub-group membership, sends to first sub-group membership and sequence number is 8 bag, and sequence number is that 9 bag sends to second sub-group membership.When each member receives this bag, at first adopt identity logic, send data to all son broadcasting group memberships, send the data on the same group member by multicast then, data just have been distributed to P2P broadcasting group membership and son is organized all members like this.
When client was data source, client will directly send the data to transmission server, simultaneously, to the broadcasting of own place transmission group, sent to child transmission group, and number getting surplus mode in proper order by bag, to determine to adopt which P2P broadcasting member be seed, transmits this packet.At this moment, also will organize transmission to the father, it is the same that mode is led to son broadcasting member transmission.Different is that the father broadcasts the packet that the group membership receives sub-broadcasting group, organize transmission to his father, will send to other son broadcasting group membership simultaneously.So just can cover all the P2P groups under the same outlet.
Five, system works flow process
System works can be divided into following flow process.
1, P2P client adition process
As shown in Figure 2, when the P2P client was connected to transmission server, the inside IP and the Mask that send oneself served to transmission, and transmission server is with client's public network IP, inner IP and Mask deliver to the P2P management server, management server is searched same public network IP and Intranet IP in the P2P of same network segment group according to these information, if this P2P group does not exist, create a P2P group, this user is joined this group, and information is returned to transmission server, the transmission service sends it back the P2P client with information.
2, the P2P client is upgraded the P2P group
As shown in Figure 2, the P2P client is after receiving P2P broadcasting group information, find broadcasting mouthful transmission adding group message at P2P, the broadcasting group membership upgrades information about firms, if other P2P group memberships receive this message, reply this message, expand this broadcasting and organize another P2P group, after this client receives that this replys, send the request of upgrading the P2P group to transmission server, whether the transmission server decision merges this group, issues group change information to transmission server, the relevant P2P client of transmission server notice is adjusted P2P transmission group.
3, the P2P client sends source data
The P2P client provides data source, to each package number, data send to the father's multicast group and the sub-multicast group of transmission server and P2P group, and transmission means is the same, data message is issued different P2P clients in turn, makes the P2P seed be served as in turn by different clients.Improve real-time and availability.Fig. 3 and Fig. 4 represent the distribution of two bags respectively, source from real time data, shared end as audio frequency and video, send data to transmission server (step 1.0), father's group (step 1.1) and son group (step 1.2), broadcasting (step 1.3) in the P2P broadcasting group of oneself simultaneously, dark color is the recipient among the figure, also is the seed of next stage node, can see that the seed of continuous two bags jumps.
4, transmission server distributing data
When the P2P client provides data source to arrive transmission server, transmission server is at first got rid of the one-level father P2P broadcasting group at this data source client place, data are distributed to other broadcasting groups, and ways of distribution remains takes turns the seeds that the P2P client of changing commanders different is regarded different bags, transmission by turns.Step 1.0.1 among Fig. 3 and 4 is that packet is sent to different P2P broadcasting groups with 1.0.2, and adjacent two bags send to different recipients respectively, shown in dark part among the figure, is typical seed jumping mode.
5, P2P client distributing data
P2P client for one-level father group can be received the packet that transmission server sends, for this group two or more P2P clients are arranged, need this packet of multicast to other recipients, finish distribution in the group, simultaneously, this P2P client needs this packet is sent to all son groups, and the packet that is distributed to the son group adopts takes turns to send between same sub-group membership, realizes the jump seed.
For receiving father node data, be considered as equally handling with the packet that the transmission server sends.
For receiving son group packet, need in this group, broadcast equally, need to be transferred to father's broadcasting group and other child broadcasting group simultaneously.To broadcasting group transmission data mode is consistent.Promptly take turns to send, realize the jump seed to different P2P clients.
Step 1.0.1.1 among Fig. 3 and 4 and 1.0.2.1 representative data recipient respectively receive server data and distribute in this group.Step 1.2 and 1.1.1 are that the father organizes mode from data to sub-component that send out.Wherein dark expression recipient also is a seed, the transition of Fig. 3 and 4 expression seeds.
6, the P2P client withdraws from process
When a P2P client withdraws from, withdraw from request to the transmission server transmission, transmission server withdraws to P2P Control Server requesting client, and the P2P Control Server sends the P2P group and changes message to transmission server, transmission server sends to corresponding P2P client, upgrades P2P group message.Change for the P2P group membership, or therefore cause the structural change of P2P broadcasting group, all send to corresponding P2P client by updating message.
7, about disposing, in this P2P system, P2P control service and transmission service are to be deployed on the server, and system's support is provided, and the P2P client deployment is on subscriber computer.