Homework 5. Solutions. Gabriela Barrantes 4.4 V&W (a) The routing table of R2 is complete, so you had to pick any other one. I am simply following V&W notation for this exercise. Keep in mind that IP addressing and tables are different. For those interested, I left copies of a more realistic scenario in my office. So: R1 R3 R4 -------------------- -------------------- -------------------- Add. N.Hop Port Add. N.Hop Port Add. N.Hop Port -------------------- -------------------- -------------------- N2 R2 r11 N1 R2 r31 N1 R3 r41 A A r12 N2.2 R4 r33 G G r42 B B r13 E E r34 H H r43 N1.2 R2 r11 F F r32 N2.1 R3 r41 The ARP table was also complete, so you could pick any of the others. Some examples: r33 r31 r41 r11 ------------ ------------- ------------ ---------------- IP MAC IP MAC IP MAC IP MAC ------------ ------------- ------------ ---------------- R4 r41 R2 r24 R3 r33 R2 r22 ==================================================================== (b) Again, the answer is completely given, so you have to choose any other one. Examples: (Remember, the packet is traveling from A to H) General Ethernet IP --------------------------------------------- From To To From To From --------------------------------------------- A R1 r12 a H A R1 R2 r22 r11 H A R2 R3 r31 r24 H A R3 R4 r41 r33 H A R4 H h r43 H A ---------------------------------------------- ===================================================================== 4.6 If we were to be fair, and nto be allowed to loose packets, then the rate of Q1, rq1 should be such that: rq1 + rq2 + rq3 < 1 x 10^6 p/s => rq1 < 0.2 x 10^6 pack/sec However, the exercise explicitly says that: (a) We ONLY want to guarantee that Q1 doesn't lose any packet (b) The other two may lose packets (c) If a queue is empty, it's skipped. If all queues are full, the scheduler will give each queue 1/3 (~33%) of its attention in any given period of time, effectively giving each queue a possible 0.33 x 10^6 p/s output rate (if all had input rates greater than 0.33 x 10^6 p/s). However: rq3 < 0.33 x 10^6 p/s (rq3 == 0.3 x x 10^6 p/s), so 3% of the time, the scheduler will find Q2 empty and will skip it. Q2 has an input rate greater than 0.33 x 10^6 p/s, and we want to operate Q1 at the max possible rate (at least 0.33 x 10^6 p/s), so Q2 will be losing packets. Now, the extra 3% bandwidth left by Q3 will be equally divided among Q1 & Q2, because the scheduler is fair, so each will end up with an extra 1.5% over their 33%. This means that the max input rate for Q1 will be: 0.33 x 10^6 + 0.015 x 10^6 p/s = 0.345 x 10^6 p/s (approx) (we are losing precision because 1/3 > 0.33) A much cleaner solution, is to use the fact that rq1 + rq2 + rq3 < 1 x 10^6 p/s Given that rq3 uses only 0.3 x 10^6 p/s, then 0.7 x 10^6 p/s are free for use between Q1 & Q2. This obviously means that Q1 & Q2 will each receive 0.35 x 10^6 p/s output rate. Q2 will be losing packets, while Q1 will be able to operate at a max speed of 0.35 x 10^6 p/s. =================================================================== 4.7 (a) Given that we only have class B networks, network address will take 2 bytes. Complete IPv4 addresses are 4 bytes long. Ethernet addresses are 6 bytes long. Size of routing table entry = 2 + 4 +1 = 7 bytes Size of ARP entry = 2 +6 = 8 bytes (b) Given that B networks use the first 2 bits of the address to identify themselves as "B", we have only 14 bits left for the actual address. Max size of the routing table = (2^14 - 1) * 7 bytes ~ 2^4 * 7 * 2^10 bytes = 112 KB Max size of the ARP table = (2^16 - 1) * 8 bytes ~ 2^6 *8 * 2^10 = 512 KB =================================================================== 4.8 We have a tree such that N x N x N x N = 100 x 10^6 => N^4 = 10^8 => N=100 So, each name server will have a table with 100 entries =================================================================== 5. First of all, you must realize that if the link that is lost disconnects the destination from the source in the graph (well, actually disconnects the graph!), no algorithm will be able to survive such loss. Next, for the not-so-tragic cases you could propose any algorithm that will give you all routes to a destination. There are several ways of doing this. For example, if you are using OSPF (Dijkstra) you have a complete graph representation locally, so you can easily calculate an alternative route to a destination in the case that a link fails, by recomputing the link weights. Or, you could do reverse path discovery, flooding the network with explorer packets (which will record the forward route), and those which manage to reach the destination, will be sent back to the source. The source will be able to store all possible routes to that destination in this way, and survive almost any link loss. You should realize at this point that ALL paths to a destination is an overshoot for the problem. We will satisfy the conditions finding two paths that DO NOT SHARE ANY LINK, and storing these two. If you decide to use some Dijkstra-like algorithm you should "elliminate" all links used in the first solution before running the algorithm again. Notice that Bellman-Ford WILL NOT WORK! this is because it doesn't have an internal representation of the graph, so it can't "mark" any links, as it only knows its neighbors. ===================================================================== 6. 240 (base 10) = 11110000 (base 2) so, the bitwise mask is: 11111111 11111111 11110000 00000000 which means we have 12 bits for host addresses. Because we always lose the "this" (all 0's) and "all" (all 1's) addresses, the actual number of hosts we can have in each subnetwork will be 2^12 -2 addresses = 4094. ====================================================================== 7. Actually the question is tricky because it is not telling us how the routing table entries are used. In a pure hierarchical scheme, each parent will know only the addresses of its children and of its parent, so each node, except for the leaves, will have r entries, with r being the number of its children, and it will not depend on any other variable. I am going to solve this one. Many other interpretations are possible (such as, that each children must store the addresses of its neigbors, and of its parent and all of its parents' neighbors, and so on). OK, each cluster router will have M entries (M regions). Each region will have N LAN routers (N entries), and conceivable, there will be a top router, taking care of the multiple clusters (K clusters). So we got our 3 levels. Which one of them should we minimize? We are not told, so we will try to "spread" the minimization, so there will be the minimal number of entries at each level. Anjha: K*M*N = 4800 If we assume that K = M = N, then, K^3 = 4800 => K =~ 16 This gives us a clue as where to start looking for. Actually the solution 15,16 & 20 (apply the numbers to either K, M or N) is the one less disperse. ===================================================================== 8. 16 byte addresses => 16 x 8 = 128 bit addresses => 2^128 total number of addresses 1024 x 1024 = 2^10 x 2^10 = 2^20 addresses assigned/second => 2^128 addresses / 2^20 addresses/second = 2^108 seconds This is a quite big number. More than 10^19 million years