1.3. PORTS, SOCKETS, AND SERVICES
17
1.3
Ports, Sockets, and Services
The computers on the internet interact in a wide variety of ways, but their
interaction is nonetheless restricted. It would not be wise to allow any computer
on the internet to have full access to every other computer on the net because
an unscrupulous user might decide to delete all of your disk files or to otherwise
use your computer without permission.
To get around this problem, the internet is modelled on an abstract view of
the net in which each computer specifies exactly what kinds of interactions it
will allow. These types of interactions are called services and each computer
on the net can offer up to 65536 services.
These services are specified by a number from 0 to 65535 called a port.
Typically, the ports with numbers under 1024 are reserved for system services
(such as email and web page serving), but anyone is free to offer any service
they please on ports numbered greater than 1024.
A computer that offers a service to another computer is called a server
and a computer that requests a service is called a client. It is typical for
computers on the internet to be both clients and servers and the same time. The
communication between client and server is initiated by the client by specifying
the IP address of the server computer and the port number of the service to
be provided. If the specified computer is offering that service, then a special
connection called a socket is created. The socket allows the two computers to
send data back and forth between themselves.
1.3.1
Common Services on the net
Some of the more common system services are listed in Figure 1.1. Each service
has a set of rules governing how the client and server interact. These rules
are called protocols and they simply represent the conventions that the two
computers will use when communicating on that port.
You can access some of these ports from Linux using the telnet command.
For example, Figures 1.2 and 1.3 give examples of accessing the date and echo
services respectively: The date service returns the local time on the server being
queried. The echo service is used for testing whether a connection is active and
just echo back each line of text that it receives.
1.4
Web Browsers and Servers
The HTTP service is perhaps the most revolutionary service that has been de
veloped for use on the internet. It provides a mechanism for clients to access
files on the server by giving the name of the file in the webserver folder. The
HTTP server then responds to such a request by returning several lines of in
formation about the file (e.g. what kind of data it contains, text, image, movie,
sound, etc.) when it was last modified, how large the file is, etc. HTTP services
are generally provided on port 80.
Php Web Hosting Introduction to Interactive Web Design Php Hosting
|
|
|
|
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved. |