lecture 8
lecture 8
DYNAMIC HOST
CONFIGURATION
PROTOCOL(DHCP)
Third Year
Second Semester
IT Department
Prepared by:
Eng. Mohammed H. Al-Marhabi
1
Introduction
3
Introduction(cont.)
5
DHCP Message Format
6
Option Format
7
Option Format
8
Operation of DHCP
9
10
Operation of DHCP (1)
11
Operation of DHCP (2)
■ The DHCP server or servers (if more than one) responds with a
DHCPOFFER message in which the your address field defines the
offered IP address for the joining host and the server address field
includes the IP address of the server. The message also includes
the lease time for which the host can keep the IP address.
■ This message is encapsulated in a user datagram with the same
port numbers, but in the reverse order. The user datagram in turn
is encapsulated in a datagram with the server address as the
source IP address, but the destination address is a broadcast
address, in which the server allows other DHCP servers to receive
the offer and give a better offer if they can.
12
Operation of DHCP (3)
■ The joining host receives one or more offers and selects the
best of them. The joining host then sends a DHCPREQUEST
message to the server that has given the best offer. The fields
with known value are set.
■ The message is encapsulated in a user datagram with port
numbers as the first message.
■ The user datagram is encapsulated in an IP datagram with the
source address set to the new client address, but the
destination address still is set to the broadcast address to let
the other servers know that their offer was not accepted.
13
Operation of DHCP (4)
14
Transition States
15
Transition States(cont.)
16
Transition States(cont.)
■ When the DHCP client first starts, it is in the INIT
state (initializing state).
■ The client broadcasts a discover message. When it
receives an offer, the client goes to the SELECTING
state. While it is there, it may receive more offers.
■ After it selects an offer, it sends a request message
and goes to the REQUESTING state.
■ If an ACK arrives while the client is in this state, it
goes to the BOUND state and uses the IP address.
17
Transition States(cont.)
19
Network Address
Resolution (NAT)
■ The distribution of addresses through ISPs has created a new
problem. Assume that an ISP has granted a small range of
addresses to a small business or a household.
■ If the business grows or the household needs a larger range, the
ISP may not be able to grant the demand because the addresses
before and after the range may have already been allocated to
other networks.
■ In most situations, however, only a portion of computers in a
small network need access to the Internet simultaneously. This
means that the number of allocated addresses does not have to
match the number of computers in the network.
20
Network Address
Resolution (NAT)
■ For example, assume that in a small business with 20
computers the maximum number of computers that access the
Internet simultaneously is only 4.
■ Most of the computers are either doing some task that does not
need Internet access or communicating with each other.
■ This small business can use the TCP/IP protocol for both internal
and universal communication.
■ The business can use 20 (or 25) addresses from the private
block addresses (discussed before) for internal communication;
five addresses for universal communication can be assigned by
the ISP.
21
Network Address
Resolution (NAT)
■ A technology that can provide the mapping between the private
and universal addresses, and at the same time support virtual
private networks is Network Address Translation (NAT).
■ The technology allows a site to use a set of private addresses for
internal communication and a set of global Internet addresses
(at least one) for communication with the rest of the world.
■ The site must have only one connection to the global Internet
through a NAT-capable router that runs NAT software. Figure
(next slide) shows a simple implementation of NAT.
22
Network Address
Resolution (NAT)
23