The concept that is widely used in the internet nowadays is client server concept, client server programming etc. most of the internet applications that we use today are based on client server programming.
CLIENT SERVER MODEL
- STANDARD MODEL FOR DEVELOPING NETWORK APPLICATIONS.
- NOTATION OF CLIENT AND SERVER
- A server is a process that is offering some service
- A client is a process that is requesting the service.
- Server or clients maybe running on different machines.
- Server waits for waits for request from client(s).
Diagram of client server model
The server should be the first process to start. The server process starts on some computer system, initializes itself then goes to sleep waiting for the clients request.
A client process starts either on same system or a different system, and sends a request to the server. When the server process has finished providing its service to the clients, the server goes back to sleep waiting for the next client request to arrive. The process repeats continuously as long the clients are sending request and the server is sending back the response and so on.
Roles of the client and server processes are asymmetric. However they are two types of servers:
- Iterative servers: The server is said to be iterative when the server process knows in advance how long it takes to handle each request and it handles each request itself. Single copy of server runs at all times. A client may have to wait if the server is busy.
- Concurrent servers: These servers are used when the amount of time required to handle a request is unknown. The server starts another process to handle each request. A copy of a server caters to a client’s request in a dedicated fashion. As many copies of server as there are client request.
A client server communication can use either TCP or UDP. If the client server is using TCP, then before start of communication, a connection has to be established between the two hosts.
They are five components in a connection.
- Protocol used
- Source IP address
- Source port number
- Destination IP address
- Destination port number
DEVELOPING A NETWORK APPLICATION
The best way to use some standard and well accepted protocol is:
- At the data link layer level, use ETHERNET.
- At the network layer level, use IP.
- At the transport layer level, use TCP.
- At the application layer level, use a standard API Berkeley socket interface.
A socket is a BSD (Berkeley socket distribution) method for achieving inter-process communication (IPC). It is used to allow one process to speak to another ( on same or different machine).
DOMAIN NAME SYSTEM (DNS). This is a global database system for internet addressing, mail and other information. It is much easier to use and memorize. DNS server translate domain names to IP addresses.
TOP LEVEL DOMAINS
.com – Commercial
.org – Non – profit
.net – Network service provider
.gov – US government
.mil – Military
. edu – Education
.au – Australian
.at – Austrian
.ca – Canadian
.dk – Dutch
.fr – French
.de – German
.in – Indian
.it – Italian
.jp – Japanese
.kr – Korean
.nz – New Zealand
.es – Spanish
.tw – Taiwanese
.uk – British or Irish
.us – US
They are two letter domain for each and every country in the world.
NAME RESOLUTION PROCESS
The most commonly used server is BINDN (Berkeley internal name domain) it runs under unix as a process called named. When an application needs some information from the server, it invokes the DNS name resolver. DNS translates a fully qualified domain name into the corresponding IP address using the command nslookup. If the name server does not have the information locally, it asks its primary server and so on. For redundancy each host may also have one or more secondary name servers which maybe queried when the primary fails.
This allows a person sitting on one computer to work on another computer, it starts a remote session on another machine, and requires a person to supply login name and password to gain entry. Using telnet, we are able to log on to another system and use some facility out there. But you cannot transfer files from one machine to another.
FILE TRANSFER PROTOCOL (FTP)
This allows a person to transfer files between two machines. It requires a person to supply login name and password to gain entry.
A special form of FTP which has become very popular is the anonymous FTP. It does not require a person to know login name and password. Instead in place of login name, type the word anonymous and in place of password, type the email address.