Network | DHCP
动态主机设置协议(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的更多相关文章
- openstack network:dhcp binding fail
- 7、二种 为二个不同的子网配置DHCP服务器(中继代理服务器)
环境如下: (参考之前,保证二个子网可以互相ping通) 虚拟机vm1 192.168.170.3 VMnet8 (NAT模式) 虚拟 ...
- 创建第一个 local network(II)- 每天5分钟玩转 OpenStack(81)
上一节通过 Web GUI 创建了 “first_local_net”,本节我们需要搞清楚底层网络结构有了哪些变化? 点击 “first_local_net” 链接,显示 network 的 subn ...
- openstack中虚拟机和其网络的联系方法 instance and network
instance和network的连接关系: 在neutron数据库中,ports存储了instance和端口的关系,其中device_id表示了instance的id,在nova数据库中的insta ...
- 【OpenStack】network相关知识学习
network 类型 local:通信不跨主机,必须同一网段,主要做单机测试使用: flat:统计可以跨主机,但是需要在同一网段: 每个 flat network 都会独占一个物理网卡 计算节点上 b ...
- openstack通过Network Namespace和iptables实现租户私有网络互訪和L3路由功能
安装架构介绍 本文旨在通过自己搭建类似neutron (openvswitch + gre) 实现SDN 的环境,学习了解其工作原理,模拟核心原理.比方:同一租户自己定义网络 instance 互通, ...
- 理解 neutron(15):Neutron linux-bridge-agent 创建 linux bridge 的简要过程
学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...
- 【openwrt】再设置
https://wiki.openwrt.org/zh-cn/doc/uci/network https://wiki.openwrt.org/zh-cn/doc/uci/wireless https ...
- yiStack平台维护
<一.> yiStack 二次封装 Iso通用发行版相关配置属性值替换1.1.yiStack AIO一体机环境根据部署子网替换修改示例如下:主要修改替换isolinux/ks-aio.cf ...
随机推荐
- 谷歌放弃“不作恶” Alphabet要“遵守法律互相尊重”
对于一些谷歌粉而言,谷歌那条“不作恶(Don’t be evil)”的行为准则是他们引以为傲的精神信仰.这一准则于1999年被首次确认,谷歌在2004年申请上市时也提到了这一点.不过现在这一点要改变了 ...
- graph-bfs-八数码问题
这个看起来是童年回忆:) 大体思路是,将每个排列状态看成图中的一个点,状态之间转换说明有边.然后用bfs,如果遍历完之后还是没有找到目标状态, 则说明是无解的,否则输出步数.具体想法写在代码里吧,多多 ...
- python3与python2的编码问题
在讲这个问题之前,我们先说说unicode的工作原理.unicode包含了跟全球所有国家编码的映射关系,就是不管你用哪个国家的编码,unicode都能找到它在unicode中的编码.那么无论你用什么编 ...
- POJ 2763 树链剖分 线段树 Housewife Wind
单个边的权值修改以及询问路径上的权值之和. 数据量比较大,用vector存图会超时的. #include <iostream> #include <cstdio> #inclu ...
- java静态代理模式
代理模式分为动态代理和静态代理. 静态代理简述: 1.为其他对象提供一种代理,以控制对这个对象的访问. 2.代理对象会起到中介的作用,可以增加些功能,也可以去掉某些功能. 静态代理: 代理和被代理对象 ...
- day01 项目
项目名称: 编写登陆接口 项目需求: 1 输入用户名密码 2 认证成功后显示欢迎信息 3 输错3次之后锁定,包括下次运行此程序也要锁定,涉及到持久化的问题只能用python 自 ...
- PHP函数参数传递(相对于C++的值传递和引用传递)
学语言学得比较多了,今天突然想PHP函数传递,对于简单类型(基本变量类型)和复杂类型(类)在函数参数传递时,有没有区别呢,今天测试了下: 代码如下: <?php function test($a ...
- Selenium WebDriver- 操作frame中的页面元素
#encoding=utf-8 import unittest import time from selenium import webdriver from selenium.webdriver i ...
- day05_03 字符串格式化
pycharm小技巧,一般情况下都需要在代码前注释以下作者以及创建日期 但是如何让软件默认生成呢? 格式化输出 可以用占位符 %s string的缩写 #__author:Administra ...
- day03_11 if语句实现猜年龄01
老男孩猜年龄游戏 age_of_princal = 56 guess_age = int( input(">>:") ) #以下为伪代码 ''' if guess_ag ...