如何认识TOS----DSCP 对照表

最近有遇到项目中对FortiGate设置TOS的策略路由的问题,其实这问题较为简单,但是由于大家对TOS-DSCP概念不熟悉造成的,所以感觉比较难,现在不同厂商在设置QOS的时候有的是使用TOS,有的使用DSCP,因此工程师感觉都很头疼,因此从网上copy来的TOS和DSCP定义供大家参考。

总之DSCP是拿出了TOS的前六位,分成两组,3位一组,并且DSCP六位中的最后一位也没有使用(保持为0)
因此可以简单的认为如下:
AF11 二进制位(**001** ****01 0)00 
对应的TOS 值为(0010 1000) 0x28

IP Type of Service
This classification type is based on an exact match of the one-byte ToS/DSCP field contained in the IP header of a frame. The ToS (Type of Service) or DSCP (Diffserve Codepoint) value is defined by an 8-bit hexadecimal number between 0 and FF. Enter a value or click Select to open a window where you can generate a hex value. For information on how to generate a ToS or DSCP value, see ToS/DSCP Configuration window.
Type of Service can be used by applications to indicate priority and Quality of Service for each frame. The level of service is determined by a set of service parameters which provide a three way trade-off between low-delay, high-reliability, and high-throughput. The use of service parameters may increase the cost of service. In many networks, better performance for one of these parameters is coupled with worse performance on another. Except for very unusual cases, at most, two of the parameters should be set.
"IP precedence 使用前3bit; ToS 使用4-7 bit, 最后一位备用;"
"DSCP 使用0-5bit, 最后两位备用;"

For a ToS value, the 8-bit hexadecimal number breaks down as follows:
Bits 0-2: Precedence
Bit 3: 0=Normal Delay, 1=Low Delay
Bit 4: 0=Normal Throughput, 1=High Throughput
Bit 5: 0=Normal Reliability, 1=High Reliability
Bits 6-7: Explicit Congestion Notification
########################
0 1 2 3 4 5 6 7
+-----+-----+-----+-----+-----+-----+-----+-----+
| | | | | | |
| PRECEDENCE | D | T | R | 0 | 0 |
| | | | | | |
+-----+-----+-----+-----+-----+-----+-----+-----+
#########################
The precedence bits (bits 0-2) break down as follows:
111 - Network Control
110 - Internetwork Control
101 - CRITIC/ECP
100 - Flash Override
011 - Flash
010 - Immediate
001 - Priority
000 - Routine
The Network Control precedence designation is intended to be used within a network only. The actual use and control of that designation is up to each network. The Internetwork Control designation is intended for use by gateway originators only.

For a DSCP value, the value represents codepoints for two Differentiated Services (DS) Per-Hop-Behavior (PHB) groups called Expedited Forwarding (EF) and Assured Forwarding (AF). For more information on these PHB groups, refer to RFC 2597 and RFC 2598.
########################################################

在IP网络中,IPv4报文中有三种承载QoS优先级标签的方式,分别为基于二层的CoS字段(IEEE802.1p)的优先级、基于IP层的IP优先级字段ToS优先级和基于IP层的DSCP(Differentiated Services Codepoint)字段优先级。每种优先级的定义如下:

  (1) IEEE802.1p优先级======> 2层Qos(ISL & Dot1Q)
  它是位于二层带标签的以太网帧的CoS字段,和VLAN ID在一起使用,在字节中的位置如下:
