CST(31)-RPC Messaging and Peer-to-Peer

Most early client/server applications were implemented using low level, conversational peer-to-peer protocols such as sockets, TLI, NetBIOS ...

Most early client/server applications were implemented using low level, conversational peer-to-peer protocols such as sockets, TLI, NetBIOS and NamedPipes. These low level protocols are hard to code and maintain, so they were losing their popularity. Instead programmers are now using RPCs, MOMs and ORBs which provide higher levels of abstraction.

The term peer-to-peer indicates that the two sides of a communication link use the same protocol interface to conduct a networked conversation. Any computer can initiate a conversation with any other computer. The protocol is symmetrical and is sometimes called program-to-program. The peer-to-peer interface does not fully mask the underlying network from the programmer. The peer-to-peer protocols are stack specific APIs. Here’s a brief description of the major peer-to-peer protocols:


Sockets were introduced in 1981 as a generic interface that would provide unix-to-unix communications over networks. . In 1986 AT&T introduced TLI that provides functionality similar to sockets but in a more network-independent fashion. Sockets and TLI are very similar form a programmer’s perspective. TLI is a cleaner version of sockets. An application written to TLI is in theory stack independent. It should run on TCP/IP or IPX/SPX with very few modifications. TLI API consist of 25 API calls.

Sockets are supported on virtually every operating system. The windows socket API is known as Winsock, a multivendor specification that standardizes the use of TCP/IP under windows. In BSD Unix systems, Sockets are part of the kernel and provide both standalone and remote IPC service. Non BSD Unix systems such as MS-DOS, Windows and OS/2 provides sockets in the form of libraries.

The three most popular types of sockets are datagram, stream and raw. Stream and datagram sockets provide interface to TCP protocol whereas raw socket provide interface to IP protocol.

                      Socket=Internet Address + Port Address.

A socket address on the TCP/IP internet consists of two parts: an internet address (IP address) and a port number.

An internet address is a 32 bit number usually represented by four decimal numbers separated by dots that must be unique for each TCP/IP network interface card within a domain. A port is an entry point to an application that resides on a host. It is represented by a 16 bit integer. Ports are commonly used to define the entry points for services provided by server applications.

Datagram Vs Sessions:

Connection oriented protocols also known as session-based protocols, virtual circuits or sequenced packet exchanges provide a reliable two way communication service over a session. Each packet of information that gets exchanged over a session is given a unique number through which it gets tracked and individually acknowledged. Duplicate packets are detected and discarded by the session services. The price to be paid for this is the overhead associated with this. If a session is lost one of the parties has to reestablish it.

Datagrams also known as connectionless protocols or transmit and pray protocols – provide a simple but unreliable form of exchange. The more powerful datagram protocols such as NetBIOS provide broadcast capabilities. NetBIOS allows you to send datagrams to a named entity, to a selected group of entities or to all entities on a network. Datagrams are unreliable in the sense that they are not acknowledged or tracked through a sequence number. Users send and pray that the datagrams gets received.

Netware : IPX/SPX and TLI

IPX/SPX covers the entire spectrum from PC LANs to enterprise LANs. IPX/SPX is an implementation of Xerox Netwrok Services transport and network protocols. XNS, developed by XNS PARC Research Institute is a much cleaner architecture than TCP/IP protocol. The IPX/SPX network layer is provided by the Internet Packet Exchange (IPX) protocol. It is a send and pray datagram protocol with no guarantees. It is used as a foundation protocol by network applications for sending and receiving low-overhead datagram packets. Novell’s SPX builds a reliable service on top of IPX. Netware provides 12 API calls that can be used to obtain the services using IPX. The transport layer of IPX/SPX is provided by Sequenced Packet Exchange protocol – a reliable connection oriented service over IPX. This service consists of 16 API calls. Netware provides four peer-to-peer protocols on top of IPX/SPX stck: NetBios, Named pipes, TLI and IPX/SPX APIs.

NetBIOS and NetBEUI:

NetBIOS is the premier protocol for LAN based program-to-program communication and was introduced by IBM. NetBIOS is used as an interface to a variety of stacks – TCP/IP, XNS and IPX.SPX. One of the many reasons for NetBIOS’s success is its simplicity.

NetBEUI is the protocol that comes with IBM and Microsoft LAN products including Windows for workgroups, Windows 95 and OS/2 Warp Server. It came to life as the original transport for NetBIOS commands.

NetBEUI offers powerful datagram and connection oriented sservices. It also offers a dynamic naming service based on discovery protocols. Its main weakness is the lack of security. The NetBIOS services are provided through a set of commands specified in a structure called Network Control Block (NCB). The structure also contains the parameters associated with the command and the fields in which the NetBIOS will return information to the program. A command can be issued in two ways – wait mode and no-wait mode. In the wait mode, the requesting thread is blocked until the command completes. In the no-wait mode, control is returned to the calling thread at the earliest time possible, usually before the command completes. When the command completes, the NetBIOS DLL places a return code in the NCB.

Named Pipes:

Named Pipes provide a reliable two-way communications between clients and a server. They provide a file-like programming API that abstracts a session based two-way exchange of data. Using Named Pipes, processes can exchange data as if they were reading from or writing to a sequential file. Named pipes are especially suitable for implementing server programs that require many-to-one pipelines. A server application can set up a pipeline where the receiving end of the pipe can exchange data with several client processes. An important benefit of Named pipes is that they are part of the base interprocess communications service. The Named Pipe interface is identical whether the processes are running on an individual machine or distributed across the network. Named Pipes are built in networking features in Windows NT. Windows for Workgroups, Windows 95 and warp Server.

Best Online Tutorials | Source codes | Programming Languages: CST(31)-RPC Messaging and Peer-to-Peer
CST(31)-RPC Messaging and Peer-to-Peer
Best Online Tutorials | Source codes | Programming Languages
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content