The class hierarchy must be based on the network traffic patterns that you want to establish for a link. As a starting point, consider the actual traffic patterns. "Configuration Planning Example" explains how information about current traffic patterns can be used to create the class hierarchy.
The class hierarchy does not need to be the same at every point, but you need to be aware of how the classes at one point correspond to the classes at other points down the route of a packet.
You must also take into account the characteristics of the traffic in each class, and how you can define a class. For example, some applications allocate port numbers dynamically. Since you do not know the port number in advance in these cases, defining a class on the basis of port number for traffic generated by such applications is not useful. Instead, use the protocol and address information to define these classes.