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過程是否成功。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章