Linux and Windows CE network based on PPP protocol

xiaoxiao2021-03-06  41

Linux and Windows CE network based on PPP protocol

content:

Background Description LINUX and Windows CE FTP Software for Windows CEs About Authors

Jiang Qingye (Qyjohn @ SMTH) software engineering expert, American navigation and control company (American GNC Corporation)

This article describes how to work together with Windows CE equipment through the network. This article first uses the PPP protocol to establish a connection between Linux hosts and Windows CE devices, and then run a FTP server on a Windows CE device such that Linux hosts can access resources on the Windows CE device. The solution described herein is equally applicable to the Windows 9x / 2000 / NT host.

Background introduction Linux is a system similar to UNIX, which originated from a hobby in Finnish LINUS Torvalds, but it is now the most popular free operating system. Ordinary users on Linux office, browse websites, send emails, and play games, many universities and research institutions are also Linux to complete their daily computing tasks. In the business sector, due to the low price of Linux systems, high security performance and very stable, many companies build their own servers on Linux. According to the statistics of International Commercial Data Company (IDC), about one-third of the website server in the world uses Linux as an operating system. Windows CE, definition in Windows CE and Pocket PC: FAQ, based on Microsoft, is a series of components for operating system developers to build a proprietary operating system. Original Equipment Manufacturer (OEM) can purchase a integrated development environment called "Windows CE Platform Development System" and use the system to assemble and compile the Windows CE-based operating system, including Windows CE-based. Components and applications developed by the developer or the device driver. Since the Windows CE-based operating system has a user interface similar to the Microsoft Windows Series operating system, it is favored by many ultimate users and developers. Currently Windows CE has been widely used on portable devices such as mobile phones, palm, personal digital assistants, expressions, and electronic dictionaries. For a long time, users of the Windows CE device also need to be equipped with a Windows 9x / 2000 / NT host to exchange data with Windows CE devices. The Windows CE service software provided by Microsoft is running on the host. The software creates a start-point connection with the Windows CE device through a RS-232 data cable. Users can access the Windows CE device through this service software, but other computers in the LAN do not Ability to access the Windows CE device. If you need other computers in the LAN, you need to install expensive private network cards and related access devices for the device, it is a very uneconomical solution. This article uses the Red Hat Linux 7.2 operating system to establish a TCP / IP connection between the PPP server and the Windows CE device, and then run a FTP server on the Windows CE device such that the Linux host can access resources on the Windows CE device. Since this method is based on the RS-232 data cable comes with the Windows CE device, there is no need to purchase additional devices, so it is an economical and practical solution. In addition, the solutions described herein are equally applicable to the Windows 9x / 2000 / NT host. Connecting Linux and Windows CE Point Data Transfer Protocol (PPP) is a protocol that transmits an IP packet through a serial line. Using the PPP protocol, a computer can log in to the remote host through communication devices such as serial line, telephone line and utilize the host or the network where the host is located. Two parts of the server and client in point-to-point communication, where the client requests a network connection to the server, and the server receives the client's request to establish a network connection and assigned to the client's corresponding network resources. When the network connection is established, the server and clients are strictly equal. Since the Linux operating system typically has a PPP server and client program, the Windows CE operating system typically has only a PPP client program, so we use the Linux host as a PPP server, the Windows CE device as the PPP client. In order to use the Linux host as a PPP server, we must first confirm if the PPP server program PPPD has been installed.

Usually the program is installed in the / usr / sbin directory, we can use the following command to find this file in this directory: LS / USR / SBIN / PPPD recently issued Linux operating system (for example, Red Hat Linux 6.x /7.x) The PPP server program is usually installed in advance. If the Linux host has not installed a PPP server, we should first download and install a PPP server program, such as PPPD2.3.4. Installing the package may also require support for other packages. Since the application's installation has exceeded the discussion scope of this article, please refer to other relevant information. After confirming that the PPP server is already installed on the Linux host, we need to make some necessary configurations for the Linux host. We need to have root privileges for these configurations. Establish file / etc / ppp / peers / wince, the content is as follows: / dev / ttys0 115200 CRTSCTS

Connect '/ usr / sbin / chat -v -f /etc/ppp/wince.chat'

NoAuth

Local

90.0.0.1:90.0.0.2

Establish file /etc/ppp/wince.chat, the content is as follows:

TIMEOUT 3600

"Client" "Client / C"

"" Server / C "

In the above two profiles, using WinCe is merely used to indicate that this configuration file is used for a Windows CE device. Readers can also use other file names, such as Palm or Handheld, but must ensure that the two file names are consistent. Profile / etc / ppp / peers / wince Specifies the use of serial TTYS0 to establish a connection with the client device with the client device at a rate of 115,200 bps, and the NoAuth parameter indicates that it is not required to authenticate when the client requests the connection. In this peer-to-peer connection, the IP of the server (Linux host) is 90.0.0.1, the IP of the client (Windows CE device) is 90.0.0.2. Profile /etc/ppp/wince.chat The Timeout parameter specifies the wait time of the server, and if the time still does not receive the client's connection request, the current server program is terminated. If a reader needs further understanding of the relevant configuration, please refer to CHAT and PPPD related documents. The configuration you need to do in the Windows CE device is relatively simple. Since the Windows CE default auto connection function takes up the serial port of the device, we first need to stop using this feature. Select "Set -> Communication -> PC Connection" in the Start menu and set it to not enable connection to the PC to stop this feature. Then we re-establish a connection, select "Programs -> Communication -> Connection Manager" start menu, then click the "New Connection" icon, name the new connection to Linux and specify the connection type "straight connection", under One step specifies that using COM1 is connected and set its communication rate of 115,200, specifying the IP of the device 90.0.0.2 in TCP / IP settings. The connection will appear in the Program -> Communication menu after clicking the OK store. Use the following command to start the PPP server on the Linux host: PPPD CALL WINCE launches a new connection on the Windows CE device (Program -> Communication -> Linux), the network connection icon appears on the taskbar of the Windows CE device, Linux The main unit shows the following information indicates that the connection has been successfully established with the Windows CE device:

SERIAL Connection Establish.

Using interface PPP0

Connect: PPP0 <-> TTYS0FOUND Interface Eth0 for Proxy ARP

Local IP Address 90.0.0.1

Remote IP Address 90.0.0.2

We can also use the ping command provided by the Linux host to verify whether it has been successfully established with the Windows CE device: ping 90.0.0.2 If the Linux host has successfully established a connection with the Windows CE device, then we should be able to see the following information :

PING 90.0.0.2 (90.0.0.2) from 90.0.0.1: 56 (84) BYTES OF DATA.

64 bytes from 90.0.0.0.2: ICMP_SEQ = 0 TTL = 32 TIME = 26.587 MSEC

64 bytes from 90.0.0.2: ICMP_SEQ = 1 TTL = 32 TIME = 19.928 MSEC

64 bytes from 90.0.0.2: ICMP_SEQ = 2 TTL = 32 TIME = 19.939 MSEC

64 bytes from 90.0.0.2: ICMP_SEQ = 3 TTL = 32 TIME = 19.947 MSEC

FTP software based on Windows CE When we successfully establish a PPP connection between Linux hosts and the Windows CE device, what should the next step? Of course, we need some suitable programs to exchange files between Linux hosts and Windows CE devices. We can now use TCP / IP protocol to transfer data between Linux hosts and Windows CE devices, it is clear that the FTP program is a suitable option. FTP (File Transport Protocol, File Transfer Protocol) is a protocol that is widely used on the network. Due to data transmission reliability, FTP is a TCP / IP-based transmission protocol. In an FTP session, a server side includes a server side and a client, the client actively connects to the server side and sends a file transfer request to the server, and the server side waits for the client's access and handles the client's file transfer request. PE FTP Explorer is a very popular Windows CE-based FTP client software and a fully fully equipped file browser. Similar to the FTP clients such as CUTE FTP and WS FTPs commonly used on the PC, users can use the mouse (pointer) to store the directory tree, upload or download files and directories, or the file or directory. Make changes and delete. This software can be obtained from the CE Archive website (http://www.cearchives.com/ftp.html). At the site reader, you can find another popular FTP client VxFTP. Although the FTP client software has been very complete and easy to operate, it is still inevitable to receive a smaller display of a smaller display of portable devices. If an FTP server can be created on a portable device, the file transfer operation can use the commonly used FTP client on the Linux host. ftpsrv.exe is such a Windows CE-based FTP server software. This only 28.5 KB of applets, in addition to not providing identity authentication functions and Passive Transfer mode, can handle most common FTP requests. Using Microsoft's Windows CE service software to upload ftpsrv.exe to any directory of portable devices, start the program, there is a small icon similar to a computer to connect two portable devices on the task bar after starting the program. A small control window will appear after clicking the icon in the icon, where we can change the port number of the FTP server or terminate the program. FTPSRV.EXE can be obtained from http://pda.tucows.com/ or http://www.oohito.com/. Readers in these two sites can also find more useful applets. Other If readers use Windows 9x / 2000 / NT host, you can also use the lineless cable connection function provided by Windows to establish a PPP connection with the Windows CE device. For example: On the Windows 2000 host, select Settings from the Start menu -> Network and Dial-up Connections -> New Connections. Select directly to another computer in the subsequent network connection wizard and configure the machine as a host. After selecting a suitable communication port and configuring the communication rate, the host is waiting for the client to wait for the client access. Similarly, a new connection is created on the Windows CE device, specifying the appropriate communication port and configures the communication parameters, you can establish a start-point connection with the Windows host. Since the Windows host is already equipped with a Dynamic Network Address Assignment (DHCP) server, the Windows CE device can use both the specified static IP address, or the dynamic IP address allocated by the server in real time. However, since the highest transfer rate allowed by the linear cable connection is 19,200 bps, the use of Windows 9x / 2000 / NT host as a PPP server seems to be more practical than Linux hosts.

If you set the PPP server to the gateway, all machines in the LAN can access the Windows CE device that has been connected to the network by changing the network. On the Linux host, you can set the host into a transparent gateway via ipchains; on the Windows 9x / 2000 / NT host, it can be set to a transparent gateway through a proxy server software such as Win Proxy. If you need to further understand how to set Linux or Windows hosts to transparent gateways, please read other references. Author brief introduction Jiang Qingye, software engineering expert. July 1999 was a bachelor's degree in Tsinghua University. January 2001 was a master's degree in the University of Irino (UNIV. "Is currently an expert in American GNC Corporation. The main research sectors include remote sensing image information processing, GPS applications, inertial navigation, wireless communications, and high-speed network technology. Source: http://www-900.ibm.com/developerWorks/cn/linux/L-TIP-PROMPT/tip16/index.shtml

转载请注明原文地址:https://www.9cbs.com/read-76614.html

New Post(0)