a lightweight embedded web server for non- internet...

5
A Lightweight Embedded Web Server for non- Internet Devices Guangjie Han, Deokjai Choi and Tam Van Nguyen Department of Computer Science, Chonnam National University, Gwangju, 500-757, Korea; E-mail:{[email protected] , [email protected] , [email protected] } Abstract – In this paper, we propose a lightweight Embedded Web Server (EWS) - Webit which enables a stand connection to non-Internet devices using the Internet and evaluate how far it can be said to give the users fast and user-friendly ways to access, monitor, control and configure non-Internet devices with standard Web browsers in real-time. We also describe the architecture of Webit in detail and present how to design and implement it. Finally we compare the results of Webit's performance with those of other similar EWS products. Index Terms Ubiquitous Computing; EWS; Webit; thin TCP/IP stack; non-Internet devices. I. INTRODUCTION The advent of Internet brought with a paradigm shift. So much has happened that no one knows where we will end up exactly. The only thing we know for sure is that things will continue to change and the effects will be very wide spread. One of the areas, which have been deeply affected by Internet technology, is much more. It is not so clear the extent to which it will be affected, or how positive or negative the effects will be. With the rapid development of the Internet, there has been attracted an increasing interest in non-Internet devices based on the network. Many people now want to remotely share and access the information from the devices via the Internet. Consequently, the question of how to share information across these single-chip systems is becoming a hot topic and the main focus of current research. How to efficiently add millions of non- Internet devices with limited resource to the Internet are the central issues that we will address in this paper. Ubiquitous Computing technology primarily results from the problem how to interconnect heterogeneous networks [1]. People hope that they could access the programmable device via the current public communication network systems, for example, remotely control and manage the devices through Web. If EWS can be embedded into a non-Internet device, we can access the device through the Internet, and then the device are added to the Internet integrally. Through interconnecting, people can monitor and control any single device node in the network. EWS gives customers user-friendly and fast way to access, monitor, control and configure the devices with standard Web browsers in real-time, and can be used in many ubiquitous applications, from Television to mobile phone communication base stations, so there must be a place in the full range of ubiquitous applications. At present, most of existing web servers is not suitable for non-Internet devices, because their limited resource prevent them from being embedded into the device [2]. Thus, in this paper we introduce an efficient and lightweight EWS - Webit and evaluate how far it can be said to give the users fast and user-friendly ways to access, monitor, control and configure non-Internet devices with standard Web browsers in real-time. The rest of this paper is organized as follows. In Section 2, we describe the benefits of embedding a web server into non- Internet devices. Section 3, we offer the architecture of Webit. In Section 4, we design and implement all Parts of Webit in detail. Section 5 we evaluate the performance of Webit based on our proposed EWS and compare with existing similar products. Finally, in Section 6, we make some conclusions and predict future work. II. WHY PROVIDING CONNECTIVITY TO NON-INTERNET DEVICES An Embedded Web Server is a microprocessor or microcontroller that contains an Internet software suite as well as application for monitoring and controlling systems. Web pages provide user-friendly interfaces for non-Internet devices. A web server can be embedded in a non-Internet device to provide remote access to the device from a web browser if the resource requirements of the web server are reduced. The final result of this reduction is typically a portable set of code that can run on the non-Internet device with limited computing resource. In ubiquitous computer, the application is the critical aspect of the device. What this means is that a web server in the EWS has quite a different set of requirements than those. Additionally, market forces are also driving requirements of EWS. It's clear that more and more non-Internet devices are being attached to the network. There are many compelling reasons why people want to access, control and manage the devices [2]: (1) Mobility between different locations and different networking platforms, namely, people would be able to access device management information transparently from any node in the Intranet or Internet using a Web browser; (2) The uniform Web browser interface gives the users a convenient way of controlling and managing the devices; (3) Smooth connection between heterogeneous networks. Since the Web application is platform independent, the devices based on web can be seamlessly connected together. In consequently, transparently access between different devices becomes

Upload: others

Post on 04-Sep-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Lightweight Embedded Web Server for non- Internet Devicesread.pudn.com/downloads97/doc/395584/2007/A lightweight... · 2007. 12. 29. · A web server can be embedded in a non-Internet