点击图片可在新窗口打开
  其中:IEEE802.1p优先级:3bit(P2-P0)
  未用(CU):1bit
  VLAN ID:12bit(V11-V0)
  IEEE802.1p优先级值有8个(0-7),0优先级最低,7优先级最高。报文分为三种情况:带优先级和VLAN ID的标签报文,其优先级值是自身带的值;只带优先级的标签报文,此时VLAN ID为0,其优先级值是自身带的值;未带标签的报文,一般默认的优先级值为0,也可以进行更改指定新的优先级。

  (2) IP优先级==============》3层IP包头的服务类型 之一
  它由IP分组报头中的服务类型(ToS)字节中的3位组成,其在字节中的位置如下:
  P2 P1 P0 T3 T2 T1 T0 CU
  其中:IP优先级:3bit(P2-P0)
  服务类型(ToS):4bit(T3-T0)
  未用(CU):1bit
  IP优先级值有8个(0-7),0优先级最低,7优先级最高。在默认情况下,IP优先级6和7用于网络控制通讯使用,不推荐用户使用。ToS字段的服务类型未能在现有的IP网络中普及使用。

  (3) DSCP优先级==============》3层IP包头的服务类型 之二
  它由IP分组报头中的6位组成,使用的是ToS字节,因此在使用DSCP后,该字节也被称为DSCP字节。其在字节中的位置如下:
  DS5 DS4 DS3 DS2 DS1 DS0 CU CU
  其中:DSCP优先级:6bit(DS5-DS0)
  未用(CU):2bit
  DSCP优先级值有64个(0-63),0优先级最低,63优先级最高。事实上DSCP字段是IP优先级字段的超集,DSCP字段的定义向后与IP优先级字段兼容。目前定义的DSCP有默认的DSCP,值为0;类选择器DSCP,定义为向后与IP优先级兼容,值为(8,16,24,32,40,48,56);加速转发(EF),一般用于低延迟的服务,推荐值为46(101110);确定转发(AF),定义了4个服务等级,每个服务等级有3个下降过程,因此使用了12个DSCP值((10,12,14),(18,20,22),(26,28,30),(34,36,38))。

#############################################
IP precedence和DSCP代码对照表

<0-63> Differentiated services codepoint value 
af11 Match packets with AF11 dscp (001010) 
af12 Match packets with AF12 dscp (001100) 
af13 Match packets with AF13 dscp (001110) 
af21 Match packets with AF21 dscp (010010) 
af22 Match packets with AF22 dscp (010100) 
af23 Match packets with AF23 dscp (010110) 
af31 Match packets with AF31 dscp (011010) 
af32 Match packets with AF32 dscp (011100) 
af33 Match packets with AF33 dscp (011110) 
af41 Match packets with AF41 dscp (100010) 
af42 Match packets with AF42 dscp (100100) 
af43 Match packets with AF43 dscp (100110) 
cs1 Match packets with CS1(precedence 1) dscp (001000) 
cs2 Match packets with CS2(precedence 2) dscp (010000) 
cs3 Match packets with CS3(precedence 3) dscp (011000) 
cs4 Match packets with CS4(precedence 4) dscp (100000) 
cs5 Match packets with CS5(precedence 5) dscp (101000) 
cs6 Match packets with CS6(precedence 6) dscp (110000) 
cs7 Match packets with CS7(precedence 7) dscp (111000) 
default Match packets with default dscp (000000) 
ef Match packets with EF dscp (101110)

Cisco推荐的几个DSCP值:
路由协议 CS6
交互式语音 EF
交互式视频 AF41
流式视频 CS4
电话信令 AF31或CS3
网络管理 CS2
大块数据 AF11
尽力服务 0

================= End

