You are on page 1of 74

Client Server Concepts,

DNS, DHCP
Prof. I. Sengupta / Dr. S.K. Ghosh
School of Information Technology
Indian Institute of Technology, Kharagpur

1
Client-Server Model

2
Client-server Model

• Standard model for developing network


applications.
• Notion 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 client may be running on
different machines.
¾Server waits for requests from client(s).
3
Client-server Model (contd.)

CLIENT

SERVER CLIENT

CLIENT

4
Client-server Model (contd.)

• Typical scenario:
¾The server process starts on some
computer system.
ƒ Initializes itself, then goes to sleep
waiting for a client request.
¾A client process starts, either on the
same system or on some other system.
ƒ Sends a request to the server.

5
¾When the server process has finished
providing its service to the client, the
server goes back to sleep, waiting for
the next client request to arrive.
• The process repeats.

6
Client-server Model (contd.)

• Roles of the client and the server


processes are asymmetric.
• Two types of servers:
¾Iterative servers.
¾Concurrent servers.

7
Iterative Servers

• Used 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.

8
Concurrent Servers

• Used when the amount of work


required to handle a request is
unknown; the server starts another
process to handle each request.
¾A copy of the server caters to a client’s
request in a dedicated fashion.
¾As many copies of server as there are
client requests.

9
Using TCP or UDP

• Before start of communication, a


connection has to be established
between the two hosts.
• Five components in a connection:
¾Protocol used
¾Source IP address
¾Source port number
¾Destination IP address
¾Destination port number
10
Develop a Network Application

• The best way is to use some


standard and well-accepted protocol.
¾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 like the Berkeley Socket
Interface.

11
What is a Socket?

• The socket is the method for achieving


inter-process communication (IPC).
• It is used to allow one process to speak
to another (on same or different
machine).
¾Analogy: Like the telephone is used to
allow one person to speak to another.

12
Basic Idea

• When two processes located on two


machines communicate, we define
association and socket.
¾Association: basically a 5-tuple
ƒ Protocol
ƒ Local IP address
ƒ Local port number
ƒ Remote IP address
ƒ Remote port number

13
¾Socket: also called half-association
(a 3-tuple)
ƒ Protocol, local IP address, local port
number
ƒ Protocol, remote IP address, remote
port number

14
Domain Name System (DNS)

15
What is DNS?

• The global database system for


Internet addressing, mail and other
information.
¾Much easier to use and memorize.
• Concept of domains and sub-domains.
¾Domain management is distributed.
¾DNS servers translate domain names to IP
addresses.

16
Top Level Domains

• com – Commercial • fr – French


• org – Non-profit • de – German
• net – Network service • in – Indian
provider • it – Italian
• gov – US govt. • jp – Japanese
• mil – military • kr – Korean
• edu – Education • nz – New Zealand
• au – Australian • es – Spanish
• at – Austrian • tw – Taiwanese
• ca – Canadian • uk – British or Irish
• dk – Dutch • us – U.S.
17
Domain Name Space

18
Domain Names and Labels

19
Domains

20
Domain Name Structure
• Domain names are arranged in a
hierarchical tree-like structure.
iitkgp
cse
ece
ernet mech

iitb
in cse
math

nic
Eg: cse.iitkgp.ernet.in

21
Some Statistics

In thousands

Year COM EDU GOV MIL NET ORG


1991 200 250 75 20 5 50
1992 350 450 100 20 10 50
1993 700 700 150 30 25 75
1994 1,200 1,075 250 100 125 175
1995 2,400 1,700 300 250 700 250

22
• Today:
¾Com :: 56 million
¾Net :: 8 million
¾Org :: 5 million
¾Us :: 1 million
¾Biz :: 1.5 million
¾Total :: 70 million

23
Distribution of Name Space

24
Hierarchy of Name Servers

25
Zones and Domains

26
What is a Zone?

• Domains are broken into zones for


which individual DNS servers are
responsible.
¾A domain represents the entire set of
names/machines that are contained under
an organizational domain name.
¾A zone is a domain minus any sub-
domains delegated to other DNS servers.

27
The Concept

• Each domain name is typically served


by 2 or more DNS servers for
redundancy.
¾Referred to as primary and secondary.
• Only one DNS server should be
configured as primary for a zone.
¾Several secondary DNS servers possible.
¾The primary server contains master copy
of the data for a zone.
¾Secondary servers get copies of this data
through zone transfers.
28
Zone Transfer

