The Diplomatic protocol consists of rules, but describe the sequence of state visits, the dress code, seating arrangements, etc..
In diplomacy subject to intergovernmental processes various rules that serve the purpose to avoid disputes and to create a pleasant atmosphere for political negotiations. Many a diplomatic incident was a (possibly welcome ) occasion for a military confrontation.
The law firms and offices of the Heads of State and Government, Foreign Ministries of most countries have their own protocol departments that deal exclusively with the diplomatic protocol and the protocol-related ranking ( priority or precedence ).
The state offices of the German Länder entertain protocol departments.