Problem: Load-balancing schemes hash a flow to a random path.
- Long flows collide on the same path. High congestion
- Other paths underutilized.
Proposed Solution: Flowbender.
- No excessive packet reordering.
- End-host driven rehashing. Assigns flows to paths dynamically.
- Recovers from link failures within Retransmit Timeout (RTO)
- Readily deployable in data-centers. (< 50 lines of kernel code)
- Robust. Easy to tune.
Top-Level Design Decisions of Flowbender:
- Uses flow load-balancing instead of packet-level load-balancing. Shift flow to a different path only once it is congested or disconnected. This avoids:
- Excessive out-of-order packet delivery
- Hardware changes to existing datacenter infrastructure
- Uses RTT-based load-balancing instead of Link-level load-balancing. This:
- Avoids congestion spreading trees that link-level schemes can create.
- ECN etc. already demonstrated to promptly propagate congestion information.
- Using ECN => targeting long flows taking several roundtrips to finish but these flows carry most of the traffic anyway.
- Transport-layer algorithms (like TCP) can quickly detect end-to-end link-failures. Flowbender can hence promptly avoid broken paths.
Gist of the Algorithm: Transmit a flow on a single path. Reroute that individual flow when it is congested.
- How do we know a flow is congestion?
- How is rerouting done?
Sensing Congestion: (uses the same technique as DCTCP)
- Switch marks every packet exceeding queue size above a threshold.
- Keep track of the fraction of ECN-marked acks in every RTT.
If congestion is larger than a threshold, we reroute the flow.
- ECMP engines in switches compute a hash-function based on packet-header fields.
- “Hacks” a packet-header field, TTL, based on congestion to change the hash generated. Maps hash to paths. (Why TTL? long story. Feel free to email me if you want to know)
- Evaluated against existing schemes: ECMP, RPS and DeTail.
- Evaluation methods used:
- Simulation (simulated in ns-3, not lame old ns-2 with a stupid Tcl binding and incredibly fucked up C++ API from the prehistoric period)
- Test-bed implementation
I may not completely agree with everything he says, but I love George Carlin. He’s hilarious and spot-on. He also has a knack of making excellent arguments brilliantly while being drop-dead hilarious at the same time, which is why he has had a lot of influence on my own opinions. For my own benefit as much as anyone else’s, here is a compilation of his comic take on various issues.
George Carlin on chickens (yay!):
George Carlin on what to do with the male chauvinists:
George Carlin on voting:
George Carlin on war:
George Carlin on questioning things:
George Carlin on abortion:
References used: The Origin of Species (first edition) by Charles Darwin. Chapter 1.
Cultivated plants and animals generally show more variety as compared to species bred naturally. This is probably because of the fact that domestic plants and animals are raised in conditions that are not as uniform as the natural habitat of their ancestors. Variation in domestic animals and plants is observed to be a continuous and unceasing process. For example, wheat, which is a very old cultivated plant, continues to produce new varieties.
Claim: Conditions of life are not the direct and only cause of this variation
Evidence: Seedlings of the same fruit and offspring from the same litter can show be considerably different from each other even if both the offspring and parents are raised under exactly the same conditions. If the conditions of life were the only cause of variation in organisms, there would have been no variation among the offspring or even if there was variation, all the offspring should have varied in the same manner. This can be used as evidence of the fact that the laws of reproduction, growth and inheritance have a greater impact on the characteristics of an organism than do the conditions of life directly.
Claim: Correlation of growth. If an organism is selectively bred for a certain characteristic, other parts of the structure of that organism are also modified.
Evidence: Cats with blue eyes are always observed to be deaf. Hairless dogs have imperfect teeth. Long limbs are always accompanied by an elongated head. White sheep and pigs are differently affected by vegetable poisons as compared to their domestic counterparts.
Claim: As a general rule, every characteristic in an organism inherited.
Evidence: When in individuals exposed to the same conditions of life as the rest of the population, a very rare deviation such as albinism, for example, appears which is only found in one of several millions of individuals in a population, the same deviation is often also found in that individual’s offspring. By the laws of probability, one is compelled to attribute its reappearance in the offspring to the laws of inheritance.
Since I have this week off from university as spring break, I have been given an epic opportunity to learn something new. So I have decided to learn something about a field that has always interested me: Biology. Especially things like evolutionary biology, ecology and genetics. My own field of Computer Science has a lot of things that are based on ideas in Biology including genetic algorithms, neural networks and even the botany-like terminology used for trees, their sub- and super-structures. Not to mention the fact that the father of computer science, Alan Turing, was also a part-time Biologist.
So here is my plan. I plan to read Charles Darwin’s The Origin of Species, two chapters every day for seven days (since the edition I was able to find at my university’s library contains fourteen chapters and I have seven days off) starting today and post notes related to them here on my blog. Let’s hope I manage to complete this project.
An indigenous american farming. Source
I used to be mortally terrified of being alone. I have now learnt to embrace it like a long lost brother. I understand the true power of this state. Being alone also means being independent. Independency leads to power and productivity. When you are not attached to anyone by symbolic strings of social convention, you are not held back by their mediocrity.
Now I want to be lonely, since only when I am alone am I truly free. A wanderer ardently experiencing the act of being alive and conscious on this planet and interestedly observing how others use up their lifetimes. I can understand the recurring patterns of nature and society without being encumbered by an unasked for and unsought membership of the latter.
I can get lost in the timeless world of mathematics and the arts and sciences emergent from it. I can express my true opinions on every issue and every matter without having to fake, censor or alter them for fear of ostracization. I can live a life that is not haunted by the ghosts of unnecessary emotional investment and unaffordable pseudo-familial or cultural expectation. I am free to explore the cascading branches born by my ideas and traverse the deepest and truest thoughts produced in my mind.
It is in this state that I am most likely to reminisce the memories of my childhood. It is in this condition that I am closest to comprehending the vast services my parents have granted me and the emotional foundation and mountains of love and affection my siblings have unreservedly made me the recipient of.
Animation depicting insertion sort
The following is the source code for insertion sort:
for i = 1 to length(A) - 1
x = A[i]
j = i - 1
while j >= 0 and A[j] > x
A[j+1] = A[j]
j = j - 1
A[j+1] = x
Here is an implementation in C++ from Weiss’s book:
template void Insertion_Sort(Etype A, const unsigned int N)
A = Min_Val();
for (int P = 0; P <= N; P++)
Tmp = A[P];
for (int j = P; Tmp < A[j-1]; j–)
A[j] = A[j-1];
A[j] = Tmp;
Since it has nested loops which take at most iterations, insertion sort is . This is a tight bound (a reverse order array as input can achieve this bound). To calculate the average case:
A binary tree.
Def: Let be a tree such that no node in has more than two children. is referred to as a binary tree.
A binary tree effectively consists of a root and two subtrees and , any (or both) of which could be empty.
Since we already know the maximum number of children each node in a binary tree can have, we can implement it in a way that is very simple in comparison to the implementation of a general tree. Just store pointers for the two children in every node.
Def: Let be a binary tree such that each node has either zero or exactly two children. is called a full binary tree.
Full Binary Tree
Def: Let be a binary tree such that every level of except for possibly the last is completely filled and all nodes are as far-left as possible. is called a complete binary tree.
Complete Binary Tree
The simplest way to implement a tree would be something like
This approach has problems, though. To begin with, the number of children per node can vary greatly and is not known in advance, hence this causes a lot of space to be wasted. A more efficient way to implement a tree would be to store the children of each node in a linked list of nodes.
Pictorial Representation of a tree implementation using the above-described method.