MAC Sublayer Abusayeed Saifullah CS 5600 Computer Networks These slides are adapted from Kurose and Ross
Collision-Free Protocols v N Stations v Each programmed with a unique address: 0-(N-1). v Propagation delay we assume to be negligible. v Question: Which station gets the channel (e.g., the right to transmit) after a successful transmission.
Basic Bit-Map Protocol v Each contention period consists of exactly N slots. v If station 0 has a frame to send, it transmits a 1 bit during the slot 0. v No other station is allowed to transmit during this slot. v Regardless of what station 0 does, station 1 gets the opportunity to transmit a 1 bit during slot 1, but only if it has a frame queued. v In general, station j may announce that it has a frame to send by inserting a 1 bit into slot j. v After all N slots have passed by, each station has complete knowledge of which stations wish to transmit. At which point they begin transmitting frames in numerical order.
Basic Bit-Map Protocol Contention period: consists of contention slots Contention period is followed by frame transmissions
Bit-Map Protocol Performance v Overhead bits N (# of terminals), Data bits d v Efficiency: v High-load N bit contention period is prorated over N frames, yielding an overhead of only 1 bit per frame: Efficiency: d d + N d d +1 à good for high load v Waiting time: Sum of the time it queues in the station +(N!1)d + N bit time
Binary Countdown A problem with the basic bit-map and token passing protocols is the overhead of 1 bit per station. Large overhead for the network with large number of stations. A better solution is to use binary station addresses with a channel that combines transmissions. A station wanting to use the channel now broadcasts its address as a binary bit string (addresses have equal length) The bits in each address position from different stations are BOOLEAN. They are OR-ed together by the channel when they are sent at the same time.
Binary Countdown v Arbitration rule: As soon as a station sees that a highordered bit position that is 0 in its address has been overwritten with 1 it gives up. v Example: If stations 0010, 0100, 1001, and 1010 are all trying to get the channel, in the first bit time the stations transmit 0, 0, 1, and 1, respectively. They are OR-ed together to get 1. Stations 0010 and 0100 see the 1 and know that higher-numbered stations is competing for the channel and they give up for the current round. Stations 1001 and 1010 continue.
Binary Countdown v The next bit is 0 so both stations continue. v The next bit is 1 so the station 1001 gives up and station 1010 wins the bidding. v This gives it a right to transmit the frame, after which a new cycle starts.
Binary Countdown The binary countdown protocol. A dash indicates silence.
Binary Countdown Efficiency v Framesize=d bits v Number of stations=n v Efficiency = d d + log 2 N v If address is the first field in header, then efficiency 100%
Limited Contention Protocols v Collision based protocols (ALOHA,CSMA/CD) are good when the network load is low. v Collision free protocols (bit map, binary Countdown) are good when load is high. v How about combining their advantages -- limited contention protocols. Behave like the ALOHA scheme under light load Behave like the bitmap scheme under heavy load.
Limited-Contention Protocols Recap of single-hop broadcast protocol: v Up to now, the only contention protocols we have studied have been symmetric. That is, each station attempts to acquire the channel with some probability, p, with all stations using the same p. v Interestingly enough, the overall system performance can sometimes be improved by using a protocol that assigns different probabilities to different stations.
Limited-Contention Protocols Recap of symmetric case for contention: v Suppose k stations are contending for channel access. v Each has a probability p of transmitting during each slot. v The probability that some station successfully acquires the channel during a given slot is the probability that any one station transmits, with probability p, and all other k 1 stations defer, each with probability 1 p. v This value is: kp(1! p) k!1 v This probability is shown in next slide.
Limited-Contention Protocols Acquisition probability for a symmetric contention channel. For small numbers of stations, the chances of success are good, but as soon as the number of stations reaches even five, the probability has dropped.
Limited-Contention Protocols v From the figure in previous slide: probability that some stations will acquire the channel can be increased only by decreasing the amount of competition. v The limited contention protocols do just that by: 1. Dividing the stations into (not necessarily disjoint) groups. 2. Only the members of group 0 are permitted to compete for slot 0. 3. If one of them succeeds, it acquires the channel and transmits its frame. 4. If there is a collision the members of the group 1 contend for slot 1. etc.
Limited-Contention Protocols v By making appropriate groups of stations the amount of contention for each slot can be reduced, thus operating each slot near the left of the figure presented in previous slide. v The trick is how to assign stations to slots. Special cases: one station per group: no contention à bitmap protocol all stations in a group: all contend à slotted ALOHA. two stations per group: probability (both will try to transmit in a slot) = p 2 à negligible for small p. The higher the # of stations per slot, the higher the probability of collision in a slotà but shorter the length of the bit-map What is the trick?
Limited-Contention Protocols v We need a way to assign station slots dynamically: Many stations per slot when the load is low, and Few (or just one) station per slot when the load is high. Adaptive Tree Walk Protocol
Adaptive Tree Walk Protocol v Algorithm used for testing soldiers during World War II: Blood samples from N soldiers A portion of each sample was poured into a single test tube. If this mixed sample was testing: If none of antibodies were found all the soldiers in the group were declared healthy. Binary search was performed to pick which soldier was infected.
Adaptive Tree Walk Protocol If there is a collision in a group, then divide the group further into 2 subgroups The binary tree for eight stations
Adaptive Tree Walk Protocol After a successful frame transmission, start a contention period to determine which slots to assign to which nodes: v Slot 0: all stations try to acquire the channel. if one station does, then done for bit slot. Otherwise.. v Slot 1: if there is a collision then during slot 1 only those stations falling under node 2 in the tree (previous slide) may compete. v Slot 2: if one in subtree(2) acquires the channel in slot 1, the slot following the frame is reserved for stations in subtree(3). If two or more stations in subtree(2) in slot 1 collide, then it is node 4 s turn i.e. nodes in subtree(4) will try to acquire channel.
Summary: Adaptive Tree Walk v Trick: partition the group of station and limit the contention for each slot. v Under light load, every one can try for each slot like ALOHA v Under heavy load, only a small group can try for each slot v how do we do it treat stations as the leaf of a binary tree. first slot (after successful transmission), all stations (under the root node) can try to get the slot. if no conflict, fine. if conflict, only nodes under a subtree get to try for the next one (depth first search)
example 0 1 2 * Ready node 3 4 5 6 A B C* D E* F* G H* Slot 0: C*, E*, F*, H* (all nodes under node 0 can try), conflict slot 1: C* (all nodes under node 1 can try), C sends slot 2: E*, F*, H*(all nodes under node 2 can try), conflict slot 3: E*, F* (all nodes under node 5 can try), conflict slot 4: E* (all nodes under E can try), E sends slot 5: F* (all nodes under F can try), F sends slot 6: H* (all nodes under node 6 can try), H sends.
Review Adaptive Tree Walk v Sixteen stations, numbered 1 through 16, are contending for the use of a shared channel v By using the adaptive tree walk protocol. If all the stations whose addresses are prime numbers suddenly become ready at once, v how many bit slots are needed to resolve the contention?
Solution v Stations 2, 3, 5, 7, 11, and 13 want to send. Eleven slots are needed, with the contents of each slot being as follows: slot 1: 2, 3, 5, 7, 11, 13 slot 2: 2, 3, 5, 7 slot 3: 2, 3 slot 4: 2 slot 5: 3 slot 6: 5, 7 slot 7: 5 slot 8: 7 slot 9: 11, 13 slot 10: 11 slot 11: 13