Sei sulla pagina 1di 11

# CNT5106C Computer Networks, Summer 2010 Instructor: Prof.

Ahmed Helmy Homework #3 & 4 (this is worth the grade of 2 homeworks) On the Data link layer, MAC protocols and Wireless Networking Q1. (9 points: 3 x 3) MAC layer utilization For an Ethernet LAN (shared bus) the data rate was increased from 10Mbps to 100Mbps. I. How will the utilization (U) of this network change? [Calculate U for each case] II. Suggest two ways in which we can return the utilization to what it was before (Increasing or decreasing another parameter and by how much? Show your reasoning.) III. One person argued that increasing the number of stations attached to the LAN would reduce the idle time on the LAN and hence increase the utilization. Do you agree? A1: I. For Ethernet U=1/(1+5a), where a = Tprop/Ttrans. But Ttrans=#bits/data rate. Since the data rate was increased, so Ttrans is decreased (by a factor of 10), and hence a is increased by a factor of 10, and subsequently U is decreased. II. We can either increase the # of bits per frame by a factor of 10 (so that Ttrans would decrease by 10), or decrease the length of the Ethernet network/cable by a factor of 10 (so that Tprop would increase by 10), or a combination thereof (i.e., increase the # of bits by 5 and the length by 2, so on). III. No. Increasing the number of stations would increase the probability of collisions and so will bring the utilization down. Q2. (13 point: 3 + 10) I. Why do we need a medium access control (MAC) protocol? Shouldnt routing, queuing and flow control at the data link layer be sufficient? II. Mention ten MAC protocols and classify them according to their type (e.g., random access, etc.). Ans I. No. Because of collision on the shared medium due to multiple accesses from connected stations. Hence a coordination (or collision resolution, avoidance of detection) mechanism is needed. These functions are not performed by routing, queuing or flow control mechanisms. II. 1. Frequency division multiplexing (FDM), 2. time division multiplexing (TDM), 3.Random access which includes: a. Aloha, b. slotted Aloha, c. CSMA, d. CSMA/CD, e.CSMA/CA, and 4. Token based: a. token ring w/ release after transmission, b. token ring with release after reception, and c. polling based MAC. Q3. (6 points) Reason mathematically about the relationship between the utilization in Aloha and utilization in the slotted Aloha MAC protocols.

