Home Operation and Maintenance Linux Operation and Maintenance Detailed explanation of DHCP protocol - where does IP come from?

Detailed explanation of DHCP protocol - where does IP come from?

Dec 11, 2020 pm 04:14 PM
dhcp

We know that if a host wants to communicate with other hosts, it must have an IP address. So, where did this IP address come from? Different from the MAC address, when you buy a laptop, the MAC address is stored in the read-only memory of the network card, but the IP address is not. Therefore, the IP address needs to be set by yourself. However, to configure it yourself, you need to know the knowledge of IP addresses, and you need to configure the IP address, subnet mask, gateway address, etc. Therefore, ordinary users may not configure IP. In most cases, the Dynamic Host Configuration Protocol DHCP is used to automatically obtain information such as IP addresses.

The workflow of DHCP has four steps, which are

  • DHCP discover: The new host sends a broadcast packet saying that it needs to be assigned an IP

  • DHCP offer: The dhcp server receives the request and sends a broadcast packet to tell the new host the assigned IP and other information.

  • DHCP request: The new host receives a message from the dhcp server and knows that it has a new IP. Send a broadcast packet to tell the dhcp server that you know the newly assigned IP.

  • DHCP ack: Broadcast a message packet to tell other hosts on the network that new friends have joined.

DHCP DISCOVE

When a new host (MAC address is 00:0b:82:01:fc: 42) When it first joins a network, it does not have an IP address at this time, so it needs to send a broadcast packet to let the network administrator DHCP SERVER receive the data packet (dhcp server is specially used to allocate IP and manage ip). The broadcast packet format is as shown below

Detailed explanation of DHCP protocol - where does IP come from?

#Here is an additional knowledge point: 255.255.255.255 is a special IP address for broadcast purposes. But its broadcast range is limited, and it will stop spreading when it reaches the gateway.

DHCP OFFER

When the dhcp server receives the Boot Request, it knows that a new host needs to be assigned an IP. At this time, dhcp The server also sends a broadcast packet (because the new host has not yet been assigned an IP). The information inside is the IP, subnet mask, lease and other information assigned to the new host.

Detailed explanation of DHCP protocol - where does IP come from?

DHCP REQUEST

The new host received the message from the dhcp server and knew that it was assigned The IP has arrived, but at this time, it cannot be used. I must tell the dhcp server that I have received the IP address. Therefore, you still need to send a broadcast packet to tell the dhcp server.

Detailed explanation of DHCP protocol - where does IP come from?

DHCP ACK

When the dhcp server receives the boot request message, it will broadcast it back to the client Send a DHCP ACK message packet to indicate that the client's selection has been accepted, and the legal lease information and other configuration information of this IP address are put into the broadcast packet and sent to the client to welcome it to join the network family.

Detailed explanation of DHCP protocol - where does IP come from?

At this point, the new host has its own IP address, and all subsequent data packets sent will include its own IP.

The above is the detailed content of Detailed explanation of DHCP protocol - where does IP come from?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1667
14
PHP Tutorial
1273
29
C# Tutorial
1255
24
Win10 Ethernet Enable DHCP Repair Method Guide Win10 Ethernet Enable DHCP Repair Method Guide Dec 30, 2023 pm 02:23 PM

What happens when Windows 10 Ethernet prompts that dhcp is not enabled? Recently, some users have encountered such a problem when using computers. In order to help everyone use the network better, the editor will share the solution to the problem that Windows 10 Ethernet prompts that dhcp is not enabled. How to fix dhcp not enabled on win10 Ethernet: 1. First press the shortcut key "win+r", and then click run. 2. Then enter services.msc and press Enter. 3. Then you can find the "DHCPClient" service and double-click it to open it. 4. Finally, change the activation type to automatic and the service status to started, then press OK to save the settings and restart the local connection.

What does the dhcp service not responding mean? What does the dhcp service not responding mean? Mar 15, 2023 pm 03:16 PM

The dhcp service does not respond because there is an error in the automatic IP address acquisition service. Reconfigure the service. Reasons for no response: 1. The "Automatically obtain IP address" function is not turned on, and you only need to set the IP to "DHCP"; 2. Caused by network fluctuations, the device is connected to the network, the router assigns an IP address, and the device obtains an IP address. This requires a process. If the network fluctuates during this process, the device will be unable to obtain an IP address. 3. Equipment problems. If the router's cache is full and crashes, IP addresses cannot be assigned to networked devices.

