轻量级网络协议栈关键技术研究
发布时间:2018-04-16 16:12
本文选题:网络协议栈 + 多进程 ; 参考:《西安电子科技大学》2014年硕士论文
【摘要】:随着物联网的蓬勃发展,嵌入式系统获得了巨大的发展契机,各式各样的嵌入式设备,如车载设备、移动终端、监控设备充斥着人们的生活,为人们的生活和工作带来了巨大的便利。然而,由于嵌入式系统种类繁多,又要考虑系统对嵌入式设备处理器及内存的资源消耗,因而许多嵌入式系统中的网络协议栈大都设计简单,并不能满足多应用场景下的需求。如何使嵌入式网络协议满足各种应用场景的需求,并保证日常通信的安全,已经成为人们共同关注的问题。Lw IP(Light weight IP)即轻量级IP协议,是标准TCP/IP协议栈的裁剪,即在保证实现TCP/IP基础功能的同时,又能很好的控制协议栈对处理器资源及存储资源的消耗,是许多嵌入式系统网络协议栈中非常重要的一种。但是随着Lw IP协议栈应用场景的扩大,在Lw IP协议栈应用过程中依然存在着很多问题。首先,LwIP网络协议栈的进程模型是让整个协议栈驻留在一个单独进程中,而并不将其放在操作系统内核中。而应用程序既可以与LwIP进程是一个进程,也可以是单独的应用进程。Windows系统自带的协议栈是内核态的网络协议栈,而移植到Windows系统下的LwIP协议栈是用户态的协议栈,与系统原生的协议栈相比具有更好的可扩展性并且高度定制。本文用官方发布的Lw IP contrib文件夹下的移植代码作为基础,将Lw IP网络协议栈移植到Windows操作系统中。此移植代码是基于Windows的线程间通信来编写,因此在此代码中是不能实现进程间通信的,而为满足LwIP多进程间的通信,一般的方法是要重新编写移植文件sys_arch.c以及其它涉及到移植的函数。但重写移植文件及函数涉及的方面非常多,不仅要对Windows中进程间通信非常了解,而且还要对Lw IP协议栈本身的移植过程非常熟悉,此种方式实现LwIP协议栈进程间通信难度很大。其次,LwIP协议栈对需要安全传输敏感信息的场景并没有做考虑,这使得嵌入式网络传输的信息完全暴露在安全威胁中。因此,如何保证嵌入式设备之间通讯的安全性,保证双方通信信息的保密性、完整性已成为亟待解决的重要问题。本文针对LwIP在多进程应用场景和安全传输问题中的不足,研究设计了多进程LwIP和LwIP IPsec协议。本设计基于Windows平台,为了能够实现多应用进程间的通信,在不改变移植文件及相应的移植函数的基础上,通过将LwIP的核心代码编译成动态链接库,使得原本只能在线程间通信的协议栈转变为可以在应用进程间通信的协议栈。同时为了能保证通信的安全,还设计实现了Lw IP的IPsec协议解决了嵌入式系统中传输安全的问题。最后通过对相应模块的测试证明了这两种方案的可行性。
[Abstract]:With the vigorous development of the Internet of things, embedded systems have got a great opportunity to develop. All kinds of embedded devices, such as vehicle-mounted devices, mobile terminals and monitoring devices, are flooded with people's lives.It brings great convenience to people's life and work.However, because of the variety of embedded systems and the resource consumption of embedded device processors and memory, most of the network protocol stacks in embedded systems are simple and can not meet the needs of multi-application scenarios.How to make embedded network protocol meet the requirements of various application scenarios and ensure the security of daily communication has become the common concern of people, I. E. lightweight IP protocol, which is the cutting of standard TCP/IP protocol stack.It is very important in many embedded system network protocol stacks to control the consumption of processor resource and storage resource at the same time to realize the basic function of TCP/IP.However, with the expansion of the application scenario of the LW IP stack, there are still many problems in the application of the LW IP protocol stack.Firstly, the process model of LwIP protocol stack is to let the whole protocol stack reside in a single process, but not in the operating system kernel.The application program can be the same process as the LwIP process, or it can be a separate application process. Windows protocol stack is the kernel network protocol stack, and the LwIP protocol stack transplanted to the Windows system is the user protocol stack.Compared with the native protocol stack of the system, it is more extensible and highly customized.In this paper, the LwIP network protocol stack is transplanted to the Windows operating system on the basis of the porting code under the LwIP contrib folder.The porting code is written on the basis of inter-thread communication of Windows, so inter-process communication cannot be implemented in this code, and in order to satisfy the LwIP multi-process communication,The general approach is to reprogram the migration file sys_arch.c and other functions involved in migration.However, there are many aspects involved in rewriting porting files and functions, not only to understand inter-process communication in Windows very well, but also to be familiar with the porting process of LW IP stack itself. It is very difficult to implement inter-process communication in LwIP protocol stack in this way.Secondly, the LwIP protocol stack does not consider the need for secure transmission of sensitive information, which makes the embedded network information completely exposed to security threats.Therefore, how to ensure the security of communication between embedded devices, the confidentiality and integrity of communication information between the two sides has become an important problem to be solved.Aiming at the deficiency of LwIP in multi-process application scenarios and secure transmission, this paper designs the multi-process LwIP and LwIP IPsec protocols.This design is based on Windows platform, in order to realize the communication between multiple application processes, without changing the porting file and the corresponding porting function, the core code of LwIP is compiled into dynamic link library.The protocol stack, which can only communicate between threads, is transformed into a protocol stack that can communicate between application processes.At the same time, in order to ensure the security of communication, the IPsec protocol of LWIP is designed and implemented to solve the problem of transmission security in embedded system.Finally, the feasibility of the two schemes is proved by testing the corresponding modules.
【学位授予单位】:西安电子科技大学
【学位级别】:硕士
【学位授予年份】:2014
【分类号】:TP393.04
【参考文献】
相关期刊论文 前1条
1 张齐;劳炽元;;轻量级协议栈LWIP的分析与改进[J];计算机工程与设计;2010年10期
,本文编号:1759660
本文链接:https://www.wllwen.com/guanlilunwen/ydhl/1759660.html