bootp引导程序协议

bootp又称为引导程序协议,我们来简单了解一下这个协议以及他的用法。

1,BOOTP 请求和应答均被封装在 U D P数据报中 ;

2,B O O T P使用 U D P,且通常需与 T F T P协同工作;

3,B O O T P有两个熟知端口: BOOTP 服务器为67(50067), BOOTP 客户为68(50068),这两个端口一般是固定不变的。

tftp协议后续再介绍,现在我们先来了解一下bootp.

3,bootp的报文了解.

我们看上面的报文,可以看到目的地址为0xffffffffff, 即是广播报文,我们可以看到request报文和reply报文都是广播报文的,那么为什么呢(这里的端口是固定的)

 IP数据报我们前面有了解过,这里不赘述了,整个报文结构如下 ,前面还有个以太网首部,即是

mac首部+ ip首部+udp首部 + udp报文。

 bootp的udp报文数据结构分析:

 报文分析

 请求报文:

op = 01;

Htype = 01;

HLen = 06;

XID = 0x7d174686;

chaddr = 0x001ab6334401(00....)

sname = 0x74697661(0000....)

 回应报文:

op = 02;

Htype = 01;

HLen = 06;

XID = 0x9d174686;

chaddr = 0x001ab6334401(00....)

sname = 0x74697661(0000....)

uint32 CIAddr; //  0x0000000

 uint32 YIAddr;//  0x7e000101(126.0.1.1)

 uint32 SIAddr;  //0x7e000107(126.0.1.7)

  uint32 GIAddr; // 0x00000

  uint8 CHAddr[16]; 0x001ab6334401(000..)

  char SName[64]; //  0x74697661(000..)

  char File[128]; .//0x6669726d776172652e62696e(000..)
 

数据结构:

typedef struct
{	  
	uint8 op; // The operation; 1 is a request, 2 is a reply.

	uint8 HType;// The hardware type; 1 is Ethernet. 

	uint8 HLen;// The hardware address length; for Ethernet this will be 6, the length of the MAC address. 

	uint8 Hops;// Hop count, used by gateways for cross-gateway booting.

	uint32 XID;// The transaction ID.

	uint16 Secs; // The number of seconds elapsed since the client started trying to boot.

	uint16 Flags;// The BOOTP flags. 

	uint32 CIAddr; // The client's IP address, if it knows it. 

	uint32 YIAddr;// The client's IP address, as assigned by the BOOTP server. 

	uint32 SIAddr; // The TFTP server's IP address.

	uint32 GIAddr; // The gateway IP address, if booting cross-gateway.

	uint8 CHAddr[16];// The hardware address; for Ethernet this is the MAC address.

	char SName[64]; // The name, or nickname, of the server that should handle this BooTP // request. 

	char File[128]; // The name of the boot file to be loaded via TFTP. 

	uint8 Vend[64];// optional vendor-specific area; not used for BOOTP.
 }bootp_pkt_t;

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陌上花开缓缓归以

你的鼓励将是我创作的最大动力,

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值