ArticleslgStudy

computer science

Turn restriction routing

Turn restriction routing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Turn restriction routing rather than just read about it. In short: A routing algorithm decides the path followed by a packet from the source to destination routers in a network. An important aspect to be considered while designing a routing algorithm is avoiding a deadlock.

Turn restriction routing — main illustration
Turn restriction routing — illustration

Key takeaways

  • Turn restriction routing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Turn restriction routing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Turn restriction routing from memory before moving on to harder problems.

Reference excerpt

A routing algorithm decides the path followed by a packet from the source to destination routers in a network. An important aspect to be considered while designing a routing algorithm is avoiding a deadlock. Turn restriction routing is a routing algorithm for mesh-family of topologies which avoids deadlocks by restricting the types of turns that are allowed in the algorithm while determining the route from source node to destination node in a network.

Reason for deadlock A deadlock (shown in fig 1) is a situation in which no further transportation of packets can take place due to the saturation of network resources like buffers or links. The main reason for a deadlock is the cyclic acquisition of channels in the network. For example, consider there are four channels in a network. Four packets have filled up the input buffers of these four channels and needs to be forwarded to the next channel. Now assume that the output buffers of all these channels are also filled with packets that need to be transmitted to the next channel. If these four channels form a cycle, it is impossible to transmit packets any further because the output buffers and input buffers of all channels are already full. This is known as cyclic acquisition of channels and this results in a deadlock.

Solution to deadlock Deadlocks can either be detected, broken or avoided from happening altogether. Detecting and breaking deadlocks in the network is expensive in terms of latency and resources. So an easy and inexpensive solution is to avoid deadlocks by choosing routing techniques that prevent cyclic acquisition of channels.

Logic behind turn restriction routing Logic behind turn restriction routing derives from a key observation. A cyclic acquisition of channels can take place only if all the four possible clockwise (or anti-clockwise) turns have occurred. This means deadlocks can be avoided by prohibiting at least one of the clockwise turns and one of the anti-clockwise turns. All the clockwise and anti-clockwise turns that are possible in a non restricted routing algorithm are shown in fig 2.

Examples of turn restriction routing A turn restriction routing can be obtained by prohibiting at least one of the four possible clockwise turns and at least one of the four possible anti-clockwise turns in the routing algorithm. This means there are at least 16 (4x4) possible turn restriction routing techniques as you have 4 clockwise turns and 4 anti-clockwise turns to choose from. Some of these techniques have been listed below.

Dimension-ordered (X-Y) routing Dimension ordered (X-Y) routing (shown in fig 3) restricts all turns from y-dimension to x-dimension. This prohibits two anti-clockwise and two clockwise turns which is more than what is actually required. Even then since it restricts the number of turns that are allowed we can tell that this is an example for turn restriction routing.

West first routing West first routing (shown in fig 4) restricts all turns to the west direction. This means west direction should be taken first if needed in the proposed route.

North last routing North last routing (shown in fig 5) restricts turning to any other direction if the current direction is north. This means north direction should be taken last if needed in the proposed route.

Negative first routing Negative first routing (shown in fig 6) restricts turning to a negative direction while the current direction is positive. West is considered as the negative direction in X-dimension and south is considered as the negative direction in Y-dimension. This means any hop in one of the negative directions should be taken before taking any other turn.

Advantages of turn restriction routing Avoiding deadlocks is less expensive to implement than deadlock detecting and breaking techniques. Turn restrictions provide alternate minimum length paths as well as non minimum length paths from one node to another, which allows routing around congested or failed links. For example, consider figure 7 below. Say there are multiple routers, F1, F2 etc., that feed packets to a congested, but low-cost link from source router S to destination router D. Implementing Turn restriction routing means that some of the turns from any of the feeder routers to the congested router S may now be restricted. Those feeder routers may have to use a longer path to get to destination D, thereby decongesting the link from S to D to an extent.

See also Policy-based routing Deadlock Heuristic algorithms

References

Illustrations

Turn restriction routing: Fig 1: Figure shows four channels with both input and output buffers full.  All packets in output buffers are to be forwarded to next channel. But since their input buffers are full, this forwarding cannot take place. As a result, no packet can be moved any further. This results in a deadlock.
Fig 1: Figure shows four channels with both input and output buffers full. All packets in output buffers are to be forwarded to next channel. But since their input buffers are full, this forwarding cannot take place. As a result, no packet can be moved any further. This results in a deadlock.
Turn restriction routing: Fig 2: All possible turns in a network route- clockwise and anti-clockwise.
Fig 2: All possible turns in a network route- clockwise and anti-clockwise.
Turn restriction routing: Fig 3: Dimension-ordered (X-Y) routing
Fig 3: Dimension-ordered (X-Y) routing
Turn restriction routing: Fig 4: West first routing
Fig 4: West first routing
Turn restriction routing: Fig 5: North last routing
Fig 5: North last routing

Worked examples

Example 1 — a first encounter with Turn restriction routing

Start with the simplest possible case. Write down what Turn restriction routing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Turn restriction routing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Turn restriction routing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Turn restriction routing

In research
Turn restriction routing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Turn restriction routing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Turn restriction routing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Concurrency (computer science), Heuristic algorithms, Internet architecture, so understanding it makes those chapters shorter.
In everyday life
Look for Turn restriction routing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Turn restriction routing” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Turn restriction routing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Turn restriction routing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Turn restriction routing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Turn restriction routing in simple terms?

A routing algorithm decides the path followed by a packet from the source to destination routers in a network. An important aspect to be considered while designing a routing algorithm is avoiding a deadlock.

Why does Turn restriction routing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Turn restriction routing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Turn restriction routing.

Tags

  • Concurrency (computer science)
  • Heuristic algorithms
  • Internet architecture
  • Routing
  • Software anomalies
  • Software bugs

Keep exploring