mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere?
@ 2010-03-15 15:49 MacCana, Mike
  2010-03-15 16:20 ` Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: MacCana, Mike @ 2010-03-15 15:49 UTC (permalink / raw)
  To: linux-kernel

Hi kernel folks,
 
I was wondering if there was a standard location to see TCP socket
options (eg, nodelay, cork, etc), perhaps via procfs or some other
means? I'd like to check whether arbitrary apps (for which I don't have
code) are using particular TCP options. 
 
Wandering round /proc/net hasn't turned up anything yet, and after a
quick:
socket.setsockopt(0, 1, 1)
to enable NODELAY I can't see any obvious difference in procfs or
netstat output (where other Unixes seem to put this info). hat's the
best way to see TCP options on sockets created by others' code?

Thanks,
 
Mike
 

Mike MacCana 
Engineer
RDO Low Latency Infrastructure 
CREDIT SUISSE
Phone: +44 (0)20 7883 5907 
Mobile: +44 (0)7547 004474 
mike.maccana@credit-suisse.com  
Five Canada Square, London, E14 4QJ. 
www.credit-suisse.com 


=============================================================================== 
 Please access the attached hyperlink for an important electronic communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 =============================================================================== 
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere?
  2010-03-15 15:49 Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere? MacCana, Mike
@ 2010-03-15 16:20 ` Eric Dumazet
  2010-03-15 16:37   ` MacCana, Mike
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2010-03-15 16:20 UTC (permalink / raw)
  To: MacCana, Mike; +Cc: linux-kernel

Le lundi 15 mars 2010 à 15:49 +0000, MacCana, Mike a écrit :
> Hi kernel folks,
>  
> I was wondering if there was a standard location to see TCP socket
> options (eg, nodelay, cork, etc), perhaps via procfs or some other
> means? I'd like to check whether arbitrary apps (for which I don't have
> code) are using particular TCP options. 
>  
> Wandering round /proc/net hasn't turned up anything yet, and after a
> quick:
> socket.setsockopt(0, 1, 1)
> to enable NODELAY I can't see any obvious difference in procfs or
> netstat output (where other Unixes seem to put this info). hat's the
> best way to see TCP options on sockets created by others' code?
> 

There is limited support given by ss command (part of iproute2) :

ss -emoi

ESTAB       0      0                                55.225.18.5:4900
55.225.18.5:50000    uid:501 ino:135421 sk:c3b405c0
	 mem:(r0,w0,f4096,t0) ts bic wscale:6,6 rto:201 rtt:1/0.5 ato:40 cwnd:3
send 393.2Mbps rcv_space:32768


But CORK flag is not exported yet (its usually a volatile flag, at least
with Apache server)




^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere?
  2010-03-15 16:20 ` Eric Dumazet
@ 2010-03-15 16:37   ` MacCana, Mike
  2010-03-15 16:40     ` MacCana, Mike
  0 siblings, 1 reply; 5+ messages in thread
From: MacCana, Mike @ 2010-03-15 16:37 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: linux-kernel

 

-----Original Message-----
From: Eric Dumazet [mailto:eric.dumazet@gmail.com] 
Sent: 15 March 2010 16:21
To: MacCana, Mike
Cc: linux-kernel@vger.kernel.org
Subject: Re: Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere?

>Le lundi 15 mars 2010 à 15:49 +0000, MacCana, Mike a écrit :
>> Hi kernel folks,
>>  
>> I was wondering if there was a standard location to see TCP socket 
>> options (eg, nodelay, cork, etc), perhaps via procfs or some other 
>> means? I'd like to check whether arbitrary apps (for which I don't 
>> have
>> code) are using particular TCP options. 
>>  
>> Wandering round /proc/net hasn't turned up anything yet, and after a
>> quick:
>> socket.setsockopt(0, 1, 1)
>> to enable NODELAY I can't see any obvious difference in procfs or 
>> netstat output (where other Unixes seem to put this info). hat's the 
>> best way to see TCP options on sockets created by others' code?
>> 

>There is limited support given by ss command (part of iproute2) :
>
>ss -emoi
>
>ESTAB       0      0                                55.225.18.5:4900
>55.225.18.5:50000    uid:501 ino:135421 sk:c3b405c0
>	 mem:(r0,w0,f4096,t0) ts bic wscale:6,6 rto:201 rtt:1/0.5 ato:40 cwnd:3 send 393.2Mbps rcv_space:32768
>
> But CORK flag is not exported yet (its usually a volatile flag, at least with Apache server)

Thanks Eric. Checking here:

> sockettest.settcpoption(serversocket,'nodelay',True)    
> LISTEN     0      5                 127.0.0.1:7778                     *:*      ino:4095699 sk:0a53b500ffff8100

I can't get NODELAY either. Looking at lsof FAQ Linux seems to be limited in this regard. 

3.14.1	Why doesn't lsof report socket options, socket states, and TCP
	flags and values for my dialect?

