网络化的嵌入式系统通信机制分析及改进
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
随着嵌入式应用的广泛发展,计算机技术和通信技术的进步以及Internet的广泛应用,“后PC时代”,网络连通性是嵌入式系统的必须要求,研究网络化的嵌入式系统有重要的实践意义。
     本文研究了基于网关和基于RTOS的两种嵌入式系统Internet互连方案,比较了两种方案的优劣,并分析了EMIT和VxWorks实例,提出了嵌入式系统网络化应用特点和要求。
     本文在分析了网络通信过程、Linux TCP/IP协议实现和Socket网络编程接口的基础上,指出提高协议处理性能的途径,并基于Linux的TCP和IP协议实现,做了适合嵌入式应用要求的改进:1)改变协议数据缓冲区的“分配-使用-释放”的内存使用模式,建立静态和动态分配相结合,静态分配为主的通信区,采用高效的“申请-使用-归还”的内存使用模式,实现策略和机制相分离的设计思想。2)为了减少对存储器访问次数,本文设计应用数据复制到协议缓冲区的同时计算数据校验和,以满足TCP差错控制的要求,可以减少一次对应用数据的遍历。3)对应用数据分块,使得数据块大小符合通信子网MTU有效负载的要求,避免IP层分片需要重新分配缓冲区、计算校验和以及数据复制的费时操作。
     为了真实测试改进的效果,本文在协议处理中内嵌时间性能测试代码,记载进入TCP处理前和完成IP处理后的系统时间,为了减低由于测试所增加的协议处理开销,将性能参数写入应用数据中,采用客户/服务器的测试结构,由服务器测试程序对时间性能参数进行计算和可视化显示。实验表明,修改后的协议栈可以提高协议处理性能,对于发送1024字节大小的应用数据,性能可以提高12.66%。
With the development of embedded application, the progress of computer and communication technology, and the extensive use of Internet, network connectivity is obligatory requirement of embedded systems. It is important practical significance to research networked embedded systems.
    Gateway-based and RTOS-based embedded systems that connect to Internet are presented in the paper, we compare the difference of the two schemes, analyze EMIT instance and VxWorks instance , and expound characteristic and requirement of networked embedded system application.
    Based on analyzing TCP/IP architecture and Socket programming interface, and of Linux TCP/IP suites implementation , we mend the implementation to fit the requirement of embedded application. 1) we modify the "allocate-use-release" use mode of protocol buffer, create communicat ion area of combined with static and dynamic allocation, and adopt efficient "apply-use-return" memory use mode. 2) in order to reduce memory access times,copy data and compute checksum synchronously to fit the requirement of TCP error control. Therefore, it can reduce one time data handling, 3) divide application data into blocks that content the demand of effective load of communication subnet MTU to avoid IP fragments.
    Embedded performance test code is applied among protocol code by this paper .It can lower test overhead .The client/server test structure is employed that the server test program answers for computing performance data and visually displaying the result. It is proved that the modification of the above can improve the performance of TCP/IP protocol, when sending 1024 bytes application data.it can improves 12.66% performance.
引文
1. P. Goyal, X. Guo, H. M Vin. A Hierarchical CPU Scheduler for Multimedia Operating Systems, In.. Proc, USENIX Symp on Operating Systems Design and Implementtation, Seattle, WA, Oct. 1996: 107-121.
    2.吕新建,肖海桥.面向二十一世纪的嵌入式系统综述.http://www. Bol-system. com.
    3. http://www. embed. com. cn/.
    4.陈岚,唐志敏.单片系统(SoC)设计技术.计算机研究与发展.2002,Vol.39(1):9~16.
    5. http://www. altera. com.
    6. http://www.intel.com/pressroom/archive/releases/20010517net.htm.
    7.岳俭,严霄凤.实时操作系统的特点及其应用.信息工程大学学报,2000,Vol.1(4):44~47.
    8.徐仑峰,熊光泽,刘锦德.超微内核嵌入式实时操作系统的设计.计算机科学,1998,Vol.25(3):30~33.
    9.卢凯,吴庆波,卢锡城.嵌入式Linux解决方案关键技术研究.计算机科学,2001,Vol.28(12):85~88.
    10. http://www. RTlinux. org.
    11. http://www. mvista. com.
    12. http://www. Embeder. com/news/em-2. htm.
    13.Wayne Wolf.嵌入式计算系统设计原理.北京:机械工业出版社,2002.
    14.Arnold Berger.嵌入式系统设计.北京:电子工业出版社,2002.
    15. Kamskrishnan K K. Performance consideration in design netwok interface. IEEE Journal on Selected Areas in Communication, 1993.
    16.李仁发,周祖德,李芳敏等.虚拟实验室网络体系结构研究.系统仿真学报,2002,Vol.14(3):359~362.
    17.张大波,王光兴.一种现场总线设备通信栈体系结构研究及应用层的设计与实现.小型微型计算机系统,1999,Vol.20(4):261~265.
    18. http://www.bol-system.com/NEWS/EMIT.html.
    
    
    19. http://www.windriver.com/whitepapers/tornado_2_vxworks. html.
    20. Clark D D, Jacobson V, Romkey Jet al. An analysis of TCP processing overhead. IEEE Communication Magazine, 1989.
    21.高小鹏,尤翔,吴文峻等.SNOW系统高速网络接口板HNI的设计与实现.计算机研究与发展,2000,Vol.37(7).:857~862.
    22.Andrew S.Tanenbaum.计算机网络.北京:清华大学出版社,1998.
    23.Gary R.Wright,W.Richard Stevens.TCP/IP详解.北京:机械工业出版社,2000.
    24.谢希仁.计算机网络.大连:大连理工大学出版社,1996.
    25.Scott Maxwell.Linux内核源代码分析.北京:机械工业出版社,2000.
    26.Stephen T.Satchell,H.B.J Clifford.Linux IP协议栈源代码分析.北京:机械工业出版社,2000.
    27.王学龙.嵌入式Linux系统设计与应用.北京:清华大学出版社,2001.
    28.Rick Gerhan,Robert Moote,Ingo Cyliax.32位嵌入式系统编程.北京:电力出版社,2001.
    29.Andrew S.Tanenbaum.现代操作系统.北京:机械工业出版社,1999.
    30.刘伟,郑纬民,申俊等.底层通信协议中内存映射机制的设计与实现.软件学报,1999,Vol.10(1):24~28.
    31.Kirk Zurell.嵌入式系统的C程序设计.北京:机械工业出版社,2002.
    32. Bhoedjang RA F, et al. User-Level Network Interface Protocols[J]. IEEE Computer, 1998, (11): 53~60.
    33.徐格,喻中超,吴建平等.高性能路由器操作系统HEROS的设计与实现.小型微型计算机系统,2002,Vol.23(1):18~24.
    34.周巍松.Linux系统分析与高级编程技术.北京:机械工业出版社,1999.