Solution to Homework # 4 By Gabriela Barrantes ======================================================================= 1. (3.4) (a) 1. Everything is a single collision domain, as hubs are mere repeaters. 2. Of course, given that they are in a single logical network. 3. It uses C's MAC address. 4. Yes, because hubs retransmit everything. (b) 1. There are 3 separate collision domains. The borders are defined by the switches. 2. Same as in (a) 3. Same as in (b). 4. Not after the first two exchanges, when the switches between A & B learn their addresses. (c) 1. Same as (b) 2. No, because A & B are on different logical networks. 3. It uses the default gateway's MAC address. 4. Of course NOT given that they are on completely different networks. ====================================================================== 2. (3.9) (a) (Assuming EXACTLY m stations) pm = (N m) * p^m * (1-p)^(N-m) (b) You can find this proof in most probability books. This is a classical one. For example, in "A first course in Probability" by S. Ross, pp 159-160. The only important point was to realize we had to use the pm we calculated in (a). ===================================================================== 3. We are going to talk about stations A and B, separated by the maximum distance. B starts transmission and collides with A in the worst possible moment. How much time does B needs to find out that there was a collision? Worst case scenario: - B starts transmission - Just a moment before the transmission reaches A, A starts transmitting - Collision propagates to the hub - It takes the hub 0.1 us to realize that a collision occurred - Hub starts sending jamming signal - Jamming signal reaches B. This is the moment B realizes that a collision ocurred. So, total time = 2 propagation delays in 200 meters + a small processing delay at rhe hub = 2 * 200 m / [1.75 x 10^8 m/s] + 0.1 us = 2.28 us + 0.1 us = 2.38 us ====================================================================== 4. We are going to ignore collisions. Efficiency will be calculated in terms of packet overhead only. Efficiency = data / [data + overhead] All numbers are in bytes unless otherwise indicated You actually had to find out how much was the max & min Ethernet packet, and how many bytes of overhead it has. Original Ethernet format: Header = 14 CRC = 4 46 <= data <= 1500 If data < 46 then it is padded until reaching that length. This is because the packet has to be 64 bytes long to be able to fill entirely the maximum cable length in the original Ethernet specification. IEEE 802.3 format: Header = 17 CRC = 4 43 <= data <= 1497 Apart from that, given that Ethernet uses Manchester for bit encoding, it needs an additional 7 bytes of premble and 1 byte of "Start of Frame" indicator. For Ethernet: If the amount of data is >= 46 overhead = header + CRC + preamble + Start = 26 else overhead = header + CRC + preamble + Start + padding = header + CRC + preamble + Start + 46 - data For 802.3: If the amount of data is >= 43 overhead = header + CRC + preamble + Start = 29 else overhead = header + CRC + preamble + Start + padding = header + CRC + preamble + Start + 43 - data So, max efficiency is reached when the data portion is bigger, that is the complete 1500 [1497] bytes. Efficiency = 1500 / [1500 + 26] , for Ethernet Efficiency = 1500 / [1500 + 23] , for 802.3 Max data rate = 1500/1526 * 10 Mbps =~ 9.83 Mpbs for Ethernet Max data rate = 1500/1523 * 10 Mbps =~ 9.80 Mpbs for 802.3 =============================================================== 5. Combined arrival rate = 10,000 * 18 / 3600 requests/second Service rate = 1/125 us G = Combined arrival rate / Service rate = 10,000 * 18 * 125 * 10^(-6) / 3600 = 6250 * 10^(-6) There are 2 possible interpretations of this one: (a) Find S given G (my favorite: channel throughput is the channel load after collisons and no-transmissions) (b) What we are given is S,and we must find G given that. (a) Find system throughput. For slotted Aloha we know that S = G * e ^(-G) using the G we just calculated, we find that S =~ 6240 * 10^(-6) (b) We are given S, find G: We "simply" have to solve 6250 * 10^(-6) = G * e ^(-G) but, doing a gross simplification we can see that G must be very small, so e ^(-G) should be very close to 1, and G =~ S ==================================================================== 6. Here the main point was to realize that p(success) = p(empty slot) Now, from the original Slotted Aloha efficiency calculations: S = p(success) * Normalized offered load but we also know that in Slotted Aloha p(success) = e ^(-G), so e ^(-G) = 0.1 => G =~ 2.302 (a) G =~ 2.302 (b) S =~ 0.2302 (c) The channel is overloaded. (*) ================================================================= 7. Here, I will only remark some aspects, as everybody knows basic geometry well enough to calculate the lengths. First of all, the cabling was behind the walls, in a plane, so diagonals could be used without any problem. (a) - A star topology requires one cable going from each machine to the router. Some of you shared cables: that is simply NOT the topology being asked. - The router should be behind the desk of cubicle 8 in the fourth floor: that is the center. Because of this, it was enough to calculate the lengths for one quadrant and multiply by 4 (after taking into account the cross that had the router as origin). (b) - Although it wasn't clear, the original question was about the clasical Ethernet topology with a long strand of Coax cable going between all computers. I got (14 x 4) x 7 + 6 x 4 m with that approach. However, if you used hubs and structured cabling that is OK also. (c) - As with the rest, this one will also depend on your geometry. I got the same as (b) with a diagonal cable between the 1st and 7 th floor that completed the ring, that added sqrt(24^2 + 56^2) meters. ================================================================== 7. Tanenbaum's solution (verbatim): ===================== "Number the acquisition attemps starting at 1. Attempt i is distributed among 2^(i-1) slots. Thus, the probability of a collision on attempt i is 2^(-(i-1)). The probability that the first k-1 attempts fail, followed by a success on round k is: k-1 Pk = (1 - 2^(-(k-1))) * mul(2^(-(i-1))) i=1 which can be simplified to Pk = (1 - 2^(-(k-1))) * (2^(-(k-1)(k-2)/2) ) The expected number of rounds is then just sum(k * Pk)" Here's MY solution, because Is till think we are solving != problems ==================================================================== In general psk = p(successful contention at round k) = p(failure at 1) * ... * p(failure at k-1) * p(success at k) In a non-variable backoff strategy, if the probability of picking THIS slot is z, then p(failure at m) == p(failure at s) == p(both try) + p(both defer) == 1 - p(success at m) p(success at m) = (2 1) p(one tries and the other defers) = 2 * z * (1-z) [Notice that: p(both try) = z^2 p(both defer) = (1 - z)^2 ] so p(failure at m) = 1 - 2z + 2z^2, and p(success at m) = 2z - 2z^2 and of course E(number of rounds) = 1/(2z - 2z^2) If the probability of picking a slot were 1/2 uniformly, then E(number of rounds) = 1/(1 - 1/2) = 1/(1/2) = 2 Some of you used exactly this argument. However, please note that this is simply an upper limit. With exponential backoff we should expect a number significantly less than 2! What was the unsimplified function? For m = 1 .. 10, p(failure at m) = 1 - (2 1)* p(one tries and the other doesn't) = 1 - 2* (1/2)^m * (1 - (1/2)^m) You can substitute this in psk, but obviously you don't get even near the neat function as if z were fixed. However, if you are patient and subsitute all numbers you should get something around 1.60 for the average (ignoring the smaller, infinite terms). And of course, after 10, p stabilizes. ==================================================================== (*) A little note on that. Dr. Angel's take on the problem is that S makes sense even if G >= 1 if S is small enough. From my perspective, if G is the normalized offered traffic entering the system, and G >= 1, then the interpretation is that the system is unstable, and the formula for S (which assumes the system is stable) is no longer usable. Of course, this relies heavily on the interpretation of G.