当前位置:网站首页>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也会走跨网段的流程,将数据包发送给网关处理。
边栏推荐
- The digital summit is popular, and city chain technology has triggered a new round of business transformation
- CADD course learning (3) -- target drug interaction
- The difference between timer and scheduledthreadpoolexecutor
- Experience of practical learning of Silicon Valley products
- mysql ---- Oracle中的rownum转换成MySQL
- dat. GUI
- Daily three questions 6.30
- Development trend and future direction of neural network Internet of things
- 2022 examination questions and online simulation examination for safety management personnel of hazardous chemical business units
- plain framework的实际应用和扩展
猜你喜欢
[understanding of opportunity-35]: Guiguzi - flying clamp - the art of remote connection, remote control and remote testing
Zero foundation tutorial of Internet of things development
众昂矿业:发展以氟化工为主的特色化工产业具有先天优势
数字峰会人气火爆,城链科技引发新一轮商业变革
[机缘参悟-35]:鬼谷子-飞箝篇-远程连接、远程控制与远程测试之术
问题随记 —— file /usr/share/mysql/charsets/README from install of MySQL-server-5.1.73-1.glibc23.x86_64 c
赵福全:短期解决保供,长期要打造安全、高效有韧性的供应链
微信个人小商店一键开通助手小程序开发
Airserver latest win64 bit personal screen projection software
CKS CKA ckad change terminal to remote desktop
随机推荐
Treatment of insufficient space in the root partition of armbain system
Some abilities can't be learned from work. Look at this article, more than 90% of peers
The online beggar function of Japanese shopping websites
Detailed explanation of twenty common software testing methods (the most complete in History)
Jielizhi, production line assembly link [chapter]
Linux基础 —— CentOS7 离线安装 MySQL
Summary of "performance testing" of software testing, novice will know the knowledge points on the road
Redis~02 cache: how to ensure data consistency in MySQL and redis when updating data?
云信小课堂 | IM及音视频中常见的认知误区
神经网络物联网的未来趋势与发展
dat. GUI
2022 examination questions and online simulation examination for safety management personnel of hazardous chemical business units
SWT/ANR问题--SWT 导致 low memory killer(LMK)
[MySQL] database optimization method
【微服务|Sentinel】@SentinelResource详解
关于游戏性能优化的一些感想
内存泄露和内存溢出的区别是什么?
证券开户选哪个证券公司比较好,哪个更安全
软件架构的本质
You probably haven't noticed the very important testing strategy in your work