Comparison of TCP and UDP under GPRS network condition

Source: Internet
Author: User

Usage scenario: Use GPRS.

Noun Explanation: NAT (network address translation)

China Mobile GPRS network is a virtual IP address that needs to be forwarded through the mobile virtual address translation router to communicate with the Internet, the implementation process is as follows:

1, the NAT router obtains from the intranet IP address request;

2, the IP source address of the request, the port number is replaced with a real Internet IP address and an idle port number, and in the internal table to add the corresponding translation information table entries;

3. Passing information to the remote

In the future, the NAT router will maintain the table entries in the table, and if you receive information from the remote to the port number of the table entry, the actual virtual IP address and port number will be translated back.
Therefore, using GPRS network to communicate with the Internet requires the GPRS virtual IP side to initiate the TCP link or send the UDP packet to the remote server, so that the NAT router can establish the correct translation table entry. In the future, two-way network data transmission can be carried out.
From the implementation of the NAT protocol, the UDP translation table entry and the TCP translation table entry hold the time is different, because UDP does not have the class TCP connection revocation message protocol, therefore uses the time-out non-message packet transmission is the release method, measured the Chinese mobile network UDP table item to hold the time only a few seconds. That is, if the two sides do not communicate for a few seconds, if the Internet server side sends information to the GPRS virtual IP, the information is lost because the corresponding NAT router table entry has been released. to avoid this problem, unless the user only realizes the GPRS network side upload waits to respond this kind of message transmission way, otherwise in order to maintain the NAT router's translation table entry, GRPR needs to send the message continuously (commonly called heartbeat information, or heartbeat information) to obtain the retention of the linked table entry. This will result in additional traffic charges.
TCP is a connected protocol, so the NAT route knows when the connection ends, so it keeps that link, so it doesn't have to be heartbeat to keep the link. It is also possible to re-refresh the table entry, such as a NAT router power-down or reset, or insufficient resources to release the corresponding table entries, but the probability of this situation is very small. You can use a send timeout or a heartbeat for a longer period of time to resolve.
In addition, the GPRS network delay and bit error rate is relatively high, TCP protocol implementation of the re-send, sequencing and flow control, and UDP needs the user to do these work in the application itself, the user's own implementation is unlikely to be more reliable than the TCP protocol has been widely used for decades, so it is known that TCP protocol is more suitable for the status of GPRS network.

Comparison of TCP and UDP under GPRS network condition

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.