Network Interfaces Programmer's Guide
  Search only this book
Download this book in PDF

Introduction to Network Interfaces

1

This manual describes the programmer's interface to network services in the SunOS 5.4 operating system. In this guide, the terms SunOS and Solaris are used interchangeably because the interfaces described in this manual are common to both. Solaris 2.4 is SunSoft's(TM) distributed computing operating environment. It is comprised of SunOS release 5.4 with ONC(TM), OpenWindows(TM), ToolTalk(TM), DeskSet(TM), and OPEN LOOK(R) as well as other utilities. This release of Solaris is fully compatible with System V, Release 4 (SVR4) and conforms to the third edition of the System V Interface Description (SVID). It supports all System V network services.
Applications that must adjust options or use specific addresses can still do so. But you can now write applications with relative ease to be portable over different protocol stacks.

Solaris Networking Features

This section summarizes the main networking themes in the current Solaris release.
Multithreaded (MT) Remote Procedure Call This release provides multithreaded-safe client and server RPC interfaces. MT-safe server interfaces are new in the SunOS 5.4 release and are documented in this revision of the manual. To determine which interfaces are safe or unsafe, refer to routines from section 3N of the man Pages(3): Library Routines.
Transport-Independent Remote Procedure Call (TI-RPC) Transport-independent RPC provides interfaces that let applications be free of, or more closely tied to the underlying transport. It is the developer's choice to use the most appropriate level.
Standardized Network Interfaces at the Transport and Link Layers At the transport level, the AT&T transport provider interface (TPI) is required. At the link level, the UNIX international data link provider interface (DLPI) is required. Standardizing on these interfaces lets you interchange STREAMS drivers at the transport and link levels with no changes to the modules or drivers communicating with them. In particular, transport layer interface (TLI) and sockets can interface to any transport provider supporting TPI, and any device driver supporting DLPI can be linked beneath the Internet protocol (IP).
Functions and Network Selection The sockets, TLI, and name-to-address translation functions work with the network selection facility to free user applications from the details of specific protocols and address formats.

Open Systems Interconnection Reference Model

The open systems interconnection (OSI) reference model is the basis of commercially available network service architectures. Other network protocols developed independently conform loosely to the model. The transport control protocol/interface program (TCP/IP) is an example. For more information on TCP/IP, see the TCP/IP Network Administration Guide.
The OSI reference model is a convenient framework for networking concepts. Basically, data are added to a network by a sender. The data are transmitted along a communication connection and are delivered to a receiver. To do this, a variety of networking hardware and software must work together.
Industry standards have been or are being defined for each layer of the reference model. Two standards are defined for each layer: one specifies the interface to the services provided by the layer, and the other specifies the protocol observed by the services in the layer. Users of a service interface standard should be able to ignore the protocol and any other implementation details of the layer.
The OSI reference model divides networking functions into seven layers, as shown in Figure 1-1.

Graphic

Figure 1-1

Each protocol layer performs services for the layer above it. The ISO definition of the protocol layers provides designers some freedom of implementation. For example, some applications skip the presentation and session layers to interface directly with the transport layer.
Layer 1: Physical Layer The hardware layer of the model. It specifies the physical connections between hosts and networks, and the procedures used to transfer packets between machines.
Layer 2: Data-Link Layer Manages the delivery of data across the physical network. It describes how the internet protocol (IP) should use existing data link protocols, such as Ethernet/802.
Layer 3: Network Layer This layer is responsible for machine-to machine communications. It determines the path a transmission must take, based upon the receiving machine's IP address. Besides message routing, it also translates from logical to physical addresses.
Layer 4: Transport Layer Controls the flow of data on the network and assures that received and transmitted data are identical. TLI, TCP/IP, or the user datagram protocol (UDP) may be used to enable communications between application programs running on separate machines.
Layer 5: Session Layer Manages reliable sessions between cooperating applications. The interface at this layer enables remote communication using function call semantics.
Layer 6: Presentation Layer Performs the translation between the data representation local to the computer and the processor-independent format that is sent across the network.
Layer 7: Application Layer At this top layer are the user-level programs and network services. Some examples are telnet, ftp, tftp, and the domain name service (DNS).

Transport Interface Overview

This section gives a brief overview of the transport layer interfaces.
Description The transport layer (layer 4) is the lowest layer of the model that provides applications and higher layers with end-to-end service. This layer hides the topology and characteristics of the underlying network from users. The transport layer also defines a set of services common to many contemporary protocol suites including the ISO protocols, TCP/IP, Xerox(R) network systems (XNS)(TM), and systems network architecture (SNA).
Industry Standard The transport layer interface (TLI) is modeled on the Transport Service Definition (ISO 8072). The TLI can be used to access any transport support on your system. It is implemented as a user library using the STREAMS I/O mechanism.
Sockets The socket interface is implemented with a set of user-level library routines and a STREAMS module. Applications that were implemented on 4.1.x or earlier versions of SunOS, or on operating systems from other vendors, can run on the current Solaris release because BCP mode (4.1.x library) is the default. To use the Solaris 2.x socket library, you must recompile the application.
MT Safe and MT Hot TLI and sockets were made MT safe in SunOS 5.3. Some of the name service interfaces are safe, such as NIS+ and name-to-address translation. SunOS 5.4 provides MT-hot RPC server interfaces. The RPC client interfaces were MT-safe in SunOS 5.3. See Chapter 3, "rpcgen Programming Guide" and Chapter 4, "RPC Programming Guide" for details. To determine which interfaces are safe or unsafe, refer to section 3N of the man Pages(3): Library Routines.

NIS+ Overview

This section is a brief introduction of the NIS+ name service. Chapter 8, "NIS+ Programming Guide covers the NIS+ API.
NIS+ is the network information service in Solaris. It is an information retrieval system for well-known UNIX databases, such as the password tables, host tables, and mail aliases maps. It also supports Solaris databases such as the automount maps and the credentials tables. NIS+ is an enterprise-wide information service. The enterprise is partitioned into organizational units that are arranged into a tree and assigned hierarchical domain names.
The types of enterprise objects that NIS+ understands are principals, directories, tables, entries, and groups. There is no concept of a user or host context, per se. Information about an entity such as a user appears in various different tables, such as the credentials table, the password table, the automount maps, and the mail aliases map. This information is retrieved using NIS+ indexed names. For example, the password entry is obtained by using the name [name=mjones]passwd.org_dir.sales.wiz.com., while the credentials for the same user are obtained using the name [name=mjones.sales.wiz.com.]cred.org_dir.sales.wiz.com.