Print this page
Clearview IPMP manpages
| Split |
Close |
| Expand all |
| Collapse all |
--- old/./arp.7p.txt
+++ new/./arp.7p.txt
1 1 NAME
2 2 arp, ARP - Address Resolution Protocol
3 3
4 4 SYNOPSIS
5 5 #include <sys/fcntl.h>
6 6
7 7 #include <sys/socket.h>
8 8
9 9 #include <net/if_arp.h>
10 10
11 11 #include <netinet/in.h>
12 12
13 13 s = socket(AF_INET, SOCK_DGRAM, 0);
14 14
15 15 d = open ("/dev/arp", oflag);
16 16
17 17 DESCRIPTION
18 18 ARP is a protocol used to map dynamically between Internet
19 19 Protocol (IP) and Ethernet addresses. It is used by all Eth-
20 20 ernet datalink providers (network drivers) and can be used
21 21 by other datalink providers that support broadcast, includ-
22 22 ing FDDI and Token Ring. The only network layer supported
23 23 in this implementation is the Internet Protocol, although
24 24 ARP is not specific to that protocol.
25 25
26 26 ARP caches IP-to-link-layer address mappings. When an inter-
27 27 face requests a mapping for an address not in the cache, ARP
28 28 queues the message that requires the mapping and broadcasts
29 29 a message on the associated network requesting the address
30 30 mapping. If a response is provided, ARP caches the new map-
31 31 ping and transmits any pending message. ARP will queue a
32 32 maximum of four packets while awaiting a response to a map-
33 33 ping request. ARP keeps only the first four transmitted
34 34 packets.
35 35
36 36 APPLICATION PROGRAMMING INTERFACE
37 37 The STREAMS device /dev/arp is not a Transport Level Inter-
38 38 face (TLI) transport provider and may not be used with the
39 39 TLI interface.
40 40
41 41 To facilitate communications with systems that do not use
42 42 ARP, ioctl() requests are provided to enter and delete
43 43 entries in the IP-to-link address tables. Ioctls that
44 44 change the table contents require sys_net_config privilege.
45 45
46 46 SunOS 5.10 Last change: 2 Dec 2008 1
47 47
48 48 Protocols arp(7P)
49 49
50 50 See privileges(5).
51 51
52 52 #include <sys/sockio.h>
53 53 #include <sys/socket.h>
54 54 #include <net/if.h>
55 55 #include <net/if_arp.h>
56 56 struct arpreq arpreq;
57 57 ioctl(s, SIOCSARP, (caddr_t)&arpreq);
58 58 ioctl(s, SIOCGARP, (caddr_t)&arpreq);
59 59 ioctl(s, SIOCDARP, (caddr_t)&arpreq);
60 60
61 61 SIOCSARP, SIOCGARP and SIOCDARP are BSD compatible ioctls.
62 62 These ioctls do not communicate the mac address length
63 63 between the user and the kernel (and thus only work for 6
64 64 byte wide Ethernet addresses). To manage the ARP cache for
65 65 media that has different sized mac addresses, use SIOCSXARP,
66 66 SIOCGXARP and SIOCDXARP ioctls.
67 67
68 68 #include <sys/sockio.h>
69 69 #include <sys/socket.h>
70 70 #include <net/if.h>
71 71 #include <net/if_dl.h>
72 72 #include <net/if_arp.h>
73 73 struct xarpreq xarpreq;
74 74 ioctl(s, SIOCSXARP, (caddr_t)&xarpreq);
75 75 ioctl(s, SIOCGXARP, (caddr_t)&xarpreq);
76 76 ioctl(s, SIOCDXARP, (caddr_t)&xarpreq);
77 77
78 78 Each ioctl() request takes the same structure as an argu-
79 79 ment. SIOCS[X]ARP sets an ARP entry, SIOCG[X]ARP gets an ARP
80 80 entry, and SIOCD[X]ARP deletes an ARP entry. These ioctl()
81 81 requests may be applied to any Internet family socket
82 82 descriptors, or to a descriptor for the ARP device. Note
83 83 that SIOCS[X]ARP and SIOCD[X]ARP require a privileged user,
84 84 while SIOCG[X]ARP does not.
85 85
86 86 The arpreq structure contains
87 87
88 88 /*
89 89 * ARP ioctl request
90 90 */
91 91 struct arpreq {
92 92 struct sockaddr arp_pa; /* protocol address */
93 93 struct sockaddr arp_ha; /* hardware address */
94 94 int arp_flags; /* flags */
95 95 };
96 96
97 97 SunOS 5.10 Last change: 2 Dec 2008 2
98 98
99 99 Protocols arp(7P)
100 100
101 101 The xarpreq structure contains:
102 102
103 103 /*
104 104 * Extended ARP ioctl request
105 105 */
106 106 struct xarpreq {
107 107 struct sockaddr_storage xarp_pa; /* protocol address */
108 108 struct sockaddr_dl xarp_ha; /* hardware address */
|
↓ open down ↓ |
108 lines elided |
↑ open up ↑ |
109 109 int xarp_flags; /* arp_flags field values */
110 110 };
111 111 #define ATF_COM 0x2 /* completed entry (arp_ha valid) */
112 112 #define ATF_PERM 0x4 /* permanent (non-aging) entry */
113 113 #define ATF_PUBL 0x8 /* publish (respond for other host) */
114 114 #define ATF_USETRAILERS 0x10 /* send trailer pckts to host */
115 115 #define ATF_AUTHORITY 0x20 /* hardware address is authoritative */
116 116
117 117 The address family for the [x]arp_pa sockaddr must be
118 118 AF_INET. The ATF_COM flag bits ([x]arp_flags) cannot be
119 - altered. ATF_USETRAILER is not implemented on Solaris and
119 + altered. ATF_USETRAILERS is not implemented on Solaris and
120 120 is retained for compatibility only. ATF_PERM makes the
121 121 entry permanent (disables aging) if the ioctl() request
122 122 succeeds. ATF_PUBL specifies that the system should respond
123 123 to ARP requests for the indicated protocol address coming
124 124 from other machines. This allows a host to act as an "ARP
125 125 server," which may be useful in convincing an ARP-only
126 126 machine to talk to a non-ARP machine. ATF_AUTHORITY indi-
127 127 cates that this machine owns the address. ARP does not
128 128 update the entry based on received packets.
129 129
130 130 The address family for the arp_ha sockaddr must be
131 131 AF_UNSPEC.
132 132
133 133 Before invoking any of the SIOC*XARP ioctls, user code must
134 134 fill in the xarp_pa field with the protocol (IP) address
135 135 information, similar to the BSD variant. The SIOC*XARP
136 136 ioctls come in two (legal) varieties, depending on
137 137 xarp_ha.sdl_nlen:
138 138 1. if sdl_nlen = 0, it behaves as an extended BSD ioctl.
139 139 The kernel uses the IP address to determine the network
140 140 interface.
141 141 2. if (sdl_nlen > 0) and (sdl_nlen < LIFNAMSIZ), the ker-
142 142 nel uses the interface name in sdl_data[0] to determine
143 143 the network interface; sdl_nlen represents the length of
144 144 the string (excluding terminating null character).
145 145 3. if (sdl_nlen >= LIFNAMSIZ), an error (EINVAL) is
146 146 flagged from the ioctl.
147 147
148 148 SunOS 5.10 Last change: 2 Dec 2008 3
149 149
150 150 Protocols arp(7P)
151 151
152 152 Other than the above, the xarp_ha structure should be 0-
153 153 filled except for SIOCSXARP, where the sdl_alen field must
154 154 be set to the size of hardware address length and the
155 155 hardware address itself must be placed in the
156 156 LLADDR/sdl_data[] area. (EINVAL will be returned if user
157 157 specified sdl_alen does not match the address length of the
158 158 identified interface).
159 159
160 160 On return from the kernel on a SIOCGXARP ioctl, the kernel
161 161 fills in the name of the interface (excluding terminating
162 162 NULL) and its hardware address, one after another, in the
163 163 sdl_data/LLADDR area; if the two are larger than can be held
|
↓ open down ↓ |
34 lines elided |
↑ open up ↑ |
164 164 in the 244 byte sdl_data[] area, an ENOSPC error is
165 165 returned. Assuming it fits, the kernel will also set
166 166 sdl_alen with the length of hardware address, sdl_nlen with
167 167 the length of name of the interface (excluding terminating
168 168 NULL), sdl_type with an IFT_* value to indicate the type of
169 169 the media, sdl_slen with 0, sdl_family with AF_LINK and
170 170 sdl_index (which if not 0) with system given index for the
171 171 interface. The information returned is very similar to that
172 172 returned via routing sockets on an RTM_IFINFO message.
173 173
174 + The ARP ioctls have several additional restrictions and
175 + enhancements when used in conjunction with IPMP:
176 +
177 + * The ARP mappings for IPMP data and test addresses are
178 + managed by the kernel, and thus cannot be changed
179 + through any ARP ioctls, though they may be retrieved
180 + using *SIOCGARP* or *SIOCGXARP*.
181 +
182 + * ARP mappings for a given IPMP group must be consistent
183 + across the group. Therefore, ARP mappings cannot be
184 + associated with individual underlying IP interfaces in
185 + an IPMP group, and must instead be associated with the
186 + corresponding IPMP IP interface.
187 +
188 + * Proxy ARP mappings for an IPMP group are automatically
189 + managed by the kernel. Specifically, if the hardware
190 + address in a *SIOCSARP* or *SIOCSXARP* request matches
191 + the hardware address of an IP interface in an IPMP
192 + group, and the IP address is not local to the system,
193 + the kernel will regard this as a IPMP Proxy ARP entry.
194 + This IPMP Proxy ARP entry will have its hardware
195 + address automatically adjusted in order to keep the IP
196 + address reachable (provided the IPMP group has not
197 + entirely failed).
198 +
174 199 ARP performs duplicate address detection for local
175 200 addresses. When a logical interface is brought up (IFF_UP)
176 201 or any time the hardware link goes up (IFF_RUNNING), ARP
177 202 sends probes (ar$spa == 0) for the assigned address. If a
178 203 conflict is found, the interface is torn down. See
179 204 ifconfig(1M) for more details.
180 205
181 206 ARP watches for hosts impersonating the local host, that is,
182 207 any host that responds to an ARP request for the local
183 208 host's address, and any address for which the local host is
184 209 an authority. ARP defends local addresses and logs those
185 210 with ATF_AUTHORITY set, and can tear down local addresses on
186 211 an excess of conflicts.
187 212
188 213 ARP also handles UNARP messages received from other nodes.
189 214 It does not generate these messages.
190 215
191 216 PACKET EVENTS
192 217 The arp driver registers itself with the netinfo interface.
193 218 To gain access to these events, a handle from
194 219 net_protocol_lookup must be acquired by passing it the value
195 220 NHF_ARP. Through this interface, two packet events are sup-
196 221 ported:
197 222
198 223 SunOS 5.10 Last change: 2 Dec 2008 4
199 224
200 225 Protocols arp(7P)
201 226
202 227 Physical in - ARP packets received via a network inter face
203 228
204 229 Physical out - ARP packets to be sent out via a network
205 230 interface
206 231
207 232 For ARP packets, the hook_pkt_event structure is filled out
208 233 as follows:
209 234
210 235 hpe_ifp
211 236
212 237 Identifier indicating the inbound interface for pack-
213 238 ets received with the "physical in" event.
214 239
215 240 hpe_ofp
216 241
217 242 Identifier indicating the outbound interface for pack-
218 243 ets received with the "physical out" event.
219 244
220 245 hpe_hdr
221 246
222 247 Pointer to the start of the ARP header (not the eth-
223 248 ernet header).
224 249
225 250 hpe_mp
226 251
227 252 Pointer to the start of the mblk_t chain containing the
228 253 ARP packet.
229 254
230 255 hpe_mb
231 256
232 257 Pointer to the mblk_t with the ARP header in it.
233 258
234 259 NETWORK INTERFACE EVENTS
235 260 In addition to events describing packets as they move
236 261 through the system, it is also possible to receive notifica-
237 262 tion of events relating to network interfaces. These events
238 263 are all reported back through the same callback. The list
239 264 of events is as follows:
240 265
241 266 plumb
242 267
243 268 A new network interface has been instantiated.
244 269
245 270 SunOS 5.10 Last change: 2 Dec 2008 5
246 271
247 272 Protocols arp(7P)
248 273
249 274 unplumb
250 275
251 276 A network interface is no longer associated with ARP.
252 277
253 278 SEE ALSO
254 279 arp(1M), ifconfig(1M), privileges(5), if_tcp(7P), inet(7P),
255 280 netinfo(9F)
256 281
257 282 Plummer, Dave, An Ethernet Address Resolution Protocol or
258 283 Converting Network Protocol Addresses to 48 .bit Ethernet
259 284 Addresses for Transmission on Ethernet Hardware, RFC 826,
260 285 STD 0037, November 1982.
261 286
262 287 Malkin, Gary, ARP Extension - UNARP, RFC 1868, November,
263 288 1995
264 289
265 290 DIAGNOSTICS
266 291 Several messages can be written to the system logs (by the
267 292 IP module) when errors occur. In the following examples, the
268 293 hardware address strings include colon (:) separated ASCII
269 294 representations of the link layer addresses, whose lengths
270 295 depend on the underlying media (for example, 6 bytes for
271 296 Ethernet).
272 297
273 298 Node %x:%x ... %x:%x is using our IP address %d.%d.%d.%d on
274 299 %s.
275 300
276 301 Duplicate IP address warning. ARP has discovered another
277 302 host on a local network that responds to mapping
278 303 requests for the Internet address of this system, and
279 304 has defended the system against this node by re-
280 305 announcing the ARP entry.
281 306
282 307 %s has duplicate address %d.%d.%d.%d (in use by %x:%x ...
283 308 %x:%x); disabled.
284 309
285 310 Duplicate IP address detected while performing initial
286 311 probing. The newly-configured interface has been shut
287 312 down.
288 313
289 314 %s has duplicate address %d.%d.%d.%d (claimed by %x:%x ...
290 315 %x:%x); disabled.
291 316
292 317 Duplicate IP address detected on a running IP interface.
293 318 The conflict cannot be resolved, and the interface has
294 319 been disabled to protect the network.
295 320
296 321 SunOS 5.10 Last change: 2 Dec 2008 6
297 322
298 323 Protocols arp(7P)
299 324
300 325 Recovered address %d.%d.%d.%d on %s.
301 326
302 327 An interface with a previously-conflicting IP address
303 328 has been recovered automatically and reenabled. The con-
304 329 flict has been resolved.
305 330
306 331 Proxy ARP problem? Node '%x:%x ... %x:%x' is using
307 332 %d.%d.%d.%d on %s
308 333
309 334 This message appears if arp(1M) has been used to create
310 335 a published permanent (ATF_AUTHORITY) entry, and some
311 336 other host on the local network responds to mapping
312 337 requests for the published ARP entry.
313 338
|
↓ open down ↓ |
130 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX