It is narrated from Sayyiduna Fadala bin Ubaid (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "The rider should greet the one who is walking, and the one who is standing should greet the one who is sitting, and a small group should greet a larger group."
Brief Explanation
(Commentary on Hadith 2669)
These are the ranks and levels of giving salam (greeting of peace).
In this, a person's status and rank will not be taken into consideration.