3 ss \- another utility to investigate sockets
6 .RI [ options ] " [ FILTER ]"
9 is used to dump socket statistics. It allows showing information similar
12 It can display more TCP and state information than other tools.
15 When no option is used ss displays a list of open non-listening
16 sockets (e.g. TCP/UNIX/UDP) that have established connection.
19 Show summary of options.
22 Output version information.
28 Print each socket's data on a single line.
31 Do not try to resolve service names. Show exact bandwidth values, instead of human-readable.
34 Try to resolve numeric address/ports.
37 Display both listening and non-listening (for TCP this means
38 established connections) sockets.
41 Display only listening sockets (these are omitted by default).
44 Show timer information. For TCP protocol, the output format is:
47 timer:(<timer_name>,<expire_time>,<retrans>)
51 the name of the timer, there are five kind of timer names:
55 : means one of these timers: TCP retrans timer, TCP early retrans
56 timer and tail loss probe timer
58 .BR keepalive ": tcp keep alive timer"
60 .BR timewait ": timewait stage timer"
62 .BR persist ": zero window probe timer"
64 .BR unknown ": none of the above timers"
68 how long time the timer will expire
72 how many times the retransmission occured
76 Show detailed socket information. The output format is:
79 uid:<uid_number> ino:<inode_number> sk:<cookie>
83 the user id the socket belongs to
87 the socket's inode number in VFS
95 Show socket memory usage. The output format is:
98 skmem:(r<rmem_alloc>,rb<rcv_buf>,t<wmem_alloc>,tb<snd_buf>,
102 f<fwd_alloc>,w<wmem_queued>,o<opt_mem>,
108 bl<back_log>,d<sock_drop>)
114 the memory allocated for receiving packet
118 the total memory can be allocated for receiving packet
122 the memory used for sending packet (which has been sent to layer 3)
126 the total memory can be allocated for sending packet
130 the memory allocated by the socket as cache, but not used for
131 receiving/sending packet yet. If need memory to send/receive packet,
132 the memory in this cache will be used before allocate additional
137 The memory allocated for sending packet (which has not been sent to layer 3)
141 The memory used for storing socket option, e.g., the key for TCP MD5 signature
145 The memory used for the sk backlog queue. On a process context, if the
146 process is receiving packet, and a new packet is received, it will be
147 put into the sk backlog queue, so it can be received by the process
152 the number of packets dropped before they are de-multiplexed into the socket
155 .B \-p, \-\-processes
156 Show process using socket.
159 Show internal TCP information. Below fields may appear:
164 show string "ts" if the timestamp option is set
168 show string "sack" if the sack option is set
172 show string "ecn" if the explicit congestion notification option is set
176 show string "ecnseen" if the saw ecn flag is found in received packets
180 show string "fastopen" if the fastopen option is set
184 the congestion algorithm name, the default congestion algorithm is "cubic"
187 .B wscale:<snd_wscale>:<rcv_wscale>
188 if window scale option is used, this field shows the send scale factor
189 and receive scale factor
193 tcp re-transmission timeout value, the unit is millisecond
196 .B backoff:<icsk_backoff>
197 used for exponential backoff re-transmission, the actual
198 re-transmission timeout value is icsk_rto << icsk_backoff
201 .B rtt:<rtt>/<rttvar>
202 rtt is the average round trip time, rttvar is the mean deviation of
203 rtt, their units are millisecond
207 ack timeout, unit is millisecond, used for delay ack mode
215 congestion window size
222 .B ssthresh:<ssthresh>
223 tcp congestion window slow start threshold
226 .B bytes_acked:<bytes_acked>
230 .B bytes_received:<bytes_received>
234 .B segs_out:<segs_out>
242 .B send <send_bps>bps
247 how long time since the last packet sent, the unit is millisecond
251 how long time since the last packet received, the unit is millisecond
255 how long time since the last ack received, the unit is millisecond
258 .B pacing_rate <pacing_rate>bps/<max_pacing_rate>bps
259 the pacing rate and max pacing rate
262 .B rcv_space:<rcv_space>
263 a helper variable for TCP internal auto tuning socket receive buffer
266 .B tcp-ulp-mptcp flags:[MmBbJjecv] token:<rem_token(rem_id)/loc_token(loc_id)> seq:<sn> sfseq:<ssn> ssnoff:<off> maplen:<maplen>
267 MPTCP subflow information
272 Show ToS and priority information. Below fields may appear:
277 IPv4 Type-of-Service byte
281 IPv6 Traffic Class byte
285 Class id set by net_cls cgroup. If class is zero this shows priority
290 Show cgroup information. Below fields may appear:
295 Cgroup v2 pathname. This pathname is relative to the mount point of the hierarchy.
299 Attempts to forcibly close sockets. This option displays sockets that are
300 successfully closed and silently skips sockets that the kernel does not support
301 closing. It supports IPv4 and IPv6 sockets only.
304 Print summary statistics. This option does not parse socket lists obtaining
305 summary from various sources. It is useful when amount of sockets is so huge
306 that parsing /proc/net/tcp is painful.
309 Continually display sockets as they are destroyed
314 option but also shows process security context.
318 sockets the initiating process context is displayed as follows:
322 If valid pid show the process context.
324 If destination is kernel (pid = 0) show kernel initial context.
326 If a unique identifier has been allocated by the kernel or netlink user,
327 show context as "unavailable". This will generally indicate that a
328 process has more than one netlink socket active.
335 option but also shows the socket context. The socket context is
336 taken from the associated inode and is not the actual socket
337 context held by the kernel. Sockets are typically labeled with the
338 context of the creating process, however the context shown will reflect
339 any policy role, type and/or range transition rules applied,
340 and is therefore a useful reference.
342 .B \-N NSNAME, \-\-net=NSNAME
343 Switch to the specified network namespace name.
346 Show socket BPF filters (only administrators are allowed to get these
350 Display only IP version 4 sockets (alias for -f inet).
353 Display only IP version 6 sockets (alias for -f inet6).
356 Display PACKET sockets (alias for -f link).
365 Display DCCP sockets.
371 Display Unix domain sockets (alias for -f unix).
374 Display SCTP sockets.
377 Display vsock sockets (alias for -f vsock).
380 Display XDP sockets (alias for -f xdp).
383 Display inet socket options.
385 .B \-f FAMILY, \-\-family=FAMILY
386 Display sockets of type FAMILY. Currently the following families are
387 supported: unix, inet, inet6, link, netlink, vsock, xdp.
389 .B \-A QUERY, \-\-query=QUERY, \-\-socket=QUERY
390 List of socket tables to dump, separated by commas. The following identifiers
391 are understood: all, inet, tcp, udp, raw, unix, packet, netlink, unix_dgram,
392 unix_stream, unix_seqpacket, packet_raw, packet_dgram, dccp, sctp,
393 vsock_stream, vsock_dgram, xdp Any item in the list may optionally be
394 prefixed by an exclamation mark
396 to exclude that socket table from being dumped.
398 .B \-D FILE, \-\-diag=FILE
399 Do not display anything, just dump raw information about TCP sockets
400 to FILE after applying filters. If FILE is - stdout is used.
402 .B \-F FILE, \-\-filter=FILE
403 Read filter information from FILE. Each line of FILE is interpreted
404 like single command line option. If FILE is - stdin is used.
406 .B FILTER := [ state STATE-FILTER ] [ EXPRESSION ]
407 Please take a look at the official documentation for details regarding filters.
412 allows to construct arbitrary set of states to match. Its syntax is
413 sequence of keywords state and exclude followed by identifier of
416 Available identifiers are:
418 All standard TCP states:
419 .BR established ", " syn-sent ", " syn-recv ", " fin-wait-1 ", " fin-wait-2 ", " time-wait ", " closed ", " close-wait ", " last-ack ", "
420 .BR listening " and " closing.
426 - all the states except for
427 .BR listening " and " closed
436 - states, which are maintained as minisockets, i.e.
437 .BR time-wait " and " syn-recv
446 Display all TCP sockets.
449 Display all TCP sockets with process SELinux security contexts.
452 Display all UDP sockets.
454 .B ss -o state established '( dport = :ssh or sport = :ssh )'
455 Display all established ssh connections.
457 .B ss -x src /tmp/.X11-unix/*
458 Find all local processes connected to X server.
460 .B ss -o state fin-wait-1 '( sport = :http or sport = :https )' dst 193.233.7/24
461 List all the tcp sockets in state FIN-WAIT-1 for our apache to network
462 193.233.7/24 and look at their timers.
464 .B ss -a -A 'all,!tcp'
465 List sockets in all states from all socket tables but TCP.
470 - https://tools.ietf.org/rfc/rfc793.txt (TCP states)
474 was written by Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>.
476 This manual page was written by Michael Prokop <mika@grml.org>
477 for the Debian project (but may be used by others).