A Lightweight Embedded Web Server for non-Internet Devices

Guangjie Han, Deokjai Choi and Tam Van Nguyen

Department of Computer Science, Chonnam National University, Gwangju, 500-757, Korea; E-mail:{[email protected] , [email protected], [email protected]}

Abstract – In this paper, we propose a lightweight Embedded

Web Server (EWS) - Webit which enables a stand connection to non-Internet devices using the Internet and evaluate how far it can be said to give the users fast and user-friendly ways to access, monitor, control and configure non-Internet devices with standard Web browsers in real-time. We also describe the architecture of Webit in detail and present how to design and implement it. Finally we compare the results of Webit's performance with those of other similar EWS products.

Index Terms – Ubiquitous Computing; EWS; Webit; thin TCP/IP stack; non-Internet devices.

I. INTRODUCTION

The advent of Internet brought with a paradigm shift. So much has happened that no one knows where we will end up exactly. The only thing we know for sure is that things will continue to change and the effects will be very wide spread. One of the areas, which have been deeply affected by Internet technology, is much more. It is not so clear the extent to which it will be affected, or how positive or negative the effects will be. With the rapid development of the Internet, there has been attracted an increasing interest in non-Internet devices based on the network. Many people now want to remotely share and access the information from the devices via the Internet. Consequently, the question of how to share information across these single-chip systems is becoming a hot topic and the main focus of current research. How to efficiently add millions of non- Internet devices with limited resource to the Internet are the central issues that we will address in this paper.

Ubiquitous Computing technology primarily results from the problem how to interconnect heterogeneous networks [1]. People hope that they could access the programmable device via the current public communication network systems, for example, remotely control and manage the devices through Web. If EWS can be embedded into a non-Internet device, we can access the device through the Internet, and then the device are added to the Internet integrally. Through interconnecting, people can monitor and control any single device node in the network. EWS gives customers user-friendly and fast way to access, monitor, control and configure the devices with standard Web browsers in real-time, and can be used in many ubiquitous applications, from Television to mobile phone communication base stations, so there must be a place in the full range of ubiquitous applications. At present, most of existing web servers is not suitable for non-Internet devices,

because their limited resource prevent them from being embedded into the device [2]. Thus, in this paper we introduce an efficient and lightweight EWS - Webit and evaluate how far it can be said to give the users fast and user-friendly ways to access, monitor, control and configure non-Internet devices with standard Web browsers in real-time.

The rest of this paper is organized as follows. In Section 2, we describe the benefits of embedding a web server into non-Internet devices. Section 3, we offer the architecture of Webit. In Section 4, we design and implement all Parts of Webit in detail. Section 5 we evaluate the performance of Webit based on our proposed EWS and compare with existing similar products. Finally, in Section 6, we make some conclusions and predict future work.

II. WHY PROVIDING CONNECTIVITY TO NON-INTERNET DEVICES

An Embedded Web Server is a microprocessor or microcontroller that contains an Internet software suite as well as application for monitoring and controlling systems. Web pages provide user-friendly interfaces for non-Internet devices. A web server can be embedded in a non-Internet device to provide remote access to the device from a web browser if the resource requirements of the web server are reduced. The final result of this reduction is typically a portable set of code that can run on the non-Internet device with limited computing resource.

In ubiquitous computer, the application is the critical aspect of the device. What this means is that a web server in the EWS has quite a different set of requirements than those. Additionally, market forces are also driving requirements of EWS. It's clear that more and more non-Internet devices are being attached to the network. There are many compelling reasons why people want to access, control and manage the devices [2]: (1) Mobility between different locations and different networking platforms, namely, people would be able to access device management information transparently from any node in the Intranet or Internet using a Web browser; (2) The uniform Web browser interface gives the users a convenient way of controlling and managing the devices; (3) Smooth connection between heterogeneous networks. Since the Web application is platform independent, the devices based on web can be seamlessly connected together. In consequently, transparently access between different devices becomes

Home
1-4244-1007-X/07/$25.00 ©2007 IEEE.
Page 2: A Lightweight Embedded Web Server for non- Internet Devicesread.pudn.com/downloads97/doc/395584/2007/A lightweight... · 2007. 12. 29. · A web server can be embedded in a non-Internet

