560 likes | 575 Views
CEN 4500 Data Communications. Chapter 4: The Medium Access Control Sublayer. Instructor: S. Masoud Sadjadi http://www.cs.fiu.edu/~sadjadi/Teaching/ sadjadi At cs Dot fiu Dot edu. Recap. Networks are divided into two categories Point-2-point connections (WANs)
E N D
CEN 4500 Data Communications Chapter 4: The Medium Access Control Sublayer Instructor: S. Masoud Sadjadi http://www.cs.fiu.edu/~sadjadi/Teaching/ sadjadi At cs Dot fiu Dot edu
Recap • Networks are divided into two categories • Point-2-point connections (WANs) • Broadcast channels (LANs) • a.k.a Multicast Channels • a.k.a Random Access Channels • Key issue in broadcast channels • Determining who gets to use the channel, when there is a competition • Medium Access Control (MAC) sublayer • Has the protocol that addresses this issue • Technically is the bottom part of the data link layer • Usually used in LAN and in satellite networks CEN 4500, S. Masoud Sadjadi
Agenda • The Channel Allocation Problem • Multiple Access Protocols • Ethernet • Data Link Layer Switching • Summary CEN 4500, S. Masoud Sadjadi
The Channel Allocation Problem • How to allocate a single broadcast channel among competing users? • Static Channel Allocation in LANs and MANs • Dynamic Channel Allocation in LANs and MANs CEN 4500, S. Masoud Sadjadi
Static Channel Allocation • Frequency Division Multiplexing (FDM) • If there are N users, the bandwidth is divided into N equal-sized portions. • Good for small and constant numbers of users, each of which has a heavy (buffered) load of traffic. • Not good for users with bursty traffic • Time Division Multiplexing (TDM) • Each user is statically allocated every Nth time slot. • The same problem with bursty traffics. CEN 4500, S. Masoud Sadjadi
Why FDM and TDM have a poor performance? • Mean time delay, T, for a channel of capacity C bps, with arrival rate of frames/sec, each frame having a length drawn from an exponential probability density function with mean 1/ bits/frame. • From queuing theory with Poisson arrival and service times: T = 1/(C - ) • Ex: C = 100 Mbps, 1/ = 10,000 bits/frames, = 5000 frames/sec, then T = 200 sec NOT T = 100 sec • TFDM= 1/( (C/N) – (/N)) = N/(C - ) = NT • Ex: 10 networks of 10 Mbps, TFDM = NT = 2 msec CEN 4500, S. Masoud Sadjadi
Dynamic Channel Allocation: Assumptions • Station Model • N independent stations/terminals • The probability of a frame being generated in an interval of t is t, where is a constant (the arrival rate of new frames). • Single Channel Assumption • A single channel is available for all communications. • All stations can transmit on it and all can receive from it • Collision Assumption • Collision: If two frames are transmitted simultaneously, they overlap in time and the resulting signal is garbled. • All stations can detect collisions. • There are no errors other than those generated by collisions. • (a) Continuous Time: No master clock. Frame can start at any time.(b) Slotted Time: Time is divided into discrete intervals (slots). Frame transmission always begins at the start of a slot. • (a) Carrier Sense: Stations can tell if the channel is in use.(b) No Carrier Sense: Stations cannot sense the channel before using it. CEN 4500, S. Masoud Sadjadi
Agenda • The Channel Allocation Problem • Multiple Access Protocols • Ethernet • Data Link Layer Switching • Summary CEN 4500, S. Masoud Sadjadi
Multiple Access Protocols • ALOHA • Carrier Sense Multiple Access Protocols • Collision-Free Protocols • Limited-Contention Protocols • Wavelength Division Multiple Access Protocols • Wireless LAN Protocols CEN 4500, S. Masoud Sadjadi
ALOHA • 1970, Norman Abramson, Univ. of Hawaii • Was called “the ALOHA system” • Used ground-based radio broadcasting • The basic idea is applicable to any system, in which uncoordinated users are competing for the use of a single shared channel. • Two versions • Pure ALOHA: not global time synchronization • Slotted ALOHA: time is divided into discrete slots CEN 4500, S. Masoud Sadjadi
Pure ALOHA • Basic idea: • Let users transmit whenever they have data to be sent. • There will be collisions, of course, and the colliding frame will be damaged. • However, due to the feedback property of broadcasting, a sender can always find out whether its frame was destroyed by listening to the channel, the same way the other users do. • If listening at the same time of sending is not possible, then ack is required. • If a frame is destroyed, the sender just wait a random amount of time and sends it again. • Contention Systems • Systems in which multiple users share a common channel in a way that can lead to conflicts. CEN 4500, S. Masoud Sadjadi
Pure ALOHA: Example • In pure ALOHA, frames are transmitted at completely arbitrary times. • The throughput of ALOHA systems is maximized by having a uniform frame size. CEN 4500, S. Masoud Sadjadi
Pure ALOHA: Channel Efficiency? • Let the “frame size” denote the amount of time needed to transmit the standard, fixed-length frame. • Assume that infinite population of users generates new frames according to a Poisson distribution with mean N frames per frame time. • If N > 1, the user community is generating more frames than the channel can handle, so nearly every frame will suffer a collision. • For reasonable throughput, we expect 0 < N < 1. • In addition to the new frame, the stations also generate retransmissions of garbled frames. • Assume that the probability of k transmission attempts per frame time, old and new combined, is also Poisson, with mean G per frame time. • Clearly G >= N • S = GP0, where S is throughput and P0 is the probability that a frame does not suffer collision. CEN 4500, S. Masoud Sadjadi
Pure ALOHA: Vulnerable Period • A frame will not suffer a collision if not other frames are sent within one frame time of its start. • Vulnerable period for the shaded frame. CEN 4500, S. Masoud Sadjadi
Pure ALOHA: Throughput • The probability that k frames are generated during a given frame time is given by the Poisson distribution: • Pr[k] = Gk e-G / k! • Pr[0] = e-G • In an interval of two frame time, the mean number of frames generated is 2G. • Then, the probability of no other traffic being initiated during the entire vulnerable period is • P0 = e-2G • Using S = GP0 , we get S = G e-2G CEN 4500, S. Masoud Sadjadi
Pure ALOHA: Throughput • Maximum throughput occurs at G = 0.5, which is about 0.184, or %18. Not encouraging! Throughput versus offered traffic for ALOHA systems. CEN 4500, S. Masoud Sadjadi
Slotted ALOHA • 1972, Roberts, doubling the capacity of ALOHA • Basic idea • Users need to agree on slot boundaries • One special station emit a pip at the start of each interval, like a clock. • The users need to wait until the beginning of the next slot. • Throughput • The vulnerable area is halved • So, P0 = e-G, and S = G e-G • Probability of collision is 1- P0 or 1- e-G • The probability of a transmission requiring exactly k attempts Pk = e-G(1- e-G)k-1 • The expected number of transmissions • E = k=1kPk = eG CEN 4500, S. Masoud Sadjadi
Carrier Sense Multiple Access Protocols • ALOHA and Slotted ALOHA are bound to have many collisions as the stations start transmitting at will. • In LANs, it is possible for stations to detect what other stations are doing and adapt their behavior accordingly. • Carrier Sense Protocols • Protocols in which stations listen for a carrier (i.e., a transmission) and act accordingly • Persistent and Nonpersistent CSMA • CSMA with Collision Detection CEN 4500, S. Masoud Sadjadi
Persistent CSMA • When a station has data to send, it first listens to the channel ro see if anyone else is transmitting • If the channel is busy, the station waits until it becomes idle. • When the station detects an idle channel, it transmits a frame with the probability of one, hence the name 1-persistent CSMA. • The propagation delay has an important effect on the performance of this protocol • The longer the propagation delay, the more chance of collision. • With propagation delay of zero, there will still be collisions. CEN 4500, S. Masoud Sadjadi
Nonpersistent CSMA • A conscious attempt is made to be less greedy. • Before sending, a station senses the channel. • If the channel is already in use, the station does not continually sense it for the purpose of seizing it immediately upon detection the end of the previous submission. • Instead, it waits a random period of time and then repeats the algorithm. • Consequently, this algorithm leads to a better channel utilization, but longer delays. CEN 4500, S. Masoud Sadjadi
P-Persistent CSMA • It applies to slotted channels • When a station becomes ready to send, it senses the channel. • If it is busy, it waits until the next slot. • If it is idle, it transmits with a probability p • With probability q=1-p, it defers until the next slot. • If that slot is also idle, it either transmits or defers again, with probability p and q. • This process is repeated until either the frame has been transmitted or another station has begun transmitting. • In the latter case, it waits a random time and starts again CEN 4500, S. Masoud Sadjadi
Persistent and Nonpersistent CSMA • Comparison of the channel utilization versus load for various random access protocols. CEN 4500, S. Masoud Sadjadi
CSMA with Collision Detection • Persistent and nonpersistent CSMA protocols are clearly an improvement over ALOHA • No station will start transmission if it senses that the channel is busy! • Another improvement • Abort transmission as soon as a collision is detected. • This saves time and bandwidth • CSMA/CD • Is widely used in LANs in the MAC sublayer • It is the base for the popular Ethernet LAN CEN 4500, S. Masoud Sadjadi
CSMA/CD Conceptual Model • Let’s assume that at time t0 a station has finished transmitting its frame. • Any other station having a frame to send may now attempt to do so. • If two or more stations decide to transmit simultaneously, there will be a collision. • Collisions can be detected by looking at the power or pulse width of the received signal and comparing it to the transmitted signal. • After a station detects a collision, it aborts its transmission, waits a random period of time, and then tries again, assuming that no other station has started transmitting in the meantime. • Therefore, our model for CSMA/CD will consists of alternating contention and transmission periods, with idle periods occurring when all stations are quiet. CEN 4500, S. Masoud Sadjadi
CSMA with Collision Detection CSMA/CD can be in one of three states: contention, transmission, or idle. CEN 4500, S. Masoud Sadjadi
CSMA/CD: Modeling the Contention Period • Worst case scenario • Assume is the channel propagation time • If station A starts transmission at t0 and B at the farthest in the channel start transmission at t0 + - , then A will not know about the collision until t0 + 2 - • Therefore, we model the contention period as a slotted ALOHA system with slot width 2 • Collision detection is an analog process • so the signal encoding must allow collisions to be detected (two 0 volts will be 0 volt). • A sending station must continuously monitor the channel, listening for noise bursts that might indicate a collision. • So, CSMA/CD with a single channel is a half-duplex system inherently, as the receiving logic is in use. • No MAC-sublayer protocol guarantees reliable delivery (the receiving side may not correctly copy the frame!). CEN 4500, S. Masoud Sadjadi
Collision-Free Protocols • In CSMA/CD still collisions can happen during the contention period • Adversely affecting the system performance. • Especially when the cable is long and frames are short • Collision-Free Protocols • Do not have any collisions • Not widely used yet • Examples • A Bit-Map Protocol • Binary Countdown Protocol CEN 4500, S. Masoud Sadjadi
A Bit-Map Protocol • Efficiency: • Low loads: With the overhead per frame, N bits, and data d bits, the efficiency is d / (N + d) • High loads: With the overhead per frame, 1 bit, the efficiency is d / (1 + d) • Problem: The overhead is one bit per station, so it does not scale well The basic bit-map protocol. CEN 4500, S. Masoud Sadjadi
Binary Countdown Protocol • All addresses are assume to be the same length. • The bits in each address position from different stations are BOOLEAN ORed together. • The channel efficiency • d / (d + log2N) The binary countdown protocol. A dash indicates silence. CEN 4500, S. Masoud Sadjadi
Limited-Contention Protocols • Performance measures • Low delay at low loads • Contention protocols (e.g., pure of slotted ALOHA) • High channel efficiency at high loads • Collision-free protocols • It would be best if we could combine the best properties of the contention and collision-free protocols. • Limited-Contention Protocol • Uses a contention protocol at low load • Uses collision-free protocol at high load CEN 4500, S. Masoud Sadjadi
Limited-Contention Protocols • Acquisition probability for a symmetric contention channel. CEN 4500, S. Masoud Sadjadi
Wireless LAN Protocols • Portal and Mobile computers may not be the same! • CSMA may not be appropriate, because what matters is interference at the receiver, and not at the sender side. • Hidden Station Problem: a station not being able to detect a potential competitor for the medium because the competitor is too far away. • Exposes Station Problem: a station falsely avoid transmission, because it senses activity on the network that does not affect the intended receiver. CEN 4500, S. Masoud Sadjadi
Wireless LAN Protocols A wireless LAN: • Hidden Station Problem: A is transmitting and if C transmits too, then there will be collision at B. • B is transmitting and for that, C is avoiding transmission to D. CEN 4500, S. Masoud Sadjadi
Wireless LAN Protocols (2) The Multiple Access with Collision Avoidance (MACA) protocol. (a) A sending an RTS to B. (b) B responding with a CTS to A. CEN 4500, S. Masoud Sadjadi
Agenda • The Channel Allocation Problem • Multiple Access Protocols • Ethernet • Wireless LANs • Broadband Wireless • Bluetooth • Data Link Layer Switching • Summary CEN 4500, S. Masoud Sadjadi
Ethernet • Ethernet Cabling • Manchester Encoding • The Ethernet MAC Sublayer Protocol • The Binary Exponential Backoff Algorithm • Ethernet Performance • Switched Ethernet • Fast Ethernet • Gigabit Ethernet • IEEE 802.2: Logical Link Control • Retrospective on Ethernet CEN 4500, S. Masoud Sadjadi
IEEE 802 • The IEEE has standardized a number of LANs and MANs under the name IEEE 802. • 802.3 is Ethernet (based on the original Ethernet) • 802.11 is for Wireless LAN • 802.15 is for Bluetooth • 802.16 is for Wireless MAN • 802.2 is for logical link control for both 802.3 and 802.11 CEN 4500, S. Masoud Sadjadi
Ethernet Cabling • 10Base5 & 10Base2 • 10 Mbps, Base is for baseband signaling, 500 & 185 meters • 10Base-T and 10Base-F • T for Twisted Pair and F for Fiber The most common kinds of Ethernet cabling. CEN 4500, S. Masoud Sadjadi
Ethernet Cabling (2) Three kinds of Ethernet cabling. (a) 10Base5, (b) 10Base2, (c) 10Base-T. CEN 4500, S. Masoud Sadjadi
Ethernet Cabling (3) Cable topologies. (a) Linear, (b) Spine, (c) Tree, (d) Segmented. CEN 4500, S. Masoud Sadjadi
Ethernet Cabling (4) (a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding. CEN 4500, S. Masoud Sadjadi
Ethernet MAC Sublayer Protocol • Preamble (10101010 pattern): The Manchester encoding will produce a 10 MHz square wave for 6.4 sec to allow the receiver clock to synchronize • Type: multiple network protocols; Which process to give the frame to. • Pad: Frame size at least 64 bytes; frames must take more than 2. • For 10 Mbps, max length of 2500 m, and four repeaters, 2 is 50 sec • So, 500 bits is the smallest frame that can work • SoF: Start of Frame delimiter for compatibility with 802.4 and 802.5 Frame formats. (a) The original DIX (DEC, Intel, and Xerox) Ethernet, (b) IEEE 802.3. CEN 4500, S. Masoud Sadjadi
Ethernet MAC Sublayer Protocol (2) CEN 4500, S. Masoud Sadjadi
Ethernet Performance • Efficiency of Ethernet at 10 Mbps with 512-bit slot times. CEN 4500, S. Masoud Sadjadi
Switched Ethernet • A simple example of switched Ethernet. • Collision domains are different. CEN 4500, S. Masoud Sadjadi
Fast Ethernet The original fast Ethernet cabling. CEN 4500, S. Masoud Sadjadi
Gigabit Ethernet • A two-station Ethernet. (b) A multistation Ethernet. CEN 4500, S. Masoud Sadjadi
Gigabit Ethernet (2) Gigabit Ethernet cabling. CEN 4500, S. Masoud Sadjadi
IEEE 802.2: Logical Link Control (a) Position of LLC. (b) Protocol formats. CEN 4500, S. Masoud Sadjadi
Agenda • The Channel Allocation Problem • Multiple Access Protocols • Ethernet • Wireless LANs • Data Link Layer Switching • Summary CEN 4500, S. Masoud Sadjadi