How to configure DHCP server on RHEL 9 How to configure DHCP server on RHEL 9 Jun 08, 2023 pm 07:02 PM

DHCP is an acronym for Dynamic Host Configuration Protocol, a network protocol that automatically assigns IP addresses to client systems in a computer network. It allocates clients from the DHCP pool or the IP address range specified in its configuration. While you can manually assign static IPs to client systems, a DHCP server simplifies the process and dynamically assigns IP addresses to client systems on the network. In this article, we will demonstrate how to install and configure a DHCP server on RHEL9/RockyLinux9. Prerequisite: Pre-installed RHEL9 or RockyLinux9 with sudo management permissions

How to configure Dnsmasq as a DHCP relay server How to configure Dnsmasq as a DHCP relay server Mar 21, 2024 am 08:50 AM

The role of a DHCP relay is to forward received DHCP packets to another DHCP server on the network, even if the two servers are on different subnets. By using a DHCP relay, you can deploy a centralized DHCP server in the network center and use it to dynamically assign IP addresses to all network subnets/VLANs. Dnsmasq is a commonly used DNS and DHCP protocol server that can be configured as a DHCP relay server to help manage dynamic host configurations in the network. In this article, we will show you how to configure dnsmasq as a DHCP relay server. Content Topics: Network Topology Configuring Static IP Addresses on a DHCP Relay D on a Centralized DHCP Server

How to solve the problem that DHCP is not enabled in the local connection. Recommended solutions to the problem that the computer cannot access the Internet and prompts that the DHCP service is not enabled. How to solve the problem that DHCP is not enabled in the local connection. Recommended solutions to the problem that the computer cannot access the Internet and prompts that the DHCP service is not enabled. Mar 13, 2024 pm 12:07 PM

When many users use computers to connect to Ethernet, they will see the prompt "DHCP is not enabled" and don't know what to do. This is because the DHCP function is not enabled on the router. This article teaches you how to solve this problem. 1. Check the login information. To solve the problem of "DHCP is not enabled on the Ethernet", you need to log in to the router first. When logging in to a router, you usually need to obtain the router's gateway, username, and password information. This information is usually marked on the back of the router. The IP of the router is the so-called gateway address. The default gateway address of some routers is 192.168.1.1 or 192.168.0.1. The login account generally defaults to admin and the password is admin or 123456. 2. Log in to router management

What does dhcp not enabled mean? What does dhcp not enabled mean? Jan 30, 2023 pm 02:04 PM

Not enabling dhcp means that the computer has not been set to automatically obtain an IP address, causing Internet access errors. The solution is: 1. Press the key combination "win+r" to open the run window, enter "services.msc" and press Enter; 2. After bringing up the service window, find the "DHCP Client" service and double-click it to open it; 3. After opening the dhcp service, change its activation type to automatic and the service status to started, and then press OK to save the settings.

What is the impact of turning off dhcp on the router? What is the impact of turning off dhcp on the router? Dec 01, 2023 pm 04:01 PM

The impact of turning off dhcp on the router: 1. The client cannot automatically obtain an IP address; 2. The IP address needs to be configured manually; 3. It may cause network connection problems; 4. It affects the communication of network devices; 5. IP address conflicts; 6. Unable to proceed Dynamic address allocation; 7. Network isolation cannot be performed; 8. Traffic control cannot be performed; 9. Access control cannot be performed. It is recommended that before turning off the DHCP service, carefully consider whether it really needs to be turned off, or keep the DHCP service to ensure that the client can automatically obtain the correct IP address.

What is the dhcp port number? What is the dhcp port number? Mar 06, 2023 pm 02:48 PM

The port numbers for the DHCP service are 68 and 67. dhcp is a LAN network protocol. It is usually used in large-scale LAN environments. Its main function is to centrally manage and allocate IP addresses and improve address usage. The DHCP protocol uses UDP as the transmission protocol. The host sends a request message to port 68 of the DHCP server, and the DHCP server responds with a response message to port 67 of the host. These two ports are normal DHCP service ports, which can be understood as one sending and one take over.

See all articles