possible. This becomes increasingly important as the progress of network development means that more and more devices are being connected to the Internet; (4) The newest version of the software application can be quickly updated using Java technology.

III. ARCHITECTURE OF WEBIT

Webit are especially suited for non-Internet devices that require fast time-to-market, low cost, and Internet connectivity to Internet. It also serves the needs of the industrial control, office and factory automation and Web-based management markets as well as high-performance electronic applications. In order to access the device using the standard browser through Internet, one has to embed the TCP/IP protocol and Embedded RTOS into the device. It will be supposed to solve the problem of connecting the various non-Internet devices in networks. Based on thin TCP/IP and Embedded RTOS, Webit is able to equip the non-Internet device with simple management function, so the device connected to the Internet is capable to be controlled and managed. The architecture of Webit is shown in Figure 1.

thinTCP/IP

HTTP Server Security

WFS

Configuration

Interface

device

EWS

WebBrowser

JavaSNMP

Manager

SNMPAgent

Application

ERTOS

Web

CGI

Interface

Fig.1. Architecture of Webit

As shown in Figure 1, the job of the HTTP server process is just to return the document requested by the user, so it is much smaller than HTTP client. The data transmission of Webit is primarily based on HTTP protocol, which makes it possible to monitor the device and download the device driver dynamically. The key technique of Webit is how to communicate and control the device using Web browser. The users can browse the Web pages and send control commands to the device, and then Webit use CGI interpreter interpret and execute the commands and then send back the results to the user. Webit File System (WFS) model is used to store released web pages and some binary files that the system needs. SNMP Manager is embedded to Web page, so the users can use it to collect the information of the device and to control and manage the device via the Internet.

In this way, the device is really incorporated into the network integrally and can be managed by the user in an efficient way. When the device has something wrong, SNMP Agent will send alert message to the client, in this case the client will get the message at the very first time so it is possible to maintain the device efficiently. Moreover the user can update the device

driver via the Internet and authorization mechanism which is added into Webit to secure the data of the device.

IV. DESIGN AND IMPLEMENTATION OF WEBIT

A. Hardware Platform The hardware platform of Webit is designed based on 8-bit

microprocessor and Ethernet interface controller, the size of program space is 8Kbytes and the memory space is 32Kbytes. It is equipped with FLASH to store Web pages and images written by users. The user can manage and control the device using the transformation of voltage at UART or I/O port or alternatively connecting to the control line of the device after power driving. The executable code of the application is downloaded to the chip of the Webit through serial port, and the Web pages are downloaded to the device using TFTP tool over Internet.

B. Design Principles Once non-Internet device is able to provide WWW service, it

is possible for the user to control and monitor the device through the Internet. In this paper, An IP address is assigned to Webit, which has the same function as a regular simple Web server; therefore it can be connected to Internet network. Design of Webit has some special points to consider [3]: (1) Users request might be real-time or come up all of a sudden, Webit has to consider that; (2) Users on different operating systems are supposed to access the device in a uniform way; (3) A complete set of security mechanism to secure the device data; (4) Users are supposed to configure the parameters of the device. In order to implement it, many new techniques such as multi-threaded parallelism and synchronization, security algorithms and thin TCP/IP techniques are incorporated into Webit.

C. Embedded RTOS An ERTOS is a system, which satisfies responses in a

predictable way to unpredictable external events and strict timing constraints. The minimum features of an ERTOS are multi-tasked (threads) and preemptive priority driven, mechanism for thread synchronization, mechanism to avoid priority inversion, and sufficient priority levels.

WebitX is an Embedded RTOS designed for Webit [11]. The structure of the WebitX includes two parts: the device driver and kernel. Every module is developed separately and provides callable API functions to users. The system kernel, which is the software running above the device driver, will occupy about 1.5 Kbytes when it is running.

The design and implementation of WebitX refer to the currently popular design idea of Embedded RTOS and some external modules are simplified specifically. As a distributed executable code featuring Embedded RTOS, WebitX is running under distributed microcontroller environment and is able to realize the mostly functions of the real-time multitask. The task will be executed in a "competitive" way, that is, the task with the highest priority will be executed first so that the real-time

