Design of Multi-Protocol routers for Embedded Linux platforms

Source: Internet
Author: User
Article Title: Design of Multi-Protocol routers for Embedded Linux platforms. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

  Introduction

With the development of social informatization and the rapid development of the Internet, it becomes more urgent to provide data services in wireless environments. Traditional wireless mobile networks are usually supported by fixed infrastructure and cannot meet people's requirements for growing communication services. AdHoc networks, a new type of wireless network, have emerged. Ad Hoc networks, also known as mobile self-networking and multi-hop networks, are flexible and fast, and are not affected by wired networks, it can be widely used in military and rescue scenarios where network facilities cannot or are inconvenient to be laid in advance. In addition, Ad Hoc networks are evolving towards network interconnection, and Internet access is one of the main contents.

Ad Hoc wireless networks have their own characteristics. When constructing a wireless work network in actual use, you must fully consider the application scale and scalability of the network, as well as the reliability and timeliness requirements of applications, select an appropriate network topology. Currently, Ad Hoc wireless networks are evolving towards a large scale and gradually show a hierarchical trend, represented by two-level networks. In a two-level network, topology 1 is shown. The network is divided into two levels: backbone network and subnet. At the subnet level, each subnet can form an independent Ad Hoc network and use different routing protocols. A backbone network consists of multiple protocol router nodes and common nodes. Common nodes distribute data and control information in the backbone network; in addition to common node functions, a multi-protocol router is also responsible for subnet management, control, and data interaction. It is the core equipment of the backbone network.

  1. Features of multi-protocol Routers

As a node of the backbone network, a multi-protocol router runs a certain Ad Hoc network routing protocol to realize the function of addressing the backbone network.

In a hierarchical Ad Hoc network, multi-protocol routers interact with subnet gateways to manage subnets. The communication in the subnet is similar to that in the general Ad Hoc network. The communication between subnets must be transit through the subnet gateway node and the backbone network node, there are two scenarios: Communication Between homogeneous/Heterogeneous subnets under the same vro and communication between homogeneous/Heterogeneous subnets under different vrouters. To achieve effective communication between subnets, routers need to complete the conversion between multiple protocols.

The demand for Internet Access makes it necessary for a hierarchical Ad Hoc network to have an Access Point (AP ). Considering the network environment, this function needs to be implemented by a multi-protocol router.

To sum up, a multi-protocol router implements three main functions: routing addressing of the backbone network, protocol conversion, and Internet access AP.

 2 Multi-Protocol Router Design

Generally, the routers in the Ad Hoc network are vehicle-mounted or backload routers. Therefore, multi-protocol routers must have a high degree of integration and mobility. Considering the above factors, we have selected the most popular embedded system design method. The microprocessor of the hardware platform of the multi-protocol router adopts the ColdFire embedded processor MCF5272 of Motorola, select uClinux as the operating system of the platform. This not only shortens the R & D cycle, but also facilitates the design and debugging of software and hardware.

The dotted line diagram in the multi-protocol router hardware design 2 is shown. The hardware structure of a vro is divided into two parts: the Core mode (MCF5272) is composed of the microcontroller module and the memory module (including SDRAM and Flash), and the communication interface module, it consists of asynchronous Serial control and receiving module, Ethernet Control and receiving module, and Universal Serial Bus USB (Universal Serial Bus) interface module.

The microprocessor module is mainly responsible for data processing. The memory module is divided into two parts: Flash (composed of two Flash devices, a total of 4 MB), as a program memory, used to store the operating system kernel, various routing protocols and route table constants; the other part is SDRAM, which serves as the data storage and serves as the operating space of the operating system and various routing programs.

