DSCP
DiffServ模型中,IETF重新定义了IPv4中的ToS和IPv6中的TC,称作DS字段,DS字段的取值称为DSCP(DiffServ code point)。具体如图10-5所示。
在IPv4报文中,DS(Differentiated Service)字节的低6位(比特0~5)用作区分服务代码点DSCP,高2位(比特6、7)是保留位。DSCP中的低3位(比特0~2)是类选择代码点CSCP(Class Selector Code Point),它表示了一类DSCP。网络中支持DiffServ技术的各设备根据DSCP值选择相应的转发行为。
在IPv6报文中,有流量类别TC(Traffic Class)字段。流量类别字段有8位,和IPv4的服务类型(ToS)字段功能相同,用于对报文的业务类别进行标识。
一般情况下,各协议都有默认DSCP值,且部分协议的DSCP值可以通过host-packet type命令和各协议自己修改DSCP值的命令配置,这种情况下,DSCP的配置生效规则如下:
- 当协议有自己的修改命令时,不管是否受host-packet type命令控制,都按协议自己的修改命令配置的DSCP值生效;
- 当协议没有自己的修改命令时,且受host-packet type命令控制,则按host-packet type命令配置的DSCP值生效;
- 当协议没有自己的修改命令时,且不受host-packet type命令控制,则按照默认DSCP值生效。
ToS/DSCP值及修改方法
协议 |
默认ToS/DSCP值 |
是否受host-packet type命令控制 |
各协议自己的修改命令 |
---|---|---|---|
ICMP_ECHO |
0 |
否 |
ping -dscp dscp-value |
ICMP_ECHO_REPLY |
0 |
否 |
NA |
ICMP差错 |
6 |
否 |
NA |
DNS |
0 |
否 |
NA |
FTP |
6 |
是,host-packet type management-protocol |
NA |
TFTP |
6 |
是,host-packet type management-protocol |
NA |
SNMP |
6 |
是,host-packet type management-protocol |
snmp-agent packet-priority snmp priority-level |
SSH |
6 |
是,host-packet type management-protocol |
ssh server dscp value |
TELNET |
6 |
是,host-packet type management-protocol |
telnet server dscp value |
SYSLOG(UDP) |
0 |
是,host-packet type management-protocol |
info-center syslog packet-priority priority-level info-center syslog packet-priority priority-level命令优先级高于host-packet type management-protocol命令。 |
SYSLOG(TCP) |
0 |
否 |
info-center syslog packet-priority priority-level |
HWTACACS |
6 |
是,host-packet type management-protocol |
NA |
Radius |
6 |
否 |
NA |
NTP |
6 |
是,host-packet type control-protocol |
NA |
BFD |
7 |
否 |
tos-exp tos-value(BFD会话视图) tos-exp tos-value { dynamic | static }(BFD视图) |
IGMP |
6 |
否 |
NA |
PIM |
6 |
否 |
NA |
CUSP |
6 |
是,host-packet type control-protocol |
NA |
BGP |
6 |
是,host-packet type control-protocol |
NA |
LDP |
6 |
是,host-packet type control-protocol |
NA |
OSPF |
6 |
是,host-packet type control-protocol |
NA |
DHCP Server/DHCP Relay |
6 |
否 |
dhcp dscp-outbound value |
DHCP Snooping |
0 |
否 |
NA |
GRE |
内层IP ToS如果有效则继承内层IP报文ToS/DSCP值,否则设置为6 |
否 |
NA |
IKE |
6 |
否 |
NA |
VXLAN |
内层IP ToS如果有效则继承内层IP报文ToS/DSCP值,否则设置为6 |
否 |
NA |
RSVP-TE |
6 |
否 |
NA |
MSDP |
6 |
否 |
NA |
Traffic Class/DSCP值及修改方法
协议 |
默认Traffic Class/DSCP值 |
是否受host-packet type命令控制 |
各协议自己的修改命令 |
---|---|---|---|
ICMP6_ECHO |
0 |
否 |
ping ipv6 -tc traffic-class-value |
ICMP6_ECHO_REPLY |
复制ICMP6_ECHO报文TC/DSCP值 |
否 |
NA |
ICMP6差错 |
复制ICMP6_ECHO报文TC/DSCP值 |
否 |
NA |
ND(NS/NA/RS/RA) |
6 |
否 |
NA |
TNL6(IPv6 over IPv4) |
0 |
否 |
NA |
TNL6(IPv4 over IPv6) |
0 |
否 |
tunnel ipv4-ipv6 traffic-class class-value |
DNSv6 |
0 |
否 |
NA |
FTPv6 |
6 |
是,host-packet type management-protocol |
NA |
TFTPv6 |
6 |
是,host-packet type management-protocol |
NA |
SNMPv6 |
6 |
是,host-packet type management-protocol |
snmp-agent packet-priority snmp priority-level |
SSHv6 |
6 |
是,host-packet type management-protocol |
NA |
TELNETv6 |
6 |
是,host-packet type management-protocol |
NA |
SYSLOG(UDP) |
0 |
否 |
info-center syslog packet-priority priority-level |
SYSLOG(TCP) |
0 |
否 |
info-center syslog packet-priority priority-level |
HWTACACS |
6 |
是,host-packet type management-protocol |
NA |
Radius |
6 |
否 |
NA |
NTPv6 |
6 |
是,host-packet type control-protocol |
NA |
BFDv6 |
7 |
否 |
tos-exp tos-value(BFD会话视图) |
tos-exp tos-value { dynamic | static }(BFD视图) |
|||
MLD |
6 |
否 |
NA |
PIMv6 |
6 |
否 |
NA |
BGP4+ |
6 |
是,host-packet type control-protocol |
NA |
OSPFv3 |
6 |
是,host-packet type control-protocol |
NA |
DHCPv6 |
6 |
否 |
NA |
GRE |
内层IP TC如果有效则继承内层IP报文TC/DSCP值,否则设置为6 |
否 |
NA |
VXLAN |
内层IP TC如果有效则继承内层IP报文TC/DSCP值,否则设置为6 |
否 |
NA |