Convert PHB AF to DSCP Decimal and Vise Versa: It’s So Easy!

If you are searching any transformation formula from AF to DSCP decimal value and the vise versa then stop here! I have the solution for you! The rules are simple:

  • From PHB AF to DSCP Decimal

Decimal from AFxy=(8*x)+(2*y)

So, let’s have some example, let’s calculate decimal value from AF13, AF31 and AF43.

AF13 = (8*1)+(2*3) = DSCP 14

AF31 = (8*3)+(2*1) = DSCP 26

AF43 = (8*4)+(2*3) = DSCP 38

  • From DSCP Decimal to PHB AF

And the formula is tricky to calculate the vise versa, i mean, from DSCP value to PHB AF. The formula is:

AFxy where, x = Floor Value [(DSCP Value)/8], y = [(Remainder)/2]

So, let’s revert back those DSCP values to AF value.

DSCP 14 = AFxy where, x = Floor Value of (14/8) = 1, y = (Remainder)/2 = 6/2 = 3, so AFxy = AF13

DSCP 26 = AFxy where, x = Floor Value of (26/8) = 3, y = (Remainder)/2 = 2/2 = 1, so AFxy = AF31

DSCP 38 = AFxy where, x = Floor value of (38/8) = 4, y = (Remainder)/2 = 6/2 = 3, so AFxy = AF43

So you will never forget it, right? πŸ˜€

Advertisements

About Mijanur Rahman
Mijanur started blogging to save and share his study and research notes. A deep diver in technologies and loves to participate in technical brainstorming. Proud father of two wonderful daughters loves to spend time with them. He writes about the topics that people deal with every day mainly on technology arena. To get in touch contact him at bilashece@gmail.com

18 Responses to Convert PHB AF to DSCP Decimal and Vise Versa: It’s So Easy!

  1. Sudharshan says:

    What about odd numbered DSCP values in the context of converting AF to DSCP

  2. Hansen B.Kannie says:

    Great thanks. This is a very simple but powerful conversion you presented with extreme clearity.Kudos.

    Hansen Kannie

  3. Parvej Khan says:

    hey what about DSCP46 ?

  4. Parvej Khan says:

    Thanks for this post- i used it @ https://www.facebook.com/groups/164049120368581/
    if u have any objection i will remove it.

  5. Francisco says:

    This is one of the most helpful tips ever. I was still using the “match dscp ?” under a bogus class-map, and the calculator. Not for the usal EF, or CSx, but to avoid being confused on the run. I can remember two simple formulas. REALLY Good. Thanks

  6. This is great – thanks for sharing.

  7. heers says:

    You made it easy…good on you mate, thanks

  8. Zaid Abbasi says:

    brilliant stuff … thanks

  9. Jonathan says:

    very nice and simple πŸ™‚ thanks

  10. Tatiane says:

    Thanks!! Very usefull!

  11. Very simple and great to remember, thanks a lot

  12. sriram says:

    Nice explanation. So easy to understand.
    Thanks
    Sriram

  13. Thanks this has helped me a lot – preparing for the CCIE Written and was looking for a simple forumula and I found it here!

  14. parthiban says:

    lovely Its great

  15. Mijanur Rahman says:

    My pleasure guys! πŸ™‚

  16. stephan.langelier@sasktel.com says:

    Awesome summary, prepping to write Cvoice so it’s a great reference. Kudo’s sir.

    Stephan

  17. Adrian says:

    top way of doing it, needed a refresher. thanks again.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: