以 PDF 格式下載這本書 (171 KB)
Chapter 2 Network ComponentsThis chapter describes the network interfaces, devices and protocols provided in the ChorusOS 4.0 product. The goal is to help you better understand what is available in the ChorusOS 4.0 product before you begin setting up networking on a ChorusOS system. This chapter does not describe how to set up network components. Supported ProtocolsNetwork protocols define how messages are formatted and packaged for transmission over the network. They provide support for sockets, which are endpoints for communication, described in socket(2POSIX). ChorusOS systems provide support for the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) over the Internet Protocol (IP). TCP is a high-level, reliable, connection-oriented protocol. In other words, it verifies that messages it sends get to their destinations and resends them if necessary. In order to do so, TCP relies on connections between the sender and the receiver. In contrast, UDP is also high-level, but is unreliable. It sends messages without verifying whether they arrive or not, making UDP faster and less resource-hungry than TCP. Both TCP and UDP sit atop the lower-lever IP, which is a transport protocol. For details about the ChorusOS implementations of these protocols, see ip(7P), tcp(7P), and udp(7P). ChorusOS systems also support remote inter-process communication (remote IPC), by allowing you to create an IPC stack
in the Finally, ChorusOS systems provide a mechanism to support Open Systems Interconnect (OSI), by allowing you to attach an OSI stack that you provide to an Ethernet device. For details, see ethOsiStackAttach(2K). Supported InterfacesChorusOS systems provide support for Ethernet, loopback, PPP and SLIP network interfaces. Network interfaces are lower-level than network protocols, providing the link between network hardware and network protocols. Figure 2-1 illustrates how the ifnet interface does this for Ethernet connections. Figure 2-2 does the same for the ppp and sl interfaces for PPP and SLIP connections, respectively. Figure 2-1 Ethernet Networking
The following list describes the network interfaces provided:
Figure 2-2 PPP/SLIP Networking
Supported DevicesNetwork devices are low-level drivers that make it easier for applications and interfaces to work closely with network hardware. ChorusOS systems provide two important types of network devices, Berkeley Packet Filters (BPF) and Teletype (tty, ptyp, ttyp) devices. Each network device described below requires both a device structure and a special file in order to function. Special files provide access either to peripheral devices, such as serial lines, or to logical "devices", such as Berkeley packet filters. Each special file:
By convention, special files are located in the /dev directory. Special files are created, usually during system initialization, using the mknod(1M) command. The following list enumerates and describes the network devices provided:
|
|