Share this

Design and Research of PC104 Computer Network Communication System

2026-04-06 03:22:48 · · #1
This paper introduces the implementation principle of UDP network communication on an embedded PC104 computer under the DOS operating system, focusing on how to solve the frame loss problem in unreliable, connectionless UDP communication. The hardware design and some software code, along with relevant flowcharts, of UDP network communication in a practical fire control system are presented. 1. Introduction With the rapid development of Internet technology and the increasing demands on the size, power consumption, and hardware overhead of embedded computers in systems engineering, embedded computers must not only achieve single serial data transmission but also network communication. In particular, the DOS operating system, with its small kernel, simple operation, and mature technology, occupies an important position in the field of embedded operating systems. However, the DOS operating system lacks APIs like Winsock in the Windows operating system, making the development workload and difficulty of network communication relatively large. This paper introduces the software and hardware system design of UDP network communication based on the DOS operating system in a fire control system. While ensuring the advantages of fast delivery and transmission of UDP communication, necessary protection designs are made to address the unreliability of the UDP network communication system, effectively overcoming the practical engineering challenges of frame loss and bit errors in UDP network communication. 2. Hardware Composition of the Network Communication System The PC104, model SCM/SDXa, uses an enhanced 80486 processor as its CPU. The board includes all PC/AT compatible DMA controllers, interrupt controllers, timers, ROM-BIOS, 32MB of DRAM, and keyboard and speaker interfaces. External interfaces include two serial ports, a parallel port, an IDE interface, a floppy disk interface, a CRT interface, a flat panel display interface, and importantly, an RTL8019 network interface compatible with NE2000. This PC104 serves as the core component of the hardware PCB circuit design. The ST16C554's four serial port card implements serial communication, the isp1032E gate circuit serves as the synchronization reference signal source for each subsystem, and the 8255A parallel port circuit controls the response to external buttons. The system compilation software uses Borland C++. 3. Connectionless UDP Datagram Socket Network Communication In UDP network applications, a socket must first be established by calling Socket, and then the local address and port are bound using bind. Unlike connection-oriented TCP stream sockets, it does not require listening and establishing a connection. Data reading and writing can be performed by calling the `Recvfrom()` and `sendto()` functions, and the client follows the same procedure. Figure 2 shows the UDP datagram socket call process. 4. UDP Network Communication Design under DOS 4.1 Network Card Driver The PC104 with model SCM/SDXa has an embedded RTL8019 network interface chip. First, run RSET8019.exe to set the network card parameters. The main settings are: interrupt number to interrupt 15 and base address to 320H (different settings apply depending on the PC104 model). Then, run NE2000.COM to install the network card's underlying packet driver. The network card's software interrupt needs to be set to 0x62. The software interrupt can be any number between 60H and 70H. The running format is as follows: NE2000 0x62 15 0x320; finally, you need to set ne2000 0x62 15 0x320 in autoexec.bat. 4.2 Establishing a UDP network communication project model requires creating a project file in Borland C++. The project file must include DSOCK.LIB and dsock.h. DSOCK.LIB is the support file for the Dsock library in DOS mode; it acts as a bridge connecting the low-level network communication driver files and the application-level C compiled files. dsock.h is the C language header file that supports Dsock. You also need to modify the DSOCK.CFG file in the project folder according to different project requirements. The DSOCK.CFG file was modified as follows: ip=192.21.209.61 netmask=255.255.255.0 4.3 Characteristics of UDP Network Communication and Design and Research on Frame Loss Prevention UDP network communication is connectionless and unreliable, but it has certain advantages: no connection needs to be established before sending data, reducing overhead and latency; it does not use congestion control or guarantee reliable delivery, and the host does not need to maintain a complex connection state table with many parameters; user datagrams have only an 8-byte header overhead, shorter than TCP's 20-byte header; because UDP does not have congestion control, network congestion will not reduce the host's sending rate. To overcome the unreliability of UDP communication, a communication process similar to TCP's "handshake" can be performed in software, but this greatly diminishes the advantages of UDP communication and increases overhead and latency. To ensure both UDP delivery and communication speed while avoiding the unreliability of UDP communication, the following design was implemented in the control software. 1. In each transmitted frame, we specify that the header status word includes the header unit sequence number, which is uniquely corresponding to the local port number. For example, if the information origin specifies that the header unit sequence number 0x7d corresponds to port number 1600, after network connectivity, the information end-result checks whether the received data header unit sequence number is 0x7d. If it is, it indicates that data from port number 1600 has been received. Otherwise, it may be due to network data collisions or congestion causing bit errors or frame errors. 2. In each transmitted frame, we specify that the header status word includes the information unit sequence number, which is uniquely corresponding to each frame. For example, the information unit sequence number of a frame sent in the first time period is 00, and the information unit sequence number of a frame sent in the next time period is incremented by one to 01, and so on until 255 completes one cycle. This enables the continuous cyclic transmission of source unit sequence numbers from 0 to 255. The sink can determine whether there are any frame losses by checking the continuity and integrity of the information unit sequence numbers. 3. A checksum operation is performed on the data frame. The checksum is a logical XOR operation performed by the source on the specific data byte segment excluding header information such as information unit sequence number, header unit sequence number, information length, and message flags. The checksum result is sent to the sink as the frame tail. After receiving it, the sink also performs a dechecksum operation. If it matches the source's, it indicates that the frame is valid network channel transmission data; otherwise, it is discarded. 4. Timestamp information is set. Each frame from the source contains a four-byte timestamp information of the time when the frame was sent, with a precision of 1ms. The sink repackages the timestamps received in the current cycle and sends them back to the source. The source compares the timestamps with the timestamp of the previous cycle frame data transmission time. If they match, it means that there are no frame losses. 5. An accumulated information for frame loss and bit error judgment is designed, that is, the number of error messages generated in the above four situations is accumulated and counted. Furthermore, the error messages are displayed in real time on the monitor, which allows for a clear and intuitive display of the number of errors during each network communication process, thus enabling better improvement of the shortcomings of UDP network communication. The above design meets the 1% bit error rate test requirement. 4.4 Engineering Application of UDP Network Communication System In a certain project, we adopted a 10MB/s bandwidth Ethernet. The communication subsystem and the upper-level fire control system transmit data via the network, while the communication subsystem, servo subsystem, and television subsystem are connected via serial communication. The isp1032E gate array timing circuit generates timing signals of different frequencies to achieve synchronization between various subsystems. The main functions and flowcharts of UDP communication are as follows: The BOOL Dsock_Open() function opens a Dsock socket library. The BOOL Dsock_LoadConfigFile(char *szFile) function loads the network settings configuration file, i.e., the dsock.cfg file mentioned above. The SOCKET SocketCreate(int nType) function creates a socket class. The type of `nType` can be either `TCP_SOCKET` or `UDP_SOCKET`. The `BOOL SocketBind(SOCKET s, DWORD dwAddr, WORD wPort)` function binds to a local IP address and a local port. `dwAddr` is the local IP address, and `wPort` is the local port number. The `int SocketDataReady(SOCKET s)` function queries the data returned by the established socket `s`. The return value of this function is the number of data items received by the socket. The `int SocketRecvFrom(SOCKET s, DWORD *pdwAddr, WORD *pwPort, BYTE *pby, int nlen)` function retrieves data received via the UDP socket. The `int SocketSendTo(SOCKET s, DWORD dwAddr, WORD wPort, BYTE *pby, int nlen)` function retrieves data sent via the UDP socket. Figure 3 shows the main implementation flowchart of UDP communication . Conclusion This paper introduces the software and hardware design principles and processes of a PC104 computer UDP network communication system based on DOS. Some of the theories and methods mentioned in the paper have been well verified in a certain actual engineering project and have achieved the actual frame loss collision technical indicators. The design idea of ​​preventing frame loss in this communication system can be extended to other embedded UDP communication devices. The innovation of this paper is: how to better solve the contradiction between the advantages and unreliability of UDP communication under the DOS operating system. References: [1] Xie Xiren. Computer Networks [M] Beijing: Electronic Industry Press 2003. [2] Jiang Dongxing. Windows Sockets Network Programming Complete [M]. Beijing: Tsinghua University Press 1999. [3] Hu Daoyuan INTRANET Network Technology and Application [M] Beijing: Tsinghua University Press May 1998, 1st edition. [4] [US] Ander S. Tanenbaum, Computer Networks, [M] Beijing: Tsinghua University Press 1999. [5] William AT Mary AP Keith AB, The Complete Guide to Internet Usage [M], Beijing: Tsinghua University Press, 1995. [6] Zhou Mingtian and Wang Wenyong, TCP/IP Network Principles and Technology [M], Beijing: Tsinghua University Press, 1993. [7] Deng Quanliang, Winsock Network Programming [M]. Beijing: China Railway Publishing House, 2002. [8] Gao Chao, Development of Network Card Drivers under VxWorks [J]. Microcomputer Information, 2004. (9): 10, 11.
Read next

CATDOLL CATDOLL 115CM Nanako Silicone Doll

Height: 115 Silicone Weight: 22kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22