Skip to main content

fix setsockopt behavior for ToS/DSCP on Windows.

Project description

Windows DSCP Fix Python Package

A Python package to fix setsockopt(..,IP_TOS,..) behavior on Windows.

Why

  • In the IPPROTO_IP socket options for setsockopt, IP_TOS is marked as "DO NOT USE", and Windows QoS2 subsystem takes over the admission.

  • ToS/DSCP value is still an important field for QoS guarantee in IEEE 802.11 network, according to RFC 8325. However, there is no existing convenient method to tune the value.

  • On Windows, only DSCP value is allowed to set except ECN bits and the Administrator permission is required (link). So, this functionality has to be maintained as a third-party module, which will not be accepted by mainline.

Usage

import socket
import windows_dscp_fix
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_TOS, 128) #NOTE: Administrator permission required

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

windows_dscp_fix-0.2.1.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

windows_dscp_fix-0.2.1-cp311-none-win_amd64.whl (108.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page