Setting the DSCP on a socket can be done like this: socket_.set_option(boost::asio::detail::socket_option::integer<IPPROTO_IP, IP_TOS>(value << 2))
(Note the left shift to set the 6 most significant bits and clears the ecn bits.
For verifying whether the socket sets the correct DSCP values I suggest you use Wireshark or if you need to test programmatically something like pcap or bpf.