当前位置:网站首页>ARP报文头部格式和请求流程
ARP报文头部格式和请求流程
2022-07-01 22:58:00 【拉普拉强】
ARP头部格式
格式说明:
- 硬件类型:16位字段,用来定义运行ARP的网络类型。每个局域网基于其类型被指派一个整数。例如:以太网的类型为1。ARP可用在任何物理网络上。
- 协议类型:16位字段,用来定义使用的协议。例如:对IPv4协议这个字段是0800。ARP可用于任何高层协议
- 硬件地址长度:8位字段,用来定义物理地址的长度,以字节为单位。例如:对于以太网的值为6。
- 协议地址长度:8位字段,用来定义逻辑地址的长度,以字节为单位。例如:对于IPv4协议的值为4。
- 操作码:16位字段,用来定义报文的类型。已定义的分组类型有两种:ARP请求是1,ARP响应是2,RARP请求是3,RARP应答是4。
- 源硬件地址:这是一个可变长度字段,用来定义发送方的物理地址。例如:对于以太网这个字段的长度是6字节。
- 源逻辑地址:这是一个可变长度字段,用来定义发送方的逻辑(IP)地址。例如:对于IP协议这个字段的长度是4字节。
- 目的硬件地址:这是一个可变长度字段,用来定义目标的物理地址,例如,对以太网来说这个字段位6字节。对于ARP请求报文,这个字段为全0,因为发送方并不知道目标的硬件地址。
- 目的逻辑地址:这是一个可变长度字段,用来定义目标的逻辑(IP)地址,对于IPv4协议这个字段的长度为4个字节。
在以太网中发送ARP请求的时候,以太头的源MAC地址为本地MAC,目的MAC地址为全f;ARP中的源MAC为本地MAC,源IP是本机的IP,目的MAC为0,目的IP为请求的IP地址
ARP请求流程
A主机向请求B主机MAC地址时,会先判断A、B是否属同一网段,分别采用不同的方式发送ARP请求。
- 同一网段
- A发送ARP广播,交换机学习A的MAC地址,并泛洪。
- B收到ARP包后发送ARP单播给A,同时交换机学到B的MAC地址,随后A学到B的MAC地址
- 跨网段
- A发送ARP广播,请求网关的MAC
- 数据包改成:源:A IP,目的:B IP,源MAC:A MAC,目的MAC:网关MAC
- A将ARP数据包发送给A的网关
- A的网关查询路由表,修改数据包:源目IP不变,源MAC改成A网关的MAC,目的MAC改成下一跳的MAC,路由递归,最终到达B的网关
- B网关查询到本机有B的MAC地址,原路返回B的MAC地址给A
如果AB属于同网段,但是A到B没有直连的路由,那么A也会走跨网段的流程,将数据包发送给网关处理。
边栏推荐
- mysql binlog的清理
- 神经网络物联网的发展趋势和未来方向
- flutter Unable to load asset: assets/images/888.png
- [applet] realize the left and right [sliding] list through the scroll view component
- SWT/ANR问题--SWT 导致 low memory killer(LMK)
- 为什么PHP叫超文本预处理器
- Commemorate becoming the first dayus200 tripartite demo contributor
- Stm32f030f4 drives tim1637 nixie tube chip
- Jielizhi, production line assembly link [chapter]
- Zhao Fuquan: to ensure supply in the short term, we should build a safe, efficient and resilient supply chain in the long term
猜你喜欢
AirServer最新Win64位个人版投屏软件
Yunxin small class | common cognitive misunderstandings in IM and audio and video
Zero foundation tutorial of Internet of things development
The online beggar function of Japanese shopping websites
[MySQL] basic use of explain and the function of each column
Jerry's records are powered by Vbat with a power supply voltage of 4.2V [chapter]
会声会影2022智能、快速、简单的视频剪辑软件
CKS CKA ckad change terminal to remote desktop
Win 10 mstsc connect RemoteApp
You probably haven't noticed the very important testing strategy in your work
随机推荐
“35岁,公司老总,月薪2万送外卖“:时代抛弃你,连声再见都没有
Yoga27 multidimensional all-in-one computer with excellent appearance and high-end configuration
RPA: Bank digitalization, business process automation "a small step", and loan review efficiency "a big step"
Advanced skills of testers: a guide to the application of unit test reports
De PIP. Interne. CLI. Main Import main modulenotfounderror: No module named 'PIP'
2022 examination questions and online simulation examination for safety management personnel of hazardous chemical business units
from pip._internal.cli.main import main ModuleNotFoundError: No module named ‘pip‘
每日三题 6.28
2022 crane driver (limited to bridge crane) examination questions and simulation examination
Jerry's question about long press boot detection [chapter]
plain framework的实际应用和扩展
y53.第三章 Kubernetes从入门到精通 -- ingress(二六)
Timer和ScheduledThreadPoolExecutor的区别
Redis数据类型和应用场景
SWT / anr problem - SWT causes kernel fuse deadlock
Treatment of insufficient space in the root partition of armbain system
Current situation and future development trend of Internet of things
[机缘参悟-35]:鬼谷子-飞箝篇-远程连接、远程控制与远程测试之术
Detailed explanation of twenty common software testing methods (the most complete in History)
Zhao Fuquan: to ensure supply in the short term, we should build a safe, efficient and resilient supply chain in the long term