Implementation of 6LoWPAN Border Router Based on OpenWrt

OpenWrt can be described as an embedded Linux distribution (mainstream router firmware has dd-wrt, tomato, openwrt) instead of trying to build a single, static system. OpenWrt's package management provides a fully writable file system, from the application vendor's choice and configuration, and allows you to customize the device to suit any application.

For developers, OpenWrt uses a framework to build applications without having to build a complete firmware to support it; for users, this means they have full customization capabilities and can use the device in ways never before possible.

6LoWPAN is a low-speed wireless personal area network standard based on IPv6, namely IPv6 over IEEE 802.15.4.

The introduction of IP protocols into wireless communication networks has long been considered unrealistic (not entirely impossible). So far, wireless networks only use proprietary protocols. Because IP protocols have high memory and bandwidth requirements, it is difficult to reduce the operating environment requirements to accommodate microcontrollers and low-power wireless connections.

The release of the draft standard for IETF 6LoWPAN[1] based on IEEE 802.15.4 for IPv6 communication is expected to change this situation. The low power potential of 6LoWPAN makes it ideal for applications ranging from handsets to instruments, and its built-in support for AES-128 encryption lays the foundation for robust authentication and security.

The IEEE 802.15.4 standard is designed to develop compact low-power, inexpensive embedded devices (such as sensors) that can run on batteries for one to five years. The standard uses a radio transceiver operating in the 2.4 GHz band to transmit information using the same frequency band as Wi-Fi, but its RF transmit power is only about 1% of Wi-Fi. This limits the transmission distance of IEEE 802.15.4 devices, so multiple devices must work together to transfer information and bypass obstacles on a longer distance.

Implementation of 6LoWPAN Border Router Based on OpenWrt

As a product of the combination of WSN and IPv6 technology, 6LoWPAN not only inherits the advantages of IPv6 huge address space, but also meets the requirements of low power consumption of wireless sensor networks, and is favored by more and more users of wireless sensor networks [1]. As far as the characteristics of the 6LoWPAN network are concerned, it should be interconnected with some external networks, so that the external network can monitor and control the 6LoWPAN network to have more practical significance. As the current mainstream network, how to realize the connection between the network and the 6LoWPAN network is an urgent problem to be solved.

As a powerful open source router Linux system, OpenWrt can be customized and optimized by users to achieve their own functional requirements [2]. The 6LoWPAN border router based on OpenWrt designed in this paper successfully solves the problem of heterogeneous network interworking between 6LoWPAN network and IP network. It has far-reaching significance for the development of wireless sensor network and the promotion of seamless integration between heterogeneous networks.

1 system architecture

As a bridge connecting IPv6 networks and 6LoWPAN networks, 6LoWPAN border routers need to provide access functions for both networks and forwarding and routing of data packets between two different networks. The system architecture of the 6LoWPAN border router designed in this paper is shown in Figure 1. It mainly includes the underlying hardware, device driver, operating system and upper application.

Implementation of 6LoWPAN Border Router Based on OpenWrt

The border router communicates with the IPv6 network through its own Ethernet interface, and the communication with the 6LoWPAN network is implemented by the IEEE802.15.4-based radio frequency module. The system topology is shown in Figure 2.

Implementation of 6LoWPAN Border Router Based on OpenWrt

2 system hardware design

The 6LoWPAN border router is mainly used to help some limited 6LoWPAN nodes access the IPv6 network. Based on the above objectives, the border routing device needs to have better protocol execution capability and certain processing capability in hardware design [3]. The hardware structure design of the 6LoWPAN border router designed in this paper is shown in Figure 3. It mainly includes the Ethernet access part and the 6LoWPAN network access part. The two parts are connected through the serial port.

Implementation of 6LoWPAN Border Router Based on OpenWrt

