locked
Filter errors in setting DSCP to UDP packets using Windows Traffic Control API RRS feed

  • Question

  • I am using the following code to add filter to Traffic Control API that has a DSCP flow on 46 (EF)

    This code uses the TcAddFilter function with TC_GEN_FILTER structure in order to add such a filter.
        TC_GEN_FILTER filter;
        IP_PATTERN pattern{};
        IP_PATTERN mask{};
    
        filter.AddressType = NDIS_PROTOCOL_ID_TCP_IP;
        filter.Pattern = &pattern;
        filter.Mask = &mask;
        filter.PatternSize = sizeof(IP_PATTERN);
    
        pattern.ProtocolId = 17; //Means UDP
        pattern.DstAddr = destination.GetSystemReadableIP();
        pattern.tcDstPort = 0
    
        mask.ProtocolId = UCHAR_MAX;
        mask.DstAddr = ULONG_MAX;
        mask.tcDstPort = 0;
    
        HANDLE filter_handle;
        auto err = TcAddFilter(flow->handle, &filter, &filter_handle);

    It returns zero which means no errors and using Wireshark I can see that the RTCP packets (which are based on UDP) have DSCP values set on 46 (EF) but UDP packets with raw data have no DSCP. When I close my app, the RTCP packets also go back to zero DSCP which means no other process handles this value assignment.

    But if I use Group Policy Editor, I am able to assign 46 to both RTCP and UDP packets.

    Please tell me what is wrong with my code?
    Monday, July 17, 2017 8:43 AM

All replies