this is the process by which the internet actually works without this process it would be required for every single machine connected to the internet to be directly connected to each other. This of course is impossible, and so routing exists. Every computer or node connected to the internet has a default gateway this is where it sends all its request this definition is recursive so a gateway will also have a default gateway and this is the basic process of routing. This of course forms a hop-by-hop model where data is passed form one machine to the next it uses the destination address with in the IP header to determine where this information needs to go, it will of course get near and near to the destination as it goes from one hop to the next,
Routing tables exist as not all information needs to go to the default gateway, the default gateway is for any address that does not have a route defined, basically because without this default we would need the route to every pc on the internet on our local computers, Routing Tables match destination addresses with the next hops and then routing protocols determine what is entered into these tables. The next hop is the IP address of a machine that is directly reachable or directly connected to that machine, whether it be via a Dial-up (PPP) connection or via an ethernet connection. The IP prefix of the IP address determines where the set of destinations are so for instance a prefix of 195.154.0.0./16 would refer to any IP address 195.154.x.x where x are values between 1 and 254. If no routing table entries match the packets destination address then the packets are discarded as undeliverable. The default route or gateway refers to all addresses matching 0.0.0.0/0.0.0.0 (so every IP address). In some instances a default gateway may not exist - examples include Internet Service Providers or Internet Exchanges (such as LINX) where al']l IP address routes are set and there are no default routes. Routing tables often contain additional information such as the Metric this reflects basically the expense of the network i.e. gives it a priority as to which network to send information if it has a choice of two routes. These metrics are often determined by network speed or by the number of hops that it would take along each route.
This is the basis for internet exchanges such as LINX (the London Internet EXchange) and telehouse. This means that networks can the peer (look onto) other networks, for instance all Internet providers with in the UK have a connection to LINX whether directly or indirectly through a backbone provider.