如何认识TOS----DSCP 对照表的更多相关文章

  1. squid源码安装下的conf文件默认值和提示

    #    WELCOME TO SQUID 3.0.STABLE26#    ----------------------------##    This is the default Squid c ...

  2. OpenFlow Switch学习笔记(七)——Matching Fields

    Matching Fields in_port=port Matches OpenFlow port port dl_vlan=vlan Matches IEEE 802.1q Virtual LAN ...

  3. opendaylight-O版本与openstack集成

    feature:list list (Lists all existing features available from the defined repositories) feature:list ...

  4. OVS常用命令与使用总结

    说明 在平时使用ovs中,经常用到的ovs命令,参数,与举例总结,持续更新中… 进程启动 1.先准备ovs的工作目录,数据库存储路径等 mkdir -p /etc/openvswitch mkdir ...

  5. Openvswitch手册(9): Flow

    这一节我们将flow table flow table主要由ovs-ofctl命令操作 ovs-ofctl可以走和openflow controller一样的协议: ssl:ip[:port]: Th ...

  6. iptables 初见 第一章

    官网:https://www.netfilter.org/ 简单来来说 ,netfilter 是一个工作在内核空间的数据包过滤系统,iptables 是一个工作在用户控件.调用netfilter 的规 ...

  7. 一种基于openflow的虚拟化层软件flowvisor的API测试

    注明:本文并不对openflow进行分析,本人也是略略知道这个概念,对flowvisor也只是对其API有所测试,更深的源码并未涉及,只是希望该文能对以后的flowvisor研究者提供些许帮助. 一: ...

  8. 博通BCM53101M以太网交换芯片原理解析

    Quality of Service 服务质量 BCM53101M的QoS为每个端口提供6个内部队列以支持6种不同的流量类别(traffic class, TC).在流量拥塞的情况下,可通过拥塞管理, ...

  9. 2019 SDN上机第3次作业

    1. 利用Mininet仿真平台构建如下图所示的网络拓扑,配置主机h1和h2的IP地址(h1:10.0.0.1,h2:10.0.0.2),测试两台主机之间的网络连通性 创建拓扑 配置主机h1和h2的I ...

随机推荐

  1. fiddler和bugfree之间的联动(做伪请求、伪响应、并发、抓密码)

    青.取之于蓝,而青于蓝:冰.水为之,而寒于水 不积跬步,无以至千里;不积小流,无以成江海. 1解压Fiddler Web Debugger V4.6.2017修正中文第6版至C盘Program Fil ...

  2. OpenCV中图像以Mat类型保存时各通道数据在内存中的组织形式及python代码访问各通道数据的简要方式

    以最简单的4 x 5三通道图像为例,其在内存中Mat类型的数据组织形式如下: 每一行的每一列像素的三个通道数据组成一个一维数组,一行像素组成一个二维数组,整幅图像组成一个三维数组,即: Mat.dat ...

  3. 粒子群算法(PSO)关于参数w的一些改进方法

    (一)线性递减 function [xm,fv] = PSO_lin(fitness,N,c1,c2,wmax,wmin,M,D) format long; % fitness学习函数 % c1学习因 ...

  4. 脚本处理iOS的Crash日志

    背景 当我们打包app时,可以选择生成对应的符号表,其保存 16 进制函数地址映射信息,通过给定的函数起始地址和偏移量,可以对应函数具体信息以供分析. 所以我们拿到测试给的闪退日志(.crash)时, ...

  5. String字符串的方法

    String字符串在Java开发中是我们常用的一种数据类型,同时String字符串也为我们提供了大量的方法.通过一些实例的练习,我们可以对String字符串的方法有一个比较清楚的了解. 有一个字符串S ...

  6. linux文件种类及其扩展名

    文件种类 普通文件(ls -al出来第一列为-) 纯文本文件(ASCII):linux系统中最多的一种文件类型,可以使用cat直接读取: 二进制文件(binary):linux下面的可执行文件: 数据 ...

  7. Harbor 学习分享系列2 - Harbor项目介绍

    云盘链接 链接:https://pan.baidu.com/s/19yZCZMijf1c3rTwYOqiZzw 密码:netv 通过本文无法把本文中的实验进行成功,请联系作者本人,作者会录制视频发送给 ...

  8. c++虚继承与虚函数

    学习继承与多态时看到这两个概念,记录整理. 虚继承与虚函数都是用virtual关键字实现,虚继承为了防止多重继承,而虚函数为了实现多态. 是几个例子. 虚继承: class A{}; class B: ...

  9. [朴孝敏][Road Trip]

    歌词来源:http://music.163.com/#/song?id=406907305 作曲 : Ryan S. Jhun/G'harah 'PK' Degeddingseze/Denzil Re ...

  10. eject命令详解

    基础命令学习目录首页 原文链接:http://www.kgc.cn/bbs/post/128680.shtml Linux eject命令用于退出抽取式设备. 若设备已挂入,则eject会先将该设备卸 ...