An implementation method for information collection and reporting based on an IPMI protocol
Patent Information
- Application Number
- CN202610952485.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-09-29
AI Technical Summary
本发明要解决的技术问题是如何提供一种基于IPMI协议信息采集上报的实现方法,以解决传统实现方式通过自定义协议获取板卡状态信息,依赖于操作系统,没有对所有信息进行标准化统一管理
本发明提出一种基于IPMI协议信息采集上报的实现方法,本发明设计了一种通用的跨平台应用方案,能够采集检测各功能板卡健康数据并通过通用的标准协议上报应用层。
Smart Images

Figure CN122845692A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer software, and specifically relates to an implementation method for information collection and reporting based on the IPMI protocol. Background Technology
[0002] In a host system using multiple functional boards to implement various applications, if a board becomes unavailable due to temperature or power supply abnormalities, the application running on the host motherboard may experience abnormal job interruption or system crash due to the lack of knowledge about the board's abnormal state. Previously, this could be achieved by manually checking the status of each board beforehand, which is extremely inefficient and lacks timely warnings. Real-time acquisition of the operating status and parameters of each board allows for early detection of board faults and abnormalities, preventing sudden system crashes caused by runtime failures. Even if system anomalies occur, the collected board status data enables rapid fault location and quick recovery. Traditional implementations obtain board status information through custom protocols, relying on the operating system and lacking standardized management of all information. This limits cross-platform compatibility and application scope. Currently, in applications such as servers, data centers, and industrial control, BMC (Baseboard Management Controller) information acquisition is a crucial link in achieving intelligent hardware management. By acquiring sensor data, log information, and device status from the BMC in real time, system reliability, operational efficiency, and security can be significantly improved. It plays an important early warning role in ensuring the reliable operation of various functional boards; in addition, in terms of performance optimization, it can promptly identify resource bottlenecks and adjust load distribution; in terms of security, earlier detection can reduce risks, and early detection of security vulnerabilities and abnormal data may indicate potential security threats.
[0003] IPMI (Intelligent Plateform Management Interface) is an open standard interface specification that enables remote monitoring and management of servers (such as hardware status monitoring, power control, event logging, etc.) through hardware and firmware, without relying on the operating system or motherboard BIOS. It provides motherboard-independent remote management capabilities and supports sensor data acquisition. It defines the functions, interfaces, and communication protocols for server management. IPMI has evolved over several years from version 1.0 to the powerful and mature version 2.0. IPMI 2.0 defines many communication interfaces, including the IPMI system interface for communication with the system bus. As an open standard protocol, IPMI provides efficient and reliable data acquisition and control capabilities for BMCs through standardized interfaces and function definitions. IPMI defines standard sensor data models, event log formats, and power control commands, supporting seamless interaction between BMCs and hardware devices from different manufacturers. It features high real-time performance and reliability, as well as redundancy and fault tolerance mechanisms. Summary of the Invention
[0004] (a) Technical problems to be solved The technical problem this invention aims to solve is how to provide an implementation method for information collection and reporting based on the IPMI protocol, in order to address the shortcomings of traditional methods that rely on custom protocols to obtain board status information, depend on the operating system, and lack standardized and unified management of all information. These methods also limit cross-platform compatibility and have a limited scope of application.
[0005] (II) Technical Solution To address the aforementioned technical problems, this invention proposes a method for information collection and reporting based on the IPMI protocol, the method comprising: Each functional board is equipped with a microcontroller module as its IPMC to collect sensor information. The microcontroller is connected to the IPMB bus through the IIC interface. The microcontroller configured on the motherboard serves as the main IPMC chip. On the one hand, it connects to the IPMCs of each function board through the IPMB bus to aggregate all IPMC data. On the other hand, it reports information to the application software of the main processor on the motherboard through the serial port. The main processor application software on the motherboard constructs a request IPMI message according to the IPMI request message format and sends it to the main IPMC chip via serial port. The main IPMC chip forwards the request IPMI message to the IPMB bus. After receiving the request IPMI message, the IPMC of the function board parses it, collects data according to the collection requirements in the message, encapsulates it into a response IPMI message, and reports it to the main processor application software on the motherboard via the IPMB bus.
[0006] (III) Beneficial Effects This invention proposes an implementation method for information collection and reporting based on the IPMI protocol. This invention designs a general cross-platform application solution that can collect and detect the health data of various functional boards and report it to the application layer through a common standard protocol.
[0007] The architecture of this invention is independent of the CPU and BIOS. Using the standardized IPMI protocol, it can operate independently of the operating system. The architecture described in this invention ensures the independent and stable operation of each functional board while also enabling cross-platform applications. Attached Figure Description
[0008] Figure 1 This is a diagram showing the connections between the IPMC, various boards, and the motherboard of this invention. Figure 2 This is a flowchart of the microcontroller's workflow on a function board. Figure 3 Design the architecture for IPMC. Detailed Implementation
[0009] To make the objectives, contents, and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0010] This invention addresses the unified management of the health status of various boards in a chassis environment equipped with multi-functional boards, using a Baseboard Management Controller (BMC) and the IPMI interface protocol. Each board is configured with an independent microcontroller to independently run health status data acquisition and communication programs with the BMC. The standard IPMI protocol interface is used to implement communication between each functional board and the BMC.
[0011] This invention proposes a method for information collection and reporting based on the IPMI protocol, comprising: 1) Each functional board is used to communicate with the host system via a bridge chip through the PCI bus. Each functional board is accessed by the application program on the host via the PCI bus, thereby enabling it to perform its functions. This invention designs... Figure 1 The architecture shown uses a BMC controller to monitor the status of each functional board to ensure its normal operation. Figure 1 In this organizational structure, each functional board is equipped with a microcontroller module acting as its own Intelligent Plateform Management Controller (IPMC) to collect sensor information. The microcontrollers are connected to the IPMB bus via an IIC interface. The microcontroller on the main board acts as the master IPMC (BMC), connecting to the IPMCs of each functional board via the IPMB bus to aggregate data collected from all IPMCs. Simultaneously, it reports information to the application software on the main processor of the main board via a serial port. The main processor application software on the motherboard constructs a request IPMI message according to the IPMI request message format and sends it to the main IPMC chip via serial port. The main IPMC chip forwards the request IPMI message to the IPMB bus. After receiving the request IPMI message, the IPMC of the function board parses it, collects data according to the collection requirements in the message, encapsulates it into a response IPMI message, and reports it to the main processor application software on the motherboard via the IPMB bus.
[0012] This invention implements three functional designs: application-side functionality on the main processor, microcontroller-side functionality on each functional board, and main BMC chip-side functionality on the motherboard.
[0013] 2) Implementation on the application side of the main processor.
[0014] The main processor application software implements the sending of IPMI requests and the receiving and parsing of IPMI response information. The format of the sent IPMI request message includes a start character (0xA0), the IPMI message body, and a stop character (0xA5). Start, stop, and escape characters are not allowed in the message body. This is to ensure that the beginning and end of the message are clearly defined. If a byte matching one of these special characters is encountered in the data to be transmitted, it is encoded into a corresponding two-character sequence and escaped before transmission, according to the IPMI protocol requirements.
[0015] The request / response IPMI message body format is defined by the following structure: typedef struct { INT8UResAddr; / / Destination address INT8UNetFnLUN; / / NET FN (Network Function) | RS LUN (Logical Unit Number of the Response) INT8UChkSum; / / This is the checksum of NetFnLUN and ResAddr. INT8UReqAddr; / / Request address INT8URqSeqLUN; / / RQ SEQ (request sequence number) | RQ LUN (requested logical unit number) INT8UCmd; / / command INT8*Data; / / Request or response data INT8UCheckSum / / Checksum IPMIMsg; The `ResAddr` parameter of the `IPMIMsg` structure is the destination address of the message response; `NetFnLUN` is a combination of `NetFn` and `RSLUN`, where the network function (`NetFn`) is a field identifying the function class of the message. The network function groups IPMI commands into different groups, consisting of a 6-bit field that identifies the function to be accessed. Even-numbered `NetFn` values are used for requests to the BMC, while odd-numbered `NetFn` values are returned in the BMC response; the response `NetFn` = request `NetFn` + 1. The remaining two bits are the responder logical unit number (`RS LUN`) field. Within the same BMC or the same IPMC, this distinguishes multiple logical processing units and is a secondary addressing method when finding the destination address. The `LUN` remains consistent across requests and responses. In most scenarios, `RS LUN` is fixed at 0 because only the main application logical unit exists. For example, `NetFn=04, 05` indicates requests and responses from sensors and events; 04 identifies the message as a command / request, and 05 identifies the message as a response. If `RS LUN=0`, it represents BMC command and event request messages.
[0016] ReqAddr is the address to which the request is sent.
[0017] RqSeqLUN is a combination of RqSeq and RQ LUN, consisting of one byte. RqSeq is the high 6 bits, and LUN occupies the low 2 bits. RqSeq is the request sequence number; it increments by 1 (mod 64) for each new request sent by the BMC. The response must include the same RqSeq so the sender knows which request the response corresponds to. RQ LUN is the requester's own logical unit number, corresponding to and consistent with the RQ LUN number in the response.
[0018] Cmd is the command code. This message byte specifies the operation to be performed under the specified network function. For example, a value of 0x2d is used to read sensor values.
[0019] Data is zero or more bytes of data in a request or response that matches a given command code Cmd, and is either a parameter of the command code or a return value of the command response.
[0020] In this invention, the main processor application software on the motherboard first constructs a request IPMI message structure. The IPMB destination address of the corresponding function board is filled into ResAddr, the request address is the IPMC address on the motherboard, and its address is filled into ReqAddr. LUN=0 (representing the sub-address of the requester / responder; the request LUN and response LUN are the same), RqSeq=0 (the sequence number of the request initiation); Network function request NetFn=0x4 (representing a request for sensor query), request function, Cmd=0x2d (this command is used to execute the reading of sensor values), and Data is filled with the channel number of the sensor to be read, such as the ADC channel number on the function board's microcontroller. The main processor application software on the motherboard sends the assembled IPMI message request to the serial port of the main IPMC chip via the serial port connected to the motherboard, according to the IPMIMsg structure. When the main IPMC chip receives a serial port message, it is parsed and relayed by the program running on the main IPMC chip before being sent to the corresponding IPMB address. The program running on the corresponding function board receives and parses the message, completes the acquisition according to the acquisition requirements indicated in the message, and then the microcontroller on the function board acts as the response end, encapsulating the response message back according to the IPMIMsg structure, setting NetFn=0x5 (response end filling), the Data part being the acquired data, and other fields being consistent with the fields filled in the request protocol, and sending the message back to the IPMB bus. After receiving the return message, the BMC at the corresponding address forwards the message to the main processor application software through the serial port channel. After receiving the IPMI message from the function board through the serial port, the main processor application software parses it to obtain the acquired data value Data.
[0021] 3) Implementation on the microcontroller side of the function board.
[0022] In this invention, each functional board is configured with an STM32F103 series microcontroller as an IPMC. This microcontroller's memory supports in-system programming, and each group of GPIO pins includes 12 pins. The ports support input, output, and multiplexing modes. Multiplexing functions are mapped to peripherals such as UART, SPI, and DMA. Pull-up / pull-down resistor configuration and open-drain mode are supported. The microcontroller's ADC module supports 12-bit resolution, 16 channels, and a single-channel conversion time of <= 1 microsecond. It supports scan mode (sequential acquisition) and continuous conversion, as well as automatic calibration. Communication interfaces support serial UART, SPI, and IIC interfaces.
[0023] This invention utilizes the ADC mode of the STM32F103 series microcontroller for temperature sensor, battery voltage detection, and photoresistor signal acquisition. The main function of the microcontroller program on the function board is to receive requests from the IPMC, acquire data, and then return the acquisition results to the IPMC via the IIC interface.
[0024] The program running on the microcontroller performs the following: a) Initialize the system clock, configure the system clock source and frequency division factor.
[0025] b) Initialize the GPIO interface and its usage mode; c) ADC data acquisition program, including ADC mode setting, ADC initialization, channel setting, ADC conversion start, waiting to read conversion value, and ending conversion function; d) IIC data transmission and reception implementation program, including configuring the local IPMB address, configuring the IIC port mode, receiving IPMI messages via IIC, sending IPMI messages via IIC, and configuring interrupt handling functions.
[0026] e) The microcontroller implements the information acquisition and communication process. The process of using a microcontroller to implement information acquisition and communication is as follows: Figure 2 As shown, a thread for receiving IIC data runs on the microcontroller's main program. When data is received, the interrupt handler is automatically executed to parse the data, obtain the requested ADC channel, acquire the corresponding data according to the channel number, encapsulate it into an IPMI message, and send it to the IPMB bus through the IIC bus. This process is repeated to achieve the functions of request reception, data acquisition, and response return.
[0027] 4) Implementation of IPMC functions on the motherboard.
[0028] This invention uses the STM32F407 microcontroller chip as the IPMC terminal. The operating principle of this chip is equivalent to that of the STM32F103 chip, and its configuration process is similar. For example... Figure 3 As shown, the IPMC chip on the motherboard is connected to the serial port on the motherboard bridge chip. The serial port enables communication between the IPMC and the application on the host main processor. The IPMC chip communicates with various function boards through the IPMB bus to realize the request and response of IPMI messages.
[0029] The main processor application sends a request to the main IPMC via serial port to retrieve the value of a specific sensor on a function board. Upon receiving the serial data, the microcontroller program running on the main IPMC parses the data according to the IPMI protocol to obtain the target board's address and sensor number. It then encapsulates this information into a request message according to the IPMI protocol and sends it to the IPMB bus. The function board corresponding to the IPMB address receives the IPMI request, parses it, completes data acquisition, encapsulates the acquired data into a response message, and sends it to the IPMC via the IPMB bus. At this point, the microcontroller program running on the IPMC parses the IPMB bus data, encapsulates the response message according to the IPMI protocol, and sends it to the main processor application via serial port, providing the user's decision-making program with the board status information.
[0030] Beneficial effects: This invention designs a universal cross-platform application solution that can collect and detect the health data of various functional boards and report it to the application layer through a common standard protocol.
[0031] The architecture of this invention is independent of the CPU and BIOS. Using the standardized IPMI protocol, it can operate independently of the operating system. While ensuring the independent and stable operation of each functional board, the architecture of this invention also enables cross-platform applications.
[0032] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for implementing information collection and reporting based on the IPMI protocol, characterized in that, The method includes: Each functional board is equipped with a microcontroller module as its IPMC to collect sensor information. The microcontroller is connected to the IPMB bus through the IIC interface. The microcontroller configured on the motherboard serves as the main IPMC chip. On the one hand, it connects to the IPMCs of each function board through the IPMB bus to aggregate all IPMC data. On the other hand, it reports information to the application software of the main processor on the motherboard through the serial port. The main processor application software on the motherboard constructs a request IPMI message according to the IPMI request message format and sends it to the main IPMC chip via serial port. The main IPMC chip forwards the request IPMI message to the IPMB bus. After receiving the request IPMI message, the IPMC of the function board parses it, collects data according to the collection requirements in the message, encapsulates it into a response IPMI message, and reports it to the main processor application software on the motherboard via the IPMB bus.
2. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 1, characterized in that, Each functional board is used to communicate with the host system via a bridge chip through the PCI bus, and each functional board is accessed by the application on the host through the PCI bus.
3. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 1, characterized in that, The main processor application software implements sending IPMI requests and receiving and parsing IPMI response information; the format of the sent IPMI request message includes a start character 0xA0, the IPMI message body, and a stop character 0xA5; start, stop, and escape characters are not allowed in the message body.
4. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 3, characterized in that, The request / response IPMI message body uses the IPMIMsg structure, which includes: ResAddr, NetFnLUN, ChkSum, ReqAddr, RqSeqLUN, Cmd, Data, and CheckSum; ResAddr is the destination address for the message response; The NetFnLUN is a combination of NetFn and RS LUN. The NetFn field, representing the network function, identifies the function class of the message. The network function groups IPMI commands into different groups, consisting of a 6-bit field that identifies the function to be accessed. Even-numbered NetFn values are used for requests to the BMC, while odd-numbered NetFn values are returned in the BMC response. The response NetFn = request NetFn + 1. The remaining two bits are the responder logical unit number (RS LUN) field. Within the same IPMC, it distinguishes multiple logical processing units and is used for secondary addressing when looking up the destination address. The RS LUN remains consistent in both requests and responses. ReqAddr is the address to which the request is sent; RqSeqLUN is a combination of RqSeq and RQ LUN, consisting of one byte, where RqSeq is the high 6 bits and RQ LUN occupies the low 2 bits; RqSeq is the request sequence number, which increments by 1 for each new request sent by the BMC; the response must include the same RqSeq so that the sender knows which request the response corresponds to; RQ LUN is the requester's own logical unit number, which corresponds to the RS LUN number in the response and must be consistent. Cmd is a command code; this message byte specifies the operation to be performed under the specified network function. Data is zero or more bytes of data in a request or response that matches a given command code Cmd, and is either a parameter of the command code or a return value of the command response.
5. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 4, characterized in that, The motherboard's main processor application software first constructs an IPMI message request structure. In this structure, the IPMB destination address of the corresponding function board is entered into ResAddr, the request address is the IPMC address on the motherboard, and its address is entered into ReqAddr. RQ LUN and RqSeq are set to 0, representing the sub-address of the requester / responder, with RqSeq set to 0. The network function request NetFn is set to 0x4, the requested function is set, and Cmd is set to 0x2d, which is used to execute the reading of sensor values. Data is filled with the channel number of the requested sensor. The motherboard's main processor application software sends the assembled IPMI message request to the serial port of the main IPMC chip via the serial port connected to the motherboard, according to the IPMIMsg structure. Upon receiving the serial message, the main IPMC chip parses and relays it through the program running on the main IPMC chip, then sends it to the corresponding IPMB address. The program running on the address function board receives and parses the message. After completing the acquisition according to the acquisition requirements indicated in the message, the microcontroller on the function board acts as the response end, encapsulates the response message according to the IPMIMsg structure, sets NetFn=0x5, the Data part is the acquired data, and the other fields are consistent with the fields filled in the request protocol, and sends the message back to the IPMB bus; after receiving the returned message, the BMC of the corresponding address will forward the message to the main processor application software through the serial port channel; after receiving the IPMI message from the function board through the serial port, the main processor application software parses it to obtain the acquired data value Data.
6. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 1, characterized in that, Each functional board is configured with an STM32F103 series microcontroller as an IPMC. The microcontroller's memory supports in-system programming. Each group of GPIOs of the microcontroller includes 12 pins, and the ports support input, output, and multiplexing modes. The microcontroller's ADC module supports 12-bit resolution and 16 channels.
7. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 6, characterized in that, The STM32F103 series microcontroller's ADC mode is used for temperature sensor, battery voltage detection, and photoresistor signal acquisition; the microcontroller program on the function board receives requests from the IPMC, acquires data, and then returns the acquisition results to the IPMC through the IIC interface.
8. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 7, characterized in that, A thread for receiving IIC data runs on the microcontroller's main program. When data is received, an interrupt handler is automatically executed to parse the data, obtain the requested ADC channel, acquire the corresponding data according to the channel number, encapsulate it into an IPMI message, and send it to the IPMB bus via the IIC bus. This process is repeated to achieve the functions of request reception, data acquisition, and response return.
9. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 1, characterized in that, The motherboard uses an STM32F407 microcontroller chip as the IPMC terminal. The IPMC chip on the motherboard is connected to the serial port on the motherboard bridge chip. The serial port enables communication between the IPMC and the application terminal on the host main processor. The IPMC chip communicates with various function boards through the IPMB bus to realize the request and response of IPMI messages.
10. The implementation method for information collection and reporting based on the IPMI protocol as described in claim 9, characterized in that, The main processor application sends a request to the main IPMC via serial port to retrieve the value of a specific sensor on a function board. Upon receiving the serial data, the microcontroller program running on the main IPMC parses the data according to the IPMI protocol to obtain the target board's address and sensor number. It then encapsulates this information into a request message according to the IPMI protocol and sends it to the IPMB bus. The function board corresponding to the IPMB address receives the IPMI request, parses it, completes data acquisition, encapsulates the acquired data into a response message, and sends it to the function board's IPMC via the IPMB bus. The microcontroller program running on the function board's IPMC parses the IPMB bus data, encapsulates the response message according to the IPMI protocol, and sends it to the main processor application via serial port, providing the user's decision-making program with the board's status.