當前位置

首頁 > 商務英語 > 計算機英語 > TCP或IP是怎麼運行的

TCP或IP是怎麼運行的

推薦人: 來源: 閱讀: 1.6W 次

小編爲大家介紹了TCP或IP是怎麼運行的,希望對你有幫助哦!

TCP或IP是怎麼運行的

Over the past few years ,one of the most written-about network topics has been IP. But even with all this attention, few, if any ,stories have traced the protocol's basic workings, that is ,how routers and Layer 3 switches act upon IP information to move Ethernet packets across the network.

As a point of referenced, bear in mind that IP is a member of the TCP/IP protocol suite.

TCP functions at the Open Systems Interconnection(OSI)transport layer, or Layer chief responsibility is to ensure reliable end-to-end connectivity. IP, located one layer down, at the OSI network layer, or Layer 3, communicates the addresses of each packet's sender and receiver to the routers along the way. Routers and Layer 3 switches can read IP and other Layer 3 protocols information ,combined with routing tables and other network intelligence ,is all it takes to get across the room or around the world via TCP/IP.

The routing process begins with an IP address that is unique to the sending end station stations may be assigned permanent IP addresses or they may borrow them as needed from a Dynamic Host Configuration Protocol (DHCP) server or other service.

Each packet carries a source address, which under current (IPv4) specifications is 32 bits long its header, each packet also carries the IP address of the final destination.

If the sending end station determines that the destination address is not local ,the packet goes to a first-hop router ,typically one that is close and has been preassigned to the sender.

The router inspects the packet's IP address and performs a route table lookup to see if the destination end station resides on the local (physically connected) network, typically called an IP subnet IP subnet usually is assigned to each of the router's network interfaces.

If the destination IP address is local ,the router searches an internal store of IP addresses and local-device Media Access Control(MAC) addresses. This store is known as the Address Resolution Protocol (ARP) cache. ARP is the universal tool for matching IP addresses to MAC addresses. If the destination's MAC address appears, the router installs that MAC address in the packet header (removing its own MAC address because that's no longer needed) and sends the packet to the destination end station.

In the event that the destination MAC address does not appear in the ARP cache ?it might have timed out ,for instance? the router must broadcast an ARP request to the subnet referenced by the packet's destination IP address end station with that IP address responds, sending back its MAC address router updates its cache, installs the new MAC address into the packet header and launches the packet. If the route table lookup shows that the packet is destined for a non-local subnet, the router forwards the packet to the next-hop router using the next-hop router's MAC address. Routing tables are continuously built and rebuilt by intelligent discovery protocols, such as Routing Information Protocol or Open Shortest Path First (OSPF). Each router's routing table shows the best route to the destination address ;for addresses that may be several hops away, it shows the best next-hop router.

在過去幾年中,寫得最多的網絡題目之一就是IP。但是,即使引起了這麼多的注意,仍很少有(如果有的話)文章介紹此協議的基本工作原理,即路由器和第三層交換器是如何對IP信息起作用,以便在整個網絡中傳遞以太網包的。

作爲參考,請記住,IP是TCP/IP整套協議中的一個協議。

TCP完成開放系統互連(OSI)模型中傳輸層,即第四層的功能。它的主要責任是確保端至端之間的可靠連接。IP位於下一層,在OSI的網絡層,即第三層,把每個包的發送者和接收者地址告訴一路上各個路由器。路由器和第三層交換器可以讀出IP和其他的第三層協議。這些信息與路由表以及其他網絡智能結合在一起,能通過TCP/IP在整個房間或圍繞地球進行傳遞。

路由過程始於對發送端站而言是唯一的一個IP地址,端站可以被分配永久的IP地址,或者按需要從動態主機配置協議(DHCP)服務器或其他服務中借用。

每個包攜帶一個源地址,在目前(IPv4)規範下,包長度是32位。在報頭中,每個包也攜帶最終目的地的IP地址。

如果發送端站確定目的地址不在本地,該包就被送到第一跳路由器,一般來說,該路由器是在附近的,並已被預先分配給發送者。

該路由器檢查包的IP地址,查找路由表,看看目的端點是否位於本地(物理位置)網絡,它通常叫做IP子網,IP子網一般被分配到路由器的每個網絡接口上。

如果目的IP地址爲本地的,該路由器就搜尋存儲着IP地址和本地設備介質訪問控制(MAC)地址的內部存儲器,這個存儲器叫作地址分辨協議(ARP)高速緩存。ARP是把IP地址映射到MAC地址的通用工具。如果目的地的MAC地址出現了,該路由器就把這個MAC地址裝進包的報頭中(取掉自己的MAC地址,因爲不再需要它了),把該包送到目的端站。

萬一目的地的MAC地址沒有出現在ARP高速緩存中(例如,有可能超時了),路由器必須向與包的目的IP地址有關的子網廣播一個ARP請求,擁有此IP地址的端站就作出響應,把MAC地址發送回去,路由器因此更新高速緩存,把新的MAC地址裝進包的報頭併發送該包。

如果查找路由表顯示包的目的地不在本地子網,路由器就利用下一跳路由器的MAC地址把包轉發給下一跳路由器。路由表由智能發現協議,如路由信息協議或者開放最短路徑優先協議,不斷地被建立和再建立。每個路由器的路由表顯示了到達目的地址的最佳路徑,對於要有幾跳的地址,它顯示出最佳的下一跳路由器。