Implementation of an Embedded MVB Protocol Analyzer Sugoog Shon. Department of information and telecommunication, Suwon University, Gyeonggi-do, Korea At the train level, communication system should configure itself Abstract—Recently, there is a lot of control equipment in a train when vehicles are coupled on the track. At the vehicle level, as traction control, air conditioners and even internet access. For manufacturers should assemble pre-tested units, such as doors this reason, vehicle network must allow for the big amount of manufactured by subcontractors. Suppliers could reduce transmission data and must ensure the high reliability. In this development costs by utilizing one standard. Operators could paper we present a protocol analyzing system to verify high reduce spare parts and simplify maintenance and part reliability of data transmission of MVB of TCN and explain how to replacement. implement the embedded network system based on an ARM processor and Linux operating system, and explain information However, there is no standard system for performing that should be analyzed. maintenance on heterogeneous railway equipments, due to the diversity of low level communication protocols, equipment Keywords—MVB, TCN, WTB, Linux, TCP/IP manufacturers, and operating systems used by maintenance and commissioning staff. For the maintenance, it is required first to monitor heterogeneous on-board equipments. We propose a 1. Introduction user-friendly MVB protocol analyzer to monitor all the Automatic coupling of railway vehicles has existed since the equipments on a vehicle. Taking advantage of the on-board mechanical Jenny coupler at the turn of the 19th century. The communication system and related network management current challenge for railway industry is to make automatic services, the proposed system will provide an entry point to the electronic coupling of the vehicles through a data bus. Over the train data for diagnosis. last several years, a strong demand has grown among railway In this paper, we present a protocol analyzing system to verify operators for a modern, versatile communication system high reliability of data transmission of MVB of TCN and on-board trains, both to interconnect equipments located inside explain how to implement the embedded network system based a railway vehicle and to allow communication between different on an ARM processor and Linux operating system, and explain vehicles. information that should be analyzed. Development of the system An international standardization of data communication is necessary at both the train and vehicle levels. Especially in is based on embedded system technology. We emphasize the Europe, it is important to ensure cross-border traffic by information that we need to implement this capability and the standardizing track profiles, pneumatic hoses, traction voltages, technique for storing and retrieving it. Later, we explain the operating procedures, and so on. Trains need a standard form of internal architecture of our approach. Finally, we draw data communication for train control, diagnostics, and passenger conclusions from the actual work. information. Such a data communication network was specified by 2. Train communication network International Electrotechnical Committee (IEC) as the Train Train Communication Network (TCN) is a real-time data Communication Network . The IEC groups worldwide network proposed for use on trains , and consists of two Deputies from over 20 countries worked several years within the different networks with somewhat different protocols . The IEC’s Working Group 22 (WG22) on the definition of the Train TCN defines standards for a data communication network, Communication Network. The TCN was adopted as the interconnecting equipments both between and within rail international standard IEC 61375 in 1999.  vehicles, and is called the distributed control system. The TCN architecture also addresses all relevant configurations found in rail vehicles. It comprises the train bus connecting the vehicles and the vehicle bus connecting the equipments aboard a vehicle or group of. The bus architecture is divided into a WTB interconnecting all vehicles, and in each vehicle a MVB, as according to the TCN standard. The general architecture is shown in Figure 1 from . Each vehicle has an own vehicle bus connecting on board equipments, such as sensors and actuators for doors, brakes and air condition system. The MVB enables considerable reduction in the amount of cabling and increased reliability with respect to conventional wiring. Applications which exchange information cannot determine whether its peer resides on the same bus, train or anywhere else Figure 2 MVBC ASIC by Adtranz in the network. From the train bus view the internal organization In the MVBC, there is a traffic memory. The traffic memory is a of a node is not detectable, since each vehicle bus is treated as an shared memory to interface the bus with the application. The bus own node on the train bus. and the application are (de)coupled by a shared memory, the Traffic Memory, where process variables are directly accessible to the application. In addition, the two interrupt request signals must be connected directly or via an interrupt controller to the CPU. The MVB protocol analyzer should analyze the effectiveness of detecting transmission errors due to corruption from network transmission noise. Error detection is a crucial part of any Figure 1 Train Communication System network communication protocol. Unfortunately, no error detection scheme can detect all possible errors, and every such To simplify assembly, commissioning, and subsystem reuse, the scheme has an associated cost in communication bandwidth. TCN architecture specifies Multi-function Vehicle Bus (MVB) Basically there is a possibility that a burst error can exist, as a vehicle bus The MVB protocol is used for connecting because the MVB uses Manchester encoding. A burst error is equipments within a single vehicle (e.g., a rail car) or within defined as a contiguous stream of bits that have been wholly or different vehicles in closed train sets, while the Wire Train Bus partly corrupted. From the study about the effectiveness of error (WTB) is used across the length of an entire train. detection codes and analysis for the TCN network protocol, error can exist in MVB. Based on our experience, the TCN The figure 2 shows the MVBC (Multifunction Vehicle Bus design is significantly more robust than typical embedded Controller) made by ADtranz. The MVB is a standard networks such as CAN or LonTalk. communication medium to transport and exchange data among All information and data pertaining to the MVBC are found in attached nodes. These nodes, which are physically connected to the traffic memory space. This space is visible to both CPU and the bus, may vary in function, size, performance and at a physical MVBC. The traffic memory is divided into several partitions. layer level. However, MVBC is the interface component The traffic memory is configured with 256KB in this research. between the MVB independent circuits and the actual physical There may be no semaphores to guard access to a traffic store layer of the MVB. The MVBC can operate with a single (real-time). It is required to restrict for simultaneous access. microprocessor to handle bus administration and upper level there may be only one writer for a port, but several readers a communication protocols. reader must read the whole port before the writer overwrites it As shown in the figure 6, the MVBC can make interconnection again therefore, the processor must read ports with interrupt off. between the traffic memory and ARM CPU. The MVBC handles all microprocessor accesses made to the traffic memory or 3. Message and management internal registers in the MVBC. The MVBC takes care of arbitration if both CPU and MVBC intend to access the traffic For the protocol analyzer, the data in the traffic memory can be memory simultaneously. analyzed. Internal register information should be analyzed. The way how to load information from the portioned areas (logical address space, device address space, service area, and miscellany) in the traffic memory should be investigated. The Port Index Table link the Ports to the Logical and Device addresss which are specified in the Master frames. In the Port Control and Status Register (PCS), there is all the relevant information pertaining to one port. This information is Another type of data, network management, helps configure, used by MVBC to determine how it should handle the related commission, and maintain the TCN. A network manager can port. The PCS includes following information: port related connect to the TCN, for instance, as a vehicle device. The information (function code, port description, event, etc.), data network manager has access to all devices—in any vehicle— consistency check, telegram report, transfer acknowledge bits, connected to the TCN The network manager can inspect and and check sequences. It is important for the MVB analyzer to modify other devices through an agent (an application task enable to load data from the PCS. running in each station). The agent has local access to managed objects such as process variables, protocols, memory, tasks, and Figure 3 shows the general format of a frame on the MVB. The clocks. The standard specifies the management services to read MVB protocol analyzer captures and analyzes the MVB frame and write the managed objects, as well as the format of network on the line. It shows the sorts of MVB frames on the line. A Start manager messages. Delimiter preamble of 9 bits provides a distinctive waveform. Frame data is included in from one to four data payload sections, All buses pertaining to the TCN provide two basic medium with each payload being 16, 32, or 64 bits in size. Frames with accesses: more than 64 bits of data are broken into multiple 64-bit data (for on-demand data traffic, such as messages). Periodic and payloads as shown. Each data payload section is protected by an sporadic data traffic share the same bus, but devices treat each 8-bit Check Sequence (CS). The end of each frame is denoted by separately. The figure 4 shows the TCN basic period. a 2-bit End Delimiter sequence. Frame length is inferred from the detection of an End Delimiter. Figure 3 MVB message formats. Now, the data service mechanism in the TCN is investigated. Figure 4 TCN Basic period There are three types of frame formats; process, message, and management data. One device acting as master controls periodic and sporadic data TCN buses transport two types of data: process variables and transmission, which guarantees deterministic medium access. To messages. Process variables reflect the train’s state, such as accomplish this, the master alternates periodic and sporadic speed, motor current, and operator’s commands. The transfer phases. Traffic is divided into basic periods of fixed time for process variables must be short and deterministic. duration—either 1 or 2 ms on the MVB. At the start of a period, Railways require that the train communication network the master polls the process variables in sequence during a guarantee less than 100 ms of delivery delay from a device on the certain time period—the periodic phase. To reduce traffic, first vehicle bus to a device on a second vehicle bus, both vehicle urgent data are transmitted every period and less urgent variables buses being connected by the train bus. Traction control over the are transmitted with an individual period every second, forth, vehicle bus requires guaranteed delivery from application to eight, and so on basic period, with the longest period being application for all critical variables within less than 16 ms. To 1,024 ms. guarantee these delays, the train communication network transmits all process variables periodically . For the process variable transmission, the master broadcasts a Message data carry infrequent, but possibly lengthy information, frame to trigger transmission of a certain variable without for instance, diagnostics or passenger information. Message specifying the source device. Then, the source device answers by length varies between a few bytes to several kilobytes. Messages broadcasting a frame containing the requested value to all transmission delay must be short on the average, but the devices. Each device interested in this variable picks up the application tolerates delays up to several seconds. This value. slackened requirement lets the TCN transmit messages on demand. The application accesses process variables either individually or (more efficiently) by clusters. Applications communicate on a client-server basis. A conversation consists of a call sent by the client and a reply sent by the remote server. MVB controller board 4.Implementation of MVB Protocol Analyzer System For the implementation of MVB protocol analyzer, MVB data is required to capture. In general, MVB nodes are connected to the MVB main board bus in series. The figure 5 shows an example system to gather MVB data for this paper. There is an maser MVB node and an slave MVB node. The MVB tester is connected between the master and slave MVB node. Figure 6 Hardware components for MVB protocol analyzer For the MVB controller, there is a traffic memory of 512KB. It can store the MVB data. MVB controller by Adtranz is used. Figure 7 describe the details for the MVB main board. The ARM MVB 2410 is the main CPU manufactured by Samsung. The ARM Protocol analyzer processor is connected to MVB controller through ARM bus and gathers and process the MVB data. For this research, a commercial ARM board is utilized for the main board. Figure 5 MVB protocol monitoring system Figure 6 shows the hardware system for MVB protocol analyzer. The analyzer consists of two hardware components; one for MVB controller board, another one for MVB main board. The MVB controller board is connected to MVB bus and is operated as one of MVB slave nodes. This node only can get command and data as a sink on the bus. The data is stored traffic memory on the MVB controller board and is shared between the MVB controller and ARM processor. ARM processor on the MVB main board can get the traffic memory and MVB data, and will transfer to the MVB analysis program via Ethernet interface when is required to sent by. One of the jobs that ARM processor offers is to convert MVB format data into Ethernet format. For this research, ARM 920T is used. Figure 7 Details of MVB main board MVB data processor works as a protocol analyzer. ARM based Linux operating system with kernel 2.6.8 is installed on the main board. It gathers MVB data including processing, management data via the traffic memory and transfers to the MVB analysis program through Ethernet port after converting Ethernet data format. Application program on the MVBC. Also, it can deal with the data communication between the traffic memory and DPRAM. Ethernet driver routine can offer the socket communication to the PC-based Protocol convert TCP/IP Stack MVB protocol analysis program. The socket program on the MVB protocol analyzer is operated Linux (kernel 2.6.8) on the non-blocking mode, which may connect to the PC program when requires to try connect to. After booting the analyzer, the initialization process is shown in MVB board driver Ethernet driver the figure 10. The MVB protocol analyzer starts to listen to both the bus and the Ethernet port. The initialization process is also Figure 8 Software structure for MVB protocol analyzer shown by using the PCS registers’ information. Figure 8 shows the software structure for MVB protocol analyzer. The system consists of Linux kernel with MVB driver and Ethernet driver, TCP/IP protocol stack, protocol converter between TCP/IP and MVB data, and application program that fetch, store, and process the traffic memory data. The application program which utilizes the underlying layers are situated on top in the figure. It uses the programming languages ANSI C for programming their devices. This is an embedded system. A bootloader is used to initialize the system and load the linux kernel and so on. All the linux kernel, drivers, application programs are stored on NAND flash memory, and loaded into the SDRAM after booting. During the development process, the programs are loaded through RS-232C or Ethernet interface. Figure 10 View of MVB analyzer initialization 5. Results MVB protocol analysis program working on Windows operating system has approximately 140KB binary application From the above proposed architecture for the MVB protocol code. It is a simply GUI based socket program as shown in the analyzer, the MVB data processor is developed as shown in the figure 11. The main parts are as shown in the figure; Windows figure 9. The MVB controller board is shown on the top and the operating software and application code. MVB data processor is placed on the behind. Figure 9 Developed MVB protocol analyzer The MVB protocol analyzer is connected between a master and a slave MVB node as shown in figure 7 and can capture the MVB data frames that move from the master to he slave and from the slave to the master. It can analyze the frame status and transfer to the PC based analysis program through the Ethernet interface Figure 11 MVB protocol analysis program port. The MVB protocol analyzer decides whether the frames are The main function of the MVB board driver is to process master or slave frames from the information for the F_Code. interrupt routine. It can initialize the traffic memory, store PCS The protocol analysis program can monitor the information such information from the host to the portList, and register the PCS as total frame, count, frame checked, reply timeout interrupt, etc. This Windows based analysis program written by Visual C++  Sang-chul Lee, Jea-Hyun Park, Nae-Hyuck Chang, "A Study on the Implementation and the Performance Evaluation of the Train can also monitor the information such as Communication Network. ▪ frame counter  myeong-ho Choe, "A Study on the Performance Improvement of Message ▪ internal registers Transmission over MVB  yeong-gi jo, "A Study on TCN/Node Redundancy Scheme for KHST ▪ Portlist ▪ dPRAM ▪ Trigger Trace. It can also display the information stored during certain time of test. 6. Conclusions From the development of new-type MVB protocol analyzer, it offers to the maintenance people a user-friendly way to monitor all the equipments on a vehicle. The protocol analyzer can give the information about PCS internal register value, error status, frame status, and link status after capturing MVB frames. The protocol analyzer also operates as a slave node. This implementation and development contributes to the management and maintenance of the MVB node. Before this research, the protocol analyzer was based on the RS-232C serial interface, which limits the speed of analysis. With the Ethernet interface, the protocol analyzer can capture all the frames on the line now. For the future work, we plan to develop MVB protocol analysis system with the automatic configuration because maintenance staff does not want to spend time installing or configuring anything in order to monitor their systems. They just want to perform maintenance. ACKNOWLEDGMENTS Special thanks to K. H. Shon of Interconsystem ltd. for his support; to D. E. Lee who did a very good job developing this system; REFERENCES  IEC 61375-1 Standard Train Communication Network : Part (1) General Architecture (2) Real-time Protocol (3) Multifunction Vehicle Bus (4) Wire Train Bus (5) Train Network Management (6) Train Communication Conformance Testing, 1999.  G.Fadin and F.Cabaliere, "IEC TC9 WG22 train communication network dependability and sagety concepts, "World Congress on Railway Research 97, 1997.  H.Kirrmann and P.A. zuber, "IEC/IEEE train communication network." 1996.  H. Kirrmann and P. A. Zuber. The IEC/IEEE Train Communication Network. IEEE Micro, 21(2):81–92, March/April 2001  UIC 556 Standard, Information Transportation on the Train Bus, 1999.  Chavarria, J.L de Arroyabe, A. Zuloaga, J. Jimenez, J.L. Martin, G. Aranguren, "Slave node architecture for train communication networks," IEEE Conference, 2000.  ABB Daimler-Bensz Transportation (Switzerland) Ltd, "Multifunction vehicle Bus Controller", Adteanz, 1997.  jae-youn you and jae-jyun park, "A Study on the Implementation of the Fault-Injector for the Fault Tolerant Train Communication Network.