1SS(8)                       System Manager's Manual                      SS(8)
2
3
4

NAME

6       ss - another utility to investigate sockets
7

SYNOPSIS

9       ss [options] [ FILTER ]
10

DESCRIPTION

12       ss  is  used  to  dump socket statistics. It allows showing information
13       similar to netstat.  It can display more  TCP  and  state  informations
14       than other tools.
15
16

OPTIONS

18       When no option is used ss displays a list of open non-listening sockets
19       (e.g. TCP/UNIX/UDP) that have established connection.
20
21       -h, --help
22              Show summary of options.
23
24       -V, --version
25              Output version information.
26
27       -H, --no-header
28              Suppress header line.
29
30       -n, --numeric
31              Do not try to resolve service names.
32
33       -r, --resolve
34              Try to resolve numeric address/ports.
35
36       -a, --all
37              Display both listening and non-listening  (for  TCP  this  means
38              established connections) sockets.
39
40       -l, --listening
41              Display only listening sockets (these are omitted by default).
42
43       -o, --options
44              Show timer information. For tcp protocol, the output format is:
45
46              timer:(<timer_name>,<expire_time>,<retrans>)
47
48              <timer_name>
49                     the  name  of  the  timer,  there  are five kind of timer
50                     names:
51
52                     on: means one of these timers:  tcp  retrans  timer,  tcp
53                     early retrans timer and tail loss probe timer
54
55                     keepalive: tcp keep alive timer
56
57                     timewait: timewait stage timer
58
59                     persist: zero window probe timer
60
61                     unknown: none of the above timers
62
63              <expire_time>
64                     how long time the timer will expire
65
66              <retrans>
67                     how many times the retran occurs
68
69       -e, --extended
70              Show detailed socket information. The output format is:
71
72              uid:<uid_number> ino:<inode_number> sk:<cookie>
73
74              <uid_number>
75                     the user id the socket belongs to
76
77              <inode_number>
78                     the socket's inode number in VFS
79
80              <cookie>
81                     an uuid of the socket
82
83       -m, --memory
84              Show socket memory usage. The output format is:
85
86              skmem:(r<rmem_alloc>,rb<rcv_buf>,t<wmem_alloc>,tb<snd_buf>,
87                            f<fwd_alloc>,w<wmem_queued>,
88                            o<opt_mem>,bl<back_log>)
89
90              <rmem_alloc>
91                     the memory allocated for receiving packet
92
93              <rcv_buf>
94                     the total memory can be allocated for receiving packet
95
96              <wmem_alloc>
97                     the  memory  used for sending packet (which has been sent
98                     to layer 3)
99
100              <snd_buf>
101                     the total memory can be allocated for sending packet
102
103              <fwd_alloc>
104                     the memory allocated by the socket as cache, but not used
105                     for  receiving/sending  packet  yet.  If  need  memory to
106                     send/receive packet, the memory in  this  cache  will  be
107                     used before allocate additional memory.
108
109              <wmem_queued>
110                     The  memory  allocated  for sending packet (which has not
111                     been sent to layer 3)
112
113              <opt_mem>
114                     The memory used for storing socket option, e.g., the  key
115                     for TCP MD5 signature
116
117              <back_log>
118                     The  memory  used  for the sk backlog queue. On a process
119                     context, if the process is receiving packet,  and  a  new
120                     packet  is  received,  it will be put into the sk backlog
121                     queue, so it can be received by the process immediately
122
123       -p, --processes
124              Show process using socket.
125
126       -i, --info
127              Show internal TCP information. Below fields may appear:
128
129              ts     show string "ts" if the timestamp option is set
130
131              sack   show string "sack" if the sack option is set
132
133              ecn    show string "ecn" if the explicit congestion notification
134                     option is set
135
136              ecnseen
137                     show  string  "ecnseen"  if  the saw ecn flag is found in
138                     received packets
139
140              fastopen
141                     show string "fastopen" if the fastopen option is set
142
143              cong_alg
144                     the congestion algorithm  name,  the  default  congestion
145                     algorithm is "cubic"
146
147              wscale:<snd_wscale>:<rcv_wscale>
148                     if window scale option is used, this field shows the send
149                     scale factor and receive scale factor
150
151              rto:<icsk_rto>
152                     tcp re-transmission timeout value, the unit is  millisec‐
153                     ond
154
155              backoff:<icsk_backoff>
156                     used  for exponential backoff re-transmission, the actual
157                     re-transmission timeout value is icsk_rto << icsk_backoff
158
159              rtt:<rtt>/<rttvar>
160                     rtt is the average round trip time, rttvar  is  the  mean
161                     deviation of rtt, their units are millisecond
162
163              ato:<ato>
164                     ack timeout, unit is millisecond, used for delay ack mode
165
166              mss:<mss>
167                     max segment size
168
169              cwnd:<cwnd>
170                     congestion window size
171
172              pmtu:<pmtu>
173                     path MTU value
174
175              ssthresh:<ssthresh>
176                     tcp congestion window slow start threshold
177
178              bytes_acked:<bytes_acked>
179                     bytes acked
180
181              bytes_received:<bytes_received>
182                     bytes received
183
184              segs_out:<segs_out>
185                     segments sent out
186
187              segs_in:<segs_in>
188                     segments received
189
190              send <send_bps>bps
191                     egress bps
192
193              lastsnd:<lastsnd>
194                     how  long  time  since  the last packet sent, the unit is
195                     millisecond
196
197              lastrcv:<lastrcv>
198                     how long time since the last packet received, the unit is
199                     millisecond
200
201              lastack:<lastack>
202                     how  long  time  since the last ack received, the unit is
203                     millisecond
204
205              pacing_rate <pacing_rate>bps/<max_pacing_rate>bps
206                     the pacing rate and max pacing rate
207
208              rcv_space:<rcv_space>
209                     a helper variable for TCP  internal  auto  tuning  socket
210                     receive buffer
211
212       -K, --kill
213              Attempts to forcibly close sockets. This option displays sockets
214              that are successfully closed and silently skips sockets that the
215              kernel does not support closing. It supports IPv4 and IPv6 sock‐
216              ets only.
217
218       -s, --summary
219              Print summary statistics. This  option  does  not  parse  socket
220              lists  obtaining summary from various sources. It is useful when
221              amount of sockets is  so  huge  that  parsing  /proc/net/tcp  is
222              painful.
223
224       -E, --events
225              Continually display sockets as they are destroyed
226
227       -Z, --context
228              As the -p option but also shows process security context.
229
230              For  netlink(7)  sockets  the initiating process context is dis‐
231              played as follows:
232
233                     1.  If valid pid show the process context.
234
235                     2.  If destination is kernel (pid = 0) show  kernel  ini‐
236                         tial context.
237
238                     3.  If a unique identifier has been allocated by the ker‐
239                         nel or netlink user, show context  as  "unavailable".
240                         This  will generally indicate that a process has more
241                         than one netlink socket active.
242
243       -z, --contexts
244              As the -Z option but also shows the socket context.  The  socket
245              context is taken from the associated inode and is not the actual
246              socket context held by the kernel. Sockets are typically labeled
247              with  the  context  of the creating process, however the context
248              shown will reflect any policy role, type and/or range transition
249              rules applied, and is therefore a useful reference.
250
251       -N NSNAME, --net=NSNAME
252              Switch to the specified network namespace name.
253
254       -b, --bpf
255              Show  socket BPF filters (only administrators are allowed to get
256              these information).
257
258       -4, --ipv4
259              Display only IP version 4 sockets (alias for -f inet).
260
261       -6, --ipv6
262              Display only IP version 6 sockets (alias for -f inet6).
263
264       -0, --packet
265              Display PACKET sockets (alias for -f link).
266
267       -t, --tcp
268              Display TCP sockets.
269
270       -u, --udp
271              Display UDP sockets.
272
273       -d, --dccp
274              Display DCCP sockets.
275
276       -w, --raw
277              Display RAW sockets.
278
279       -x, --unix
280              Display Unix domain sockets (alias for -f unix).
281
282       -S, --sctp
283              Display SCTP sockets.
284
285       --vsock
286              Display vsock sockets (alias for -f vsock).
287
288       -f FAMILY, --family=FAMILY
289              Display sockets of type FAMILY.  Currently the  following  fami‐
290              lies are supported: unix, inet, inet6, link, netlink, vsock.
291
292       -A QUERY, --query=QUERY, --socket=QUERY
293              List  of socket tables to dump, separated by commas. The follow‐
294              ing identifiers are understood: all, inet, tcp, udp, raw,  unix,
295              packet,   netlink,   unix_dgram,   unix_stream,  unix_seqpacket,
296              packet_raw, packet_dgram, dccp, sctp, vsock_stream, vsock_dgram.
297              Any  item  in the list may optionally be prefixed by an exclama‐
298              tion mark (!)  to exclude that socket table from being dumped.
299
300       -D FILE, --diag=FILE
301              Do not display anything, just dump  raw  information  about  TCP
302              sockets  to  FILE after applying filters. If FILE is - stdout is
303              used.
304
305       -F FILE, --filter=FILE
306              Read filter information from FILE.  Each line of FILE is  inter‐
307              preted  like  single  command line option. If FILE is - stdin is
308              used.
309
310       FILTER := [ state STATE-FILTER ] [ EXPRESSION ]
311              Please take a look at the  official  documentation  for  details
312              regarding filters.
313
314