• A primary server loads all information


from the disk file.
• The secondary server loads all
information from the primary server.
• When the primary downloads
information from the secondary, it is
called zone transfer.

29
DNS in the Internet

30
DNS in the Internet

31
Generic Domains

32
Country Domains

33
Inverse Domain

34
Name Resolution

35
Name Resolution Process

• The commonly used server is BIND


(Berkeley Internal Name Domain).
¾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.
36
37
¾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 may be queried when
the primary fails.
• How do name servers update
themselves?

38
Hierarchy of Name Servers

root

au edu com in

stanford.edu gatech.edu rediff.com yahoo.com

39
Recursive Resolution

40
Iterative Name Resolution

• Client sequentially sends queries to


DNS servers and receives response.
¾If response is negative, the DNS server
to query next is also returned.
¾Unlike recursive name resolution, where
only one response is finally returned
back to the client.

41
Iterative Resolution

42
DNS Messages

43
DNS Messages

44
Query and Response Messages

45
Header Format

46
Flag Fields

QR: Query/Response
OpCode: 0 standard, 1 inverse, 2 server status
AA: Authoritative
TC: Truncated
RD: Recursion Desired
RA: Recursion Available
rCode: Status of the error

47
Types of Records

48
Question Record Format

49
Query Name Format

admin.atc.fhda.edu.

50
Resource Record Format

51
Example 1

• A resolver sends a query message to


a local server to find the IP address
for the host “chal.fhda.edu”. We
discuss the query and response
messages separately.

52
Example 1: The Query Message

53
Example 1: The Response Message

54
Example 2

• An FTP server has received a packet


from an FTP client with IP address
153.2.7.9. The FTP server wants to
verify that the FTP client is an
authorized client.

55
Example 2: Inverse Query Message

56
Example 2: Inverse Response Message

57
BOOTP and DHCP

58
BOOTP

59
Introduction

• The Bootstrap Protocol allows a host to


configure itself dynamically at boot time.
• This protocol provides three services:
¾ IP address assignment.
¾ Detection of the IP address of a serving
machine.
¾ The name of a file to be loaded and executed
by the client machine.
• The BOOTP packet is assumed to never
fragment.

60
• BOOTP uses two well-defined port numbers.
¾ UDP port number 67 is used for the server.
¾ UDP port number 68 is used for the BOOTP client.
• The process:
¾ The BOOTP client broadcasts a single packet.
called a BOOTREQUEST packet containing the
client’s MAC address.
¾ The client waits for a response from the server. If
not received within a specified time interval, the
client retransmits the request.
¾ The server responds with a BOOTREPLY packet.

61
Points to Note

• BOOTP is an alternative to RARP,


which operates at the data link layer
for LAN only.
• BOOTP, a UDP/IP based configuration
protocol, provide much more
configuration information.
¾Allows dynamic configuration of the
entire IP network.
• BOOTP and its extensions became the
basis for the DHCP protocol.
62
BOOTP Packet Format

63
• Operation code (8 bits)
¾Value = 1 Î Boot request
¾Value = 2 Î Boot reply
• Hardware type (8 bits)
¾Value = 1 Î Ethernet
¾Value = 2 Î Experimental Ethernet
¾Value = 15 Î Frame relay
¾Value = 19 Î ATM

64
Option Format

65
BOOTP Operation

66
DHCP

67
What is DHCP?

• Dynamic Host Control Protocol


¾Used to centrally allocate and manage
TCP/IP configurations of client nodes.
¾Allows us to define pools of IP addresses,
which are then allocated to client computers
by the server.
ƒ These pools of addresses are called “scopes”.
ƒ Not only are the addresses handed out, so also
are the related configuration settings like the
subnet mask, default router, DNS server, etc.

68
• DHCP works across most IP routers,
and allocates addresses depending
on the subnet the request came from.
¾No need to reconfigure a PC that is
moved from one subnet to another.

69
How does DHCP work?

• When a DHCP client is first switched on:


¾ It sends a broadcast packet on the network
with a DHCP request.
¾ This is picked up by the DHCP server.
¾ Server allocates an IP address to the PC, from
one of the scopes it has.
• DHCP does not allocate addresses
permanently:
¾ It “leases” the address for a particular time
period.
¾ Controlled by the administrator.

70
DHCP Packet Format

71
DHCP Transition Diagram

72
DHCP: Exchanging Messages

73
Exchanging Messages (contd.)

74

You might also like