Media Access Control (MAC) Systems

Ethernet is a ired network that is IEEE standard 802.3. There are 2 ethernet types, classic ethernet and switched ethernet Switched ethernet can be grouped into Fast Ethernet, Gigabit Ethernet, and 10 Gigabit Ethernet. 

In classic ethernet, one shared coaxial cable is attached to all the hosts. Here, the physical layer uses Manchester encoding for synchronization, described in an earlier article. The cable is up to 185 meters per coaxial segment handling 30 machines, up to 10Mbps. 


Now let's discuss the frame format. The data size is at least 46 bytes and at most 1,500 bytes. It could be a unicast, broadcast, or multicast address. This example shows what the source address looks lie: 


Now let's discuss the MAC protocol. These protocols use Carrier Sense Multiple Access with Collision Detection (CSMA/CD). Here, the random delay after the collision is computed with BEB (Binary Exponential Backoff). After a collision, the time is divided into discrete slots with a length equal to 2τ.

After an nth collision, the station waits for X slots where X is chosen randomly between 0 and 2^n - 1. Further collisions leads to freezing and randomization. 

Now, let's refer to CSMA. When a station has data to send, we first sense to the channel to see if anyone has been transmitting. If channel is idle, then transmit the frame and detect collision for the 2τ period, or the contention slot period. If collision is detected then Abort the transmission, wait for a random period and start over. If channel isn't idle, wait for a random period and start all over again. 

The following diagram depicts the life stages of CSMA/CD, the beginning without collision and the ending with collision.

Now, let's talk about collision detection. Collisions can take as long as 2τ to detect, where τ is the amount of time to propagate over the ethernet. For example, packet can start at time 0, packet is almost at destination at τ - ε, we get a collision at time τ, with another colliding packet going from other direction and then the noise gets back to the source packet at 2τ.

Now max size defines the RAM side at transceivers. The minimum size is to ensure that each frame takes at least 2τ time to transmit on the cable. Recall that collisions are detected while transmitting a frame, taking at least 2τ amount of time to detect collisions. 