The Ethernet access part of the main control chip is a high-integrated low-cost SOC chip RT5350F from Taiwan's Ralink Technology. The chip is a high-performance MIPS 24Kc CPU core with a maximum frequency of 360 MHz. The higher main frequency guarantees a certain processing power. In addition, this part uses 16 MB Flash memory as program memory, 32 MB 16-bit SDRAM as memory, can embed a complete TCP/IP network protocol, realize powerful network communication functions, and have enough space. Used to install programs and dependencies to meet the user's functional expansion needs.

Since the RT5350 only provides the RF interface of the IEEE802.11 protocol, and the 6LoWPAN protocol is currently based on the IEEE802.15.4 standard, other chips are needed to provide the functional support of the 6LoWPAN network access. In this paper, the RF access module based on CC2530F256 chip and its external function expansion circuit are provided to provide access to the 6LoWPAN network.

3 system software design

To achieve interconnection of two heterogeneous networks, the border router must have both IPv6 and 6LoWPAN standards. Although the 6LoWPAN protocol is derived from the IPv6 protocol, the protocol has its own particularity: it includes an adaptation layer to implement the transmission of IP packets over the IEEE 802.15.4 link [4].

Since the maximum transmission unit of an IPv6 packet is 1 280 B, and IEEE 802.15.4 defines the length of each frame of the MAC layer to be 127 B, this causes a mismatch in the length of the IPv6 datagram and the IEEE802.15.4 frame, many IPv6 packets cannot be completely placed in an IEEE 802.15.4 frame for transmission [5]. In order to solve this problem, the IPv6 data packet needs to be fragmented and reassembled at the adaptation layer, and the header of the data packet is also compressed to adapt to the size of the IEEE 802.15.4 frame [6].

According to the above situation, the 6LoWPAN border router protocol stack part is designed as shown in Figure 4: first realize the IPv6 and 6LoWPAN protocol stacks respectively, and then establish a serial between the two protocol stacks through the SLIP (Serial Line Internet Protocol) protocol. The communication link enables two heterogeneous networks to transmit IP datagrams over the link, thereby enabling communication between the two heterogeneous networks.

Implementation of 6LoWPAN Border Router Based on OpenWrt

3.1 IPv6 Access Module

The establishment of this module is mainly done by using the OpenWrt operating system. The system uses uClibc, busybox and shell interpreter to provide hardware abstraction layer and package management through embedded Linux tools. The internal composition of the system is shown in Figure 5. Users only need to recompile uClibc and packages to match the target architecture to get the same application on different embedded devices. Given the many advantages of the OpenWrt embedded system, it is well suited for use in IP network access modules.

Implementation of 6LoWPAN Border Router Based on OpenWrt

3.2 6LoWPAN access module

The 6LoWPAN access module is mainly implemented based on the ConTIki operating system. The system is a highly portable, multi-tasking environment and open source free embedded operating system, which is very suitable for the design of 6LoWPAN access modules. The software structure of the system is shown in Figure 6. It consists of three parts: the uIP protocol stack, the Rime protocol stack, and the upper application.

Implementation of 6LoWPAN Border Router Based on OpenWrt

uIP is a small RFC-compliant TCP/IP stack that allows ConTIki to communicate directly with the Internet. The main task of the uIP protocol stack is to process the data packets received by the underlying driver, or to forward the data packets that need to be forwarded to the underlying device driver for packet forwarding [7]. The IPv6 RouTIng Protocol for Low-Power and Lossy Network (RPL) protocol provides the networking function of 6LoWPAN.

The Rime of the MAC layer is a lightweight protocol stack designed for low-power wireless sensor networks. The protocol stack provides a large number of communication primitives, from simple one-hop broadcast communication to complex reliable multi-hop data. Communication functions such as transmission [8].

The upper application mainly includes the bridge program and the boundary routing program. The former is used to forward data packets to the RPL interface through the SLIP serial port, which is the middle layer of RPL data transceiving and conversion. The latter is responsible for requesting the IP access module for the subnet prefix of the node, initializing the 6LoWPAN access module, and periodically maintaining the established 6LoWPAN network.