Page 3: A Lightweight Embedded Web Server for non- Internet Devicesread.pudn.com/downloads97/doc/395584/2007/A lightweight... · 2007. 12. 29. · A web server can be embedded in a non-Internet

execution can be guaranteed. Since we have only limited computing resources, the task creation is performed in a simple static way, that is, the developers predefine the size of the task and some parameters such as priorities, and the system will assign stacks to every task and control block, so at most 64 tasks are supported at a time.

D. thin TCP/IP Stack TCP/IP stack offers a way for most computers to

communicate with each other over the Internet, thus having a TCP/IP stack at every non-Internet device makes it to possible communicate each other, however, which are poorly suited for use in ubiquitous devices (Because memory management has become an important issue when the software is transferred from the development PC to non-Internet devices). For some small devices, it is necessary to reduce TCP/IP stack to its essential components, which require just a few Kbytes of memory.

The key to implement Webit is how to embed TCP/IP stack into the device. Traditional protocols are not suitable any more when used in a ubiquitous device, thus the memory resource and the memory management become main issues. In order to implement the mostly functions of TCP/IP stack in the non-Internet device with limited resource. Some of the protocol modules are reduced, so basically a subset of TCP/IP is implemented in a ubiquitous device, which is called thin TCP/IP stack [4], including some parts of ARP, UDP, HTTP, and TCP protocol.

According to the design idea of network layer structure, every layer of thin TCP/IP is designed to be a functionally independent module. Every module is handling its own data, the above or lower module can obtain the control right through the function call. In the whole design process, every data packet of thin TCP/IP stack is processed in a new "byte processing" way. In order to use the SRAM to send or receive as little data as possible and at the same time make the protocol functions complete, the data are packed or unpacked when sending or receiving one or more byte data, instead of sending the data after getting all the data or unpacking after receiving all the data. In this way, the pressure on memory can be greatly reduced.

E. HTTP Server HTTP is a standard Internet protocol used to transfer files. It

supports two types of requests: complete request or simple request. The difference is: simple request only need one line to refer to the wanted webpage using GET line, no version information is needed. Simple request in HTTP server can provide enough information to be used to monitor the device and dynamically download the device driver [5]. In order to quickly respond to the received data packets, Webit transfers them to do some preprocessing. As in Figure 2, the most common HTTP client is the familiar web browser. The web browser issues an HTTP request to the web server in order to access a document. The server must be operating before the browser initiates its requests. This way, the data redundancy is

reduced and complexity is decreased. Consequently the data processing time of Webit is greatly saved and response to HTTP request from user could be sent back more quickly.

Server

Data

HTTP HTTP

Client

Webbrowser

Task

ERTOS

HTTPserver

Applic-ationInternet

Fig.2. The model of HTTP process HTML pages

HTTP server in Webit fits into the ubiquitous application very nicely and supports certain number connections, requests, processes and transfers between the device and Web browser. Webit implements the HTTP, a compact, reliable, good performing protocol well suited to be used in ubiquitous applications. Before one can add the HTTP to your application, there are a number of prerequisites that your application must include. Webit is supposed to handle requests and pass data back to the browser. Webit also provides a CGI layer as well as some other functions: HTTP1.0, authentication and security mechanism in Web browser.

The model in Webit has HTTP server, a file system and several security modules, which works via the CGI interpreter between the application and the server. Webit can also dynamically create user Web pages and configure the system parameters. User can submit the data to the ubiquitous device by filling out a form that tells the server to process the information by running a CGI script, notifies the server to process the information through executing the URL request, and accesses the pages in the memory and process the pages through CGI interpreter, as shown in Figure 3. The device can also serve to complete the command sent by the CGI interpret from the user.

Server

Webpage

Return page

Commandfeedback

Controlcommand

URL request

Client

Web Browser

Web ControlPage

WebServer

deviceHardware

Interface

CGIinterpreter

database

Fig.3. Access process of HTTP

F. HTML pages and CGI scripts An HTML page can be generated dynamically with CGI

