Debian Codegraph @

upstream/debian-trixie/man5/proc_pid_net.5

raw
1 .\" Copyright (C) 1994, 1995, Daniel Quinlan <[email protected]>
2 .\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <[email protected]>
3 .\" Copyright (C) , Alan Cox <[email protected]>
4 .\" Copyright (C) 2023, Alejandro Colomar <[email protected]>
5 .\"
6 .\" SPDX-License-Identifier: GPL-3.0-or-later
7 .\"
8 .TH proc_pid_net 5 2024-05-02 "Linux man-pages 6.9.1"
9 .SH NAME
10 /proc/pid/net/, /proc/net/ \- network layer information
11 .SH DESCRIPTION
12 .TP
13 .IR /proc/ pid /net/ " (since Linux 2.6.25)"
14 See the description of
15 .IR /proc/net .
16 .TP
17 .I /proc/net/
18 This directory contains various files and subdirectories containing
19 information about the networking layer.
20 The files contain ASCII structures and are,
21 therefore, readable with
22 .BR cat (1).
23 However, the standard
24 .BR netstat (8)
25 suite provides much cleaner access to these files.
26 .IP
27 With the advent of network namespaces,
28 various information relating to the network stack is virtualized (see
29 .BR network_namespaces (7)).
30 Thus, since Linux 2.6.25,
31 .\" commit e9720acd728a46cb40daa52c99a979f7c4ff195c
32 .I /proc/net
33 is a symbolic link to the directory
34 .IR /proc/self/net ,
35 which contains the same files and directories as listed below.
36 However, these files and directories now expose information
37 for the network namespace of which the process is a member.
38 .TP
39 .I /proc/net/arp
40 This holds an ASCII readable dump of the kernel ARP table used for
41 address resolutions.
42 It will show both dynamically learned and preprogrammed ARP entries.
43 The format is:
44 .IP
45 .in +4n
46 .EX
47 IP address HW type Flags HW address Mask Device
48 192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
49 192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
50 .EE
51 .in
52 .IP
53 Here "IP address" is the IPv4 address of the machine and the "HW type"
54 is the hardware type of the address from RFC\ 826.
55 The flags are the internal
56 flags of the ARP structure (as defined in
57 .IR /usr/include/linux/if_arp.h )
58 and
59 the "HW address" is the data link layer mapping for that IP address if
60 it is known.
61 .TP
62 .I /proc/net/dev
63 The dev pseudo-file contains network device status information.
64 This gives
65 the number of received and sent packets, the number of errors and
66 collisions
67 and other basic statistics.
68 These are used by the
69 .BR ifconfig (8)
70 program to report device status.
71 The format is:
72 .IP
73 .EX
74 Inter\-| Receive | Transmit
75 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
76 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
77 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
78 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
79 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
80 .EE
81 .\" .TP
82 .\" .I /proc/net/ipx
83 .\" No information.
84 .\" .TP
85 .\" .I /proc/net/ipx_route
86 .\" No information.
87 .TP
88 .I /proc/net/dev_mcast
89 Defined in
90 .IR /usr/src/linux/net/core/dev_mcast.c :
91 .IP
92 .in +4n
93 .EX
94 indx interface_name dmi_u dmi_g dmi_address
95 2 eth0 1 0 01005e000001
96 3 eth1 1 0 01005e000001
97 4 eth2 1 0 01005e000001
98 .EE
99 .in
100 .TP
101 .I /proc/net/igmp
102 Internet Group Management Protocol.
103 Defined in
104 .IR /usr/src/linux/net/core/igmp.c .
105 .TP
106 .I /proc/net/rarp
107 This file uses the same format as the
108 .I arp
109 file and contains the current reverse mapping database used to provide
110 .BR rarp (8)
111 reverse address lookup services.
112 If RARP is not configured into the
113 kernel,
114 this file will not be present.
115 .TP
116 .I /proc/net/raw
117 Holds a dump of the RAW socket table.
118 Much of the information is not of
119 use
120 apart from debugging.
121 The "sl" value is the kernel hash slot for the
122 socket,
123 the "local_address" is the local address and protocol number pair.
124 \&"St" is
125 the internal status of the socket.
126 The "tx_queue" and "rx_queue" are the
127 outgoing and incoming data queue in terms of kernel memory usage.
128 The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
129 The "uid"
130 field holds the effective UID of the creator of the socket.
131 .\" .TP
132 .\" .I /proc/net/route
133 .\" No information, but looks similar to
134 .\" .BR route (8).
135 .TP
136 .I /proc/net/snmp
137 This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
138 management
139 information bases for an SNMP agent.
140 .TP
141 .I /proc/net/tcp
142 Holds a dump of the TCP socket table.
143 Much of the information is not
144 of use apart from debugging.
145 The "sl" value is the kernel hash slot
146 for the socket, the "local_address" is the local address and port number pair.
147 The "rem_address" is the remote address and port number pair
148 (if connected).
149 \&"St" is the internal status of the socket.
150 The "tx_queue" and "rx_queue" are the
151 outgoing and incoming data queue in terms of kernel memory usage.
152 The "tr", "tm\->when", and "rexmits" fields hold internal information of
153 the kernel socket state and are useful only for debugging.
154 The "uid"
155 field holds the effective UID of the creator of the socket.
156 .TP
157 .I /proc/net/udp
158 Holds a dump of the UDP socket table.
159 Much of the information is not of
160 use apart from debugging.
161 The "sl" value is the kernel hash slot for the
162 socket, the "local_address" is the local address and port number pair.
163 The "rem_address" is the remote address and port number pair
164 (if connected).
165 "St" is the internal status of the socket.
166 The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
167 in terms of kernel memory usage.
168 The "tr", "tm\->when", and "rexmits" fields
169 are not used by UDP.
170 The "uid"
171 field holds the effective UID of the creator of the socket.
172 The format is:
173 .IP
174 .EX
175 sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
176 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
177 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
178 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
179 .EE
180 .TP
181 .I /proc/net/unix
182 Lists the UNIX domain sockets present within the system and their
183 status.
184 The format is:
185 .IP
186 .EX
187 Num RefCount Protocol Flags Type St Inode Path
188 0: 00000002 00000000 00000000 0001 03 42
189 1: 00000001 00000000 00010000 0001 01 1948 /dev/printer
190 .EE
191 .IP
192 The fields are as follows:
193 .RS
194 .TP 10
195 .IR Num :
196 the kernel table slot number.
197 .TP
198 .IR RefCount :
199 the number of users of the socket.
200 .TP
201 .IR Protocol :
202 currently always 0.
203 .TP
204 .IR Flags :
205 the internal kernel flags holding the status of the socket.
206 .TP
207 .IR Type :
208 the socket type.
209 For
210 .B SOCK_STREAM
211 sockets, this is 0001; for
212 .B SOCK_DGRAM
213 sockets, it is 0002; and for
214 .B SOCK_SEQPACKET
215 sockets, it is 0005.
216 .TP
217 .IR St :
218 the internal state of the socket.
219 .TP
220 .IR Inode :
221 the inode number of the socket.
222 .TP
223 .IR Path :
224 the bound pathname (if any) of the socket.
225 Sockets in the abstract namespace are included in the list,
226 and are shown with a
227 .I Path
228 that commences with the character '@'.
229 .RE
230 .TP
231 .I /proc/net/netfilter/nfnetlink_queue
232 This file contains information about netfilter user-space queueing, if used.
233 Each line represents a queue.
234 Queues that have not been subscribed to
235 by user space are not shown.
236 .IP
237 .in +4n
238 .EX
239 1 4207 0 2 65535 0 0 0 1
240 (1) (2) (3)(4) (5) (6) (7) (8)
241 .EE
242 .in
243 .IP
244 The fields in each line are:
245 .RS 7
246 .TP 5
247 (1)
248 The ID of the queue.
249 This matches what is specified in the
250 .B \-\-queue\-num
251 or
252 .B \-\-queue\-balance
253 options to the
254 .BR iptables (8)
255 NFQUEUE target.
256 See
257 .BR iptables\-extensions (8)
258 for more information.
259 .TP
260 (2)
261 The netlink port ID subscribed to the queue.
262 .TP
263 (3)
264 The number of packets currently queued and waiting to be processed by
265 the application.
266 .TP
267 (4)
268 The copy mode of the queue.
269 It is either 1 (metadata only) or 2
270 (also copy payload data to user space).
271 .TP
272 (5)
273 Copy range; that is, how many bytes of packet payload should be copied to
274 user space at most.
275 .TP
276 (6)
277 queue dropped.
278 Number of packets that had to be dropped by the kernel because
279 too many packets are already waiting for user space to send back the mandatory
280 accept/drop verdicts.
281 .TP
282 (7)
283 queue user dropped.
284 Number of packets that were dropped within the netlink
285 subsystem.
286 Such drops usually happen when the corresponding socket buffer is
287 full; that is, user space is not able to read messages fast enough.
288 .TP
289 (8)
290 sequence number.
291 Every queued packet is associated with a (32-bit)
292 monotonically increasing sequence number.
293 This shows the ID of the most recent packet queued.
294 .RE
295 .IP
296 The last number exists only for compatibility reasons and is always 1.
297 .SH SEE ALSO
298 .BR proc (5)