NOSintro – TCP/IP over Packet Radio

An Introduction to the KA9Q Network Operating System

by Ian Wade, G3NRW

Chapter 9: CLIENT / SERVER

 

Fundamental to the operation of NOS is the concept of "client/server" organisation. This chapter covers the basics of client/server, explaining why it is so powerful and flexible in networked environments.

 

Fig 9-1: Client/Server Organisation.

It’s convenient to use a post office analogy to show how client/server works (Fig 9-1). Let’s say that a manager in the offices of XYZ Inc requires some postage stamps. He asks his secretary to go to the post office to buy them. To do this, the secretary leaves the building, goes down the street, enters the post office, and stands in line waiting to be served at a counter.

Eventually, the secretary reaches the front of the line and asks the counter clerk for the stamps. The clerk hands over the stamps. Then the secretary leaves the post office and returns to XYZ Inc, arriving back in the manager’s office to hand over the stamps.

A simple enough transaction. Now let’s translate this into networking jargon. The manager is a user, who issues an instruction to a client (the secretary) to request a server (the counter clerk) to provide a service (issue postage stamps). The client (secretary) then submits the result of the service (the stamps) back to the user (the manager). That’s basically all there is to "client/server".

[As an aside, you’ll see the words listener or daemon scattered throughout NOS documentation. These are alternatives for the word server].

 

The telnet Client

In the world of TCP/IP, there are several types of client (just as in the office there are several types of secretary), used for requesting different services. One of the most important clients is telnet (Fig 9-2). When you give a command such as telnet ns9ken, you are asking your telnet client to make a connection with the telnet server at NS9KEN.

When the connection is made, the telnet server then sets up a logical path between the client and the NOS BBS service. The BBS sends back a login prompt to the client, which displays it on your screen. You then log in, and you’re away. The connection remains in place until you give the B command to the BBS, which then disconnects itself from the client.

The numbers 1024 and 23 in Fig 9-2 are called port numbers. Packets passing between client and server contain these port numbers, so that each end knows which service and which user session they relate to. The number 1024 is an arbitrary port number allocated by the client, and 23 is the port number for the telnet service.

Fig 9-2: When NS9BOB gives the command telnet ns9ken, his telnet client connects to the telnet server at NS9KEN. The server then starts the BBS, which sends a login request back to NS9BOB.

Multiple Sessions

You are not restricted to just one telnet session. In principle, you could start many sessions, accessing the BBSs of several stations at the same time. Fig 9-3 shows two such session, with NS9KEN and NS9LIZ.

Fig 9-3: Multiple TELNET sessions.

A further concept associated with client/server is the socket. A socket is basically an end point for communication, and is expressed as a combination of hostname:port number. For example, in Fig 9-3, socket ns9bob:1024 is connected to socket ns9ken:23, and socket ns9bob:1025 is connected to socket ns9liz:23. These socket numbers appear in several NOS status messages, making it possible uniquely to identify individual sessions.

 

Behind the telnet Server

It’s important to realise that when your telnet client connects with a telnet server on another machine, you may not always be greeted by a NOS BBS. See Fig 9-4. If the server is running on a UNIX machine, the telnet server will connect your client to a UNIX login prompt instead, which will then take you into a UNIX shell. If the telnet server is running on a DEC VAX machine, the server will connect you to a VMS login sequence instead.

 

Fig 9-4: The NOS telnet client can communicate with telnet servers on all kinds of systems.

In other words, what lies behind the TELNET server depends very much on the machine it is running on and the network services it supports. In NOS you have the potential to login to any machine of any type which is running a telnet server — almost every well-known machine supports telnet these days — giving you the opportunity to connect to all manner of network services.

 

Different Services

Let’s take the post office analogy a little further. When the secretary talks to the the clerk, it doesn’t always have to be a request for stamps. It could be a request to mail a parcel, or to ask for a sheet of airmail stickers, or whatever.

That is, the server can handle several kinds of related request from the client. In the telnet world, the user can ask for a different service by adding a service number to the telnet command; for example, telnet ns9ken 21. The number 21 is called a "well-known" port number. The default well-known port number for the telnet server is 23 (that is, telnet ns9ken 23 means the same as telnet ns9ken).

There are around 370 assigned well-known port numbers. Here are some of them:

7 echo
9 discard
20 ftp-data
21 ftp-control
23 telnet
25 smtp
67 bootp
69 tftp
79 finger
87 ttylink (chat)
109 pop2
110 pop3
119 nntp
513 rlogin

Having to add a port number to a telnet command is a bit of a chore, and so to make things easier, NOS provides more meaningful client names for the more frequently used services. For example, you can say ftp ns9ken instead of telnet ns9ken 21, or finger ns9ken instead of telnet ns9ken 79, and so on.

Note that some versions of NOS don’t have a ttylink (or chat) client, so in this case you’ll need to include the well-known port number 87 in telnet commands to chat to those versions; e.g. telnet ns9ken 87 — see Fig 9-5.

 

Fig 9-5: It is possible to access several different types of server by adding a port number to the telnet command. For example, to chat to NS9KEN, the command will be telnet ns9ken 87.

 

Talking to Yourself

A further feature of client/server architecture is that you are not restricted to having only clients on some machines and only servers on others. Any machine can have both clients and servers. This gives you the opportunity to talk to yourself in exactly the same way as you would talk to somebody else over the network — very useful for testing and familiarising yourself with NOS.

Thus if you are running NS9BOB, you could log into your own NOS BBS with the command telnet ns9bob (Fig 9-6). In this case, the telnet client in your machine connects directly to the telnet server in your machine. Now you can drive your own BBS in exactly the same way as if you had logged into somebody else’s NOS BBS. In fact, logging into your own BBS is such a common requirement that NOS has a special command for this: bbs.

 

Fig 9-6: NS9BOB can log into his own NOS BBS with any of three different commands:
bbs, telnet loopback, or telnet ns9bob.

 

Back to Contents Page

Back to NOSintro Main Page.


[Copyright 1992-2009 Dowermain Ltd. All Rights Reserved. This page last modified: 21 May 2009]