Do you know the DHCP packet format?

Source: Internet
Author: User

To better understand a network protocol, we must clearly define and structure it. We have also explained the definition of the DHCP protocol. Here we will analyze the DHCP packet format.

DHCP packet format

Let's introduce the DHCP packet format, 1

OP (1)

Htype (1)

Hlen (1)

Hops (1)

Transaction ID (4)

Seconds (2)

Flags (2)

Ciaddr4)

Yiaddr4)

Siaddr4)

Giaddr4)

Chaddr16)

Sname64)

File128)

Optionsvariable)

Figure 1 DHCP packet format)

OP: if the client sends a packet to the server, set it to 1 and reverse to 2;

Htype: hardware type. The value of ethernet is 1;

Hlen: hardware length. The ethernet value is 6;

Hops: if the data packet needs to be transmitted through the router, add 1 to each station. If the data packet is in the same network, it is 0;

Transaction ID: Transaction ID, which is a random number used to match requests and messages between the customer and the server;

Seconds: the time specified by the user. It refers to the time after the address is obtained and updated;

Flags: from 0 to 15 bits, when the leftmost bit is 1, the server sends packets to the client in broadcast mode, and the rest are not used yet;

Ciaddr: user IP address;

Yiaddr: the customer's IP address;

Siaddr: IP Address used in the bootstrap process;

Giaddr: IP address of the forwarding Proxy gateway;

Chaddr: The hardware address of the client;

Sname: name of an optional server, ending with 0x00;

File: the Startup File Name;

Options:, vendor ID, optional parameter field

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.