3.3 Establishment of channels between two protocol stacks

The establishment of the channel between the two protocol stacks is mainly realized by the tun virtual network card driver and the SLIP protocol. The tun virtual network card driver is mainly used to receive and send network data packets from the TCP/IP protocol stack, or vice versa, to transmit the received network data packets to the protocol stack; at the same time, the part also bears the transmission process in the point-to-point device. In the task of correspondingly encapsulating the data packet. As for the package format, it is mainly determined by the point-to-point device transmission mode. This article uses the SLIP protocol, which is a serial line Internet protocol transmitted on the link layer. It mainly encapsulates the IP data packets to be transmitted, that is, plus corresponding Head and tail, and make appropriate modifications to the packet to prevent misjudgment of the head and tail.

The establishment of the above channels is mainly implemented on the OpenWrt system, and a tunslip6 program is used to establish a corresponding virtual network card and SLIP package. The flow of processing data by a specific SLIP channel can be described using FIG.

Implementation of 6LoWPAN Border Router Based on OpenWrt

3.4 The operation process of the entire boundary route

After the radio interface of the border router receives the bit stream sent by the 6LoWPAN subnet, it needs to be fragmented and integrated into a complete IPv6 data packet through the adaptation layer. It is then passed to the network layer to determine if the destination address of the packet is in the 6LoWPAN network via the RPL routing protocol. If yes, the data packet is forwarded to the 6LoWPAN network; if not, it continues to determine whether the destination address prefix of the data packet belongs to the 6LoWPAN network. If it belongs, it is discarded because there is no destination route; if it does not belong, it is forwarded to the IPv6 access module. In the IPv6 access module, it is first determined whether there is a route with a destination address. If it exists, it is directly sent to the corresponding IPv6 host. If there is no route at the destination end, the neighbor discovery operation should be performed, and the data packet is corresponding according to the result. deal with. The whole process is shown in Figure 8.

Implementation of 6LoWPAN Border Router Based on OpenWrt

The processing flow of the border router to the Ethernet data frame is opposite to the above process of processing the 6LoWPAN data packet, and will not be further described herein.

4 test

In order to verify whether the 6LoWPAN border router designed in this paper can connect to the IPv6 network and the 6LoWPAN network, the connectivity test is carried out. In addition to the border router, the test includes two 6LoWPAN sensor nodes and one IPv6 host.

First, two sensor nodes are placed at a distance of about 10 m from the border router, and the border router is connected to the IPv6 host through the LAN port. Since the lab does not provide access to the IPv6 network, the WAN port of the border router is temporarily unused. Then ping the two sensor nodes on the IPv6 host. It can be seen from the test results that the response time is within 30 ms and the data packet is not lost, which can ensure the forwarding and routing of data between the IPv6 network and the 6LoWPAN network.

5 Conclusion

This paper proposes an implementation method of 6LoWPAN border router based on OpenWrt operating system. By implementing two protocol stacks on the border router and establishing SLIP channels between the protocol stacks, the data packets are realized between two heterogeneous networks. Forwarding and routing. By testing the ping command of the border router, it is proved that the scheme is feasible and can realize the communication between the 6LoWPAN network and the IPv6 network host. In practical applications, the intermediate gateway device that can be used as an Internet of Things device to access the Internet has a broad application prospect with the extensive use of the Internet of Things device.

Germany Cable Reel

German type cable reel Non-rewirable, 230V~, IP20, Class I, with a thermal cut-out, with a non-rewirable plug with cord H05VV-F 3G1,0-1,5mm 2 ,

with 4-way socket outlet with or without shutters.

Germany Cable Reel,Cable Reel,Automatic Cable Reel,Cable Spool Reel

CIXI KYFEN ELECTRONICS CO.,LTD, , https://www.kyfengroup.com

Posted on