CN101834881A - Network communication method for embedded system - Google Patents

Network communication method for embedded system Download PDF

Info

Publication number
CN101834881A
CN101834881A CN200910113021A CN200910113021A CN101834881A CN 101834881 A CN101834881 A CN 101834881A CN 200910113021 A CN200910113021 A CN 200910113021A CN 200910113021 A CN200910113021 A CN 200910113021A CN 101834881 A CN101834881 A CN 101834881A
Authority
CN
China
Prior art keywords
layer
network
message
embedded system
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN200910113021A
Other languages
Chinese (zh)
Inventor
曾振宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Newland Communication Science Technology Co Ltd
Original Assignee
Fujian Newland Communication Science Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Newland Communication Science Technology Co Ltd filed Critical Fujian Newland Communication Science Technology Co Ltd
Priority to CN200910113021A priority Critical patent/CN101834881A/en
Publication of CN101834881A publication Critical patent/CN101834881A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The invention provides a network communication method for an embedded system. The information transmission is realized by using a simple mechanism of 'mailing and extraction'. A network communication protocol referred in the method adopts a hierarchical structure, protocol layers coordinate and process the communication problem, and the protocol layers coordinate the communication between the layers through a system simulation layer. The method has the advantages of low requirement on embedded system hardware, stable system and capability of meeting the requirement of most network functions of the current embedded system.

Description

