RTPS is a message exchange protocol, whereas the DDS defines an application level interface; that is RTPS is the underlying layer allowing DDS implementations from multiple vendors to interoperate. A RTPS implementation is only responsible for network communications, DCPS is at user data level. Actors in the RTPS Protocol are in one-to-one correspondence with the DDS entities, that's why names are the same.
The RTPS was standardized within the OMG as an interoperability wire protocol for DDS - specifically to let DDS implementations from different vendors interwork seamlessy. In a sense, you could drive the following parallel, RTPS is to DDS as GIOP is to CORBA.
Thus it is not by accident that the RTPS "supports" the key DCPS features, but it was designed to be as such.
-- Angelo Corsaro, PhD Product Marketing Manager | PrismTech OMG DDS SIG and RTESS Co-Chair
The RTPS specification describes the protocol in terms of a "virtual machine". The only purpose of the RTPS virtual machine is to describe the protocol in a complete and un-ambigious manner. It does not require an RTPS implementation to have a 'HistoryCache' entity.
Furthermore, DCPS does not depend on RTPS. It is possible to be fully DCPS compliant, without using RTPS as the underlying transport mechanism to exchange messages over the wire. Such an implementation will not interoperate with other DCPS implementations of course.
DCPS does not define HistoryCache as a separate entity, but it does specify a History QoS policy. This policy controls the behavior of the Service when the value of an instance changes before it is finally communicated to some of its existing DataReader entities.
Writer RTPS receives data by DDS DataWriter (match 1:1), but DDS entity that sends data is Publisher. Really the sequence of data transmission is: DDSDataWriter -> Publisher -> RTPSWriter, but also RTPS Writer sends data and if it matches 1:1 with DDSDataWriter, when I have 2 topic, I have 2 DDSDataWriter, 1 Publisher end 2 RTPS Writer. It's slow clear this sequence of operation, why to do match DDSDataWriter and RTPS Writer rather than Publisher and RTPS Writer? Same consideration are valid on Subscriber side
DDS DataWriters and RTPS DataWriters are bound to one single Topic and therefore to one single type, whereas Publishers are 'typeless'. Besides that, one has to consider the QoS RxO in matching the DataWriters and DataReaders.
Conceptually, communication indeed goes: DDS DataWriter --> DDS Publisher --> RTPS Writer, but this does not imply a 'slow' implementation.