[ 
https://issues.apache.org/jira/browse/CASSANDRA-6198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13832045#comment-13832045
 ] 

sankalp kohli commented on CASSANDRA-6198:
------------------------------------------

I am having trouble setting the value on the socket. Since we create the socket 
from SocketChannel, I am not able to set the TOS. 
http://docs.oracle.com/javase/7/docs/api/java/nio/channels/SocketChannel.html
Here is a sample code I tried running on OSX and Linux in Java 1.7. The IP 
x.y.z pointed to a test cassandra instance running 2.0.2

        Socket socket = SocketChannel.open(new InetSocketAddress("x.y.z", 
7000)).socket();
        socket.setTrafficClass(8);
        System.out.println(socket.getTrafficClass());// WIll print 0
        SocketChannel channel = SocketChannel.open(new 
InetSocketAddress("x.y.z", 7000));
        channel.setOption(StandardSocketOptions.IP_TOS, 8);
        System.out.println(channel.getOption(StandardSocketOptions.IP_TOS));// 
WIll print 0
        System.out.println(channel.socket().getTrafficClass());// WIll print 0
        channel.socket().setTrafficClass(8);
        System.out.println(channel.socket().getTrafficClass()); // WIll print 0
        //This will work and prints 8
        Socket socket1 = new Socket("x.y.z", 7000);
        socket1.setTrafficClass(8);
        System.out.println(socket1.getTrafficClass()); // WIll print 8

> Distinguish streaming traffic at network level
> ----------------------------------------------
>
>                 Key: CASSANDRA-6198
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6198
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: sankalp kohli
>            Assignee: sankalp kohli
>            Priority: Minor
>
> It would be nice to have some information in the TCP packet which network 
> teams can inspect to distinguish between streaming traffic and other organic 
> cassandra traffic. This is very useful for monitoring WAN traffic. 
> Here are some solutions:
> 1) Use a different port for streaming. 
> 2) Add some IP header. 



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to