Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我能';在IP标头中找不到DSCP字段,只有不推荐使用的TOS字段_C_Network Programming_Ip_Qos - Fatal编程技术网

我能';在IP标头中找不到DSCP字段,只有不推荐使用的TOS字段

我能';在IP标头中找不到DSCP字段,只有不推荐使用的TOS字段,c,network-programming,ip,qos,C,Network Programming,Ip,Qos,我将尝试用我用Raspberry Pi制作的接入点来保证一些QoS 在开始之前,我已经把手弄脏了:我读了关于tcp、udp和ip头的文章。在中,我看到了DSCP字段,最初定义为服务类型字段 DSCP字段将为我提供有关Qos的有趣信息,因此我查找了它……但我找不到它:我仍然有弃用的tos字段 从my/usr/include/netinet/ip.h: struct ip { #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned int ip_hl:4;

我将尝试用我用Raspberry Pi制作的接入点来保证一些QoS

在开始之前,我已经把手弄脏了:我读了关于tcp、udp和ip头的文章。在中,我看到了
DSCP
字段,最初定义为
服务类型
字段

DSCP
字段将为我提供有关Qos的有趣信息,因此我查找了它……但我找不到它:我仍然有弃用的
tos
字段

从my
/usr/include/netinet/ip.h

struct ip {
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned int ip_hl:4;       /* header length */
unsigned int ip_v:4;        /* version */
#endif
#if __BYTE_ORDER == __BIG_ENDIAN
unsigned int ip_v:4;        /* version */
unsigned int ip_hl:4;       /* header length */
#endif
u_int8_t ip_tos;            /* type of service */
u_short ip_len;         /* total length */
u_short ip_id;          /* identification */
u_short ip_off;         /* fragment offset field */
#define IP_RF 0x8000            /* reserved fragment flag */
#define IP_DF 0x4000            /* dont fragment flag */
#define IP_MF 0x2000            /* more fragments flag */
#define IP_OFFMASK 0x1fff       /* mask for fragmenting bits */
u_int8_t ip_ttl;            /* time to live */
u_int8_t ip_p;          /* protocol */
u_short ip_sum;         /* checksum */
struct in_addr ip_src, ip_dst;  /* source and dest address */
};
关于我的系统的信息:

uname -r -> 3.13.0-49-generic
lsb_release -a -> Distributor ID: Ubuntu
    Description:    Ubuntu 14.04.2 LTS
    Release:    14.04
    Codename:   trusty

DSCP字段已取代ToS字段:这只是IP头中同一字段的两个名称。如果发送方将DSCP值放入该字段,那么使用ToS字段访问它就可以了

但是请注意,路由器是否以及如何实际解析DSCP/ToS字段在很大程度上取决于实现。大多数运营商(ISP)只需在进入其网络时清除该字段。大多数家庭路由器将忽略该字段,尽管OpenWRT将其解释为ToS

简言之,在不充分了解本地网络环境的情况下使用DSCP/ToS字段只是一种欺骗