version 1 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
ARP |
|
|
2 |
!!!ARP |
|
|
3 |
NAME |
|
|
4 |
DESCRIPTION |
|
|
5 |
IOCTLS |
|
|
6 |
SYSCTLS |
|
|
7 |
BUGS |
|
|
8 |
VERSIONS |
|
|
9 |
SEE ALSO |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
arp - Linux ARP kernel module. |
|
|
15 |
!!DESCRIPTION |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
This kernel protocol module implements the Address |
|
|
19 |
Resolution Protocol defined in RFC 826. It is used to |
|
|
20 |
convert between Layer2 hardware addresses and IPv4 protocol |
|
|
21 |
addresses on directly connected networks. The user normally |
|
|
22 |
doesn't interact directly with this module except to |
|
|
23 |
configure it; instead it provides a service for other |
|
|
24 |
protocols in the kernel. |
|
|
25 |
|
|
|
26 |
|
|
|
27 |
A user process can receive ARP packets by using |
|
|
28 |
packet(7) sockets. There is also a mechanism for |
|
|
29 |
managing the ARP cache in user-space by using |
|
|
30 |
netlink(7) sockets. The ARP table can also be |
|
|
31 |
controlled via __ioctl (2)__ on any __PF_INET__ |
|
|
32 |
socket. |
|
|
33 |
|
|
|
34 |
|
|
|
35 |
The ARP module maintains a cache of mappings between |
|
|
36 |
hardware addresses and protocol addresses. The cache has a |
|
|
37 |
limited size so old and less frequently used entries are |
|
|
38 |
garbage-collected. Entries which are marked as permanent are |
|
|
39 |
never deleted by the garbage-collector. The cache can be |
|
|
40 |
directly manipulated by the use of ioctls and its behaviour |
|
|
41 |
can be tuned by the sysctls defined below. |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
When there is no positive feedback for an existing mapping |
|
|
45 |
after some time (see the sysctls below) a neighbour cache |
|
|
46 |
entry is considered stale. Positive feedback can be gotten |
|
|
47 |
from a higher layer; for example from a successful TCP ACK. |
|
|
48 |
Other protocols can signal forward progress using the |
|
|
49 |
__MSG_CONFIRM__ flag to sendmsg(2). When there is |
|
|
50 |
no forward progress ARP tries to reprobe. It first tries to |
|
|
51 |
ask a local arp daemon __app_solicit__ times for an |
|
|
52 |
updated MAC address. If that fails and an old MAC address is |
|
|
53 |
known an unicast probe is send __ucast_solicit__ times. |
|
|
54 |
If that fails too it will broadcast a new ARP request to the |
|
|
55 |
network. Requests are only send when there is data queued |
|
|
56 |
for sending. |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
Linux will automatically add a non-permanent proxy arp entry |
|
|
60 |
when it receives a request for an address it forwards to and |
|
|
61 |
proxy arp is enabled on the receiving interface. When there |
|
|
62 |
is a reject route for the target no proxy arp entry is |
|
|
63 |
added. |
|
|
64 |
!!IOCTLS |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
Three ioctls are available on all __PF_INET__ sockets. |
|
|
68 |
They take a pointer to a __struct arpreq__ as their |
|
|
69 |
parameter. |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
struct arpreq |
|
|
73 |
{ |
|
|
74 |
struct sockaddr arp_pa; /* protocol address */ |
|
|
75 |
struct sockaddr arp_ha; /* hardware address */ |
|
|
76 |
int arp_flags; /* flags */ |
|
|
77 |
struct sockaddr arp_netmask; /* netmask of protocol address */ |
|
|
78 |
char arp_dev[[16]; |
|
|
79 |
}; |
|
|
80 |
__SIOCSARP__, __SIOCDARP__ and __SIOCGARP__ respectively set, delete and get an ARP mapping. Setting __CAP_NET_ADMIN__ capability or an effective UID of 0. |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
''arp_pa'' must be an __AF_INET__ socket and |
|
|
84 |
''arp_ha'' must have the same type as the device which is |
|
|
85 |
specified in ''arp_dev''. ''arp_dev'' is a |
|
|
86 |
zero-terminated string which names a device. |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
If the __ATF_NETMASK__ flag is set, then ''arp_netmask'' should be valid. Linux 2.2 does not support proxy network ARP entries, so this should be set to 0xffffffff, or 0 to remove an existing proxy arp entry. __ATF_USETRAILERS__ is obsolete and should not be used. |
|
|
90 |
!!SYSCTLS |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
ARP supports a sysctl interface to configure parameters on a |
|
|
94 |
global or per-interface basis. The sysctls can be accessed |
|
|
95 |
by reading or writing the |
|
|
96 |
__/proc/sys/net/ipv4/neigh/*/*__ files or with the |
|
|
97 |
sysctl(2) interface. Each interface in the system has |
|
|
98 |
its own directory in /proc/sys/net/ipv4/neigh/. The setting |
|
|
99 |
in the `default' directory is used for all newly created |
|
|
100 |
devices. Unless otherwise specified time related sysctls are |
|
|
101 |
specified in seconds. |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
__anycast_delay__ |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
The maximum number of jiffies to delay before replying to a |
|
|
108 |
IPv6 neighbour solicitation message. Anycast support is not |
|
|
109 |
yet implemented. Defaults to 1 second. |
|
|
110 |
|
|
|
111 |
|
|
|
112 |
__app_solicit__ |
|
|
113 |
|
|
|
114 |
|
|
|
115 |
The maximum number of probes to send to the user space ARP |
|
|
116 |
daemon via netlink before dropping back to multicast probes |
|
|
117 |
(see ''mcast_solicit''). Defaults to 0. |
|
|
118 |
|
|
|
119 |
|
|
|
120 |
__base_reachable_time__ |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
Once a neighbour has been found, the entry is considered to |
|
|
124 |
be valid for at least a random value between |
|
|
125 |
''base_reachable_time''/2 and |
|
|
126 |
3*''base_reachable_time''/2. An entry's validity will be |
|
|
127 |
extended if it receives positive feedback from higher level |
|
|
128 |
protocols. Defaults to 30 seconds. |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
__delay_first_probe_time__ |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
Delay before first probe after it has been decided that a |
|
|
135 |
neighbour is stale. Defaults to 5 seconds. |
|
|
136 |
|
|
|
137 |
|
|
|
138 |
__gc_interval__ |
|
|
139 |
|
|
|
140 |
|
|
|
141 |
How frequently the garbage collector for neighbour entries |
|
|
142 |
should attempt to run. Defaults to 30 seconds. |
|
|
143 |
|
|
|
144 |
|
|
|
145 |
__gc_stale_time__ |
|
|
146 |
|
|
|
147 |
|
|
|
148 |
Determines how often to check for stale neighbour entries. |
|
|
149 |
When a neighbour entry is considered stale it is resolved |
|
|
150 |
again before sending data to it. Defaults to 60 |
|
|
151 |
seconds. |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
__gc_thresh1__ |
|
|
155 |
|
|
|
156 |
|
|
|
157 |
The minimum number of entries to keep in the ARP cache. The |
|
|
158 |
garbage collector will not run if there are fewer than this |
|
|
159 |
number of entries in the cache. Defaults to |
|
|
160 |
128. |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
__gc_thresh2__ |
|
|
164 |
|
|
|
165 |
|
|
|
166 |
The soft maximum number of entries to keep in the ARP cache. |
|
|
167 |
The garbage collector will allow the number of entries to |
|
|
168 |
exceed this for 5 seconds before collection will be |
|
|
169 |
performed. Defaults to 512. |
|
|
170 |
|
|
|
171 |
|
|
|
172 |
__gc_thresh3__ |
|
|
173 |
|
|
|
174 |
|
|
|
175 |
The hard maximum number of entries to keep in the ARP cache. |
|
|
176 |
The garbage collector will always run if there are more than |
|
|
177 |
this number of entries in the cache. Defaults to |
|
|
178 |
1024. |
|
|
179 |
|
|
|
180 |
|
|
|
181 |
__locktime__ |
|
|
182 |
|
|
|
183 |
|
|
|
184 |
The minimum number of jiffies to keep an ARP entry in the |
|
|
185 |
cache. This prevents ARP cache thrashing if there is more |
|
|
186 |
than one potential mapping (generally due to network |
|
|
187 |
misconfiguration). Defaults to 1 second. |
|
|
188 |
|
|
|
189 |
|
|
|
190 |
__mcast_solicit__ |
|
|
191 |
|
|
|
192 |
|
|
|
193 |
The maximum number of attempts to resolve an address by |
|
|
194 |
multicast/broadcast before marking the entry as unreachable. |
|
|
195 |
Defaults to 3. |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
__proxy_delay__ |
|
|
199 |
|
|
|
200 |
|
|
|
201 |
When an ARP request for a known proxy-ARP address is |
|
|
202 |
received, delay up to ''proxy_delay'' jiffies before |
|
|
203 |
replying. This is used to prevent network flooding in some |
|
|
204 |
cases. Defaults to 0.8 seconds. |
|
|
205 |
|
|
|
206 |
|
|
|
207 |
__proxy_qlen__ |
|
|
208 |
|
|
|
209 |
|
|
|
210 |
The maximum number of packets which may be queued to |
|
|
211 |
proxy-ARP addresses. Defaults to 64. |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
__retrans_time__ |
|
|
215 |
|
|
|
216 |
|
|
|
217 |
The number of jiffies to delay before retransmitting a |
|
|
218 |
request. Defaults to 1 second. |
|
|
219 |
|
|
|
220 |
|
|
|
221 |
__ucast_solicit__ |
|
|
222 |
|
|
|
223 |
|
|
|
224 |
The maximum number of attempts to send unicast probes before |
|
|
225 |
asking the ARP daemon (see ''app_solicit''). Defaults to |
|
|
226 |
3. |
|
|
227 |
|
|
|
228 |
|
|
|
229 |
__unres_qlen__ |
|
|
230 |
|
|
|
231 |
|
|
|
232 |
The maximum number of packets which may be queued for each |
|
|
233 |
unresolved address by other network layers. Defaults to |
|
|
234 |
3. |
|
|
235 |
!!BUGS |
|
|
236 |
|
|
|
237 |
|
|
|
238 |
Some timer settings are specified in jiffies, which is |
|
|
239 |
architecture related. On the Alpha a jiffy is 1/1024 of a |
|
|
240 |
second, on most other architectures it is |
|
|
241 |
1/100s. |
|
|
242 |
|
|
|
243 |
|
|
|
244 |
There is no way to signal positive feedback from user space. |
|
|
245 |
This means connection oriented protocols implemented in user |
|
|
246 |
space will generate excessive ARP traffic, because ndisc |
|
|
247 |
will regularly reprobe the MAC address. The same problem |
|
|
248 |
applies for some kernel protocols (e.g. NFS over |
|
|
249 |
UDP). |
|
|
250 |
|
|
|
251 |
|
|
|
252 |
This man page mashes IPv4 specific and shared between IPv4 |
|
|
253 |
and IPv6 functionality together. |
|
|
254 |
!!VERSIONS |
|
|
255 |
|
|
|
256 |
|
|
|
257 |
The __struct arpreq__ changed in Linux 2.0 to include the |
|
|
258 |
''arp_dev'' member and the ioctl numbers changed at the |
|
|
259 |
same time. Support for the old ioctls was dropped in Linux |
|
|
260 |
2.2. |
|
|
261 |
|
|
|
262 |
|
|
|
263 |
Support for proxy arp entries for networks (netmask not |
|
|
264 |
equal 0xffffffff) was dropped in Linux 2.2. It is replaced |
|
|
265 |
by automatic proxy arp setup by the kernel for all reachable |
|
|
266 |
hosts on other interfaces (when forwarding and proxy arp is |
|
|
267 |
enabled for the interface). |
|
|
268 |
|
|
|
269 |
|
|
|
270 |
The neigh/* sysctls did not exist before Linux |
|
|
271 |
2.2. |
|
|
272 |
!!SEE ALSO |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
ip(7) |
|
|
276 |
|
|
|
277 |
|
|
|
278 |
RFC826 for a description of ARP. |
|
|
279 |
RFC2461 for a description of IPv6 neighbour discovery and |
|
|
280 |
the base algorithms used. |
|
|
281 |
|
|
|
282 |
|
|
|
283 |
Linux 2.2+ IPv4 ARP uses the IPv6 algorithms when |
|
|
284 |
applicable. |
|
|
285 |
---- |