动态主机设置协议(Dynamic Host Configuration Protocol, DHCP)是一个局域网的网络协议,使用UDP协议工作,主要有两个用途:

  • 给内部网络或网络服务供应商自动分配IP地址给用户
  • 给内部网络管理员作为对所有计算机作中央管理的手段

DHCP使用了租约的概念,或称为计算机IP地址的有效期。租用时间是不定的,主要取决于用户在某地联接Internet需要多久,这对于教育行业和其它用户频繁改变的环境是很实用的。通过较短的租期,DHCP能够在一个计算机比可用IP地址多的环境中动态地重新配置网络。DHCP支持为计算机分配静态地址,如需要永久性IP地址的Web服务器。

When a computer or other networked device connects to a network, its DHCP client software in the operating system sends a broadcast query requesting necessary information. Any DHCP server on the network may service the request. The DHCP server manages a pool of IP addresses and information about client configuration parameters such as default gateway, domain name, the name servers, and time servers. On receiving a request, the server may respond with specific information for each client, as previously configured by an administrator, or with a specific address and any other information valid for the entire network, and the time period for which the allocation (lease) is valid.

The client broadcasts messages on the network subnet using the destination address 255.255.255.255 or the specific subnet broadcast address. A DHCP client may also request its last-known IP address. If the client remains connected to the same network, the server may grant the request. Otherwise, it depends whether the server is set up as authoritative or not. An authoritative server denies the request, causing the client issue a new request. A non-authoritative server simply ignores the request, leading to an implementation-dependent timeout for the client expire the request and ask for a new IP address.

When a DHCP server receives a DHCPDISCOVER message from a client, which is an IP address lease request, the server reserves an IP address for the client and makes a lease offer by sending a DHCPOFFER message to the client. This message contains the client's MAC address, the IP address that the server is offering, the subnet mask, the lease duration, and the IP address of the DHCP server making the offer.

In response to the DHCP offer, the client replies with a DHCP request, broadcast to the server, requesting the offered address. A client can receive DHCP offers from multiple servers, but it will accept only one DHCP offer. Based on required server identification option in the request and broadcast messaging, servers are informed whose offer the client has accepted.[5] When other DHCP servers receive this message, they withdraw any offers that they might have made to the client and return the offered address to the pool of available addresses.

When the DHCP server receives the DHCPREQUEST message from the client, the configuration process enters its final phase. The acknowledgement phase involves sending a DHCPACK packet to the client. This packet includes the lease duration and any other configuration information that the client might have requested. At this point, the IP configuration process is completed.

After the client obtains an IP address, the client may use the Address Resolution Protocol (ARP) to prevent address conflicts caused by overlapping address pools of DHCP servers.

Network | DHCP的更多相关文章

  1. openstack network:dhcp binding fail

  2. 7、二种 为二个不同的子网配置DHCP服务器(中继代理服务器)

    环境如下:        (参考之前,保证二个子网可以互相ping通) 虚拟机vm1        192.168.170.3                    VMnet8 (NAT模式) 虚拟 ...

  3. 创建第一个 local network(II)- 每天5分钟玩转 OpenStack(81)

    上一节通过 Web GUI 创建了 “first_local_net”,本节我们需要搞清楚底层网络结构有了哪些变化? 点击 “first_local_net” 链接,显示 network 的 subn ...

  4. openstack中虚拟机和其网络的联系方法 instance and network

    instance和network的连接关系: 在neutron数据库中,ports存储了instance和端口的关系,其中device_id表示了instance的id,在nova数据库中的insta ...

  5. 【OpenStack】network相关知识学习

    network 类型 local:通信不跨主机,必须同一网段,主要做单机测试使用: flat:统计可以跨主机,但是需要在同一网段: 每个 flat network 都会独占一个物理网卡 计算节点上 b ...

  6. openstack通过Network Namespace和iptables实现租户私有网络互訪和L3路由功能

    安装架构介绍 本文旨在通过自己搭建类似neutron (openvswitch + gre) 实现SDN 的环境,学习了解其工作原理,模拟核心原理.比方:同一租户自己定义网络 instance 互通, ...

  7. 理解 neutron(15):Neutron linux-bridge-agent 创建 linux bridge 的简要过程

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  8. 【openwrt】再设置

    https://wiki.openwrt.org/zh-cn/doc/uci/network https://wiki.openwrt.org/zh-cn/doc/uci/wireless https ...

  9. yiStack平台维护

    <一.> yiStack 二次封装 Iso通用发行版相关配置属性值替换1.1.yiStack AIO一体机环境根据部署子网替换修改示例如下:主要修改替换isolinux/ks-aio.cf ...

随机推荐

  1. 数字内置方法详解(int/long/float/complex)

    一.常用方法 1.1.int 以下是Python2.7的int内置函数: 序号 函数名 作用 举例 1 int.bit_length() 二进制存储这个整数至少需要多少bit(位). >> ...

  2. 《Java并发编程实战》读书笔记一 -- 简介

    <Java并发编程实战>读书笔记一 -- 简介 并发的历史 并发的历史,也是人类利用有限的资源去提高生产效率的一个的例子. 设想现在有台计算机,这台计算机具有以下的资源: 单核CPU一个 ...

  3. Python函数的基本定义和调用以及内置函数

    首先我们要了解Python函数的基本定义: 函数是什么? 函数是可以实现一些特定功能的小方法或是小程序.在Python中有很多内建函数,当然随着学习的深入,你也可以学会创建对自己有用的函数.简单的理解 ...

  4. 02 Django模型

    ORM 的作用 ORM 作用示意图 ORM 框架的功能 建立模型类和表之间的对应关系,允许通过面向对象的方式来操作数据库 根据设计的模型类生成数据库中的表格. 通过方便的配置就可以进行数据库的切换 数 ...

  5. init_bootmem_node

    初始化pg_data_t->bdtat结构体, /* * node_bootmem_map is a map pointer - the bits represent all physical ...

  6. LeetCode(260) Single Number III

    题目 Given an array of numbers nums, in which exactly two elements appear only once and all the other ...

  7. STM32——PWM基本知识及配置过程

    将通用定时器分为四个部分: 1,选择时钟 2,时基电路 3,输入捕获 4,输出比较 本节定时器PWM输出主要涉及到定时器框图右下方部分,即输出比较部分 和上一讲相同,时基时钟来源于内部默认时钟 对此有 ...

  8. day02 Python 的模块,运算,数据类型以及方法

    初识pyhton的模块: 什么是模块: 我的理解就是实现一个功能的函数,把它封装起来,在你需要使用的时候直接调用即可,我的印象里类似于shell 的单独函数脚本. python 的模块分为标准的和第三 ...

  9. Appscan安全漏洞扫描使用(转)

    这里主要分享如何使用AppScan对一大项目的部分功能进行安全扫描. ----------------------------------------------------------------- ...

  10. 大数据学习——scala数组

    package com import scala.collection.mutable.ArrayBuffer /** * Created by Administrator on 2019/4/8. ...