17

So, AFAIK, packets "hop" between routers. Packets are forwarded via a router's default path until it gets to destination IP. So is it possible to specify a specific set of routers this packet "hops" to?

lpydawa
  • 275
  • 2
  • 8
  • 2
    There is a complicated answer to that question, but in general, no, and you have a misconception about a "default" path. Most Internet routers have a full knowledge of the Internet routing table and do not use default paths. The very idea of IP was that a packet will be routed one router at a time to the destination in case there is a disaster and one path fails then the packets can be forwarded along a different path with no need for intervantion. This was a great leap over the old circuit switching networks. – Ron Maupin Apr 13 '20 at 04:06
  • Actually, packets "hop" between *networks* - that's why forwarding through a gateway/router is called a hop. – Zac67 Apr 13 '20 at 07:16
  • @RonMaupin I'd replace "full" with "local". You may be able to see how *you* can reach any other address on the Internet, but you don't necessarily know how packets flow between two remote addresses. – chepner Apr 13 '20 at 13:20
  • 1
    @chepner, no, I mean that the ISP routers have full Internet routing tables. That is necessary so that each ISP can pick the best path out to the next ISP toward the destination. – Ron Maupin Apr 13 '20 at 13:23

3 Answers3

22

It's theoretically possible, but not really in a practical sense.

The IP protocol includes two options:

  • Loose Source and Record Route (LSRR)
  • Strict Source and Record Route (SSRS)

They're both described in RFC 791.

The difference between them is that LSRR can specify a partial route, while SSRS specifies the complete, exact route. With LSRR, each router along the path uses its local routing table to determine how to send to the next hop in the source route.

The reason it's not practical is because most routers are configured to ignore this option. RFC 1122 says that source-route forwarding must be disabled by default, and I would be surprised if any ISP enables it.

Barmar
  • 436
  • 2
  • 6
  • 1
    I was surprised nobody mentioned Source Routing, 'till I saw your answer. It is indeed a security issue to enable source routing in private routers (and of course in public ones as well), as stated by many books and papers. Not only because of attacks, but also because you could, by accident, end up with a routing loop. But yeah, source routing is a thing, the IP protocol was designed to do it and, in a controlled environment, you can experiment with it - as long as the routers are yours. – Henrique Apr 13 '20 at 19:18
  • Not only ISP; I've never heard of any router (even in a lab) actually configured for it. It was one of those YAGNI features. – chrylis -cautiouslyoptimistic- Apr 14 '20 at 03:05
  • @Henrique what is source routinf – lpydawa Apr 14 '20 at 04:03
  • Is the full complete route specified within the packet and routers receiving the packet know from the packet where to go next? – lpydawa Apr 14 '20 at 04:06
  • @lpydawa Source routing is what I describe in the answer. The details are in the RFC. – Barmar Apr 14 '20 at 04:10
  • Whether it's the complete route depends on whether it's Loose or Strict. – Barmar Apr 14 '20 at 04:11
  • @Barmar tldr would be much appreciated :) – lpydawa Apr 14 '20 at 04:18
  • Is this all in the forwarding plane? – lpydawa Apr 14 '20 at 04:38
  • It's basically just a list of router IPs. – Barmar Apr 14 '20 at 04:42
  • Source routing conflicts with policy routing and the Internet uses policy routing to ensure that people don't get service they didn't pay for. So you aren't going to find source routing working on the expensive parts of the Internet. If I'm a Comcast customer and Comcast has a crappy path to Google, I might want to route my packets to AT&T and then to Google -- but who paying AT&T to carry a Comcast customer's packets to Google? – David Schwartz Apr 15 '20 at 05:46
7

Routing is done on an end to end basis. This means, each router along the path needs to make its own individual routing decision based on which path that Router thinks is the best. Fortunately, without direct control over the networks a packet will traverse, there is no way to "specify a specific set of routers this packet hops to". E.g. If I send a packet destined for Google to my ISP then it is up to my ISP to forward this traffic along its best path.

Packets are forwarded via a router's default path

This is not necessarily correct. Routing works on a most specific match, this means that a Router will only take the default if it does NOT have a more specific Route for a prefix.

ditrapanij
  • 1,307
  • 5
  • 11
  • 5
    Initially, there was the concept of *source routing* for IPv4 where the source could specify the route. Source routing is deprecated and not supported on the Internet. – Zac67 Apr 13 '20 at 07:22
5

Yes you can, there's MPLS which allows for Explicit routing with strict hops. There's also the concept of link coloring within administrative groups for Constraint Shortest Path First.

https://www.juniper.net/documentation/en_US/junose15.1/topics/concept/mpls-explicit-routing-overview.html

https://www.juniper.net/documentation/en_US/junos/topics/usage-guidelines/mpls-configuring-administrative-groups.html

Ditrapanij is right as well, but he's either forgotten or is unaware of MPLS. MPLS is local though only to your own network, you cannot specify a constraint path beyond your network egress.

  • 2
    The way the question was worded I figured he meant external to his network. You're right, MPLS LSP's is one way to achieve this however it seems OP is missing the fundamentals of routing. – ditrapanij Apr 13 '20 at 05:36
  • 2
    MPLS (Multi-Protocol Label _Switching_) is actually switching, not routing. – Ron Maupin Apr 13 '20 at 12:47
  • 1
    @RonMaupin MPLS is a routing technique where labeled packets are switched and unlabeled packets are routed. – syntaxerror Apr 13 '20 at 18:27
  • MPLS is a switching technique, closely related to frame relay. – Ron Maupin Apr 13 '20 at 20:33
  • @RonMaupin please show me where it's considered a switch technique and I will show you where it's called a routing technique or maybe it's both? – syntaxerror Apr 14 '20 at 00:31
  • 1
    The RFC is full of that. For example, "_MPLS forwarding can be done by **switches** which are capable of doing label lookup and replacement, but are either not capable of analyzing the network layer headers, or are not capable of analyzing the network layer headers at adequate speed._" or "_layer 2 the protocol layer under layer 3 (which therefore offers the services used by layer 3). **Forwarding, when done by the swapping of short fixed length labels, occurs at layer 2 regardless of whether the label being examined is an ATM VPI/VCI, a frame relay DLCI, or an MPLS label.**_" – Ron Maupin Apr 14 '20 at 01:10
  • 1
    However MPLS is described as a layer 2.5 protocol, with routers exchanging labels for their configured Loopback (system) IP addresses over a T-LDP session. RFC8660 describes Segment Routing with the MPLS Data Plane. RFC 3469 describes how Multi-protocol label switching integrates the label swapping forwarding paradigm with network layer routing. – syntaxerror Apr 14 '20 at 03:12
  • Routing can configured as per our requirement.. traffic can be diverted with help of routing configuration .Basically specific routes have priority to forward packets then default routes.. – Sagar Uragonda Nov 22 '20 at 13:40