ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
diffserv.h File Reference

Layer 4 (Transport) - DiffServ QoS marking (RFC 2474) for outbound traffic. More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

Layer 4 (Transport) - DiffServ QoS marking (RFC 2474) for outbound traffic.

Stamps the 6-bit DSCP into the DS field (the high 6 bits of the IPv4 TOS / IPv6 Traffic-Class byte) of outbound TCP connections and UDP datagrams so a QoS-aware network - and the Wi-Fi driver's 802.11e WMM access-category mapping - can prioritize real-time / safety packets over best-effort. The marking is applied on tcpip_thread where the pcb is created (accept / connect / udp create), so nothing is added to the send hot path. This module owns the two server-wide DSCP defaults; the per-listener and per-connection overrides live with their pcb (listener.cpp / tcp.cpp) but read the defaults through here.

Three levels of control, coarse to fine:

  • pc_set_default_dscp(): every outbound TCP connection (accepted + client) gets this DSCP.
  • pc_listen_set_dscp(): all connections accepted on one port get a DSCP (overrides the default).
  • pc_conn_set_dscp(): tag one live connection with any DSCP - real QoS, or arbitrary network testing. Plus pc_udp_set_dscp() for outbound datagrams. A DSCP of 0 means best-effort (no marking / TOS left 0).
Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file diffserv.h.