Linux
		No socket options and values, socket states, or TCP
		flags and values are reported.  The support for "-Tf"
		could not be added to Linux, because socket options,
		socket states, and TCP flags and values are not
		available via the /proc file system.

However the SystemTap Networking Tapset provides a tcp.setsockopt breakpoint which I can 








=============================================================================== 
 Please access the attached hyperlink for an important electronic communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 =============================================================================== 
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere?
  2010-03-15 16:37   ` MacCana, Mike
@ 2010-03-15 16:40     ` MacCana, Mike
  2010-03-16 18:24       ` MacCana, Mike
  0 siblings, 1 reply; 5+ messages in thread
From: MacCana, Mike @ 2010-03-15 16:40 UTC (permalink / raw)
  To: MacCana, Mike, Eric Dumazet; +Cc: linux-kernel


-----Original Message-----
From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
Sent: 15 March 2010 16:21
To: MacCana, Mike
Cc: linux-kernel@vger.kernel.org
Subject: Re: Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere?

>Le lundi 15 mars 2010 à 15:49 +0000, MacCana, Mike a écrit :
>> Hi kernel folks,
>>  
>> I was wondering if there was a standard location to see TCP socket 
>> options (eg, nodelay, cork, etc), perhaps via procfs or some other 
>> means? I'd like to check whether arbitrary apps (for which I don't 
>> have
>> code) are using particular TCP options. 
>>  
>> Wandering round /proc/net hasn't turned up anything yet, and after a
>> quick:
>> socket.setsockopt(0, 1, 1)
>> to enable NODELAY I can't see any obvious difference in procfs or 
>> netstat output (where other Unixes seem to put this info). hat's the 
>> best way to see TCP options on sockets created by others' code?
>> 

>There is limited support given by ss command (part of iproute2) :
>
>ss -emoi
>
>ESTAB       0      0                                55.225.18.5:4900
>55.225.18.5:50000    uid:501 ino:135421 sk:c3b405c0
>	 mem:(r0,w0,f4096,t0) ts bic wscale:6,6 rto:201 rtt:1/0.5 ato:40 
>cwnd:3 send 393.2Mbps rcv_space:32768
>
> But CORK flag is not exported yet (its usually a volatile flag, at 
> least with Apache server)

Thanks Eric. Checking here:

# sockettest.settcpoption(serversocket,'nodelay',True)    

# ss -emoi
LISTEN     0      5                 127.0.0.1:7778                     *:*      ino:4095699 sk:0a53b500ffff8100

<my last reply was truncated>

I can't get NODELAY either. Looking at lsof FAQ Linux seems to be limited in this regard. 

3.14.1	Why doesn't lsof report socket options, socket states, and TCP
	flags and values for my dialect?

Linux
		No socket options and values, socket states, or TCP
		flags and values are reported.  The support for "-Tf"
		could not be added to Linux, because socket options,
		socket states, and TCP flags and values are not
		available via the /proc file system.

However the SystemTap Networking Tapset provides a tcp.setsockopt breakpoint which I can use.

Mike

1. http://gd.tuwien.ac.at/utils/admin-tools/lsof/FAQ
2. http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/pdf/SystemTap_Tapset_Reference.pdf








=============================================================================== 
 Please access the attached hyperlink for an important electronic communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 =============================================================================== 
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere?
  2010-03-15 16:40     ` MacCana, Mike
@ 2010-03-16 18:24       ` MacCana, Mike
  0 siblings, 0 replies; 5+ messages in thread
From: MacCana, Mike @ 2010-03-16 18:24 UTC (permalink / raw)
  To: linux-kernel

-----Original Message-----
From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
Sent: 15 March 2010 16:21
To: MacCana, Mike
Cc: linux-kernel@vger.kernel.org
Subject: Re: Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere?

>>Le lundi 15 mars 2010 à 15:49 +0000, MacCana, Mike a écrit :
>>> Hi kernel folks,
>>>  
>>> I was wondering if there was a standard location to see TCP socket 
>>> options (eg, nodelay, cork, etc), perhaps via procfs or some other 
>>> means? I'd like to check whether arbitrary apps (for which I don't 
>>> have
>>> code) are using particular TCP options. 

> the SystemTap Networking Tapset provides a tcp.setsockopt breakpoint which I can use.
> Mike

Here's the tap I used (included for anyone reading on a list archive if there's still no /proc implementation):

sockettest.stap
# Show sockets setting options
probe begin
{
	print ("\nChecking for apps making socket calls\n")
}
probe tcp.setsockopt
{
	printf ("  App '%s' (PID %d) set socket with args %s \n", execname(), pid(), optstr)
}

Mike

=============================================================================== 
 Please access the attached hyperlink for an important electronic communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 =============================================================================== 
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-16 18:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-15 15:49 Seeing TCP socket options (nodelay, cork, etc) in Linux procfs or elsewhere? MacCana, Mike
2010-03-15 16:20 ` Eric Dumazet
2010-03-15 16:37   ` MacCana, Mike
2010-03-15 16:40     ` MacCana, Mike
2010-03-16 18:24       ` MacCana, Mike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®