16

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?

  • 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 at 4:06
  • Actually, packets "hop" between networks - that's why forwarding through a gateway/router is called a hop. – Zac67 Apr 13 at 7: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 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 at 13:23
20

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.

| improve this answer | |
  • 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 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 at 3:05
  • @Henrique what is source routinf – lpydawa Apr 14 at 4: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 at 4:06
  • @lpydawa Source routing is what I describe in the answer. The details are in the RFC. – Barmar Apr 14 at 4:10
6

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.

| improve this answer | |
  • 4
    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 at 7: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.

| improve this answer | |
  • 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 at 5:36
  • 2
    MPLS (Multi-Protocol Label Switching) is actually switching, not routing. – Ron Maupin Apr 13 at 12:47
  • 1
    @RonMaupin MPLS is a routing technique where labeled packets are switched and unlabeled packets are routed. – syntaxerror Apr 13 at 18:27
  • 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 at 1: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 at 3:12

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.