STATE-FILTER

316       STATE-FILTER  allows to construct arbitrary set of states to match. Its
317       syntax is sequence of keywords state and exclude followed by identifier
318       of state.
319
320       Available identifiers are:
321
322              All  standard  TCP states: established, syn-sent, syn-recv, fin-
323              wait-1, fin-wait-2,  time-wait,  closed,  close-wait,  last-ack,
324              listening and closing.
325
326              all - for all the states
327
328              connected - all the states except for listening and closed
329
330              synchronized - all the connected states except for syn-sent
331
332              bucket  -  states,  which  are  maintained  as minisockets, i.e.
333              time-wait and syn-recv
334
335              big - opposite to bucket
336
337

USAGE EXAMPLES

339       ss -t -a
340              Display all TCP sockets.
341
342       ss -t -a -Z
343              Display all TCP sockets with process SELinux security contexts.
344
345       ss -u -a
346              Display all UDP sockets.
347
348       ss -o state established '( dport = :ssh or sport = :ssh )'
349              Display all established ssh connections.
350
351       ss -x src /tmp/.X11-unix/*
352              Find all local processes connected to X server.
353
354       ss -o state fin-wait-1 '( sport =  :http  or  sport  =  :https  )'  dst
355       193.233.7/24
356              List  all  the tcp sockets in state FIN-WAIT-1 for our apache to
357              network 193.233.7/24 and look at their timers.
358
359       ss -a -A 'all,!tcp'
360              List sockets in all states from all socket tables but TCP.
361

SEE ALSO

363       ip(8),
364       RFC 793 - https://tools.ietf.org/rfc/rfc793.txt (TCP states)
365
366

AUTHOR

368       ss was written by Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>.
369
370       This manual page was written by Michael Prokop <mika@grml.org> for  the
371       Debian project (but may be used by others).
372
373
374
375                                                                         SS(8)
Impressum