惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
D
DataBreaches.Net
Recent Announcements
Recent Announcements
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
Y
Y Combinator Blog
博客园 - 【当耐特】
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
P
Proofpoint News Feed
量子位
C
Check Point Blog
F
Fortinet All Blogs
罗磊的独立博客
Last Week in AI
Last Week in AI
GbyAI
GbyAI
L
LangChain Blog
博客园 - 司徒正美

博客园 - sudochen

linux kernel format nand for ubifs ipq95xx rdp433 烧写运行openwrt25 git多用户管理 以太网EthernetII,LLC,SNAP判断 命令行获取公网IP地址 免密SSH登录Openwrt 研发管理的一般流程 haserl repo error with python3.10 on ubuntu22.04 京东AX3000后裔刷机 UTF-8 ebtables Ubuntu建立samba共享目录 linux文件的时间 SFP光模块定义 i2ctools工具使用 linux内核Makefile和busybox编译 I2C协议 SPI协议 免费ARP FEM介绍 notepad++每两个字符添加一个空格
IP优先级TOSDSCP
sudochen · 2024-06-17 · via 博客园 - sudochen

1,常见的QoS

  1. IP层的ToS(Type of Service)优先级(RFC791),后来升级为IP层的DSCP(Differentiated Services Codepoint)优先级(RFC 2474)
  2. 802.3报文的IEEE802.1p优先级
  3. 802.11 MAC优先级AC_VO、AC_VI、AC_BE、AC_BK

IP层的ToS和80211有响应的映射关系,这个我们后面在讲。

2,ToS的格式

早期RFC791定义,IP数据包是依赖ToS字段来标识数据优先级, ToS字段由8个比特组成, 其中BIT0~2的Precedence字段标识了IP报文的优先级。

我们可以定义ToS 为如下的数据结构

struct Tos {
    unsigned char Precedence:3;
    unsigned char Delay:1;
    unsigned char Througput:1;
    unsigned char Reliabilty:1;
    unsigned char Cost:1;
    unsigned char Unused:1;
}

但是在网络传输时,按大端传输,在抓包文件中的格式为

| Precedence:3 | Delay:1 | Througput:1 | Reliabilty:1 | Cost:1 | Unused:1 |

Precedence bit0-bit2 指示IP优先级0~7,值越大优先级越高

  • 111--Network Control(网络控制);
  • 110--Internetwork Control(网间控制);
  • 101--Critic(关键);
  • 100--Flash Override(疾速);
  • 011--Flash(闪速);
  • 010--Immediate(快速);
  • 001--Priority(优先);
  • 000--Routine(普通)。

DTRC这些位也成为ToS位,指示报文关键特性/业务类型要求。每个IP报文的Bit3~6只有一个Bit = 1,分别对应D(Delay)、T(Throughput)、R(Reliability)、C(Cost),因此实际只有5个值,这些值一般不使用,使用Precedence的值就可以满足一般的QoS需要。

  • 0000--normal service;
  • 1000--minimize delay;
  • 0100--maximize throughput;
  • 0010--maximize reliability;
  • 0001--minimize monetary cost。

2,IP DSCP

为了更好的控制数据流分类,新的RFC 2474 标准中,重新定义了IP 报文头的ToS 字段为DS(Differentiated Services,差分服务)字段,

DSCP使用6比特,

Precedence