OSDN Git Service

d3b3f06fa58472fd89e9fb68f9fa6b264e1211c5
[linuxjm/LDP_man-pages.git] / original / man7 / icmp.7
1 .\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
2 .\"
3 .\" %%%LICENSE_START(VERBATIM_ONE_PARA)
4 .\" Permission is granted to distribute possibly modified copies
5 .\" of this page provided the header is included verbatim,
6 .\" and in case of nontrivial modification author and date
7 .\" of the modification is added to the header.
8 .\" %%%LICENSE_END
9 .\"
10 .\" $Id: icmp.7,v 1.6 2000/08/14 08:03:45 ak Exp $
11 .\"
12 .TH ICMP 7 2012-05-10 "Linux" "Linux Programmer's Manual"
13 .SH NAME
14 icmp \- Linux IPv4 ICMP kernel module.
15 .SH DESCRIPTION
16 This kernel protocol module implements the Internet Control
17 Message Protocol defined in RFC\ 792.
18 It is used to signal error conditions and for diagnosis.
19 The user doesn't interact directly with this module;
20 instead it communicates with the other protocols in the kernel
21 and these pass the ICMP errors to the application layers.
22 The kernel ICMP module also answers ICMP requests.
23 .PP
24 A user protocol may receive ICMP packets for all local sockets by opening
25 a raw socket with the protocol
26 .BR IPPROTO_ICMP .
27 See
28 .BR raw (7)
29 for more information.
30 The types of ICMP packets passed to the socket can be filtered using the
31 .B ICMP_FILTER
32 socket option.
33 ICMP packets are always processed by the kernel too, even
34 when passed to a user socket.
35 .LP
36 Linux limits the rate of ICMP error packets to each destination.
37 .B ICMP_REDIRECT
38 and
39 .B ICMP_DEST_UNREACH
40 are also limited by the destination route of the incoming packets.
41 .SS /proc interfaces
42 ICMP supports a set of
43 .I /proc
44 interfaces to configure some global IP parameters.
45 The parameters can be accessed by reading or writing files in the directory
46 .IR /proc/sys/net/ipv4/ .
47 Most of these parameters are rate limitations for specific ICMP types.
48 Linux 2.2 uses a token bucket filter to limit ICMPs.
49 .\" FIXME better description needed
50 The value is the timeout in jiffies until the token bucket filter is
51 cleared after a burst.
52 A jiffy is a system dependent unit, usually 10ms on i386 and
53 about 1ms on alpha and ia64.
54 .TP
55 .IR icmp_destunreach_rate " (Linux 2.2 to 2.4.9)"
56 .\" Precisely: from 2.1.102
57 Maximum rate to send ICMP Destination Unreachable packets.
58 This limits the rate at which packets are sent to any individual
59 route or destination.
60 The limit does not affect sending of
61 .B ICMP_FRAG_NEEDED
62 packets needed for path MTU discovery.
63 .TP
64 .IR icmp_echo_ignore_all " (since Linux 2.2)"
65 .\" Precisely: 2.1.68
66 If this value is nonzero, Linux will ignore all
67 .B ICMP_ECHO
68 requests.
69 .TP
70 .IR icmp_echo_ignore_broadcasts " (since Linux 2.2)"
71 .\" Precisely: from 2.1.68
72 If this value is nonzero, Linux will ignore all
73 .B ICMP_ECHO
74 packets sent to broadcast addresses.
75 .TP
76 .IR icmp_echoreply_rate " (Linux 2.2 to 2.4.9)"
77 .\" Precisely: from 2.1.102
78 Maximum rate for sending
79 .B ICMP_ECHOREPLY
80 packets in response to
81 .B ICMP_ECHOREQUEST
82 packets.
83 .TP
84 .IR icmp_errors_use_inbound_ifaddr " (Boolean; default: disabled; since Linux 2.6.12)"
85 .\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt
86 If disabled, ICMP error messages are sent with the primary address of
87 the exiting interface.
88
89 If enabled, the message will be sent with the primary address of
90 the interface that received the packet that caused the ICMP error.
91 This is the behavior that many network administrators will expect from
92 a router.
93 And it can make debugging complicated network layouts much easier.
94
95 Note that if no primary address exists for the interface selected,
96 then the primary address of the first non-loopback interface that
97 has one will be used regardless of this setting.
98 .TP
99 .IR icmp_ignore_bogus_error_responses " (Boolean; default: disabled; since Linux 2.2)"
100 .\" precisely: since 2.1.32
101 .\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt
102 Some routers violate RFC1122 by sending bogus responses to broadcast frames.
103 Such violations are normally logged via a kernel warning.
104 If this parameter is enabled, the kernel will not give such warnings,
105 which will avoid log file clutter.
106 .TP
107 .IR icmp_paramprob_rate " (Linux 2.2 to 2.4.9)"
108 .\" Precisely: from 2.1.102
109 Maximum rate for sending
110 .B ICMP_PARAMETERPROB
111 packets.
112 These packets are sent when a packet arrives with an invalid IP header.
113 .TP
114 .IR icmp_ratelimit " (integer; default: 1000; since Linux 2.4.10)"
115 .\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt
116 Limit the maximum rates for sending ICMP packets whose type matches
117 .IR icmp_ratemask
118 (see below) to specific targets.
119 0 to disable any limiting,
120 otherwise the minimum space between responses in milliseconds.
121 .TP
122 .IR icmp_ratemask " (integer; default: see below; since Linux 2.4.10)"
123 .\" The following taken from 2.6.28-rc4 Documentation/networking/ip-sysctl.txt
124 Mask made of ICMP types for which rates are being limited.
125
126 Significant bits: IHGFEDCBA9876543210
127 .br
128 Default mask:     0000001100000011000 (0x1818)
129
130 Bit definitions (see the Linux kernel source file
131 .IR include/linux/icmp.h ):
132
133 .RS 12
134 .TS
135 l l.
136 0 Echo Reply
137 3 Destination Unreachable *
138 4 Source Quench *
139 5 Redirect
140 8 Echo Request
141 B Time Exceeded *
142 C Parameter Problem *
143 D Timestamp Request
144 E Timestamp Reply
145 F Info Request
146 G Info Reply
147 H Address Mask Request
148 I Address Mask Reply
149 .TE
150 .RE
151
152 The bits marked with an asterisk are rate limited by default
153 (see the default mask above).
154 .TP
155 .IR icmp_timeexceed_rate " (Linux 2.2 to 2.4.9)"
156 Maximum rate for sending
157 .B ICMP_TIME_EXCEEDED
158 packets.
159 These packets are
160 sent to prevent loops when a packet has crossed too many hops.
161 .SH VERSIONS
162 Support for the
163 .B ICMP_ADDRESS
164 request was removed in 2.2.
165 .PP
166 Support for
167 .B ICMP_SOURCE_QUENCH
168 was removed in Linux 2.2.
169 .SH NOTES
170 As many other implementations don't support
171 .B IPPROTO_ICMP
172 raw sockets, this feature
173 should not be relied on in portable programs.
174 .\" not really true ATM
175 .\" .PP
176 .\" Linux ICMP should be compliant to RFC 1122.
177 .PP
178 .B ICMP_REDIRECT
179 packets are not sent when Linux is not acting as a router.
180 They are also accepted only from the old gateway defined in the
181 routing table and the redirect routes are expired after some time.
182 .PP
183 The 64-bit timestamp returned by
184 .B ICMP_TIMESTAMP
185 is in milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
186 .PP
187 Linux ICMP internally uses a raw socket to send ICMPs.
188 This raw socket may appear in
189 .BR netstat (8)
190 output with a zero inode.
191 .SH SEE ALSO
192 .BR ip (7)
193 .PP
194 RFC\ 792 for a description of the ICMP protocol.
195 .SH COLOPHON
196 This page is part of release 3.67 of the Linux
197 .I man-pages
198 project.
199 A description of the project,
200 information about reporting bugs,
201 and the latest version of this page,
202 can be found at
203 \%http://www.kernel.org/doc/man\-pages/.