Subscribe to Windows IT Pro
July 01, 1998 12:00 AM

IPC Mechanisms

Windows IT Pro
InstantDoc ID #3578
Rating: (0)
How named pipes, mailslots, and other mechanisms facilitate communication in your NT network

You've probably heard of named pipes, mailslots, and Windows Sockets (Winsocks), but do you know what they are and how Windows NT uses them? NT networks use these and other interprocess communications (IPC) mechanisms to establish communication channels in a distributed computing environment. But before you learn about how these mechanisms work, you need to understand how distributed computing fits in the client/server model.

The Distributed Computing Network
Most networks, including NT systems, use a client/server model in which the client computer makes a request and the server computer fulfills it. In a distributed computing network, both the client and the server perform tasks. But the workload isn't distributed evenly. Because the server is typically more powerful and faster than the client, the server handles most of the tasks, leaving the smaller ones for the client. Distributed computing is not limited to two machines. Several clients and servers in a network can perform tasks. And in an NT network, NT machines can assume the role of server or client.

Communication is key at all levels of a distributed computing network. At the machine level, clients and servers must communicate with each other. For example, when you run a distributed application (i.e., an application that splits processing between the client and server), the various clients and servers must communicate task-related information. At the operating system (OS) level, various OS components need to communicate with each other. For example, user-mode and kernel-mode components must communicate OS-related information. Communication is vital even at the application level. For example, threads in a process must communicate with each other and with threads from different processes.

IPC mechanisms are the conduit for communication at all levels, and the IPC Manager is responsible for calling these mechanisms into action. The IPC Manager runs in kernel mode, as Figure 1 shows, page 194. As a result, the IPC Manager runs at a high priority, has access to all system resources, and can see the address spaces of both client and server processes. When the client and server processes cannot call each other's functions directly, the IPC Manager calls on the services of an appropriate IPC mechanism. NT has seven primary IPC mechanisms: named pipes, mailslots, NetBIOS, Winsock, Network Dynamic Data Exchange (NetDDE), remote procedure calls (RPCs), and distributed component object model (DCOM).

Named Pipes
Named pipes provide a reliable, bidirectional communication channel to transfer data between a client and server. NT implements named pipes as file system drivers. Thus, they are available to all processes, including local processes on a machine and Remote Access Service (RAS) processes.

Named pipes offer connection-oriented messaging. This type of messaging is secure and efficient (i.e., there's no data loss) because it requires that the receiver acknowledge receipt of all data sent. Connection-oriented messaging is akin to making a telephone call. When you dial a number and someone answers the phone, a connection is made and you relay your message. When you hang up, the connection terminates. But if you dial a number and no one answers the phone, you don't relay your message because a connection was never made.

For added security, NT includes special APIs and the impersonation feature in named pipes messaging. Impersonation enhances the security of the server application. When an application that uses named pipes (e.g., SQL Server) receives a request from a client, the server will impersonate the client before honoring the request. Although the server might have the authority to perform the request, the client might not. If the client doesn't have the necessary authority, the server denies the client's request.

Various software products use named pipes, including NT and SQL Server. NT uses named pipes in the Win32 logon process.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.