Packet user priority was earlier defined by IP Precedence (IPP) and Type of Service (TOS) field in IPv4 header. The IP Precedence/TOS fields could specify the route delay, priority and reliable service for a packet. Later on, the TOS field was extended to 6 bits(RFC 2474) and was called Differentiated Services Code Point (DSCP).
The Explicit Congestion Notification (ECN) was also added later (RFC 3168). The ECN bits do not define the priority of the packet and the priority of the packet needs to be considered from the third bit.
The IPP/TOS field and the DSCP/ECN bit formats and the IPv4 format are shown below
in the IPP/TOS field — the first 3 (0 – 2) bits as shown below indicate packet priority, bit 3 indicates if “low delay is preferred”, bit 4 indicates if “high throughput is preferred” and bit 5 indicates if “high reliability is preferred”.
Fig Courtesy : Wikipedia
The upper three bits of the DSCP field still provide the priority.
As an example – in the IPP/TOS byte – for an IP Precedence value of 1 (in decimal) = 001. The remaining TOS field being zero would make the value as | 001 | 00000 | = 32 in decimal
The same bits in terms of DSCP would be | 001000 | 00 | = 8 in decimal, with the first two bits as ECN and counting from the third bit.
A conversion of the IPP <=> TOS <=> DSCP is shown below for different values as depicted in the example above
Fig Courtesy: Wikipedia
Reference: https://en.wikipedia.org/wiki/Type_of_service