I need a more specific question but the calculation is based on programmed routing tables.
192.168.1.0
255.255.255.0
has no idea of the existence of
192.168.2.0
255.255.255.0
Routers use route tables telling them where to find that address and which router is the gateway to that network space and which computer is on which network.
A lot of routers now use a protocol called OSPF (shortest path first) and also RIP (Routing Information Protocol) which broadcast to every router it's location and who it's serving. The more expensive the router, the more you get. If you want to use Linux or Windows Server 2003 they do have the ability for a cheaper routing solution.
You still have to set these protocols up but this reduces administrative effort making them 'smart'. All the routers constantly update their routing tables automatically by talking to each other. The downsize is it increases network traffic slightly but if you have a large enough network it's grace.
cabz0r
2008-02-27 12:55:52 UTC
routers calculate the best path to a destination from metrics known as hops, link delay, or bandwidth.
depending on the routing protocol in use, they use a combination of either one, two or all 3 metrics.
the metrics are entered into the routing table, and these are consulted by the router when calculating a best route.
Certain routing protocols favour particular metrics over others, so depending on the layout of your network and what topology is being used - will determine best route to a destination.
anonymous
2008-02-27 11:33:07 UTC
each interface has IP address, if destination IP address is not locally it is sent out other port, incase of multiple router interfaces router keeps track of each network and looks up in routing table wich interface to send out
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.