The Procedures of Ping

Host A Ping through Host B as FIG.1.


 
FIG.1 

HOST A -->ROUTER

1. 在host A 中ICMP 将创建一个回应请求数据包.
2. ICMP将这有效负荷递交给因特网协议(IP),IP用它创建分组(packet).
3. 分组被创建后,协议就判断目标IP地址的位置(local or other networks).
4. 当确定为远程网络时,就将分组发送给默认网关.
5. 要发送给默认网关需要已知其IP地址以及接口的硬件地址(分组只有知道了硬件的接口地址,分组才能传输到下一层数据链路层,并在此完成帧的组建—> 路由接口).
6. 检查主机的ARP缓存,查看此默认网关的IP地址是否被解析为一个硬件地址.
a. 若已经被解析,分组将被传送到数据链路层,以转化为帧.
b. 若没有被解析,ARP的广播将被发送到LAN中以查找IP地址对应的MAC地址—> 网关相应并发送MAC address.
7. 当分组以及目标MAC地址交给数据链路层(data link layer),局域网驱动程序负责选用合适所在局域网类型的介质访问方式,将控制信息封装到该分组上,帧就被创建了.
8. 一旦帧创建完成,这个帧将交给物理层,物理层会以比特的方式将帧传送到物理介质上.
9. 这时,此冲突域中的每台设备都会接收到这些比特流,并将他们组建成帧(each equipment will do the RPC and compare the content with FCS in its frame).
a. 如果不匹配便直接丢弃.
b. 如果CRC结果与FCS匹配-->接着检查数据中的目的MAC与自己是否匹配.
c. 如果匹配--> 查看以太网类型字段,以获取完成数据后续处理.
10. 将分组从帧中提出,并将其他部分丢弃。分组被传递交给以太网类型字段中列出 的协议--> 这边是IP.

ROUTER --> HOST B

11. 默认网关接收到这个分组,并检查分组中的目标IP地址。若分组的目标地址与接收该数据包的router的address 不同,then router will search the target address in its routing table.
a. 在路由表中,如果没有与目标IP相匹配的地址,那么该数据包将被丢弃,并且router会回源设备目标不可达的反馈消息.
b. 若存在路由器将数据包交换到Ethernet1 的buffer中.
12. 此E1 缓冲区需要获得目的主机的硬件地址,因此首先查看ARP缓存.
a. 若有,直接将分组change into frame in data link layer.
b. Or, it will send the ARP request for MAC address of target IP.
13. Data link layer will combine the target MAC address, source address, Ethernet type and FCS into the frame. Then transmit it into the physical layer, where the data type frame will transform into bit.
14. Host_B will receive the frame .
a. in data link layer, B will run CRC immediately.
b. If the result math with the FCS.
c. then check the target MAC address contained in the frame.
d. If it matches all above, then check the value of Ethernet type numeric field, after which the     packet will be sent to the network layer.
15. In network layer, B will receive the packets and check the head of IP message by running CRC.
16. 若此数据有效,It will be sent to ICMP in application layer, which will know the burden is a request data. Then the ICMP deposit the packet and produce a new effective burden as reply data.

HOST B --> ROUTER

17. 这样一个包含源地址,目的地址,协议字段和有效负荷的一个新分组就被创建出来了.
18. 在分配递交IP后,它将对这个目的方的IP地址的位置进行判断(本地or远程).
19. 根据位置确定默认网关--> ARP buffer中查找gateway MAC地址.
a. 若没有,则发送ARP请求.
b. 查到时,则将target MAC address send to DLL(data link layer)to create the frame.
20. DLL 将packet 分装起来成帧,帧头包含:
a. target MAC address  & source MAC address.
b. the type of Ethernet .
c. 值为CRC结果的FCS字段.
21. 帧-->belongs to the physical layer and is transmitted in network media in the form of bit.
22. Router’s E1 will receive these bit messages and reconstructed into Frame. The FCS will be also checked by the CRC result.
23. If the router’s port is matching with the target MAC address, the packet in the frame will be accepted , and check the Ethernet type of frame, which is used to determine the accepted network protocol of this frame.
24. 由于以太网类型字段中指定的是IP,于是分组被递交给了网络层,在网络层会对IP报头进行CRC检测.
25. 根据第一次ICMP请求数据包,路由器知道如何到达target address host A , 此时用于输出的接口就是E0, the packet is loaded in the buffer of E0 port.
26. Router check ARP 缓存,确定目标IP的硬件地址是否被解析.
27. 同样由于第一次的发送请求过程,此时的target address host A 已经在buffer中,因此一起被递交给数据链路层.
28. DLL will use the target MAC, source MAC and Ethernet type 完成帧的创建,随后对帧进行CRC, 并把result load into FCS 字段.

ROUTER --> HOST A

29. Host A 接收到来自host B的reply信号处理方式类似于ROUTER --> HOST B. 当把router反馈回来的reply信号通过ICMP解析剥去的MAC 头 ,IP头,以太网类型字段后剩下的burden数据,判断ping过程是否成功。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值