Read a book about the IP prtocol and the WIndows doucmentation.
Dynamic IP refers to an IP address that is dynamically assigned to a computer when the computer connects to the physical network ,by means of a DHCP server which dynamically configures the host (with a dynamic IP). The opposite is a STATIC IP which is hard-coded into the computer configuration (i.e. you set it statically).
More is in the documentation. This is a low level beginner question - answering it without a lot of context is hard. Books and Documentation provide the context.
当您的网络适配器连接到网络时,它会向 DHCP 服务器请求 IP 地址的租用。 DHCP 服务器返回的 IP 地址具有有限的生命周期。当租约到期时,网络适配器必须请求新的租约。
租约的生命周期通常约为 2 小时或 24 小时,取决于适合网络的情况。租约有效期短并不意味着您经常更改 IP 地址,因为大多数时候您会获得与之前相同的 IP 地址的租约。
对于不涉及 DHCP 服务器的静态 IP 地址,您只需在网络设置中输入 IP 地址即可。
您无法使用套接字实现动态 IP 地址,因为您需要已有 IP 地址才能建立套接字连接。
A dynamic IP address is assigned from a DHCP server (Dynamic Host Configuration Protocol).
When your network adapter connects to the network, it asks the DHCP server for a lease on an IP address. The DHCP server returns an IP address which has a limited life time. When the lease expires, the network adapter has to ask for a new lease.
The lifetime of a lease is usually something like two hours or 24 hours, whatever is appropriate for the network. A short lifetime for the lease doesn't mean that you change IP address often, because most of the time you will get a lease for the same IP address that you had before.
For a static IP address the DHCP server isn't involved, you simply enter the IP adress in the network settings.
You can't implement dynamic IP addresses using sockets, because you need to have an IP address already to establish a socket connection.
发布评论
评论(2)
阅读一本有关 IP 协议和 WIndows 文档的书。
动态IP是指当计算机连接到物理网络时,通过动态配置主机(具有动态IP)的DHCP服务器动态分配给计算机的IP地址。相反的是静态IP,它被硬编码到计算机配置中(即静态设置)。
更多内容在文档中。这是一个低水平的初学者问题 - 在没有大量背景的情况下回答它是很困难的。书籍和文档提供了上下文。
Read a book about the IP prtocol and the WIndows doucmentation.
Dynamic IP refers to an IP address that is dynamically assigned to a computer when the computer connects to the physical network ,by means of a DHCP server which dynamically configures the host (with a dynamic IP). The opposite is a STATIC IP which is hard-coded into the computer configuration (i.e. you set it statically).
More is in the documentation. This is a low level beginner question - answering it without a lot of context is hard. Books and Documentation provide the context.
动态 IP 地址是从 DHCP 服务器(动态主机配置协议)分配的。
当您的网络适配器连接到网络时,它会向 DHCP 服务器请求 IP 地址的租用。 DHCP 服务器返回的 IP 地址具有有限的生命周期。当租约到期时,网络适配器必须请求新的租约。
租约的生命周期通常约为 2 小时或 24 小时,取决于适合网络的情况。租约有效期短并不意味着您经常更改 IP 地址,因为大多数时候您会获得与之前相同的 IP 地址的租约。
对于不涉及 DHCP 服务器的静态 IP 地址,您只需在网络设置中输入 IP 地址即可。
您无法使用套接字实现动态 IP 地址,因为您需要已有 IP 地址才能建立套接字连接。
A dynamic IP address is assigned from a DHCP server (Dynamic Host Configuration Protocol).
When your network adapter connects to the network, it asks the DHCP server for a lease on an IP address. The DHCP server returns an IP address which has a limited life time. When the lease expires, the network adapter has to ask for a new lease.
The lifetime of a lease is usually something like two hours or 24 hours, whatever is appropriate for the network. A short lifetime for the lease doesn't mean that you change IP address often, because most of the time you will get a lease for the same IP address that you had before.
For a static IP address the DHCP server isn't involved, you simply enter the IP adress in the network settings.
You can't implement dynamic IP addresses using sockets, because you need to have an IP address already to establish a socket connection.