At a basic protocol level they don't.
Part of the point of Pub/Sub messaging is that it totally decouples the user producing the data from those consuming it.
A subscriber subscribes to a topic, there may never be a message published on that topic and they should not care which publisher sends that message. Likewise a publisher publishes message to a topic, there may be 0 to many clients subscribed to that topic.
If you REALLY need notifying that a client is on/off line then there are techniques to do this. The usual version is to have the client publish a retained message to a specific topic just after they connect. e.g. client/a/online
value 1
. They should include a Last Will and Testament message in the connection details that will publish 0
to this topic in the event of a unintentional disconnect. They would also manually publish 0
just before a instructed shutdown.
P.S. While valid in the spec, topics shouldn't start with /
as this adds a null entry in the topic tree at the start and breaks advanced features like Shared Subscriptions.