script in Webit. Certainly, in Webit an HTTP function library is provided, which allows the user to create scripts for dynamic generation of HTML pages. These pages can be simply downloaded from a file system to the client. This is the typical method used on Internet. This allows for dynamic re-configuration of the system, or a very easy way of controlling the device. Server-side HTML allows the usage of a standard

Page 4: A Lightweight Embedded Web Server for non- Internet Devicesread.pudn.com/downloads97/doc/395584/2007/A lightweight... · 2007. 12. 29. · A web server can be embedded in a non-Internet

HTML editor to create the GUI of ubiquitous applications and at the same time processes dynamic content as part of the HTML pages viewed by the user.

When Webit receives a request for a file, it locates the file and returns it to the client. Different from Non-EWS running on desktop operating systems, which can simply spawn a process to execute CGI script, Webit handle them differently. The function is implemented to be part of the application. As above-mentioned analysis, Webit is designed so that it will take advantage of WebitX.

G. SNMP Agent SNMP is the standard network management protocol used in

Internet, which can help network administrators to locate and solve problems in a TCP/IP network. The design of SNMP Agent is consist of three parts, memory allocate, initialize the variable of MIB, and the mainly function code. Because of all the variable structure of MIB must be saved inside SRAM in the board, we design a three level chained table to search the pair of variable. The mainly function in SNMP Agent consists of reading/writing length of variable, reading/writing the values of integer, reading/writing values of Object ID, and an parse and response the SNMP function. It also contains the Trap function to collection the information of error and return to Users.

H. Security Since Webit has been critical for applications such as

environmental controls, office equipment, and telemedicine. It is obvious that if hackers or competitors gain access, the consequences could be severe. So the security problem is also a main factor when designing Webit. A simple security policy has been implemented in order to avoid execution of malicious code that could harm Webit. Although in the platform, public key cryptography will be used for authorization of the clients.

Every client will carry a certificate issued by a trusted authority. If the certificate is valid, the client will be accepted; otherwise, access to the client will be denied.

I. Functions of Webit Webit provides an easy and straightforward way to connect

the non-PC devices to Internet via a Web browser and it is fully compatible with all the standard Web browsers. It has follow features: (1) Thin TCP/IP stack. (2) Java Applets. (3) The embedded file system for storage of Web pages. (4) Security functions. (5) Real-time clock support. (6) Run-time supervision of the target system and collection of target information that will be graphically displayed on the host screen. (7) Maintenance and management of the target system, the device's parameters are also configurable on-line.

V. PERFORMANCE AND RELATED WORK

The performance of Web server is dependent on a number of variables: hardware and operating environment, application, network bandwidth and traffic load. The performance indices of Webit are code size, run-time memory, the CPU usage, throughput and maximum user connectivity. By evaluating the system performance of Webit, we have the following conclusions: the code size is approximated 3.5 Kbytes, the average run-time memory is 6 Kbytes, the CPU usage is about 15% and it supports about 64 users at the same time.

Today, a number of similar commercial products have appeared on the market. In the sequel, we will compare the features of some commercially available implementations to those of Webit. As shown in Table 1, blank columns represent features not supported or we do not find appropriate information about them from the available literature.

Table1. Comparison of similar products

Features Company & Products

OS Supported

Full Code Size

(Kbytes)

HTTP code size

(kbytes/version) Platform VFS SNMP Security

Agranat Systems, mWeb [6] No OS 25 25/1.1 32-bit O O Basic+Digest

Allegrosoft, Rompager [7] Any RTOS 40 10~40/1.1 32-bit File sys O Basic

Magma, Lava [8] Any RTOS 45 15~40/1.0 32-bit O O Basic+SSL

Web Device, PicoServer [9]

LynxOS, pSOS,

VxWorks 50 15~30/1.0 32-bit O O Basic+Digest

+SSL

AVRmega, EI toolkit [10] AvrX 5.5 2~2.5/1.0 8-bit FTP O Basic

Webit [3] WebitX 3.5 1~1.5/1.0 8-bit VFS SNMP Agent Basic (MD5)

As shown in Table 1, we can compare these products and summarize most similar products offer about 30 kbytes for HTTP code size, use 32-bit platform, support for security/authentication, and option for file system and TCP/IP

