Starting from the transmission speed of MSN and QQ files

Source: Internet
Author: User
It is found that in many cases, the transmission of MSN files is slower than that of QQ, not to say that MSN is not fast, but most of the time it is really slower than QQ, even those who are nervous about me have noticed that some people have answered the question after Google. Basically, MSN uses TCP to transmit files, while QQ uses UDP, the rest is to demonstrate that TCP transmission files are not UDP fast. here are some of the following points:

1. TCP is reliable, and it is necessary to verify whether the data arrives and whether it is correct. UDP is unreliable and does a lot of things, so MSN's file transmission is slower than QQ.
I laughed at the time and used QQ for a long time. I never found any problems with the file transfer. I also used UDP as the protocol for a long time and did not use the application layer to verify retransmission.CodeI am afraid to write it. For this reason, it fails.

2. TCP requires three handshakes to establish a connection, but UDP does not. Therefore, TCP is slow.
The three-way handshake is indeed true. Fortunately, I am not so easy to be fooled. It takes a few seconds to shake hands before two people talk, but what is the speed of the conversation? If the ping value of the network reaches 300 ms, you may not be able to play online games, otherwise, the dying boss will be happy to find that you suddenly become a puppet and you can beat them without returning them. In the end, you can only scold China Telecom Netcom and then restore them for a few minutes. however, for TCP, the ping value usually does not take one second for the three-way handshake. It seems that it is too difficult to count the cause of slow file transfer.

3. Once a link is established in TCP, the route is determined, while UDP is an uncertain routing method, and who is faster.
In this case, the author does not understand the TCP/IP protocol. The TCP link is only a logic, and no physical link is established. The next step is the IP package. This package follows this path, the package may take another path, which is similar to TCP and UDP. the reason continues to fail.

4. Is the MSN server abroad?
Some truth, but I heard a friend from the United States say that he also likes to use QQ to upload files.

So what is going on? Is Microsoft not doing well? (In other words, I do think that MSN is slower than QQ's rapid progress.) QQ's fans began to shake hands, and some people who liked M $ would start to drop bricks. no matter what the standpoint is, we still need to explore the facts. In the spirit of not seeking for a thorough solution, thin accumulation, and simple introduction, I think there are several possible reasons:

1. When both file transfer clients are behind NAT (you do not know what Nat means? For example, if multiple people share a cat's Internet access through a vro, you are usually behind Nat.) Technically, TCP is much more troublesome than UDP in this case. as long as UDP starts several negotiation packets that pass through NAT, the server needs to switch over the file data. The subsequent file data can be directly transmitted between the two clients. However, generally, TCP can only be transited by the server throughout the process, which one will be faster? Why does TCP need server transfer? Let's take a look at Nat. I have heard that someone can use raw sock to handle it. I don't have any intermediate servers.

2. however, even if the above conditions are not true, MSN is generally slower than QQ. the problem is that TCP is reliable and UDP is unreliable, but UDP is used for file transmission, you must write a verification protocol at the application layer. Otherwise, the uploaded files will be scolded by users if they have no arm or legs. it is not difficult to say it is an agreement. For example:

Long long ago, Jia Baoyu is in Beijing, and Lin Daiyu is in Changsha. How can I send a letter to each other! The journey is far away. How do I know if I receive the message? Call to ask? At that time, if I invented this, I didn't need to send a mail. I had to check whether Jia Ding had received a reply. if I find that my family has not returned for a month, most of them will be lost, and the traffic jam will be hit by a mountain thief or when I drive to Yangzhou, and I will send another person! This is what TCP does. UDP also needs to do so in the application layer protocol, but sometimes there are differences in implementation.

The road between Beijing and Changsha is not only run by one person. It is often congested. If Jia Ding hasn't returned for a long time, the TCP version of Jia Baoyu will send another mail, however, he will be more knowledgeable about it. He will write less and reduce the sending speed. One day in the past, maybe one week now. he thought, if everyone had done this, the road would not be so crowded. this method makes sense. If everyone wants to see the plug-in, they can only get more and more congested, and at last everyone can't move, so it's better to let each other wait in line. the UDP version of Jia Baoyu is also so collective, then it is called TCP-friendly stream, and it is not TCP-friendly.

If any TCP protocol finds congestion, it will immediately reduce its transmission speed. if the UDP-based protocol is not used in this way, the network will only get congested when the IP packet in the original congestion is added with the resend packet, and the rest of the TCP streams that stick to the collectivism will make sacrifices, give the bandwidth to some non-TCP-friendly UDP streams. therefore, unless the network conditions are very good, TCP is not suitable for non-TCP friendly protocols.

I doubt (I only doubt it, and I have no conditions or time to verify it). QQ's file transmission mechanism is not so TCP-friendly, and it is more "I Can ", in this way, although it is not a good thing for the entire network load, it is wise for a single user, as if you look at multi-thread download or P2P.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.