Client-Server Applications
Derek Bridge
Department of Computer Science,
University College Cork
Client-Server Applications
Aims:
- to know what client-server computing is
- to know about servers and ports
- to understand the Domain Name System
Client-Server Networking
Client-server diagram from The TCP/IP Guide by Charles M. Kozierok
Peer-to-Peer Networking
Peer-to-peer diagram from The TCP/IP Guide by Charles M. Kozierok
Servers
- Servers have to run, unattended, continuously under
possibly heavy loads
- We need high performance and redundancy
Discussion: Is there a difference between the hardware needed for servers and the
hardware needed for 'normal' computers?
Ports
- One server might be offering ('hosting') more than one service
- E.g. a server computer may be running web server software and email server software
- How does a client indicate which
server program is to handle its requests?
- Each server program is assigned an identification number, called
a port number
Class exercise: When transmitting a packet, where does
the client put the port number? The IP address?
Listening on ports
Telnet and ssh
- The telnet and ssh application protocols allow a user to access and
use a remote computer
- Commands you type are
- captured by the telnet/ssh client software
- sent over the network, and
- executed by the remote computer's operating system
- Telnet/ssh are client-server applications; at the transport layer, they use TCP;
and they use well-known ports 23 and 22, resp.
The Domain Name System (DNS)
- Numeric IP addresses are cumbersome for humans.
Why exactly?
- The Domain Name System (DNS) defines:
- a name space
- a name registration scheme, and
- a name resolution scheme
- In DNS, these are organised hierarchically
The DNS name space
- The set of names is split into subsets, called domains.
- The top-level domains (TLDs) are:
- .com, .edu, .gov, .mil, .net, .org (.arpa)
- .int
- .aero, .biz, .coop, .info, .museum, .name, .pro
- .mobi
- two-letter country codes (.ie, .uk, .de, etc).
http://www.iana.org/cctld/cctld-whois.htm
The DNS name space
- E.g. www.cs.ucc.ie, cosmos.ucc.ie
- The top-level domains (TLDs) are split into second-level domains
- Each second-level domain may be split further
- At the lowest-level are hostnames
- A name must be unique within its parent domain
DNS name registration
- The IANA decides what TLDs there will be
- For each TLD, there is an authority for managing names within the TLD
- E.g. in Ireland the IE Domain Registry: http://www.domainregistry.ie/
- Once an organization has a registered lower-level domain,
it becomes the authority for that domain
- It can sell further lower-level domains or use it for its own internal
structure
- Each authority is responsible for ensuring that names are unique
within their parent domain
DNS name resolution
- DNS uses a client-server name resolution scheme
- DNS name servers receive names and, if they can,
they respond with the corresponding IP address from their database
- But, no DNS name server knows every domain name
- E.g. your local DNS name server(s) might know just the names and
IP addresses of hosts connected to your LAN
DNS name resolution
- If you are running an application that needs to translate a name to
a numeric IP address:
- Your application launches a DNS client program
- The DNS client contacts (one of) your local DNS name server(s)
- Your local DNS name server responds with the address if it knows it
- If not, it asks another DNS name server, which will send back either
the IP address we want, or the address of another DNS name server
- And so on, until the local server gets the address and sends it to
your DNS client, which gives it to your application
Class exercise:Which do you think DNS uses for name
resolution: TCP or UDP?
DNS name resolution
DNS name resolution diagram modified from The TCP/IP Guide by Charles M. Kozierok
Efficiency: caching
- DNS name servers store the results of recent name resolution requests
- If the request occurs again it can be satisfied from the cache
- Your own machine might even cache results for your DNS client software
Class exercise: What problem do you think this brings? How
do you think it is solved?