stack. Most products haven't SNMP Agent to manage lots of devices, however, our Webit only use a little code to achieve the same function on 8-bit platform than other products, and to manage and monitor devices via the Internet. Also, our

Page 5: A Lightweight Embedded Web Server for non- Internet Devicesread.pudn.com/downloads97/doc/395584/2007/A lightweight... · 2007. 12. 29. · A web server can be embedded in a non-Internet

Webit provides effective integration mechanisms into ubiquitous device. We testified them through applying Webit to manage a group of UPS. The comparison of throughput is shown in Table 2. (Because we can't compare the product of 32-bit platform with 8-bit platform at the same level, we only test the similar products of 8-bit platform.)

Table 2 Comparison of throughput Products Request per second Throughput Processing delay

EI Toolkit 35 GETs/s 8 Kbytes/s 43 ms

Webit 48 GETs/s 14 Kbytes/s 32 ms

As shown in Table 2, we can draw the following conclusions: the total throughput of Webit is greater than EI Toolkit.

In our scheme, three kinds of web pages are used to evaluate the performance of Webit by managing a group of UPS. These three kinds of web pages are HTML, HTML file with JPEG, and HTML file with JAVA script. The main performance parameters are recorded in Table 3.

Table 3 Comparison of download speed File category File size File number Display time

HTML 30Kbytes 1 2.29s

HTML&JPG 35.4Kbytes 6 2.91s

HTML&JAVA 28Kbytes 4 3.45s

As shown in Table 3, the test results show that the web pages of Webit can be displayed within 2-4 seconds using the web browser, thus the download speed of Webit can be accepted by the users.

VI. CONCLUSIONS AND FUTURE WORK

In this paper, the design and implementation of an embedded web server--Webit are described. Webit, which is able to provide Internet connectivity for the non-Internet devices, has significant benefits not only to the end user but also to the manufacturer. Webit really implements the intelligent management of the devices, for example, the user

can remotely control, manage and maintain a group of UPSs using the Internet. The study of Webit makes it possible to dynamically download, diagnose and maintain the devices. Using the Webit, the devices will be integrally a part of the Internet. We plan to optimize our Webit even further and make it more powerful in its application to home appliances, office equipments, and industrial products. We will check the reliability of Webit for other ubiquitous applications and also plan to apply Webit to other CPUs and Embedded RTOSs. Future work involves investigating network management of heterogeneous devices equipped with Webit.

ACKNOWLEDGMENT

We thank the BK 21 Project of Korea and the anonymous reviewers for useful comments.

REFERENCES [1] Albrecht Schmidt. Ubiquitous Computing ―Computing in context,

Ph.D thesis, Lancaster University, U.K., 2002. [2] Qinma Kang; Hong He; Hongrun Wang; Study on Embedded Web

Server and Realization, 2006 1st International Symposium on Pervasive Computing and Applications, Aug 2006, pp:675-678

[3] Guangjie Han, ZHAO Hai, WANG Jin-dong, and GUAN Mo. Study and realization of Webit 2.0 architecture under the Embedded Internet environment. Journal of Institute of Communication. 2004, Vol.25, No.9, pp.62-68.

[4] Guangjie Han, Hai Zhao, Jin-dong Wang, Tao Lin, Jiyong Wang. The Reduction of TCP/IP Protocol Stack Under Embedded Internet Environment, Chinese Journal of Mini-Micro systems, 2004, Vol.25, No.9, pp.1602-1606.

[5] Stevens, W. 1996. TCP/IP Illustrated Volume І: The protocols. W. Richard Stevens, Addison Wesley, MA.

[6] Agranat Systems. EmWeb. http://www.emweb.com/. [7] AllegroSoft. RomPager. http://www.allegrosoft.com/. [8] Magma Information Technologies. LAVA. http://www.magmainfo.

com/ [9] Web Device Inc. Pico Server. http://www.webdevice.com/. [10] Avr EI ToolKit. http://www.avr.com [11] Mo Guan, Guangjie Han, Wen-bo Zhang, Hai Zhao. WebitX: The

Design and Realization of An Embedded RTOS Based on EI Technology. Journal of Northeastern University (Natural Science), 2004, Vol.31, No.4, pp.24-26.