Internet-of-things terminal based on IPv6 and the communication means of internet host
Technical field
The present invention relates to a kind of Internet of Things lightweight terminal and internet host means of communication based on IPv6, belong to internet-of-things terminal applied technical field.
Background technology
Along with the development of Internet of Things industry, the quantity of Internet of Things application is more and more, and coverage also gets over extensively.It is many that internet-of-things terminal shows quantity, wide coverage, and density is high; Powered battery, the feature that energy resource is limited.For these features, design and research has been carried out in the aspects such as, lightweight network protocol stack integrated for application, low-power consumption energy management integrated to the circuit of node respectively, node.And to the research of internet-of-things terminal, be to be set out by application substantially at present, for different application, research and develop different terminals, thereby impel Internet of Things application to become one by one " isolated island ", cannot carry out application and configuration between industry.
For these features of Internet of Things, the research of 6lowpan technology also day by day receives publicity simultaneously, and it adopts IPv6 to encode, and more address space can be provided; Link layer adopts 802.15.4 standard logarithmic to transmit according to bag simultaneously, has had addressing range concurrently and has extensively met the requirement of Internet of Things lightweight addressing simultaneously.Yet adopt 6lowpan technical support Internet of Things, the while also requires the design of internet-of-things terminal can support the application of 6lowpan technology.At ietf standard tissue, formulate in RFC normative document, closed specification the ins and outs of 6lowpan adaptation layer, but its 6lowpan protocol stack is being written into internet-of-things terminal, and finally for the process of Internet of Things application, it is still unsolved in standard still having more technological difficulties.Wherein for the administrative mechanism of context in address compression process, ietf standard is organized in and in its Neighbor Discovery Protocol, has provided a set of comparatively detailed distribution and update scheme, but the wherein design in the context unknown situation of sent message destination address for terminal, the internet-of-things terminal that makes to be equipped with 6lowpan protocol stack cannot compress the address of this main frame, until the lifetime in the context table of front once distribution exhausts, could wait for the distribution again of gateway.This design all increases the burst number that terminal node sends to this main frame at every turn to some extent, has not only taken processor and the spatial cache of this terminal node, even can have influence on efficiency of transmission and the energy consumption of whole network.
1. related art one: network intelligence terminal > > based on Internet of Things of mono-kind of < < (Chen Yingdong. a kind of network intelligence terminal [Z] based on Internet of Things. CN102006209A:, 2011.).The design feature of this terminal comprises: (1) is a kind of optical fiber network terminal device that meets unification of three nets demand towards family and SOHO user's design; (2) comprise and show input module, communication interface module, intelligent control module and central processing unit; (3) based on Internet of Things, the new and high technology means such as comprehensive utilization digital technology, network technology, EPON optical communication technique, RFID technology, by computer, TV, three kinds of media types of mobile phone, go deep into the common people such as family, individual at one's side, for the common people provide the service for life of comprehensive thing connection, can meet people from basic voice communication service to multimedia life etc. comprehensively home intelligence, informatized life demand.
The shortcoming of prior art one:
Network intelligence terminal based on Internet of Things designs for domestic. applications, the same with the design of a lot of research institutions, for different application designs different internet-of-things terminal nodes, does not possess universality.Secondly, this design is outstanding intelligent, emphasizes printer, and the connection of the peripheral hardwares such as display screen and application are not discussed for internet-of-things terminal feature.Finally, the design of this terminal is to the network bandwidth, and communication mechanism has higher requirement, and its universal and realization also needs to wait for renewal and the construction of infrastructure.
2. related art two: the design of 6lowpan sensor node and realization (Wang Xiaonan, Gao Demin. the design of 6LoWPAN sensor node and realization [J]. sensing technology journal, 2010, (10) .).
The intercommunication of internet-of-things terminal and IPv6 network is considered in this design, and sensor network adopts the architectural framework of 6lowpan, and link layer is used 802.15.4 agreement.From the angle of hardware and software, be two functions below internet-of-things terminal is realized: 1) realize the IPv6 procotol of simplifying; (2) realize IPv6 data message in the transmission of IEEE802.15.4 frame.Hardware designs considered how to read and write data between processor and radio frequency chip and register and the buffer memory process of frame.Software for Design has defined three-tier architecture: hardware abstraction layer, adaptation layer and application layer.The task of hardware abstraction layer is receiving data frames and encapsulation of data frame; The task of adaptation layer is burst and restructuring; Application layer has defined IPv6 control domain.
The shortcoming of prior art two:
This scheme designs node from the angle of hardware and software respectively, has ignored contact problem between the two.Secondly, the adaptation layer design reference of Software for Design part the 6lowpan standard rough draft of 2007,6lowpan-15 has had renewal now.Simultaneously in the design of adaptation layer, scheme has only been mentioned burst and restructuring and has been ignored the compress mode to stem.Finally, the consideration background of this programme is sensor network, and its range of application and feature and Internet of Things exist certain difference, and this scheme can not meet the demand of Internet of Things completely to the design of terminal node.
3. related art three: a kind of wireless mobile RFID data acquisition terminal equipment and method for designing (simple clock based on Internet of Things, Song Yuan, He Hu, Zhao little Gang, Rao Xiaoyan. a kind of wireless mobile RFID data acquisition terminal equipment and method for designing [Z] based on Internet of Things. CN101894280A:, 2010.).
The method for designing of this scheme is that RFID middleware data processing module is incorporated on read write line, and the action function of read write line in whole system strengthened, and minimizing system relies on the technology of middle event data processing module.Hardware using CAN mode bus, related chip is integrated, software adopts embedded Java application program and embedded Java virtual machine KVM, operating system adopts embedded OS, embedded Java application program meets ALE (the Application Level Events) standard of EPCglobal, and in conjunction with JINI (Java Intelligent, Network Infrastructure) serviced component, to support wireless sensor network function.The advantage of this scheme is be applicable to Internet of Things large-scale application universal, and maximum innovation is to carry out the processing of de-redundancy for the radio-frequency (RF) identification in Internet of Things (RFID) device provides the magnanimity RFID data to recognition simultaneously.
The shortcoming of existing scheme three:
The design of this scheme concentrates the data redundancy of having optimized RFID to process problem, has therefore also only related to a kind of in the numerous terminal node types of Internet of Things, can not be applicable to the design of other Internet of Things inductive terminations.Secondly, this scheme is incorporated into middleware data processing module on read write line, and having limited like this this type of read write line must be that the mode that cable power connects is powered, otherwise the problem that has serious energy supply deficiency is existed.Finally, the design of this scheme does not relate to coding and the addressing system of terminal, and feasibility has to be strengthened.
Summary of the invention
Technical problem to be solved by this invention be limited for existing Internet of Things application terminal node energy, quantity is many, the technical problem a little less than disposal ability, a kind of Internet of Things lightweight terminal and internet host means of communication based on IPv6 are proposed, there is lightweight, network stabilization is good, consume energy low, be applicable to the feature of large-scale Internet of Things application.
The present invention is for solving the problems of the technologies described above by the following technical solutions:
A kind of internet-of-things terminal based on IPv6 and the communication means of internet host, in this communication means, the link layer of internet-of-things terminal adopts 802.15.4 standard and the gateway of IEEE to carry out data communication, between gateway and internet host, by the Ethernet based on IPv6 agreement, carries out data communication; The network layer of described internet-of-things terminal is supported jointly by 6lowpan agreement and IPv6 agreement, in the protocol stack of internet-of-things terminal, adds 6lowpan agreement to carry out adaptation to packet; Described communication means comprises the flow process of internet host accessing internet of things terminal, and the flow process of internet-of-things terminal access internet host; Wherein:
The flow process of described internet host accessing internet of things terminal is specific as follows:
A, when the contextual information context of gateway and the known internet host of internet-of-things terminal, step is as follows:
Steps A 01, by internet host, send request of data message to gateway, gateway is compressed into the IPv6 address of the internet host comprising in this request of data message the 6lowpan address of internet host according to its contextual information context, generate 6lowpan Packet Generation to internet-of-things terminal;
Steps A 02, internet-of-things terminal inquires the contextual information context of this internet host according to the list items of context of its preservation, the decompression of effective address is carried out in 6lowpan address to internet host, through 6lowpan agreement, the 6lowpan packet obtaining is de-compressed into initial IP v6 packet, the request of data message information that parsing internet main frame sends;
B, when the contextual information context of gateway and the equal unknown internet host of internet-of-things terminal, step is as follows:
Step B01, netinit, internet-of-things terminal completes the registration that the overall situation can routing IP v6 address, the IPv6 address of the known internet-of-things terminal of internet host;
Step B02, internet host is encapsulated in request of data in UDP message bag, and sets source address and destination address, via IPV6 Ethernet, sends to gateway;
Step B03, gateway carries out address resolution to packet, analyzing destination address is the IPv6 address of internet-of-things terminal, calls uip process, according to internet-of-things terminal contextual information context, the IPv6 address of internet-of-things terminal is compressed to the 6lowpan address that obtains internet-of-things terminal;
Step B04, gateway intercepts the Ipv6 address prefix of internet host, generate internet host contextual information context and deposited in the list items of context of gateway, according to this internet host contextual information context, the IPv6 address of internet host being compressed to the 6lowpan address that obtains internet host;
Step B05, according to the 6lowpan address architecture 6lowpan packet of the 6lowpan address of internet-of-things terminal, internet host;
Step B06, is sent to internet-of-things terminal by the wireless radio interface by gateway after the encapsulation of IEEE802.15.4 link of 6lowpan packet described in step B05;
Step B07, internet-of-things terminal receives that this packet is by being resolved and obtained 6lowpan packet by IEEE802.15.4 link layer;
Step B08, internet-of-things terminal inquiry list items of context, sends RS request to gateway, and request gateway sends the internet host contextual information context being obtained by step B04; Gateway sends to internet-of-things terminal by this internet host contextual information context by RA message; Internet-of-things terminal receives after RA message, records this internet host contextual information context, is stored in the list items of context of himself;
Step B09, internet-of-things terminal obtains after the contextual information context of this internet host, and 6lowpan packet step B07 being obtained through 6lowpan agreement de-compresses into former IPv6 packet;
Step B10, internet-of-things terminal analyzes the request of data information of UDP encapsulation, carries out data acquisition, and constructs IPv6 packet, carries out following step C03 and packet is sent to internet host by gateway to step C06;
The flow process of described internet-of-things terminal access IPv6 internet host is as follows:
C, when in gateway list items of context, known internet-of-things terminal needs the internet host contextual information context of active reporting, comprises the following steps:
Step C01, when arranging 6lowpan network, for internet-of-things terminal configures IPv6 address and the contextual information context of its internet host of wanting active reporting;
Step C02, internet-of-things terminal carries out data acquisition, and constructs IPv6 packet;
Step C03, compresses the IPv6 address of internet-of-things terminal according to internet-of-things terminal contextual information context the 6lowpan address that obtains internet-of-things terminal; According to this internet host contextual information context, the IPv6 address of internet host is compressed to the 6lowpan address that obtains internet host;
Step C04, the data encapsulation gathering according to the 6lowpan address of the 6lowpan address of internet-of-things terminal, internet host and step C02 becomes 6lowpan packet;
Step C05, internet-of-things terminal by IEEE802.15.4 protocol encapsulation framing, is sent to gateway by wireless network by 6lowpan packet;
Step C06, gateway obtains 6lowpan packet after packet is resolved, by inquiring about the list items of context of self, according to internet-of-things terminal contextual information context, the 6lowpan address decompress(ion) of internet-of-things terminal is condensed to the IPv6 address of internet-of-things terminal; According to internet host contextual information context, internet host 6lowpan address decompress(ion) is condensed to internet host Ipv6 address, then according to the IPv6 address of internet-of-things terminal, internet host Ipv6 address architecture Ipv6 packet;
Step C07, gateway by Ipv6 network by this Ipv6 Packet Generation to internet host;
D, in gateway list items of context, unknown internet-of-things terminal needs the internet host contextual information context of active reporting, specifically comprises the following steps:
Step D01, internet-of-things terminal carries out data acquisition, and constructs IPv6 packet;
Step D02, compresses the IPv6 address of internet-of-things terminal according to internet-of-things terminal contextual information context the 6lowpan address that obtains internet-of-things terminal; Using the 6lowpan address of internet-of-things terminal as source address, internet host IPV6 address is as destination address structure 6lowpan packet;
Step D03, internet-of-things terminal is dressed up IEEE802.15.4 Packet Generation to gateway by 6lowpan data envelope;
Step D04, gateway is resolved IEEE802.15.4 packet and is obtained 6lowpan packet, obtain the internet host IPV6 address in this packet, Ipv6 address prefix to internet host intercepts, and generates internet host contextual information context and is deposited in the list items of context of gateway;
Step D05, according to internet-of-things terminal contextual information context, the 6lowpan address decompress(ion) of internet-of-things terminal is condensed to the IPv6 address of internet-of-things terminal, then according to the IPv6 address of internet-of-things terminal, internet host Ipv6 address architecture IPV6 packet, by this IPV6 package forward to internet host.
The present invention adopts above technical scheme compared with prior art, has following technique effect:
The designed internet-of-things terminal of the present invention can be applicable to the Internet of Things application of all employings 6lowpan networks, is conducive to promote the development of 6lowpan network application business and integrated simultaneously.The topmost difference of Internet of Things and wireless sensor network can realize the UNICOM with the Internet, configures 6lowpan agreement in internet-of-things terminal, can realize it and in lowpan territory, by 802.15.4 agreement, send the packet of lightweight.Proposed by the invention realizes initiatively update mechanism of context at internet-of-things terminal, and this mechanism is initiatively accessed in the flow process of internet-of-things terminal in lowpan territory for the IPv6 main frame of the Internet, propose the flow process of internet-of-things terminal active reporting data to internet host simultaneously, solved in lowpan territory the problem that interconnects of main frame in internet-of-things terminal and the Internet.
Accompanying drawing explanation
Fig. 1 is that internet-of-things terminal of the present invention is realized module diagram.
Fig. 2 is terminal node and the IPv6 main-machine communication protocol stack system schematic diagram based on IPv6.
Fig. 3 is the communication graph between internet-of-things terminal, gateway and PC main frame.
Fig. 4 is 6CO choice format schematic diagram.
Embodiment
Below in conjunction with accompanying drawing, technical scheme of the present invention is described in further detail:
1, internet-of-things terminal node module design.
As shown in Figure 1, internet-of-things terminal of the present invention comprises five main modular altogether: microprocessor module, data transmission module, data acquisition module, memory module and power management module.
Microprocessor module requires carrying to support the embedded OS of multitask, comprising uIPv6 protocol stack, can support IPv6 communication; It connects memory module and power management module simultaneously.Memory module requires the on-chip memory that comprises certain byte, and outside provides the flash flash memory of the configurable certain capacity of interface; Power management module requires to have the feature of low-power consumption, extends the operating time of node, requires not need external power supply simultaneously.
Data transmission module requires to have unlimited radio-frequency system, and its stable performance is simultaneously low in energy consumption, meets 802.15.4 standard, can guarantee the validity and reliability of short haul connection.The internet-of-things terminal node of integrated this data transmission module adopts IPv6 agreement to realize the communication of multi-point.
Data acquisition module comprises sensing unit and A/D converter, and its induction form can be diversified, adapts to the collection of dissimilar perception data.
2, internet-of-things terminal is sent out the method for data mutually based on main frame in IPv6 and 802.15.4 agreement and the Internet.
In the internet-of-things terminal design of lightweight, most important what can realize its lightweight feature is in microprocessor, to need to load the operating system that can move uIPv6 protocol stack.And the network architecture of 6lowpan is day by day ripe, its agreement is also just at gradual perfection, and its maximum feature is exactly low in energy consumption, and while source code takes up space little, has solved the problem of internet-of-things terminal processor resource finite energy.The present invention adds 6lowpan agreement to carry out adaptation to packet in internet-of-things terminal protocol stack, below 2 terminal node and IPv6 main-machine communication protocol stack systems that describe in detail based on IPv6 with reference to the accompanying drawings.
As shown in Figure 2, the physical layer of bottom and link layer adopt the 802.15.4 standard of IEEE, the common supporting network layer of 6lowpan agreement and IPv6 agreement, and transport layer adopts UDP and ICMP agreement.Compare with Traditional IP protocol stack, this protocol stack has added an adaptation layer, i.e. 6lowpan agreement between network layer and link layer.This is because the load of IPv6 is 1280byte, and the load of 802.15.4 frame is 127 bytes, therefore by 6lowpan agreement, will after IPv6 packet adaptation, meet the transmission standard of 802.15.4 frame format.The most general transport layer protocol of 6lowpan is udp protocol simultaneously, compares with IP stack, and due to reasons such as performance, efficiency and complexity, Transmission Control Protocol is generally not used in 6lowpan transport layer.ICMPv6 agreement is mainly used in control message, such as ICMP resets, object is unreachable and neighbor discovery messages.
Its final ability of lightweight internet-of-things terminal based on IPv6 need to reach the proper communication with IPV6 network, can carry out normally the basic function of 6lowpan adaptation layer again simultaneously, but when any main frame in IPv6 network is wanted to inquire about in lowpan territory any one terminal data, the IP address of this main frame is not known by gateway and internet-of-things terminal.The context information of this IPV6 address is unknown by the terminal that will inquire about yet.But known according to the basic function of above-mentioned context, in the situation that unknown its of terminal in lowpan territory sends packet IPv6 address context, can not compress its address.And also this situation is not designed to processing in the standard proposing at IETF, therefore Fig. 3 has provided the communication graph between internet-of-things terminal, gateway and the PC main frame of describing under this sight, wherein the designed lightweight internet-of-things terminal context based on IPv6 initiatively update mechanism will effectively utilize context inquiry and initiatively ask for upgrade in time self context storage list of function, the communication efficiency of main frame in raising and Internet network, the network payload of design mechanism in reduction script standard; Method based on 6lowpan protocol IP v6 main frame active accessing internet of things terminal will effectively utilize update mechanism and the internet-of-things terminal internet-of-things terminal of context to carry out efficient communication; Lightweight internet-of-things terminal and the realization of the IPv6 main frame under internet environment that method based on 6lowpan agreement internet-of-things terminal access IPv6 main frame can realize based on IPv6 are interconnected.
To introduce in detail respectively this three kinds of mechanism according to Fig. 3 below.
A, the internet-of-things terminal context based on 6lowpan is update mechanism initiatively:
Context carries that prefix information for 6lowpan address compression is obtained and configured by gateway, the 6CO option by RA message is distributed to intradomain router, by router, be distributed to each main frame again, thereby make the identical address prefix information of all 6lowpan nodes sharing in network.Therefore, in guaranteeing territory, on the conforming basis of each node context, how utilizing efficiently context to carry out address compression to any overseas main frame is the key point that this terminal realizes.
A real Internet of things system needs to make wireless sensor network and internet interconnect, at least realize the basic communication of three inter-entity, i.e. main frame on wireless sensor terminal, things-internet gateway and internet (PC or mobile terminal).Context adopts the mode of human configuration that fixing PC address prefix is write in 6CO option and issues internet-of-things terminal internet-of-things terminal, is illustrated in figure 4 the basic format of 6CO option, and gateway is mainly safeguarded four main fields of context information:
1, C bit-identify whether with this context, compress, C=0 represents that this context can only be for decompressing, C=1 represents both for compression, also to can be used for decompressing;
2, the CID field of sign context sequence number, for compression and decompression;
3, valid lifetime sign context effective life cycle, the context that preserves when internet-of-things terminal internet-of-things terminal is fast retransmits clean culture RS message to gateway when expired;
4, context prefix carries address prefix information.
First the obtain manner that is context need to be realized gateway self adaptation, gateway need to obtain the outer net IPv6 address prefix mutual with internet-of-things terminal internet-of-things terminal, mainly from two aspects, consider: be on the one hand of known the sent host IP address context of internet-of-things terminal internet-of-things terminal, the outer net communication request of being initiated by internet-of-things terminal internet-of-things terminal, now the destination address in 6lowpan stem is complete IPv6 address, when packet arrives gateway, gateway is according to complete its prefix information of IPv6 address acquisition, deposit in context list item, simultaneously location conversion, to send request through route and send to outer net main frame, while initiating the access to internet-of-things terminal internet-of-things terminal by PC on the other hand, gateway need to carry out prefix intercepting and deposit in context list item its address, and request of data is transmitted to terminal node, terminal node is according to the context of the request of data query source address receiving, the in the situation that of context the unknown, to gateway, send RS request, to the context information of this main frame source address of gateway requests, gateway is crossed RA message by the context information exchange under just storing and is sent back to terminal node again, receive after RA message, terminal node enters this context value record in the context table of oneself, and the destination address of sent packet is compressed, packet is carried out after burst Packet Generation to gateway, by gateway, undertaken sending back to again outer net host C after protocol conversion.
About the management and distribution mechanism of context, 6lowpan Neighbor Discovery Protocol has provided a comprehensive mechanism comparatively flexibly, and gateway makes full use of the mark function of C position, when the context value that guarantees C=0 travels through whole 6lowpan territory again by C position 1.
The assurance here, according to being a global variable MIN_CONTEXT_CHANGE_DELAY who sets manually, travels through according to network rate and 6lowpan territory coverage test RA message the minimal time delay that whole network obtains.In this time delay, guaranteed that same RA message is distributed to each node in 6lowpan territory by multi-hop topology.
In addition the prefix information of same CID also can face the demand of version updating, gateway upgrades the indifference that realizes context by three steps and distribution: first, the corresponding C of legacy version context position clear 0 is gone out by RA message distribution, through minimal time delay, carry out again second step, be about to the prefix information of the context prefixs_overlap legacy version of redaction, C position is still 0 simultaneously, sends and enter the 3rd step after minimal time delay equally in RA message, is about to C position 1.So just guaranteed the consistency of the context that in whole territory, the node of address compression and the node of decompression obtain.And complicated context administrative mechanism all realizes in gateway, has guaranteed the low consumption of sensing terminal node.
B, the method based on 6lowpan protocol IP v6 host access internet-of-things terminal:
In the Internet, IPv6 main frame initiatively initiates the access of internet-of-things terminal to be mainly divided into two kinds of situations: a kind of is to be that gateway and internet-of-things terminal are known at the context of this main frame, main frame sends to the request of data message of gateway, gateway all can carry out the normal transmission of effective address compression and 6lowpan packet, internet-of-things terminal A also can inquire the address prefix of this main frame according to the context table of oneself, carry out the decompression of effective address and send data answering message.Another kind of situation is the context of gateway and all unknown this host C of internet-of-things terminal, and this session is initiatively initiated by host C.Through the netinit stage, node A completes the registration that the overall situation can routing IP v6 address ip (A), the address of host C known node A.
Next will carry out alternately with host C by IP (A).Native system adopts udp protocol at data transmission procedure, realizes compression and the decompression of UDP stem.Do not realize complicated application layer protocol, but adopt the most simply request---reply data acquisition and the transmission (as Fig. 2) of machine-processed complete transducer.Protocol analysis route when dotted line represents each node gateway protocol stack of native system and transmission udp data in Fig. 2: first by host C, request of data is encapsulated in UDP message bag, set source address and destination address, via IPV6 Ethernet, send to gateway, gateway carries out address resolution to packet, analyzing destination address is IP (A), call uip process, IPv6 stem is compressed and obtained 6lowpan packet, source wherein, destination address passes through contextA, contextC is compressed into 6lowpan address 6L (C), 6L (A), last 6lowpan packet sends by wireless radio interface after the encapsulation of IEEE802.15.4 link.Internet-of-things terminal internet-of-things terminal A receives the 6lowpan packet after resolving via IEEE802.15.4 link layer.Through 6lowpan agreement, de-compress into former IPv6 packet, source, destination address are condensed to IP (C) by contextA, contextC decompress(ion) respectively, IP (A).Analyze the request of data information of UDP encapsulation, carry out data acquisition, and construct IPv6 packet, now source IPv6 address and destination address are respectively IP (A), IP (C).Through becoming 6L (A), 6L (C) after 6lowpan layer.When packet arrives gateway B by IEEE802.15.4 wireless network, by the step contrary with reception, carry out protocol conversion and address transition (IPv6 address->6lowpan address), after Route Selection, send to host C.
C, the method based on 6lowpan agreement internet-of-things terminal access IPv6 main frame:
Internet-of-things terminal active reporting data are to the main frame in IPv6 network, and how the IPv6 address that topmost problem to be solved is reported main frame obtains.In this case, general internet-of-things terminal need to periodically be uploaded to server by collected data message, its data message amount is large, generally also comparatively repeat, therefore can configure for the internet-of-things terminal in certain limit identical server ip v6 address, when 6lowpan network is set, for internet-of-things terminal configures the server ip v6 address that it wants active reporting, in this case, the active reporting process of its data as shown in Figure 3 under context known case data transmission procedure consistent.