Network communication method for embedded system
[technical field]
The present invention relates to a kind of embedded system, relate in particular to a kind of network communication method for embedded system.
[background technology]
Along with development of internet technology, traditional embedded system also becomes rich and varied after introducing network technology, network technology allows embedded system move according to natural mode no longer singlely, but can remote live and the user carry out alternately, allow the user recognize the running status of current system, and the state that system will move can be set.
But embedded system has powerful hardware foundation unlike computer, general embedded system is in order to control cost, adopt the process chip of function singleness mostly, therefore the huge protocol stack that uses in the computer network world no longer is adapted at moving in the embedded system, and it is also just imperative to design a kind of simple embedded system protocol stack.
[summary of the invention]
The technical problem to be solved in the present invention is to provide a kind of network communication method for embedded system, and is low to the embedded system hardware requirement, and system stability can satisfy the requirement of the most of network function of current embedded system.
The present invention is achieved in that a kind of network communication method for embedded system, it is characterized in that: a kind of " mailing and extraction " simple mechanisms is used in the realization that information is transmitted, the related network communication protocol of this method adopts hierarchy, protocal layers Coordination Treatment communication issue, and protocal layers are coordinated communication between each layer by a system simulation layer.
Described protocal layers are respectively from bottom to top: link layer: be used to handle the physical interface details with transmission medium, this link layer comprises corresponding network interface unit in device driver in the operating system and the computer; Network layer: be used for handling the activity that is grouped in network; Transport layer: be used to two application programs on the main frame that communication end to end is provided; Application layer: be responsible for handling specific application particulars.
Described transport layer: comprise two host-host protocols of TCP and UDP usually, TCP provides the data communication of high reliability for two main frames, comprising the data of giving it application program is divided into suitable fritter and gives following network layer, the grouping that affirmation receives is provided with and sends the last timeout clock of confirming grouping; UDP then provides a kind of very simply service for application layer, and it just sends to another main frame to the grouping that is called datagram from a main frame, but does not guarantee that this datagram can arrive the other end, and any essential reliability must be provided by application layer; Described application layer: be responsible for handling specific application particulars, comprise Telnet Telnet, ftp file transfer protocol, SMTP simple message transfer protocol (SMTP), snmp simple network management protocol;
Described system simulation layer: for the ease of being implanted in the different operating system, this system simulation layer has encapsulated some system functions.Some important informations in the described protocol stack are designed to and can share.
This method specifically comprises process of transmitting and receiving course, and described process of transmitting comprises the steps:
When certain application program of step 11, described application layer will send information to long-range certain embedded system, this application layer at first sent to described transport layer by the system simulation layer with information;
After step 12, described transport layer were received the message of described system simulation layer, the head interpolation transport layer header information in this message sent to described network layer with this information by described system simulation layer after integration finishes again;
After step 13, described network layer were received message, the head interpolation network layer header information in this message sent to described link layer with this message after integration finishes again;
After step 14, described link layer are received message,, integrate the back that finishes and form a whole network bag in the head interpolation link layer head information of this message, again this network packet is paid network interface card, by network interface card this bag is sent to network, so far, a normal process of transmitting finishes;
Described receiving course comprises the steps:
Step 21, receive when embedded system and to send packet on the network that network interface card is passed to described link layer after receiving this packet;
Step 22, described link layer parse network interface card hardware address MAC, check whether conform to,, notify described network layer handles this packet if conform to then send message to described network layer by the system simulation layer with the self MAC address, if be not inconsistent, then abandon this packet;
After step 23, described network layer are received the message of described system simulation layer, handle the packet of receiving, parse the IP address of communicating pair, the agreement that upper layer data will use, and TTL, data check information is resolved the back that finishes and is sent out message to described transport layer by described system simulation layer;
Step 24, described transport layer are received the message that described network layer is sent, and the agreement that parses according to network layer is correspondingly processed, and the back that finishes sends message to described application layer by described system simulation layer;
After step 25, described application layer are received message, can monitor whether forward data of the described transport layer of fixed port number always, have then to receive, finish the primary network communication process at this point.
The present invention has following advantage: low to the embedded system hardware requirement, system stability can satisfy the requirement of the most of network function of current embedded system.
[description of drawings]
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is the Organization Chart of the related network communication protocol of the inventive method.
Fig. 2 is the schematic flow sheet of the inventive method process of transmitting.
Fig. 3 is the schematic flow sheet of the inventive method receiving course.
[embodiment]
See also shown in Figure 1, network communication method for embedded system of the present invention, simple mechanisms that the realization that information is transmitted is used a kind of " mailing and extraction ", related network communication protocol adopts hierarchy, protocal layers Coordination Treatment communication issue, and protocal layers are coordinated communication between each layer by a system simulation layer.This hierarchy can also play the effect of a guidance simultaneously with whole network communication protocol modularization to its realization, but piecemeal designed after modularization was handled, and was more conducive to designer's work, also was convenient to the maintenance and the modification in later stage.But the drawback that modularization is brought is the reduction that the communication between each module may cause overall performance.In order to overcome these problems, some important informations in the described protocol stack are designed to and can share.
Described protocal layers are respectively from bottom to top:
Link layer: be used to handle the physical interface details with transmission medium, this link layer comprises corresponding network interface unit in device driver in the operating system and the computer;
Network layer: be used for handling the activity that is grouped in network, best communication line is selected in for example Fen Zu routing;
Transport layer: be used to two application programs on the main frame that communication end to end is provided; Usually comprise two host-host protocols of TCP and UDP, TCP provides the data communication of high reliability for two main frames, comprise the data of giving it application program and be divided into suitable fritter and give following network layer, confirm to be provided with the grouping that receives and to send the last timeout clock of confirming grouping; UDP then provides a kind of very simply service for application layer, and it just sends to another main frame to the grouping that is called datagram from a main frame, but does not guarantee that this datagram can arrive the other end, and any essential reliability must be provided by application layer; Wherein, basic TCP handles and is divided into six functions; It is relevant that tcp_input (), tcp_process (), tcp_receive () and TCP input are handled, and tcp_write (), tcp_enqueue (), tcp_output () handle output;
Described application layer: be responsible for handling specific application particulars, comprise Telnet Telnet, ftp file transfer protocol, SMTP simple message transfer protocol (SMTP), snmp simple network management protocol etc.;
Described system simulation layer: this layer is not the layering that belongs to TCP/IP, but coordinates communication between above four layers.For the ease of being implanted in the different operating system, this system simulation layer has encapsulated some system functions, and when the such function of needs, the operating system simulation layer will be used.The operating system simulation layer to such as timer, handle synchronously, the operating system service of message transfer mechanism etc. provides a cover unified interface.In principle, when being transplanted to other operating systems, only need to realize being fit to the operating system simulation layer of this operating system.
As previously mentioned, a kind of simple mechanisms is used in the realization of the inventive method information transmission, with the abstract method of a kind of being called " mailbox ".Mailbox has two kinds of operations: mailing and extraction; Franking operation can not block process; The message of posting to mailbox enters formation by described system simulation layer and extracts them up to another process.
Protocol stack involved in the present invention is only realized the basic functions of IP, and it can send, and receives and transmits bag, but can not send or receive the IP bag of cutting apart, and can not handle the bag of band IP option.This can not cause any problem for great majority are used.For the some bags of IP that receive, handle and called by device driver from ip_input () function.Here, initial work will be checked IP version, determine simultaneously also can calculate and check header checksum territory by header length.The situation of expectation is, since the Proxy server was recombinated all fragments (fragmented) bags, storehouse was not just received fragment (fragments) again, and the Bao Douhui of any like this ip fragmentation is by abandoning quietly.The bag that has the ip option can be designated as by agent processes equally, and is therefore lost.
This method specifically comprises process of transmitting and receiving course.
As shown in Figure 2, described process of transmitting comprises the steps:
When certain application program of step 11, described application layer will send information to long-range certain embedded system, this application layer at first sent to described transport layer by the system simulation layer with information;
After step 12, described transport layer are received the message of described system simulation layer, head in this message adds the transport layer header information, this header information comprises port numbers, and information such as sequence number send to described network layer with this information by described system simulation layer after integration finishes again;
After step 13, described network layer were received message, in the head interpolation network layer header information of this message, header information comprised the IP address of communicating pair, the employed agreement of transport layer, TTL, information such as data check send to described link layer with this message after integration finishes again;
After step 14, described link layer are received message, head in this message adds link layer head information, header information comprises the hardware address MAC of communicating pair, information such as data length, the integration back whole network bag that finishes has just formed, and again this network packet is paid network interface card, and network interface card sends to network with this bag and gets on, so far, a normal process of transmitting finishes
As shown in Figure 3, described receiving course comprises the steps:
Step 21, receive when embedded system and to send packet on the network that network interface card is passed to described link layer after receiving this packet;
Step 22, described link layer parse network interface card hardware address MAC, check whether conform to,, notify described network layer handles this packet if conform to then send message to described network layer by the system simulation layer with the self MAC address, if be not inconsistent, then abandon this packet;
After step 23, described network layer are received the message of described system simulation layer, handle the packet of receiving, parse the IP address of communicating pair, the agreement that upper layer data will use, and TTL, data check information is resolved the back that finishes and is sent out message to described transport layer by described system simulation layer;
Step 24, described transport layer are received the message that described network layer is sent, and the agreement that parses according to network layer is correspondingly processed, and the back that finishes sends message to described application layer by described system simulation layer;
After step 25, described application layer are received message, can monitor whether forward data of the described transport layer of fixed port number always, have then to receive, finish the primary network communication process at this point.
In sum, the present invention requires low to embedded system hardware, and system stability can satisfy the requirement of the most of network function of current embedded system.

