This section describes the details the protocols and socket naming conventions used in the Internet namespace.
To create a socket in the Internet namespace, use the symbolic name PF_INET of this namespace as the namespace argument to socket or socketpair . This macro is defined in `sys/socket.h'.
A socket address for the Internet namespace includes the following components:
The address of the machine you want to connect to. Internet addresses can be specified in several ways; these are discussed in Internet Address Format, Host Addresses, and Host Names.
A port number for that machine. See Ports.
You must ensure that the address and port number are represented in a canonical format called network byte order. See Byte Order, for information about this.
| Internet Address Format | How socket addresses are specified in the Internet namespace. |
| Host Addresses | All about host addresses of internet host. |
| Protocols Database | Referring to protocols by name. |
| Ports | Internet port numbers. |
| Services Database | Ports may have symbolic names. |
| Byte Order | Different hosts may use different byte ordering conventions; you need to canonicalize host address and port number. |
| Inet Example | Putting it all together. |