Now let's evaluate classical ethernet performance. Assuming that there are k stations, during a contention slot, let each station transmit a frame with probability p. Now let's define A to be the probability that one station acquires the channel without a collision, which will be kp(1 - p) ^ (k - 1). A is maximized when the probability is 1/k or 1/(# stationed with A = 1/e and k approaching infinity). If the mean frame takes P seconds to transmit then the channel efficiency is (P)/(P + 2τ/A). 

This is efficient for large frames, but degrading for smaller frames. The efficiency is proportional to frame size P and inversely proportional to cable length τ. The probability that a contention interval has exactly j slots in it is A(1 - A) ^ (j - 1) which means that the mean number of slots per contention interval to be 1/A, and the mean contention interval is this number * slot interval or 2τ/A. So the longer the frame and shorter the number of stations trying to send, the larger the channel efficiency. 

Now it's time to discuss ethernet using Hubs. Remember Hubs are Physical Layer Devices, and all they do is relay bits. They wire all lines to a single collision domain. The Ethernet Stations can be connected through a hub instead of a long cable. 


Time to discuss Switched Ethernet now. They use a switch to connect user cables, and makes it easier to manage cables/identify problems. They look very similar to hubs but in reality are vastly different from each other. Hubs wire all lines to a single collision domain (CSMA/CD needed) while Switches isolate each port into a separate collision domain (CSMA/CD is not needed here). 



The switch receives a frame over one port and transmits the frame using the port corresponding to the frame's destination mac address. So, we need to be able to associate STA MAC addresses with ports. We need to queue incoming frames, check an incoming frame destination MAC address in layer 2 header, and then finally transmit frame over the corresponding port. The advantage of switch is no collisions, multiple frames sent simultaneously over many stations (with buffering), and frames between 2 stations are not observed by other stations (Security Benefit). 

Now time to discuss Switched Ethernet Variants. Fast Ethernet goes 100 Mbps. Gigabit Ethernet goes at 1Gbps. 10-Gigabit Ethernet goes at 10 Gbps. Now, improvements in switched ethernet are made possible with cable from twisted pair CAT 3 to CAT 5 to fiber. We are also using higher clocking speeds and higher bandwidth. Finally, there are more signal levels (or symbols). It is still backwards compatible as well. CSMA/CD is still used where there are hubs in the networks, so cable length and frame size relation still needs to be maintained to efficiently detect collisions. 

Now wireless LANs, or wireless networks, Leads to different designed choices than in wired ethernet case. It follows IEEE standard 802.11 and have 2 ethernet types, Infrastructure mode (where access points connect nodes) and Ad-hoc mode (where nodes communicate directly). Wireless clients associate to a wired Access Point, as follows: 


MAC protocol is also used in the data link and logical sublayers. 




We'll discuss these layers later. In the 802.11 collision detection is not possible since radios are almost half duplex, meaning that the stations cannot transmit and listen for noise/collisions at the same time, so we need to use CSMA/CA. The transmission range of different stations may also be different which leads to hidden and exposed terminal issues, which is solved by NAV protocol, discussed shortly. 

CSMA/CA is Carrier Sense Multiple Access with Collision Avoidance, and this uses ACKS/retransmissions for wireless errors and inserts backoff slots to avoid collisions. When we are ready to transmit, compute a backoff value (which is also indicated by a random number of slots) and sense if a channel is free. If the channel is free with backoff expired then transmit frame, otherwise if channel is free without backoff expired then wait until backoff. If we are busy, we put backoff on hold until the channel is free.  


But then what about the hidden and exposed terminal issues? We must use the MACA (Multiple Access with Collision Avoidance) Protocol to help resolve this. This protocol relies and short RTS (Request to Send) and CTS (Clear to Send) frames. In the below diagram, A sends RTS to B, C, and E and defer to CTS, in next sentence. B replies with CTS, D and E hear and defer the data. 



By using short RTS/CTS frames and having stations wait for CTS or for data, MACA helps to resolve the hidden/exposed terminal issue. 802.11 uses a variant of MACA in which it relies on RTS/CTS and a station hearing an RTS or CTS frame assumes the channel will be busy for the duration of the frame and the corresponding ACK. 

NAV is the Network Allocation Vector. Each frame carries this NAV field saying how long it will take to complete transmission. The stations that overhead the NAV know for how long the channel will be busy. 


RTS/CTS has an overhead especially for short frames. It doesn't help for Access Point (AP) frames where all stations will hear and we won't have and hidden/exposed terminal issues anyways. It also doesn't help with the exposed terminal problem. When there are a few hidden terminals, CSMA/CA helps without RTS/CTS by slowing down stations submitting unsuccessfully through backoff. 


Let's now talk about the ethernet extra features. We have frame fragmentation to improve channel efficiency, power saving, and quality of service. In fragmentation, shorter frames have a better chance at getting through undamaged, but larger frames provide better channel efficiency in ethernet. 

Let p be the probability of receiving a bit in error. This means that the probability of receiving a bit correctly is (1 - p). Given that the frame size in bits is n, the probability of receiving a frame correctly is (1 - p) ^ n. So for P = 10^-4 the probability of no error for 12k bits is < 50% and >50% for 4k bits. So, the standard of 802.11 provides the possibility of fragmenting frames into fragments. Each are transmitted as a separate frame, individually numbered and ACK'ed. The fragment size is an 802.11 parameter. 

In power saving, the idea is to have the Access Point buffer traffic for stations in power-save mode. It relies on Beacon frames sent by the Access Point periodically. The beacon frames include the ID of the Access Point, Time, System Parameters, Security Settings, and Map of Stations where there is buffered traffic. 

There are 2 power saving mechanisms. The first one relies on Poll messages sent from a station to Access Point. The second mechanism does not use Poll messages. In these mechanisms, clients set a power management bit in frames they send to the Access Point to indicate that they are entering the power save mode. 

In the mechanism relying on poll messages, the Access Point buffers traffic intended for the station and periodically sends traffic map as part of the beacon frames. In the power-save mode, the station wakes up periodically listens to the beacons. The traffic map tells the STA if it has buffered traffic. If it has buffered traffic, it sends a poll message to the Access Point. 

In the other mechanism, which is called APSD (Automatic Power Save Delivery), the Access Point buffers traffic intended for the Station. When the Access Point receives a frame from the station with buffered traffic, it automatically transmits the traffic to the station. 

Now, let's discuss quality of service. It is used to distingush between different types of frames. Different backoff slot times add quality of services, and shorter intervals give more preferred access. Here, CSMA/CA is still used. 

Data frames have the recipient, transmitter, and address 3 to pass to access point. Here is a diagram showcasing the frame control: 


Now, let's move the discussion to Broadband wireless. Here, wireless clients connect to the wired based station. This competes with 4G, and is referred to as WiMAX. Goes both downlink and uplink. 



This is different than ethernet, in that WiMax is Wireless. Compared to 802.11 in that does not use the ISM free brand. Instead 2GHz-10GHz commercial. The number of customer is expected to be larger. A more complex MAC protocol is needed. CSMA/CA might waste bandwidth due to collisions. The coverage range of the Base station is larger than that of an AP at least 10 times larger. The base station has more powerful antennas and signals. And there is more processing to handle errors. WiMax is designed with the Internet Traffic and Mobility. It provides up to 1Gbps for fixed stations. Here is the 802.16 protocol stack. 



This type of physical layer is based on OFDM. The symbols on each subcarrier are sent with QPSK, QAM-16, QAM-64 depending on the SNR and the distance between base station and the STAs. Connection-oriented with base station in control. Once connection is established, subscriber can send bursts for frames without contention with collision avoidance. 

In uplink MAC, subscribers contend to deliver their connection requests to the base station. Client request the bandwidth they need and if the request is successful its success will be noted in the next downlink map. The exponential backoff will be used to minimize collisions. In downlink MAC, the procedure is very straightfoward with no contention. The base station controls the physical layer bursts to send information to different subscribers. The base station gives mobile bursts by both uplink and downlink, as follows: 

For 802.16, the frames vary depending on their type and a connection ID instead of source/destiation addresses. The top shows a generic frame. The bottom shows a bandwidth request frame. 


Bluetooth provides wireless short-range communication channels between nearby devices. They unite both personal computing and telecommunications devices. In the bluetooth architecture, Piconet master is connected to slave wireless devices. Slaves might be asleep to reserve power and 2 piconets can be bridged into a scatternet. The below diagram shows bluetooth architecture. 


Profiles give the set of protocols for a given application (headset, intercom, streaming, application, personal area network,).



Bluetooth uses adaptive frequency hopping in a 2.4 GHz band. There are 79 channels of 1MHz each. Up to 1600 hops per second. All nodes hop frequencies simultaneously following a pseudo-random hop sequence dictated by the master. The sequence is adapted to exclude channels where there are also other radio frequency signals. Master get even time slots, slaves get the remaining half. Like the base stations in WiMAX, the Master controls the schedule here. There is No contention, as master sets time slots and frequency hopping sequence for each slave.

The Bluetooth Link Layer Protocols are the Link Control Protocols, Link Manager Protocol, and Logical Link Control Adaptation Protocol (L2CAP). The Link Control Protocol deals with how the master controls time slots and how these slots are grouped into frames. The Link Manager Protocol sets up logical channels (links) between the master and a slave device. It does pairing, encryption, power management, and quality of service. It does pairing, encryption, power management, and quality of service. Bluetooth links could either be Synchronous Connection-Oriented periodic slots, and Asynchronous Connectionless. 

The third thing that we have to discuss is the L2CAP protocol. The frame provide reliability if needed. Applications may use L2CAP if they are transmitting variable size packets, other apps may disregard L2CAP. This is during variable length messages. In Bluetooth frames, Time is slotted, enhanced data rates send faster and at the same time.



RFID is Radio Frequency Identification. The tags communicate wirelessly with the readers over short distances. The tags may or may not have a power source to store some data. The readers can read data from tag's memory. They can also write data to tag memory. The reader signal power tags, and the tags will reply with backscatter. 



ISM-Band or frequency hopping is used to reduce interference. Tags are sent through the backscatter. Tags harvest the power of the courier signal by reflecting the signal from the reader or absorbing it. The reader is always trying to submit. 

The RFID MAC Layer is known as the Tag Identification Layer. The reader will most likely want to hear from the area and this is most likely a multi-access case with collisions. RFID uses Slotted Aloha to contend for a transmission slot. First, the reader sends the query. The tags send a random slot to reply which may collide. The reader gets a tag id and eventually sends an acknowledgement. The process continues until no slots are left. 




In RFID Frames, Reader frames vary depending on type. The tag responses are simply data (as the reader sets timing and knows the expected format). 



Comments

Popular Posts