Claims (6)

1. network communication method for embedded system, it is characterized in that: a kind of " mailing and extraction " simple mechanisms is used in the realization that information is transmitted, the related network communication protocol of this method adopts hierarchy, protocal layers Coordination Treatment communication issue, and protocal layers are coordinated communication between each layer by a system simulation layer.
2. network communication method for embedded system according to claim 1 is characterized in that: described protocal layers are respectively from bottom to top:
Link layer: be used to handle the physical interface details with transmission medium, this link layer comprises corresponding network interface unit in device driver in the operating system and the computer;
Network layer: be used for handling the activity that is grouped in network;
Transport layer: be used to two application programs on the main frame that communication end to end is provided;
Application layer: be responsible for handling specific application particulars.
3. network communication method for embedded system according to claim 2 is characterized in that:
Described transport layer: comprise two host-host protocols of TCP and UDP usually, TCP provides the data communication of high reliability for two main frames, comprising the data of giving it application program is divided into suitable fritter and gives following network layer, the grouping that affirmation receives is provided with and sends the last timeout clock of confirming grouping; UDP then provides a kind of very simply service for application layer, and it just sends to another main frame to the grouping that is called datagram from a main frame, but does not guarantee that this datagram can arrive the other end, and any essential reliability must be provided by application layer;
Described application layer: be responsible for handling specific application particulars, comprise Telnet Telnet, ftp file transfer protocol, SMTP simple message transfer protocol (SMTP), snmp simple network management protocol.
4. network communication method for embedded system according to claim 3 is characterized in that: described system simulation layer: for the ease of being implanted in the different operating system, this system simulation layer has encapsulated some system functions.
5. network communication method for embedded system according to claim 4 is characterized in that: some important informations in the described protocol stack are designed to and can share.
6. network communication method for embedded system according to claim 5 is characterized in that: this method specifically comprises process of transmitting and receiving course, and described process of transmitting comprises the steps:
When certain application program of step 11, described application layer will send information to long-range certain embedded system, this application layer at first sent to described transport layer by the system simulation layer with information;
After step 12, described transport layer were received the message of described system simulation layer, the head interpolation transport layer header information in this message sent to described network layer with this information by described system simulation layer after integration finishes again;
After step 13, described network layer were received message, the head interpolation network layer header information in this message sent to described link layer with this message after integration finishes again;
After step 14, described link layer are received message,, integrate the back that finishes and form a whole network bag in the head interpolation link layer head information of this message, again this network packet is paid network interface card, by network interface card this bag is sent to network, so far, a normal process of transmitting finishes;
Described receiving course comprises the steps:
Step 21, receive when embedded system and to send packet on the network that network interface card is passed to described link layer after receiving this packet;
Step 22, described link layer parse network interface card hardware address MAC, check whether conform to,, notify described network layer handles this packet if conform to then send message to described network layer by the system simulation layer with the self MAC address, if be not inconsistent, then abandon this packet;
After step 23, described network layer are received the message of described system simulation layer, handle the packet of receiving, parse the IP address of communicating pair, the agreement that upper layer data will use, and TTL, data check information is resolved the back that finishes and is sent out message to described transport layer by described system simulation layer;
Step 24, described transport layer are received the message that described network layer is sent, and the agreement that parses according to network layer is correspondingly processed, and the back that finishes sends message to described application layer by described system simulation layer;
After step 25, described application layer are received message, can monitor whether forward data of the described transport layer of fixed port number always, have then to receive, finish the primary network communication process at this point.
CN200910113021A 2009-12-23 2009-12-23 Network communication method for embedded system Pending CN101834881A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910113021A CN101834881A (en) 2009-12-23 2009-12-23 Network communication method for embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910113021A CN101834881A (en) 2009-12-23 2009-12-23 Network communication method for embedded system

