Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

If I execute ss -lu in order to view all the listening UDP sockets, then none of the sockets are displayed. If I execute ss -au, which lists all(both listening and non-listening) UDP sockets, then "listening" sockets are displayed as UNCONN:

T60:~ # lsof -n | sed -n '1p;/UDP/p'
COMMAND     PID   TID       USER   FD      TYPE     DEVICE SIZE/OFF       NODE NAME
avahi-dae   963            avahi   11u     IPv4       9088      0t0        UDP *:mdns 
avahi-dae   963            avahi   12u     IPv4       9089      0t0        UDP *:44639 
cupsd      1238             root   10u     IPv4       8160      0t0        UDP *:ipp 
dhcpcd     2072             root    7u     IPv4     532052      0t0        UDP *:bootpc 
dhclient6 13131             root    5u     IPv6      38031      0t0        UDP *:dhcpv6-client 
dhclient6 13131             root   20u     IPv4      37954      0t0        UDP *:20152 
dhclient6 13131             root   21u     IPv6      37955      0t0        UDP *:36745 
atftpd    20639             tftp    0u     IPv4     344977      0t0        UDP *:tftp 
T60:~ # netstat -lu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
udp        0      0 *:bootpc                *:*                                 
udp        0      0 *:tftp                  *:*                                 
udp        0      0 *:44639                 *:*                                 
udp        0      0 *:ipp                   *:*                                 
udp        0      0 *:20152                 *:*                                 
udp        0      0 *:mdns                  *:*                                 
udp        0      0 *:36745                 *:*                                 
udp        0      0 *:dhcpv6-client         *:*                                 
T60:~ # ss -lu
Recv-Q Send-Q                                                                                                          Local Address:Port                                                                                                              Peer Address:Port   
T60:~ # ss -ua
State       Recv-Q Send-Q                                                                                                     Local Address:Port                                                                                                         Peer Address:Port   
UNCONN      0      0                                                                                                                      *:bootpc                                                                                                                  *:*       
UNCONN      0      0                                                                                                                      *:tftp                                                                                                                    *:*       
UNCONN      0      0                                                                                                                      *:44639                                                                                                                   *:*       
UNCONN      0      0                                                                                                                      *:ipp                                                                                                                     *:*       
UNCONN      0      0                                                                                                                      *:20152                                                                                                                   *:*       
UNCONN      0      0                                                                                                                      *:mdns                                                                                                                    *:*       
UNCONN      0      0                                                                                                                     :::36745                                                                                                                  :::*       
UNCONN      0      0                                                                                                                     :::dhcpv6-client                                                                                                                :::*       
T60:~ # ss -v
ss utility, iproute2-ss110629
T60:~ # 

What is the logic behind this? For example running atftpd listening for connections, should have state LISTEN not UNCONN, shouldn't it?

share|improve this question
    
Maybe just wording? A listening socket is obviously unconnected... ;-) –  Hauke Laging Apr 17 '13 at 11:05
1  
@HaukeLaging Not to mention both sound bad considering UDP :) –  TNW Apr 17 '13 at 11:30

1 Answer 1

up vote 1 down vote accepted

UDP is a connectionless protocol. SS probably won't show one in LISTEN state, only in UCONN or ESTAB.

If I do this,

$ nc -u -l 2333

Then ss will show (in a 2nd shell):

$ ss -au|grep 2333
UNCONN     0      0                       *:2333                     *:*       

If I then connect to it (3rd shell)

$ nc -u localhost 2333

then SS shows:

$ ss -au|grep 2333
ESTAB      0      0               127.0.0.1:2333             127.0.0.1:58434   
ESTAB      0      0               127.0.0.1:58434            127.0.0.1:2333    
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.