Question

In: Computer Science

IPv4 packet header has a bit field called DF. The semantics of this bit is “Don’t...

IPv4 packet header has a bit field called DF. The semantics of this bit is “Don’t frangment”, as such, when a router sees a IPv4 packet whose DF bit is set and the packet is bigger than MTU, it will discard the packet and returns an ICMP Destination Unreachable messages with a code meaning “fragmentation needed and DF set”. (a) Relying on only this mechanism, devise an algorithm for a host that sends a sequence of IPv4 packets with varying length to discover the path MTU. (b) Argue that the algorithm is efficient (or whether it is efficient) (Hint: using Big-O notation on packets sent by the host)

Solutions

Expert Solution

The problem of finding path MTU is similar to finding a number in sorted list with only difference that the length of the list or the highest number in it is not known to us.
Had that be known we can simply apply binary search algorithm picking up half of the size and give a try, to ultimately reach the number which is allowed and one more byte from that is not allowed thus giving path MTU.

Lets say the maximum packet size is known. M.

subroutine findMTU(1, M+1) // we assume 1 size will go thorough and M+1 won't

{


while (start < end)
{

S = integer of [(start + end)/2]

result = attempt sending packet with size S

If the result == Destination not reachable

end = S - 1
result = Start

else // the destination is reachable

result = start
start = S + 1

endif

}

return MTU = result

}

being based on the binary search the the complexity is O(lgN) (log is base 2) which is by far the best for this scenario.

But the problem can arise if the biggest possible packet size is not known a priori
Here we first need to find the range of value between which the MTU lies, and then we can use above mentioned binary search like algorithm to figure out the MTU.

i.e. if we can find efficiently the rangle 500 to 1000 for the the range in which the MTU value lies, we can run binary algorithm on it and find the MTU in O(lgN) which is by far the best.

To find the range insted of breaking the list into equal half, we start from 1 or other logical value and enlarge the list by double every cycle.

find_range_for_MTU(start) // assumption MTU will be greater that start.

{

next = start * 2

result = send_packet_of_size(next);

while (result != destination_not_reachable)
{
start = next

next = start * 2

result = send_packet_of_size(next);

}

return range(start, next);

}

This algorithm doesnot work on divide and conqur but opposite, i.e merge and build. But since in every cycle the list grows double the original size. We will reach the range in O(lgN) time.

So combining this two algorithm i.e. first to find the range in which MTU lies and then running binary search kind of algorithm to find exact MTU in that range again with complexity O(lgR)

We have the complexity. O(lgN) + O(lg(N/2)) ~ 2O(lgN) i.e. O(lgN)

This would be the most effective approach.


Related Solutions

Kinesiology has not always been called kinesiology? What was the field called in the late 1800s...
Kinesiology has not always been called kinesiology? What was the field called in the late 1800s and early 1900s?
Ovation Company has a single product called a Bit. The company normally produces and sells 69,600...
Ovation Company has a single product called a Bit. The company normally produces and sells 69,600 Bits each year at a selling price of $49 per unit. The company’s unit costs at this level of activity are given below:   Direct materials $ 9.90   Direct labour 8.10   Variable manufacturing overhead 4.20   Fixed manufacturing overhead 3.00 ($208,800 total)   Variable selling expenses 7.20   Fixed selling expenses 3.60 ($250,560 total)   Total cost per unit $ 36.00      A number of questions relating to the production...
Ovation Company has a single product called a Bit. The company normally produces and sells 36,000...
Ovation Company has a single product called a Bit. The company normally produces and sells 36,000 Bits each year at a selling price of $35 per unit. The company’s unit costs at this level of activity are given below:   Direct materials $ 11.40   Direct labour 3.90   Variable manufacturing overhead 2.70   Fixed manufacturing overhead 4.20 ($151,200 total)   Variable selling expenses 3.00   Fixed selling expenses 3.90 ($140,400 total)   Total cost per unit $ 29.10      A number of questions relating to the production...
Ovation Company has a single product called a Bit. The company normally produces and sells 62,400...
Ovation Company has a single product called a Bit. The company normally produces and sells 62,400 Bits each year at a selling price of $46 per unit. The company’s unit costs at this level of activity are given below:   Direct materials $ 10.80   Direct labour 7.20   Variable manufacturing overhead 3.30   Fixed manufacturing overhead 4.50 ($280,800 total)   Variable selling expenses 6.30   Fixed selling expenses 2.40 ($149,760 total)   Total cost per unit $ 34.50      A number of questions relating to the production...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT