2

So I'm revising for a Networking exam and struggling to understand IP routing. If I explain how I understand it, could you tell me where I'm right and where I'm wrong? I'd really appreciate it. Here's how I see it:

  • Hosts ARPs for gateway (if needed).
  • Host sends request to gateway. Ethernet frame has the gateway MAC address for it's destination, but the internal IP packet has the destination address of the server that is ultimately trying to be reached.
  • Gateway compares the IP packet destination address to the IP address prefixes in it's route table. If one matches, it sends it down that port. Every subsequent server does the same and in a well-established route every one of them will have an address prefix matching the destination to some degree and will send it on down this familiar path.
  • If the gateway doesn't have an address prefix that matches the destination address, then it begins routing. It uses an Internal Gatewway Protocol (IGP) such as RIP or OSPF to ask it's neighbours within it's Autonomous System (AS)(most likely a Transit AS belonging to your ISP), "do you know where this is?".
    • This message is passed around within the AS until one of the gateways recognises a part of the network prefix, such as perhaps the region of the address, and has a vague notion of where to send it on.
    • That gateway will then use an External Gateway Protocol (EGP) such as BGP to communicate with the AS(es?) that it's linked to and ask them for routing information.
    • One of these may recognise the second block and be able to route it further in the correct direction
    • Eventually a gateway will use EGP on the AS that owns the destination address and that target gateway will reply yes, I can get there in n hops.
    • This message follows back through the path, each hop adding one to the length until it gets back to our original gateway that now knows of a path of y hops to get to the destination.
    • It will add this to it's routing table, wrap the IP packet in a new ethernet frame with a destination address of the first hop on this path and send it on it's way.
  • 2
    In step 4, if the destination address doesn't match any prefix in the routing table, the router drops the packet. – Ron Trunk Jan 16 '17 at 13:22
  • This article series may help clear things up for you -- it specifically addresses how packets move through a network. Specially the last four articles in the series. – Eddie Jan 16 '17 at 20:10
2

Hosts contain their own routing tables, and will consult those to determine whether the packet can be delivered directly, or forwarded to a gateway (and if so, which one). Only then does your step 1 start.

Your final step is completely incorrect. At no point does a router "ask" its neighbours for a route to a specific destination.

The routing protocols run continuously in the background, updating the router's internal routing tables (the RIB and FIB) with a complete reachability table, on the fly, as links and neighbours come and go.

If there's no matching route in the routing tables, the packet will be dropped. An ICMP "network unreachable" packet should be returned.

  • Thanks for the answer. It really clears things up. I find it hard to imagine, but I suppose the routers must have massive amounts of routes then. Obviously they don't store every address of every network, so I presume they store the address prefixes of the different ASes and the path to them? Though even then there's tens of thousands. Then the AS gateway knows the path to the local network? – Jansky Jan 16 '17 at 14:02
  • @Jansky a typical customer edge router, assuming a single uplink, only needs one route for 0.0.0.0/0 on IPv4, aka the "default route". An ISP core router needs to support several 100k routes, one for each prefix advertised by every other ASN in the global routing table. – Alnitak Jan 16 '17 at 14:06
1

Routers don't "ask" each other about routes when deciding where to send a packet. The routes a router knows about are determined in advance, either statically or by routing protocols.

To reduce the size of routing tables summarisation techniques are employed. Within your site you need routes for each of your subnets. Ideally your ISP only needs a route for your site as a whole and the internet only needs a route for your ISP as a whole.

In reality things are messier than that. Sites and ISPs will grow and therefore end up with multiple IP blocks that cannot be aggregated. This is especially a problem with IPv4 due to address shortages and the resulting tight allocation policies.

The extreme case of summarisation is the "default route". A place where all packets for which no other route is known get sent.

Some routers have no default route. They have an explicit routing table built over BGP that covers the whole internet. This is a big table (over half a million routes) which needs a beefy router to handle. This would be the normal setup in the "core network" of a provider.

Other routers will only have local routes and a default gateway. Any traffic heading towards other providers will be sent to the default route. This would be the normal setup in the "access network" of a provider.

And of course there are possibilities in-between. For example a smaller ISP using older routers that can no longer handle the whole internet routing table may choose to pull in only part of the internet routing table and use a default route to a transit provider to handle the rest.

0

You are inter mingling IP routing and Ethernet switching. In terms of routing, it's pretty simple: If a route to the packets destination exists, forward the packet; else don't. If multiple destinations exist choose the most specific one; if more than one most specific, choose based on other factors (administrative distance).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.