With the rapid development of intelligent connected vehicles, their open and interconnected communication characteristics necessitate the use of in-vehicle Ethernet with high bandwidth, real-time performance, and reliability. DDS is expected to become the middleware of choice for in-vehicle Ethernet communication. The Data Distribution Service (DDS), provided by the Object Management Group (OMG), is an efficient message middleware based on the publish/subscribe model. It offers high real-time performance, flexibility, reliability, and scalability, showing great potential in service-oriented in-vehicle Ethernet communication. The performance of DDS directly impacts the stable operation of vehicle systems, making accurate evaluation of DDS performance in automotive systems crucial for optimizing system design. This paper proposes a latency decomposition method based on DDS middleware, aiming to break down the overall end-to-end latency into specific delays at each processing stage, thereby enabling a more precise evaluation of the system's overall performance. By reviewing the DDS protocol standard, a sequence diagram analysis is conducted based on the FastDDS implementation, and the boundaries for latency decomposition between DDS and the lower layers are determined according to the protocol specification. To eliminate biases caused by clock synchronization issues, an end-to-end latency loopback testing method based on the RPC mechanism is proposed. This method integrates RPC with the publish-subscribe model, combining it with a synchronization discovery mechanism. Building on the foundation of end-to-end latency, a segmented latency testing method is designed using DDS, allowing for a fine-grained analysis of the latency characteristics of each component within the system. Finally, experiments simulating the communication environment of in-vehicle controllers were conducted. The results show that publication frequency, data load, and reliability QoS strategies significantly affect different layers of the system. The validity and reliability of the segmented latency testing method are verified, and optimization recommendations for design are provided.