|
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 theprotocol'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/IPprotocol suite.
在过去几年中,写得最多的网络题目之一就是IP。但是,即使引起了
这么多的注意,仍很少有(如果有的话)文章介绍此协议的基本工作原理,即路由器和第三层交换器是如何对IP信息起作用,以便在整个网络中传递
以太网包的。作为参考,请记住,IP是TCP/IP整套协议中的一个协议。
TCP functions at the Open Systems Interconnection(OSI)transport
layer,or Layer 4. Its chief responsibility is to ensure reliable
end-to-end connectivity.IP,located one layer down,at the OSI net-
work 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.This
information,combined with routing tables and other network
intelligence,isall it takes to get across the room or around the
world via TCP/IP.
TCP完成开放系统互连(OSI)模型中传输层,即第四层的功能。它的
主要责任是确保端至端之间的可靠连接。IP位于下一层,在 OSI的网络层,即第三层,把每个包的发送者和接收者地址告诉一路上各个路由器。路由
器和第三层交换器可以读出IP和其他的第三层协议。这些信息与路由表以
及其他网络智能结合在一起,能通过 TCP/IP在整个房间或围绕地球进行传
递。
The routing process begins with an IP address that is unique to
the sending endstation.Endstations may be assigned permanent IP
addresses or they mayborrow them as needed from a Dynamic Host
Configuration Protocol(DHCP)server or other service.
路由过程始于对发送端站而言是唯一的一个IP地址,端站可以被分配
永久的IP地址,或者按需要从动态主机配置协议(DHCP)服务器或其他服
务中借用。
If the sending endstation determines that the destination address
is notlocal,the packet goes to a first-hop router,typically one
that is close andhas been preassigned to the sender.
如果发送端站确定目的地址不在本地,该包就被送到第一跳路由器,
一般来说,该路由器是在附近的,并已被预先分配给发送者。
The router inspects the packet's IP address and performs a route
table lookup to see if the destination endstation resides on the
local(physically connected)network,typically called an IP subnet.
An IP subnet usually is assigned to each of the router's network
interfaces.
该路由器检查包的IP地址,查找路由表,看看目的端点是否位于本地
(物理位置)网络,它通常叫做IP子网,IP子网一般被分配到路由器的每
个网络接口上。
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'sMAC
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 thepacket to the destination endstation.
如果目的IP地址为本地的,该路由器就搜寻存储着IP地址和本地设备
介质访问控制(MAC)地址的内部存储器,这个存储器叫作地址分辨协议
(ARP)高速缓存。ARP是把IP地址映射到 MAC地址的通用工具。如果目的
地的MAC地址出现了,该路由器就把这个MAC地址装进包的报头中(取掉自
己的MAC地址,因为不再需要它了),把该包送到目的端站。
In the event that the destination MAC address does not appear
in the ARPcache—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.Theendstation with that IP address responds,sending back its MAC address.The router updates its
cache,installs the new MAC address into the packet header and
launches the packet.
万一目的地的MAC地址没有出现在ARP高速缓存中(例如,有可能超时
了),路由器必须向与包的目的IP地址有关的子网广播一个 ARP请求,拥
有此IP地址的端站就作出响应,把MAC地址发送回去,路由器因此更新高速
缓存,把新的MAC地址装进包的报头并发送该包。
If the route table lookup shows that the packet is destined for
a nonlocal 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 orOpen Shortest
Path First.Each router's routing table shows the best route to
the destination address;for addresses that may be several hops
away,it showsthe best next-hop router.
如果查找路由表显示包的目的地不在本地子网,路由器就利用下一跳
路由器的 MAC地址把包转发给下一跳路由器。路由表由智能发现协议,如
路由信息协议或者开放最短路径优先协议,不断地被建立和再建立。每个
路由器的路由表显示了到达目的地址的最佳路径,对于要有几跳的地址,
它显示出最佳的下一跳路由器。 |
|