Implementation principle of mcu tcp ip protocol stack (1)

Source: Internet
Author: User

For the tcp ip protocol stack, we have already talked a lot about its principles. However, the principle is not enough. In this regard, we will give you an actual operation example to explain, first, let's take a look at the TCP/IP protocol stack for single-chip microcomputer that runs on single-chip microcomputer. As there are more and more embedded networking devices, we need to implement the TCP/IP protocol stack on embedded devices, however, embedded devices are different from PCs, and generally use MCU, that is, single chip microcomputer rather than CPU, as the core processor. This requires the TCP/IP protocol stack on single chip microcomputer. for high-end 32-bit single chip microcomputer, because its performance is close to that of the low-end pc cpu (such as Pentium II series), it is not much different from the implementation of the tcp ip protocol stack on the PC. Here we mainly describe the low-end 8-bit (such as 51 Single-Chip Microcomputer), 16-bit mcu tcp ip protocol stack 。

Characteristics of MCU TCP/IP

The realization of TCP/IP on a single-chip microcomputer is different from that on a PC. Its features are as follows:

1. slow speed: the fastest network transmission speed of 51 single-chip microcomputer of 12 m crystal oscillator is 25KB/s. The key is that TCP/IP needs to verify and calculate each transmitted byte, and the necessary copy. The processing speed of the 51 single-chip microcomputer is not enough. To improve the speed of the TCP/IP of the single-chip microcomputer, the general method is to streamline the protocol stack 。

2. program storage space and external RAM space are not large: Generally, the maximum program and data space of single-chip microcomputer is 64 KB. tcp ip protocol generally needs to cache the sent data, the maximum packet size is about B. When the network speed is very high, the memory consumption will be very high. For non-embedded TCP/IP protocol stacks, 64 KB of programs and data space is not enough 。

3. single-Chip Microcomputer System Structure: 51 single-chip microcomputer is an 8-bit machine, so for the same data operation, 32-bit PC may only need 10 instructions, 51 Single-Chip Microcomputer may require several hundred commands 。


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.