A3. Students need to write the formulas used in each of the schemes (depending on the collision probability). For Aloha, probability of collision exists anytime during the slot in which the frame is sent, and also if a frame is already in flight (i.e., that was sent during the previous time slot). P(success by given node) = P(node transmits) . P(no other node transmits in [t0-1,t0] . P(no other node transmits in [t0,t0+1] = p . (1-p)N-1 . (1-p)N-1 = p . (1-p)2(N-1) choosing optimum p and then letting n -> infty ... = 1/(2e) = .18 For slotted Aloha collision can only happen during the allocated slot for transmission (theres a pre-specified time for contention, after which stations are not allowed to transmit). Hence the collision probability goes down by half. P(success by given node) = P(node transmits) . P(no other node transmits during pre-specified time slot) = p . (1-p)N-1 choosing optimum p and then letting n -> infty ... = 1/(e) ~ .37 So the utilization is double that of Aloha. [Note, the students can get the relative ratio between the two without getting exact numbers and thats ok too] Q4. (6 points: 3 x 2) I. Which MAC protocol is used in switched (fast/Gigabit) Ethernet, and why? II. What is frame bursting in switched Ethernet and why is it used? A4. I. The MAC protocol used is still CSMA/CD although in switched Ethernet theres no contention for the shared medium (the switch operates to resolve contentions). The main reason CSMA/CD is used, is for backward compatibility and interoperability with previous (legacy) versions of Ethernet. That was one of the main reasons for the success of Ethernet. II. Frame bursting in switched Ethernet is to send multiple frames (as one burst) without checking for (or detecting) collision. Since there are no collisions, CSMA/CD would

unnecessarily wait for collision detection. Frame bursting raises the utilization of switched Ethernet by reducing idle time. Q5. (13 total points) I. (6 points) Derive an expression for the utilization of the token ring release-aftertransmission algorithm. Comment on your result showing the effect of the change of a on the utilization. II. (4 points) Compare this result to utilization of token ring (release after reception) and Ethernet. (You do not have to draw graphs to answer this question). III. (3 points) What is the difference between the 3 mechanisms (token ring release-aftertransmission, token ring release-after-reception, CSMA/CD) as the number of total stations increases in the network? A5. I. <6 points: 4 points for the derivation, 2 points for comments> For token ring release after transmission (RAT):

Utilization

## where E(Tn) = expected (average) duration of node transmission

So,

Comment: <2 points>As N increases there is less time wasted in propagating the token and utilization increases. As a increases the utilization decreases. (b) <4 points> For token ring release after reception (RAR):

For Ethernet (CSMA/CD): For the same a, we see the u RAT > u RAR > u CSMA/CD When a increases the utilization for all schemes drops, while at small a they exhibit somewhat similar utilization. III. For CSMA/CD the number of probable collisions increases with the increase in N (the number of attached stations). For token ring (release after reception), the number of stations sending per tokenpropagation around the ring increases, but so does the wait time (since each station would wait for its own transmission to be received), so the net result doesnt change the utilization. For token ring (release after transmission) the number of stations sending per tokenpropagation around the ring increases, so the wasted (idle) time decreases, which increases the overall utilization. (this also shows in the utilization formula). Q6. (8 points) I. (2 points) What is the exponential back off mechanism? II. (2 points) Mention two protocols that use such mechanism, one at the transport layer and another at the data link layer. III. (4 points) Discuss how the above two protocols use the exponential back off mechanism differently and why. A6. I. Exponential backoff is a timing mechanisms, that doubles the values (or range fro which the timer value is chosen) with every loss of packet or failure of trial. II. CSMA/CD and CSMA/CA use exponential backoff timers after collisions (they double the interval from which the timer value is chosen randomly), and TCP retransmission timeout is doubled every time the transmission is lost (for the same segment). III. At the data link layer, the timers are used to resolve (and avoid future) collisions on the same LAN (in which the delays are quite small). Hence, the backoff is not doubled exactly for each station (this would lead to deterministic collisions). Rather, the range of values from which a random timer value is chosen is doubled (to reduce the probability of future collisions for the same transmissions). For TCP, the backoff timers are not used to resolve collisions, it is rather providing the network time to recover from congestion and drain its buffers. Also, the timers depend on RTT estimates that are end-to-end and vary from one flow to another. So the timer values an be directly doubled.

Q7. ARP (4 points) Mention whether ARP is necessary for the proper operation of routing and why. A 7. Routing tables have IP addresses in them, potentially the routers can always use data link broadcast to forward packets to the next hop but that would create extra unnecessary overhead. ARP is not necessary for the proper operation of routing, but is certainly essential in improving the efficiency of processing at the routers over the broadcast scheme. This is especially true for networks with many switched hubs. It also enhances security somewhat by having specific unicast MAC addresses in the frames instead of broadcast. Q8. (12 points: 3 + 9) TCP over ATM: I. What is the main observation (or problem) you can identify regarding transfer of TCP segments and IP datagrams over ATM networks? II. Suggest and compare three different schemes that attempt to alleviate the above problem. Mention the advantages and disadvantages of each. I. -observation: when ATM cell is dropped, all other ATM cells that belong to the same IP datagram are useless II. -solution: develop discard strategy to minimize transmission of useless cells (1) Partial Packet Discard (PPD): -when a cell is dropped at a switch, all cells belonging to the same datagram are dropped -switch identifies the end of IP datagram using type-bit in ATM header in AAL 5 -on average: datagram worth of ATM cells are transmitted uselessly (2) Early Packet Discard (EPD): -when buffer exceeds a threshold, drop complete IP datragrams -problem of fairness: the shorter the datagram, the higher the probability of drop (3) add fairness using fair buffer allocation (FBA): - when EPD is invoked drop from connections using more than their fair share -the number of VC connections is V -if N is the current occupancy, then the fair share is N/V -the weight w(i)=N(i)/[N/V], where N(i) is occupancy of connection I -policy to drop: if (N>R) and w(i)>z then drop, where R is the congestion threshold and z~1 Q9. (12 points: 6 x 2) I. What are the features in ATM AAL5 that allow efficient transfer of TCP over ATM? Mention 2 main features and explain how they can be used to increase the efficiency (define what you mean by efficiency). II. What would happen if those two features were not supported?

A9. I. The features: 1. The type bit is set to 1 in the very last cell that belongs to a datagram. This helps delimit the datagrams at the ATM layer. 2. The virtual channels (VCs) are not multiplexed, so that every VC at the ATM layer corresponds to a flow at the IP layer. This ensures that consecutive ATM cells belong to the same IP flow. Both of these features are necessary to allow the packet discard mechanisms (discussed in Q8) to work effectively. II. if those features are not supported, then ATM will not be able to identify the beginning and end of each datagram and the packet discard mechanisms would not work effectively. Hence, the efficiency of the ATM cloud would decrease. Q10. (8 points) Mention 8 characteristics of wireless systems that render the field of wireless networking fundamentally more challenging and different from wired networking. A10. 5 for Channel characteristics: 1- extended delays for satellite links, 2- high BER, 3asymmetric links, 4- unidirectional links, 5- interference, multipath, attenuation, etc. 6- mobility, 7- power constraints as the devices are mostly battery operated and tetherless, 8- locality of the neighborhood (which subsequently leads to the hidden terminal problem) vs. wired Ethernet (where all nodes on the shared bus have the same neighboring nodes). Q11. Rate Adaptation (6 points: 3 x 2) I. What is rate adaptation in wireless MAC protocols? Why is it used, and how does it help the performance of wireless networks? II. Discuss possible effects on upper layer protocols (such as TCP and real time applications)? A11. I. Rate adaptation in wireless MAC (e.g., 802.11) changes the encoding scheme to reduce the sending data rate when the signal to noise ratio SNR (or the signal power) decreases to a level at which BER is high (~10% or more). This could occur due to increased interference from the nearby environment or due to the increased distance from the base station (or the other node involved in the communication). By decreasing the data rate, the SNR is increased and the BER is decreased to acceptable levels. This effectively increases the usability (in terms of distance and operational range) of the wireless network. II. Decreasing the data rate (sometimes by orders of magnitude; e.g., from 100Mbps to 1Mbps) would increase the delay dramatically for the wireless links. TCP relies on RTT estimates to detect congestion and set its retransmission timers. Having huge fluctuations in the RTT estimates (due to the rate adaptation of wireless links) can degrade the performance of TCP.

(4 points) Q12. Someone suggested that wireless networks in vehicles may be used for safety enhancement. For example, 802.11 can be used to quickly detect an imminent collision from a nearby car (through real time communication) and trigger the brakes to stop the car. Do you agree with the feasibility of such approach. Discuss your position. A12. No. 802.11 uses CSMA/CA which is a random access technique that attempts to reduce collisions but doesnt eliminate it. Hence, 802.11 does not provide any guarantees or delay bounds for the messages to be delivered. Potentially, a very important message (to push the brakes) could be delayed, leading to a crash. For such application more guaranteed performance will be required. Q13. (8 points: 4 x 2) Emerging networks: Mobile ad hoc networks (MANETs) and delay tolerant networks (DTNs): I. A new generation of emerging networks consists of peer-to-peer wireless mobile networks that are infrastructure-less (those that have no access points or infrastructure support, in which every mobile node acts as both a host and a router). We call them ad hoc networks in general. Those networks pose a new set of challenges. Discuss routing in ad hoc networks as compared to the routing approaches in wired networks. II. When ad hoc networks consist of highly mobile nodes, they are likely to form intermittently connected islands of mobile devices. We refer to those networks as delay tolerant networks (DTNs). Discuss possible approaches for routing in such networks vs. wired networks and the ad hoc networks discussed in part I above. Also discuss the effect of mobility on performance in general terms? A13. I. The main approach in wired networks is to prepare the routing tables in anticipation of packets (i.e., establish a complete routing table to all potential destinations before the packets are sent). This way there is minimum delay in packet forwarding when the packets are actually sent. The routing changes occur rarely, and when they do they trigger mechanisms to discover new usable routes. In Adhoc networks, due to mobility and the high level of dynamics of the links, routes are likely to change frequently as part of the normal operation of the network (and not as an exception). Hence the same approach would be inefficient (many routes will be established in anticipation of packets, only to become stale/obsolete and the routing algorithms would unnecessarily spend a lot of overhead discovering new routes that may never be used). A better approach is to only discover routes for those flows that are active, but then discovery would occur on-demand (when the flows are initiated) and would incur some delays for the first few packets. II. In DTNs, potentially there would not exist a complete path from the source to destination at any point in time. So all the previous approaches (in wired or ad hoc networks) would fail. Algorithms that route in both time and space would have to be used, where segments of the path would be used at any point, then packets will have to be buffered at intermediate nodes, then forwarded when the rest of the path becomes

available. Note that mobility has a vital role in this case in establishing paths in the future and forming new links. So mobility is used to carry-and-forward the packets and is considered useful and even essential. Traditionally, one would consider mobility harmful because it breaks links causing topology change. It is exactly such topology change over time that renders DTNs useful, whereas otherwise they would form disconnected islands of nodes. Q14. (5 points) Why isnt CSMA sufficient for a wireless MAC protocol? Explain clearly the main problem when using CSMA. Also explain clearly any modifications needed to CSMA to work efficiently in wireless networking. A14. CSMA may be effective when the carrier-sense would indicate activity (by other stations) that would interfere with the ability of the intended recipient to receive the packets successfully. In wireless networks, the hidden terminal problem may occur, in which a station on one side, attempting to send another node, would not be aware (and not be able to sense) a station on the other side attempting to send to the same destination. Hence, the CSMA scheme would not be effective in this case and collisions will occur frequently. In order for CSMA to work effectively it needs to be coupled with a collision avoidance scheme in the form of RTS/CTS exchange that enables both the neighborhood of the sender and the neighborhood of the receiver to sense the existence of a transmission and hence avoids collisions to a large extent. [Another possibility is to extend the range of the carrier sense to double that of the transmission range such that transmission of senders on the other side of a hidden terminal can be sensed.] Q15. 802.11 (8 points) I. (5 points) In 802.11 there can be no collision between data and data or data and ack. Discuss this statement. Under which conditions does it hold and under which conditions does it not hold (give 2 examples in which it does not hold). II. (3 points) Give example in which 802.11 may under utilize the network with unnecessary defer missing opportunity to transmit over a non-idle medium. I. In general, 802.11 with CSMA/CA was designed to prevent (or at least minimize) the data collisions (since retransmissions can be costly). However, due to the non-ideal conditions of the wireless channels and potential mobility of the nodes, such statement may not be true always. The first scenario in which this statement may be violated is with message loss range, where in A-B-C-D topology (with hidden terminal problem) a CTS from B to A would be lost by C. Hence, a connection between A & B can be established and another one between C & D where data-data or data-ack collision may be possible. Another example is of mobility where C (already sending data to D) was out of range of B when the CTS was sent (from B to A) then it moved within range of B. [other reasonable scenarios are also acceptable]

II. In 802.11, nodes receiving RTS would defer their own transmission for the duration in the RTS message (assuming that the rest of the handshake was successful). However, when/if a CTS is not received for that RTS, that neighborhood would go idle unnecessarily. Q16. CDMA (10 points: 5 x 2) I. Explain the basic concepts of CDMA operation (at the transmitter and the receiver). II. Mention 5 advantages of using CDMA. A16. I. Operation: CDMA uses a pseudo noise (PN) sequence. The PN sequence has a much higher frequency (hence much lower pulse duration) than the original signal. By multiplying the PN sequence by the original signal, the resulting signal becomes of much higher bandwidth than the original signal (i.e., the original signal is spread in bandwidth). Each user uses a different PN sequence. At the receiver, using the correct PN sequence (with the correct seed at the right time) would result in high signal using correlation of signals and hence the original signal can be obtained. Correlation with other signals (that were sent with a different PN sequence) would seem like noise. II. The advantages are: 1-secure: using the PN sequence, non-intended receivers with the wrong PN sequence get noise 2- reduced fading effect . Fading affects only part of the frequency spectrum. By spreading the signal over the whole spectrum only part of the signal is affected, and can be in general recovered . 3- No frequency planning . All cells use the same frequency . 4- Soft handoff (no frequency change during handoff) . All cells use the same frequency 5- Increased capacity: the number of users is not limited by the number of channels anymore (there is no channel allocation), but is limited by the noise floor. Typically the number of users supported by CDMA systems can go up to 5 to 10 times more than other conventional cellular systems.

Q17. (10 points) Explain the basic concepts of CDMA operation (at the transmitter and the receiver). Mention 5 advantages of using CDMA. (6 points) Q17. Why do some popular version of 802.11 (e.g., 802.11b, 802.11g) use DSSS? If DSSS is used then why is CSMA/CA still needed? Ans.

802.11 uses CDMA (or DSSS) mainly to reduce interference from others in the same freq spectrum (802.11 operates in the unlicensed spectrum and suffers from interference from many other devices, including microwaves, Bluetooth devices, cordless phones and baby monitors, among others. However, CSMA/CA is still needed since that version of DSSS doesnt use many orthogonal codes (and no code assignment per device) and hence the noise from other signals may be significant, and collision can still happen (noise floor could be high depending on synchronization of sending messages). Both are needed for robust operation. (5 points) Q18. As an Engineer designing a cellular system you are given an option between 2 systems, each with 10 channels. The first uses 1 big cell of 10 channels to cover the required area. The second uses 2 smaller cells, each with 5 channels, and does not re-use the channels. Which system would you choose and why. A18. The system having 10 channels would be able to use sharing between these 10 channels to increase the utilization of the system and handle more traffic overall. However, in the other (2 cells, with 5 channels each) would be underutilized when one of the cells is overloaded and the other is underloaded (no sharing is possible in this case). This is stemming from the statistical multiplexing principles discussed at the beginning of the semester. [It can also be mathematically proven using trunking theory but thats not required for the answer]. Q19. Mobile IP (12 points: 6 x 2) I. What are the design goals for Mobile IP? How does it strive to achieve them? Give a scenario of a mobile node moving to a foreign network and explain the main mechanisms II. What are the main drawbacks of basic Mobile IP? [Mention at least 3 main issues] Answer: I. Mobile IP strives to provide (1) transparency of connection while providing the ability to move for mobile nodes. This means that the nodes communicating with a mobile host do not know its current location, nonetheless they are able to establish continuous communication with it. <1.5 points> (2) maintaining established connections (such as TCP) during mobility. <1.5 points> Mobile IP provides this transparency by having the correspondent node (CN) send packets to the home network, then the home agent (HA) would tunnel these packets to the mobile node. The home agent knows the (new) address of the mobile node through registration process that occurs through the foreign agent (FA) (in the foreign network). <3 points> II. The main drawbacks of basic Mobile IP are: (. 3 drawbacks are sufficient)

1. Triangle routing 2. Delay (or packet loss) during handoff 3. Communication overhead during handoff 4. Not fit for micro mobility Q20. (10 points) Suggest two ways to alleviate the problems associated with basic Mobile IP as described above. Discuss the advantages and disadvantages of your proposals. Answer: <total 10 points> Two suggestion to deal with the triangular routing problem are: - route optimization: the mobile node sends its new address to the correspondent host so that further packets are sent directly to the mobile node without going to the home agent. [or the home agent sends this new address to the correspondent host] <2 points> - multicast-based mobility: have the mobile node use a multicast address (which is independent of location), and whenever it moves to a new network it joins that multicast group through the new network and leaves it through the old network. The correspondent node always sends to the group. <2 points> The advantage of both the above proposals is that they avoid triangular routing. In the multicast-based mobility approach, there is no need for home agent or foreign agent, and the handoff is theoretically simpler and faster than other approaches. <2 points> Disadvantages: Route optimization: may incur handoff problems as does Mobile IP. Needs the correspondent node to change address of the mobile host on the fly for the same connection (like TCP connections). <2 points> Multicast-based mobility: needs to assign a multicast address for each mobile node. Connection needs to be established with a multicast address, which may cause a problem for come applications (like TCP). <2 points> (4 points) Q21. What determines the limit of a CDMA network? Would you expect it to be more or less than FDMA or TDMA systems? 1. the orthogonality of the PN codes assigned. The more orthogonal these codes, the less the noise coming from other simultaneous transmissions. 2. the noise floor (exacerbated by the near far effect) generally because it is not limited by frequency spectrum or time slots it can achieve 3-5 times in capacity more than FDMA and TDMA (this is from empirical data).