Publications (1)

Publication Number Publication Date
CN101834881A true CN101834881A (en) 2010-09-15

Family

ID=42718810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910113021A Pending CN101834881A (en) 2009-12-23 2009-12-23 Network communication method for embedded system

Country Status (1)

Country Link
CN (1) CN101834881A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092689A (en) * 2014-07-15 2014-10-08 四川航天系统工程研究所 Method for obtaining highly reliable multi-computer communication architecture in embedded system
CN104503850A (en) * 2014-12-11 2015-04-08 天津中兴智联科技有限公司 Embedded system communication method
CN107241383A (en) * 2017-04-27 2017-10-10 广州慧扬健康科技有限公司 Meet the network communication module of dicom standard

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855054A (en) * 2005-04-29 2006-11-01 上海全景数字技术有限公司 Embedded applied software development emulator based on windows platform
CN101212479A (en) * 2007-12-25 2008-07-02 康佳集团股份有限公司 Method for implementing byte alignment on network platform

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1855054A (en) * 2005-04-29 2006-11-01 上海全景数字技术有限公司 Embedded applied software development emulator based on windows platform
CN101212479A (en) * 2007-12-25 2008-07-02 康佳集团股份有限公司 Method for implementing byte alignment on network platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
石小兰: "嵌入式系统中IPv6协议栈的研究与实现", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092689A (en) * 2014-07-15 2014-10-08 四川航天系统工程研究所 Method for obtaining highly reliable multi-computer communication architecture in embedded system
CN104092689B (en) * 2014-07-15 2018-02-16 四川航天系统工程研究所 Highly reliable multi-computer communication framework method in a kind of embedded system
CN104503850A (en) * 2014-12-11 2015-04-08 天津中兴智联科技有限公司 Embedded system communication method
CN104503850B (en) * 2014-12-11 2017-10-31 天津中兴智联科技有限公司 Communication in embedded system method
CN107241383A (en) * 2017-04-27 2017-10-10 广州慧扬健康科技有限公司 Meet the network communication module of dicom standard

Similar Documents

Publication Publication Date Title
US7272153B2 (en) System and method for distributed processing of packet data containing audio information
CN105429858B (en) A kind of real-time Message Passing method between multirobot
CN101442556B (en) Wireless sensor network server system based on IPv6
CN100370788C (en) Method for realizing data communication utilizing virtual network adapting card in network environment simulating
CN103731409B (en) The distributed measurement device of embedded type automobile acquisition equipment for accelerating with TCP
CN100505663C (en) Reliable transfer method of short message in the ad hoc network
CN104158627B (en) A kind of automatic recognition system and method for heterogeneous links multi-protocols
CN104010039A (en) Multi-radar remote monitoring system and method based on WebSocket
CN105306354A (en) Communication method and system of network data without using explicit addressing
CN101986648A (en) Negotiation method, device and network device of TCP option
CN110069441A (en) A kind of FPGA network and stream calculation System and method for for stream calculation
CN203151742U (en) A short message intercommunicating system between network clients and Beidou RDSS terminals
CN104995878B (en) A kind of message transmitting method, equipment and communication system
CN103200548A (en) Short message intercommunicating system and method of network client and compass radio determination satellite service (RDSS) terminal
CN101778093A (en) UDP (User Datagram Protocol) based data transmission method
CN109756475B (en) Data transmission method and device in unidirectional network
US20070291771A1 (en) System and Method for Distributed Processing of Packet Data Containing Audio Information
CN101834881A (en) Network communication method for embedded system
CN108712289A (en) Using hard-wired TTE end systems network administration apparatus
CN110120854A (en) The method and apparatus for transmitting data
CN114338274A (en) Heterogeneous industrial field bus fusion method and system
CN101047620B (en) Device and method for quickly processing message
CN102790663B (en) Full-hardware network interface applied to very long baseline interferometry (VLBI) hardware related processor
CN106657377A (en) WIA-PA (Wireless Networks for Industrial Automation-Process Automation)/full-interconnection manufacturing network information service adaptor and realization method thereof
CN106302426A (en) A kind of udp protocol stack implementation method of band retransmission mechanism based on FPGA

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20100915