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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93
36 .Nd Internet protocol family
41 The Internet protocol family is a collection of protocols
45 transport layer, and utilizing the Internet address format.
46 The Internet family provides protocol support for the
47 .Dv SOCK_STREAM , SOCK_DGRAM ,
52 interface provides access to the
56 Internet addresses are four byte quantities, stored in
57 network standard format (on little endian machines, such as the
62 these are word and byte reversed).
66 as a discriminated union.
68 Sockets bound to the Internet protocol family utilize
69 the following addressing structure,
70 .Bd -literal -offset indent
73 sa_family_t sin_family;
75 struct in_addr sin_addr;
80 Sockets may be created with the local address
84 matching on incoming messages.
93 The distinguished address
95 is allowed as a shorthand for the broadcast address on the primary
96 network if the first network configured supports broadcast.
98 The Internet protocol family is comprised of
101 network protocol, Internet Control
104 Internet Group Management Protocol
109 and User Datagram Protocol
112 is used to support the
116 is used to support the
122 by creating an Internet socket of type
126 message protocol is accessible from a raw socket.
130 address on an interface consist of the address itself, the
131 netmask, either broadcast address in case of a broadcast
132 interface or peers address in case of point-to-point interface.
135 commands are provided for a datagram socket in the Internet domain:
137 .Bl -tag -width ".Dv SIOCGIFBRDADDR" -offset indent -compact
139 Add address to an interface.
141 .Ft struct in_aliasreq
144 Delete address from an interface.
149 .It Dv SIOCGIFBRDADDR
150 .It Dv SIOCGIFDSTADDR
151 .It Dv SIOCGIFNETMASK
152 Return address information from interface.
153 The returned value is in
155 This way of address information retrieval is obsoleted, a
156 preferred way is to use
161 A number of variables are implemented in the net.inet branch of the
164 In addition to the variables supported by the transport protocols
165 (for which the respective manual pages may be consulted),
166 the following general variables are defined:
167 .Bl -tag -width IPCTL_ACCEPTSOURCEROUTE
168 .It Dv IPCTL_FORWARDING
170 Boolean: enable/disable forwarding of IP packets.
172 .It Dv IPCTL_SENDREDIRECTS
174 Boolean: enable/disable sending of ICMP redirects in response to
176 packets for which a better, and for the sender directly reachable, route
177 and next hop is known.
181 Integer: default time-to-live
186 .It Dv IPCTL_ACCEPTSOURCEROUTE
187 .Pq ip.accept_sourceroute
188 Boolean: enable/disable accepting of source-routed IP packets (default false).
189 .It Dv IPCTL_SOURCEROUTE
191 Boolean: enable/disable forwarding of source-routed IP packets (default false).
192 .It Va ip.process_options
193 Integer: control IP options processing.
194 By setting this variable to 0, all IP options in the incoming packets
195 will be ignored, and the packets will be passed unmodified.
196 By setting to 1, IP options in the incoming packets will be processed
200 .Dq "prohibited by filter"
201 message will be sent back in response to incoming packets with IP options.
205 variable affects packets destined for a local host as well as packets
206 forwarded to some other host.
207 .It Va ip.rfc1122_strong_es
208 Boolean: in non-forwarding mode
209 .Pq ip.forwarding is disabled
210 partially implement the Strong End System model per RFC1122.
211 If a packet with destination address that is local arrives on a different
212 interface than the interface the address belongs to, the packet would be
214 Enabling this option may break certain setups, e.g. having an alias address(es)
215 on loopback that are expected to be reachable by outside traffic.
216 Enabling some other network features, e.g.
218 or destination address rewriting
220 filters may override and bypass this check.
222 .It Va ip.source_address_validation
223 Boolean: perform source address validation for packets destined for the local
225 Consider this as following Section 3.2 of RFC3704/BCP84, where we treat local
226 host as our own infrastructure.
227 This has no effect on packets to be forwarded, so don't consider it as
228 anti-spoof feature for a router.
231 Boolean: control IP IDs generation behaviour.
232 True value enables RFC6864 support, which specifies that IP ID field of
234 datagrams can be set to any value.
236 .Fx implementation sets it to zero.
239 Boolean: control IP IDs generation behaviour.
242 to 1 causes the ID field in
244 IP datagrams (or all IP datagrams, if
246 is disabled) to be randomized instead of incremented by 1 with each packet
248 This closes a minor information leak which allows remote observers to
249 determine the rate of packet generation on the machine by watching the
251 At the same time, on high-speed links, it can decrease the ID reuse
253 Default is 0 (sequential IP IDs).
254 IPv6 flow IDs and fragment IDs are always random.
256 Integer: maximum number of fragments the host will accept and simultaneously
257 hold across all reassembly queues in all VNETs.
258 If set to 0, reassembly is disabled.
259 If set to -1, this limit is not applied.
260 This limit is recalculated when the number of mbuf clusters is changed.
261 This is a global limit.
262 .It Va ip.maxfragpackets
263 Integer: maximum number of fragmented packets the host will accept and
264 simultaneously hold in the reassembly queue for a particular VNET.
265 0 means that the host will not accept any fragmented packets for that VNET.
266 \-1 means that the host will not apply this limit for that VNET.
267 This limit is recalculated when the number of mbuf clusters is changed.
268 This is a per-VNET limit.
269 .It Va ip.maxfragbucketsize
270 Integer: maximum number of reassembly queues per bucket.
271 Fragmented packets are hashed to buckets.
272 Each bucket has a list of reassembly queues.
273 The system must compare the incoming packets to the existing reassembly queues
274 in the bucket to find a matching reassembly queue.
275 To preserve system resources, the system limits the number of reassembly
276 queues allowed in each bucket.
277 This limit is recalculated when the number of mbuf clusters is changed or
279 .Va ip.maxfragpackets
281 This is a per-VNET limit.
282 .It Va ip.maxfragsperpacket
283 Integer: maximum number of fragments the host will accept and hold
284 in the reassembly queue for a packet.
285 0 means that the host will not accept any fragmented packets for the VNET.
286 This is a per-VNET limit.
302 .%T "An Introductory 4.3 BSD Interprocess Communication Tutorial"
307 .%T "An Advanced 4.3 BSD Interprocess Communication Tutorial"
314 protocol interface appeared in
321 The Internet protocol support is subject to change as
322 the Internet protocols develop.
323 Users should not depend
324 on details of the current implementation, but rather
325 the services exported.