In the communication interface module, the asynchronous serial control and receiving module is used to connect to multiple backbone network nodes and multiple subnet gateways (PRU ). The Ethernet Control and transceiver module enables Internet access. The USB interface module is used to connect to the control terminal of network devices and implement the storage control of routers on USB devices (such as USB standard mobile hard disks, used to store important routing information.

The PRU (Packet Radio Unit) in is equivalent to the secondary processor of the router. It is used to pre-process the received wireless subnet group.

3. Implementation of multi-protocol Routers

3.1 Establishment of hardware platform

To use an embedded system, You must select an appropriate microprocessor for the hardware platform. to select a microcontroller MCU for a router, consider the following aspects: processing speed, bus width, integration, and cost effectiveness. Considering the above aspects, we finally chose Motorola ColdFire 5272 (MCF5272) as the master CPU. MCF5272 is a high-integration 32-bit ColdFire microprocessor launched by Motorola. It has strong communication processing capability and high performance and price ratio, and is suitable for small and medium network control devices.

MCF5272 adopts the ColdFire V2 variable-length CPU core and DigitalDNA technology to achieve excellent processing capabilities of 63Dhrystone2. 1MIPS at a 66MHz clock. Its internal SIM unit (System Integrated Module) integrates a wide range of general modules, such as 10/100 Mbps Fast Ethernet controller and USB1.1 interface, and can work with common peripheral devices (such as SDRAM and ISDN transceiver) seamless connection.

MCF5272 is integrated with 4 kb SDRAM (static RAM), out-of-chip Flash (Flash memory), and SDRAM (synchronous dynamic RAM ).

MCF5272 integrates a wide range of peripheral devices and interfaces, including two general asynchronous serial transceiver modules, one Adaptive Fast Ethernet Media Access Controller module, and one USB controller (as a slave device) module.

According to the vro design shown in the figure, certain expansion needs to be performed on the basis of MCF5272. Multi-Protocol routers need to connect multiple subnets and backbone network nodes, while MCF5272 only integrates two UART controllers, therefore, in the asynchronous serial expansion and receiving module, the ST 16C554 is used to expand four UART controllers to ensure that a multi-protocol router is connected to the other two backbone nodes at the same time, it can be connected to four subnets. In the USB interface module, the MCF5272 integrated USB controller (Slave Device) is used as the network management control terminal, and a master USB controller is extended to implement the storage control of the router on the USB device. With the MCF5272 integrated Fast Ethernet Media Access Controller, an external adapter (transceiver) can be extended to enable Ethernet access.

After the above steps, we have obtained a multi-protocol router hardware platform.

 3.2 operating system uClinux

Due to hardware restrictions, embedded systems usually have very few hardware resources, such as CPU with low clock speed and small memory. Linux is a popular Unix-like operating system. It is free and open source code and is widely used in personal computers and servers. More importantly, Linux adopts modular design and can be customized in practical applications. Therefore, Linux is also applicable to the embedded field.

MCF5272 is a type of microprocessor without MMU. Therefore, we chose the operating system uCLinux and uClinux customized for Embedded NOMMU microprocessor, which is an embedded version of Linux, the binary image file of the kernel can be smaller than kb. UClinux supports multiple tasks, multiple file systems, a complete TCP/IP protocol stack, and multiple network protocols to meet the needs of Ad Hoc network nodes accessing the Internet. In addition, uClinux is highly portable. By reconfiguration and compiling the kernel, you can easily transplant it to a multi-processor computing platform.

Embedded Linux porting technology is a key technology engaged in Embedded Linux development. It requires developers to have a considerable understanding of the Linux kernel and the ability to modify the kernel. The following describes the porting process of uClinux.

  (1) streamlined kernel M

Common commands for streamlining the kernel to construct the kernel include: make config, dep, clean, mrproper, zImage, bzImage, modules, modules_install. you can use these commands to remove all the options that can be removed and streamline the kernel as much as possible.

  (2) Modify hardware-related code

As an open source code operating system, uClinux source code can be obtained from www.uClinux.org. During system startup, you need to add three files: crt0_rom.s and sysinit. c and rom. ld. crt0_rom.s can be modified by crt0_ram.s. It provides a ROM vector table for reading during CPU power-on, initializing CPU registers, setting program stacks, and finally redirecting to the uClinux kernel. Sysinit. c. Make necessary modifications based on the actual situation, mainly for the part selection resources actually occupied by CS0 ~ CS7, SDRAM control registers SDCR, SDTR make some modifications to adapt to the hardware platform. The rom. ld file is used to calculate the actual storage address of the binary image ROMFS. img of the romfs File System in the ROM.

  (3) modify the Startup Script

After the kernel initialization in uClinux is complete, the init (void *) kernel calls/bin/init and then runs the/etc/re script command.

You can use this script to automatically configure the system after power-on, or run user programs.

(4) Kernel configuration and compilation

A cross-compiling environment is required to compile the kernel and applications, generate the ROMFS file system, and finally form a solid file. Www.uClinux.org also provides such a toolkit. After correct installation, You can compile it. First, go to the source code directory uClinuxdist, execute make xconfig, select "Target Platform Selection" in the pop-up dialog box, and then configure it accordingly. After the configuration is complete, Run "make dep" and "make" in the source code directory to obtain the desired binary kernel image. bin, which can be directly downloaded to the hardware platform for running.

3.3 router software

After the successful transplantation, the uClinux operating system only provides users with a basic system platform. For actual applications, you must also write the necessary drivers and applications. MCF5272 integrates two UART controllers, one slave USB controller, and one Ethernet controller. We have expanded one master USB controller and four UART controllers to write drivers for these devices, and on the basis of uClinux and drivers, implement router software (including the routing module, protocol conversion module, and Internet proxy module for wireless network nodes ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.