【正文】
四、 總結(jié) 本次計算機網(wǎng)絡的課程設計收獲頗多,總體總結(jié)下來可以有以下幾點收獲和體會。 24. The datagram containing the HTTP reply message is forwarded through the Google, Comcast, and school works, and arrives at Bob’s laptop. Bob’s web browser program reads the HTTP response from the socket, extracts the html for the web page from the body of the HTTP response, and finally (finally!) displays the web page! 這個包含有 HTTP 回復消息的數(shù)據(jù)報通過層層轉(zhuǎn)發(fā)到 Bob 的電腦。 TCP 報文段被封裝在數(shù)據(jù)報中然 后發(fā)送傳輸?shù)焦雀瑁M行的是 1820 部分。 22. With the socket on Bob’s laptop now (finally) ready to send bytes to , Bob’s browser creates the HTTP GET message containing the URL to be fetched. The HTTP GET message is then written into the socket, with the GET message being the payload of a TCP segment. The TCP segment is placed in a datagram and sent and delivered to as in steps 18- 20 above. 有了連接套接字 Bob 的電腦就可以準備發(fā)送字節(jié)到谷歌, Bob 的瀏覽器創(chuàng)建 HTTP GET 消息進行訪問,其中使用 URL。 21. The datagram containing the TCP SYNACK segment is forwarded through the Google, Comcast, 26 and school works, eventually arriving at the Ether card in Bob’s laptop. The datagram is demultiplexed within the operating system to the TCP socket created in step 18, which enters the connected state. 該包含 TCP SYN ACK 的報文段在通過層層轉(zhuǎn)發(fā)到 Bob 的電腦上。 這樣,一個在 googleHTTP 服務器和 Bob 電腦上的 TCP 鏈接套接字就被創(chuàng)建成功了。 20. Eventually, the datagram containing the TCP SYN arrives at . The TCP SYN message is extracted from the datagram and demultiplexed to the wele socket associated with port 80. A connection socket is created for the TCP connection between the Google HTTP server and Bob’s laptop. A TCP SYNACK segment is generated, placed inside a datagram addressed to Bob’s laptop, and finally placed inside a linklayer frame appropriate for the link connecting to its firsthop router. 最終,包含 TCP SYN 的報文段 到達谷歌服務器。 19. The routers in the school work, Comcast’s work, and Google’s work forward the datagram containing the TCP SYN towards , using the forwarding table in each router, as in steps 14- 16 above. Recall that the router forwarding table entries governing forwarding of packets over the interdomain link between the Comcast and Google works are determined by the BGP protocol. 學校網(wǎng)絡上的路由器,電信網(wǎng)絡和谷歌所在網(wǎng)絡的路由器都使用各自的轉(zhuǎn)發(fā)表負責轉(zhuǎn)發(fā)包含TCP SYN 的報文到谷歌服務器。 當 Bob 創(chuàng)建 TCP 套接字, TCP 連接第一次必須和谷歌服務器執(zhí)行三次握手。 最后,經(jīng)過許多工作之后, Bob 的電腦準備連接谷歌服務器。 這個報文將被轉(zhuǎn)發(fā)通過電信網(wǎng)絡到學校路由器,然后在通過以太網(wǎng)交換機到 Bob 的電腦。 DNS 服務器提取 DNS 查詢報文,在 DNS數(shù)據(jù)庫中查找谷歌域名,找到包含谷歌 IP 地址的 DNS25 源記錄(假設該地址被放到 DNS 服務器的緩沖區(qū)中) 調(diào)用這些緩存數(shù)據(jù)起源于 認證的 DNS 服務器。 15. The leftmost router in the Comcast work ? receives the frame, ? extracts the IP datagram, ? examines the datagram’s destination address () and ? determines the outgoing interface on which to forward the datagram towards the DNS server from its forwarding table, which has been filled in by Comcast’s intradomain protocol (such as RIP, OSPF, or ISIS) as well as the Inter’s interdomain protocol, BGP. 最左邊的路由器在電信公司的網(wǎng)絡上 接收數(shù)據(jù)幀,提取 IP 報文段,檢查報文的目 的 IP 地址,檢查從路由器的轉(zhuǎn)發(fā)表發(fā)送數(shù)據(jù)報到 DNS 服務器的合適的接口,轉(zhuǎn)發(fā)表通過域內(nèi)網(wǎng)關協(xié)議和邊界網(wǎng)關協(xié)議來進行填充。 路由器查看目的 IP ,然后檢查它的轉(zhuǎn)發(fā)表,上圖中最左邊的路由器。 Bob 的電腦發(fā)送幀到交換機,然后發(fā)送到網(wǎng)關路由器。 13. Bob’s laptop can now (finally!) address the Ether frame containing the DNS query to the gateway router’s MAC address. Note that the IP datagram in this frame has an IP destination address of (the DNS server), while the frame has a destination address of 00:22:6B:45:1F:1B (the gateway router). Bob’s laptop sends this frame to the switch, which delivers the frame to the gateway router. Bob 的電腦現(xiàn)在能發(fā)送包含 DNS 查詢報文的以太網(wǎng)幀到網(wǎng)關路由器的 MAC 地址。 網(wǎng)關路由器將 ARP 請求報文封裝在以太網(wǎng)幀中,其目的地址為 Bob 電腦的 MAC 地址,并且24 發(fā)送幀到交換機,交換機再發(fā)送在、數(shù)據(jù)幀到 Bob 的 電腦。 11. The gateway router receives the frame containing the ARP query message on the interface to the school work, and finds that the target IP address of in the ARP message matches the IP address of its interface. The gateway router thus prepares an ARP reply, indicating that its MAC address of 00:22:6B:45:1F:1B corresponds to IP address . It places the ARP reply message in an Ether frame, with a destination address of 00:16:D3:23:68:8A (Bob’s laptop) and sends the frame to the switch, which delivers the frame to Bob’s laptop. 網(wǎng)關路由器接收包含 ARP 查詢消息的幀到連接學校網(wǎng)絡的接口,發(fā)現(xiàn)在 ARP 查詢消息中 的目標地址和它的接口相匹配。 為了獲得默認網(wǎng)關的 MAC 地址還需要 ARP 協(xié)議。 該數(shù)據(jù)幀將被發(fā)送到處在學校網(wǎng)絡上的默認網(wǎng)關。 23 8. The operating system on Bob’s laptop thus creates a DNS query message, putting the string “” in the question section of the DNS message. This DNS message is then placed within a UDP segment with a destination port of 53 (DNS server). The UDP segment is then placed within an IP datagram with an IP destination address of (the address of the DNS server returned in the DHCP ACK in step 5) and a source IP address of . Bob 電腦的 OS 創(chuàng)建一個 DNS 查詢消息,其中把谷歌域名放在 DNS 報文的請求問題部分。 為了創(chuàng)建套接字, Bob 的電腦需要知道谷歌的 IP 地址。 當 Bob 使用 URL 用瀏覽器打開谷歌首頁時,事件鏈最終將導致谷歌的主頁在他的網(wǎng)頁瀏覽器中顯示。 此時, Bob 的電腦已經(jīng)開始初始化網(wǎng)絡部件并準備開始生成并加工網(wǎng)頁。 同時也將默認網(wǎng)關的地址記錄在它的轉(zhuǎn)發(fā)表中。 7. Bob’s laptop receives the Ether frame containing the DHCP ACK, extracts the IP datagram from the Ether frame, extracts the UDP segment from the IP datagram, and extracts the DHCP ACK message from the UDP segment. Bob’s DHCP client then records its IP address and the IP address of its DNS server. It also installs the address of the default gateway into its IP forwarding table. Bob’s laptop will send all datagrams with destination address outside of its sub to the default gateway. At this point, Bob’s laptop has initialized its working ponents and is ready to begin processing the web page fetch. Note that only the last two DHCP steps of the four presented in chapter 4 are actually necessary. When Bob types the URL for into his web browser, he begins the long chain of events that will eventually result in Google’s home pa