Original address: http://bbs.tvkoo.com/dispbbs.asp? BoardId = 3 & ID = 4017 & Page = 1
Recently, I have studied P2P live broadcast technology, talking about the advantages and disadvantages of TVkoo software, on the one hand, I hope that TVKOO can do better, on the other hand, I also throw a bricks:
The technical difficulties of P2P live broadcast are: First, the firewall penetration: More than 90% of the computer is behind the firewall, if the two computers behind the firewall can implement P2P interconnection, this is a technology difficult. There are 2 ways:
1. Require the user to configure TCP ports: BT and eDonkey adopted, and the configuration requires network expertise. The general approach is to implement the TCP port on the firewall. If the port is turned on or the Internet IP address is turned on, it is a high-unconnected computer; in the firewall and does not turn on the TCP port, which is a low-gotective computer. High Unit Computers can be P2P with other high-uniform computers that have low Unicom computers; while low-link computers can only perform P2P with a high-link computer. Therefore, in BT, eDonkey, there is Internet IP or the computer that has already opened the port on the firewall is very fast, and the computer behind the firewall (generally a local area online network approach) is slower. The computer has more than 70% of the network through the local area network. If there is no network foundation, or there is no special configuration of the NMS, it can only be in low linkability, and the speed is very slow.
2. The firewall is automatically penetrated. No user configuration is required, automatically allow 2 computers behind the firewall to interconnect P2P. The P2P connection can use TCP and UDP 2 ways. Since WinXP SP2 limits an application's TCP connection number, use TCP mode for P2P, to install the TCP restrictions. The TVKOO is data transfer using UDP, so there is no TCP limit. This is why some users say: I don't see a lot of TCP connections through NetStat, I suspect that the TVKOO is the reason for P2P software.
TVKoo's P2P penetration is the strongest software I have seen. Of course, since I don't use TCP, there is no way to access the computer behind the firewall that is allowed to access the HTTP. Skype has a trick when P2P penetrates, so that some computer with Internet IP uses TCP's 80-port, which is only connected to these 80-port computers on the HTTP access to access by HTTP access. P2P connection. TVKoo can also consider this way.
Second, WMV format analysis
At present, P2P live broadcast uses the WMV format, and the WMV data stream is transmitted to Media Player by simulating the HTTP server. This is the key point of P2P live broadcast. The HTTP data emitted by Media Encoder is needed to make a 30 second -1 minute P2P data block, and then send the data block to the TVKoo client via the P2P mode, and the TVKoo simulates the data block that is completed into the transmitted data block. Media Player. This part of TVKOO is also good.
Third, how to effectively choose P2P nodes
This is the weakness of TVkoo. Because a computer is transmitted in P2P, connect to dozens of other computers. When tens of thousands of computers transmit a P2P data block, there is an optimization algorithm. For example, there are 5,000 users in the United States. China Telecom has 5,000 users. China Netcom has 5,000 users, and each user can only connect up to 30-50 nodes. If it is not smart, a telecom user connects 20 Netcom Users and 30 US users have continuously interrupted. That's why people have a lot of people, and Tvkoo has the reason why foreign IP is closed.
Is there any good way to solve this problem? I first throw bricks: (1) As a P2P live operator, there are several P2P seed servers, which are distributed in different network segments. For example: Northern Netcom has a (group), and the South Telecom has a (group), and the content of the seed is the same. The seed server is more, and the difficulty of the optimization algorithm can be reduced.
(2) Priority of seed servers and normal nodes: The total number of seed servers is lower than normal nodes. If the speed of normal nodes is fast, reduce the amount of data obtained from the seed server.
(3) Global IP address table. In the P2P Node Arbitration server, there should be a global IP address table, divided into mainland China, Hong Kong, Taiwan, North America, Europe, Australia, and others. China's mainland is divided into operations: Telecom, Netcom, Tietong, Unicom, Education Network, etc., follow the provincial classification. (There is downloaded on the Internet, you can organize)
(4) High speed network segment table. In P2P access, the node dynamically transmits the speed of other node IP addresses, and the server calculates the network segment based on the global IP address table, and recorded in the database in the network segment.
(5) When a new user is connected to the node, find the nearest node in the global IP address table, and assign the node of the fastest network segment according to the proportion; the nearest node; a closer node, a random node, and Seed server.
(6) P2P In data transfer, 30 second video can be used as a block of packets; in the packet, according to each 16kb. Each time period (such as 2 seconds), this node exchanges the transfer of data blocks to other nodes, and then calculates the ownership rate of each data block in the packet, prioritizing a data block with low ownership rate. Random choices in the case of equivalent ratio.
(7) In the data exchange, for the slowed node, periodically, and then ask the node arbitration server to be new nodes.
(8) If the data block is less than 10% in the data packet is not transferred, in the case of sufficient, for the remaining data block, the same data block can be requested to request the same data block.
(9) Node Arbitration Server will also load new P2P nodes to another node, but cannot exceed the maximum number of nodes.