1 .\" Copyright (c) 1983, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93
33 .\" $FreeBSD: src/share/man/man4/inet.4,v 1.11.2.6 2001/12/17 11:30:12 ru Exp $
34 .\" $DragonFly: src/share/man/man4/inet.4,v 1.7 2008/03/09 08:09:01 swildner Exp $
41 .Nd Internet protocol family
46 The Internet protocol family is a collection of protocols
50 transport layer, and utilizing the Internet address format.
51 The Internet family provides protocol support for the
52 .Dv SOCK_STREAM , SOCK_DGRAM ,
57 interface provides access to the
61 Internet addresses are four byte quantities, stored in
62 network standard format (on the
64 these are word and byte
65 reversed). The include file
68 as a discriminated union.
70 Sockets bound to the Internet protocol family utilize
71 the following addressing structure,
72 .Bd -literal -offset indent
77 struct in_addr sin_addr;
82 Sockets may be created with the local address
86 matching on incoming messages.
95 The distinguished address
97 is allowed as a shorthand for the broadcast address on the primary
98 network if the first network configured supports broadcast.
100 The Internet protocol family is comprised of
103 network protocol, Internet Control
106 Internet Group Management Protocol
111 and User Datagram Protocol
114 is used to support the
118 is used to support the
120 abstraction. A raw interface to
123 by creating an Internet socket of type
127 message protocol is accessible from a raw socket.
129 The 32-bit Internet address contains both network and host parts.
130 However, direct examination of addresses is discouraged. For those
131 programs which absolutely need to break addresses into their component
134 commands are provided for a datagram socket in the Internet domain;
135 they have the same form as the
142 .Bl -tag -width ".Dv SIOCSIFNETMASK"
143 .It Dv SIOCSIFNETMASK
144 Set interface network mask.
145 The network mask defines the network part of the address;
146 if it contains more of the address than the address type would indicate,
147 then subnets are in use.
148 .It Dv SIOCGIFNETMASK
149 Get interface network mask.
152 The current implementation of Internet protocols includes some routing-table
153 adaptations to provide enhanced caching of certain end-to-end
154 information necessary for Transaction TCP and Path MTU Discovery. The
155 following changes are the most significant:
158 All IP routes, except those with the
160 flag and those to multicast destinations, have the
162 flag forcibly enabled (they are thus said to be
163 .Dq "protocol cloning" ) .
165 When the last reference to an IP route is dropped, the route is
166 examined to determine if it was created by cloning such a route. If
167 this is the case, the
169 flag is turned on, and the expiration timer is initialized to go off in
170 .Va net.inet.ip.rtexpire
172 If such a route is re-referenced, the flag and expiration timer are reset.
174 A kernel timeout runs once every ten minutes, or sooner if there are
175 soon-to-expire routes in the kernel routing table, and deletes the
179 A dynamic process is in place to modify the value of
180 .Va net.inet.ip.rtexpire
181 if the number of cached routes grows too large.
182 If after an expiration run there are still more than
183 .Va net.inet.ip.rtmaxcache
184 unreferenced routes remaining, the rtexpire
185 value is multiplied by \(34, and any routes which have longer
186 expiration times have those times adjusted. This process is damped
187 somewhat by specification of a minimum rtexpire value
188 .Va ( net.inet.ip.rtminexpire ) ,
189 and by restricting the reduction to once in a ten-minute period.
191 If some external process deletes the original route from which a
192 protocol-cloned route was generated, the ``child route'' is deleted.
193 (This is actually a generic mechanism in the routing code support for
194 protocol-requested cloning.)
196 No attempt is made to manage routes which were not created by protocol
197 cloning; these are assumed to be static, under the management of an
198 external routing process, or under the management of a link layer
203 Only certain types of network activity will result in the cloning of a
204 route using this mechanism. Specifically, those protocols (such as
208 which themselves cache a long-lasting reference to route for a destination
209 will trigger the mechanism; whereas raw
211 packets, whether locally-generated or forwarded, will not.
213 A number of variables are implemented in the net.inet branch of the
216 In addition to the variables supported by the transport protocols
217 (for which the respective manual pages may be consulted),
218 the following general variables are defined:
219 .Bl -tag -width IPCTL_FASTFORWARDING
220 .It Dv IPCTL_FORWARDING
222 Boolean: enable/disable forwarding of IP packets.
224 .It Dv IPCTL_FASTFORWARDING
225 .Pq ip.fastforwarding
226 Boolean: enable/disable the use of fast IP forwarding code.
228 When fast forwarding is enabled, IP packets are forwarded directly to
229 the appropriate network interface with a minimal validity checking, which
230 greatly improves the throughput. On the other hand, they bypass the
231 standard procedures, such as IP option processing and
234 It is not guaranteed that every packet will be fast-forwarded.
235 .It Dv IPCTL_SENDREDIRECTS
237 Boolean: enable/disable sending of ICMP redirects in response to
244 Integer: default time-to-live
249 .It Dv IPCTL_SOURCEROUTE
251 Boolean: enable/disable forwarding of source-routed IP packets (default false).
252 .It Dv IPCTL_RTEXPIRE
254 Integer: lifetime in seconds of protocol-cloned
256 routes after the last reference drops (default one hour). This value
257 varies dynamically as described above.
258 .It Dv IPCTL_RTMINEXPIRE
260 Integer: minimum value of ip.rtexpire (default ten seconds). This
261 value has no effect on user modifications, but restricts the dynamic
262 adaptation described above.
263 .It Dv IPCTL_RTMAXCACHE
265 Integer: trigger level of cached, unreferenced, protocol-cloned routes
266 which initiates dynamic adaptation (default 128).
280 .%T "An Introductory 4.3 BSD Interprocess Communication Tutorial"
285 .%T "An Advanced 4.3 BSD Interprocess Communication Tutorial"
290 The Internet protocol support is subject to change as
291 the Internet protocols develop. Users should not depend
292 on details of the current implementation, but rather
293 the services exported.
297 protocol interface appeared in