Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Medium Access Control Sublayer Chapter 4. Medium Access Control (MAC) Sublayer Basic Problem in broadcast networks: Many stations and a single medium.

Similar presentations


Presentation on theme: "The Medium Access Control Sublayer Chapter 4. Medium Access Control (MAC) Sublayer Basic Problem in broadcast networks: Many stations and a single medium."— Presentation transcript:

1 The Medium Access Control Sublayer Chapter 4

2 Medium Access Control (MAC) Sublayer Basic Problem in broadcast networks: Many stations and a single medium  Who sends what and when?  Also known as multiaccess channel problem Idea of multiaccess channels is relatively young (1973) ISO included it relatively late in its reference model MAC is seen as part of layer 2 (Others see it rather as part of layer 1) Anyway, it deals with transmission of packets (rather frames) between flat stations Multiaccess Channel (Medium) Station May I send now? Am I meant as a receiver?

3 MAC Sublayer Multiaccess channel problem arises in: LANs (1000 m range) Bus-based Ring  distributed solution of the MAC problem Similar problem when accessing system bus in a computer  central solution using bus arbiter Radio networks (50 km range) No problem for microwave bridges Typically FDM/TDM

4 MAC Sublayer Satellite networks Also have the multiaccess channel problem Except satellite channels in telephone networks, which use sometimes FDM (like radio networks) Problem of FDM/TDM: Let E[B] be the mean frame/packet time if channel was idle  max. throughput C = 1/[B] Let E[T] the mean frame time and the frame arrival rate Then: E[T] = E[B]/(1 – /C) = E[B]/(1 – E[B]) = 1/(1/E[B] – ) = 1/(C – ) With N chunks of channel (FDM/TDM): E[T MUX ] = 1/(C/N –  N x E   Multiplexing is inherently inefficient

5 MAC Sublayer Multiple Access Protocols Random Access With reservation Without sensing of medium With sensing of medium (CS: carrier sensing) Pure Aloha Slotted Aloha P-persistent Non-persistent Token ring Token bus Static Dynamic Stiff FDMStiff TDM Unslotted Slotted CSMA Slotted Unslotted CSMA Priority after conflict Reservation Aloha CFMA (Conflict Free Multi Access) MLMA (Multi Level Multi Access) BRAM (Broadcast Recognition Access Method) … Further classification based on collision detection/handling

6 MAC Sublayer Criteria for Multiple Access Protocols: Reservation or at a venture Slotted time or continuous time Carrier sense or no carrier sense Priority or fairness Load dependency Time until a frame is transmitted (potentially after collisions) Throughput …. Main assumptions: Single shared channel Stations are independent No way to contact other parties except through medium

7 Protocols Without Reservation ALOHA (hello!): Each station sends as soon as it wants to No positive ACK after timeout, then frame is retransmitted Collision if frames overlap at the central station Only central station can detect a collision; if so then no positive ACKs Similar situation if multiple access uses a satellite:  Comparison of the sent message with the message from the satellite Performance of ALOHA: X: delay (before sending a frame anew) k: collision probability E[D]: mean frame/packet throughput Main parts of system model: A: whole system (Aloha) X: delay unit M: medium

8 ALOHA System model: E[N] = E[D].E[T] ( Number of frames [frame] = Rate [frame/sec] x Time [sec] )  E[N A ] = E[D A ].E[T A ] = E[N M ] + E[N X ] E[N X ] = E[D X ].E[T X ] = k.E[D M ].E[T X ] E[N M ] = E[D M ].p (p: packet time) E[D A ] = (1 – k).E[D M ]  E[T A ] = p/(1 – k) + E[T X ].k/(1 – k) This is the time needed by a packet in order to be sent after potential collisions Delay X Medium M k 1-k E[D M ] A E[D A ]

9 ALOHA Again: E[T A ] = p/(1 – k) + E[T X ].k/(1 – k) In words: Time through Aloha = 1/(1-k) times time in medium + k/(1-k) times delay time Hence: Packet visits the medium vm =1/(1-k) times (number of sending trials) Packet visits the delay unit vd = k/(1-k) = vm -1 times (intended waiting after late ACK) What is the value of the collision probability k?  two cases Pure ALOHA: Send anytime (continuous time) Slotted ALOHA: Time segmented in slots with length equal to packet time. Sending starts only at the beginning of a slot (discrete time) Assumption: Inter-arrival time A of packets has the following distribution: P[A <= t] = 1 – e – t with = E[D M ] (i.e. exponential distribution)

10 ALOHA Let us determine the collision probability k: pure Alohaslotted Aloha p p 2p k = P[A <= 2p]k = P[A <= p] k = 1 – e –2 pE[D M ] k = 1 – e – pE[D M ] Earliest next packet Latest previous packet our packet p time Collision-free if no packet arrival in previous slot

11 ALOHA Throughput of Aloha: E[D A ] = (1 – k).E[D M ] Pure Aloha: k = 1 – e –2 pE[D M ]  E[D A ] = (1 – (1 – e –2 pE[D M ] )).E[D M ] = E[D M ].e –2 pE[D M ] Slotted Aloha: k = 1 – e – pE[D M ]  E[D A ] = (1 – (1 – e – pE[D M ] )).E[D M ] = E[D M ].e – pE[D M ] E[D A ] Maximum throughput c if packet alone (c = 1/p) 1/p 1/2p 1/p 3/2p E[D M ] pure Aloha slotted Aloha 1/2ep 1/ep Utilization of channel  = E[D A ]/C, thus  <= 1/2e = 18% (pure) and  <=1/e = 36% (slotted)

12 ALOHA What is the time until packet is successfully transmitted? (= T A ) E[T A ] = p/(1 – k) + E[T X ].k/(1 – k) Pure Aloha (slotted similar): k = 1 – e –2 pE[D M ]  E[T A ] = p/ e –2 pE[D M ] + E[T X ]. (1 – e –2 pE[D M ] ) / e –2 pE[D M ] = = (p + E[T X ]. (1 – e –2 pE[D M ] )).e 2 pE[D M ]] Since: E[D M ] = E[D A ]./(1-k) The time rises more than exponentially with p.E[D A ] E[T A ] p p.E[D A ] = utilization of A Most beautiful thing in Aloha is its name  Drawback (in general for all protocols at a venture) is that no maximum transmission time can be guaranteed (bad for real-time processing).

13 CSMA (carrier sensing – multiple access) A better idea: Do not send if a foreign transmission has already begun.  Sense the medium before sending Problems: The stations cannot “hear” each other (satellite/radio network) Because of the distribution, a foreign transmission may have begun before our station recognizes it. Should we send now, then a collision is sure. Shared channel is particularly natural for LANs with bus structure (Ethernet). The second problem, however, should be considered in LANs, too. A B Should B have begun here, A could have recognized it g g message time g: propagation delay g = distance/v 0 v 0 : speed of light In this 2g interval B is allowed to send though it will collide with A Now A is sure that everything is ok (end of risk time) Now B is allowed to send (without collision with A)

14 CSMA For effectiveness (collision protection, utilization) is obviously required that: message time >> maximum propagation time of the network This means: m / c >> distance / v 0 (length in bits, c: max.throughput) (technical improvement increases c and distance) Important parameter: Conflict parameter: a = propagation time / message time should be << 1 Example: LANMAN m1000 b c10 7 bps10 8 bps distance500 m50 km v0v0 10 8 m/sec a0.01717

15 CSMA In particular, a sender risks a collision if it sends 2 (more) consecutive messages, because during the first message more than one station may have become ready to send. Variants of CSMA regulate the behavior after a collision has been detected: If not free, persist or wait for a while If free, send immediately or wait for a while Types: CSMA persistent: persist, as soon as free send immediately with probability p 1-persistent: persist, send as soon as medium is free (p=1) good transmission time if load low, high collision risk if load high p-persistent (p <1): persist, perhaps send worse transmission time, less risk CSMA non-persistent: do not persist (wait for a while) if medium is occupied, but send if medium is found free

16 CSMA CSMA Algorithm: Ready to send Carrier sense? Type? Send Probability? Wait Collision? Wait Type? Wait End No Yes Non-persistent p-persistent Non- persistent p-persistent 1-p p Free In use

17 CSMA E[D Aloha/CSMA ] E[D M ] E[D Aloha/CSMA ] Conflict parameter: a 10.10.010.001 0 0.2/p 0.4/p 0.6/p 0.8/p 1/p c = 1/p Pure Aloha Slotted Aloha 1-persistent Slotted persistent Non-persistent CSMA Aloha Like so often the strategy used is not important if load is low

18 CSMA The CSMA multi-channel access protocols are further refined by collision detection and abortion. CSMA-CD: (CD: Collision Detection) As soon as a station detects (by monitoring the voltage characteristics, not using checksums an so on) that different transmissions have overlapped, it triggers a warning signal (jamming). All senders interrupt their transmission, if they receive a jamming signal. CSMA-CD 1-persistent is the basis of ISO standard 8802 and IEEE 802.3, which is known under the product name Ethernet (Xerox, 1976) Where in OSI?

19 Ethernet Manchester Encoding PSK

20 Ethernet

21 Segmentation:  to overcome distance limitation

22 Ethernet Topology of 10Base2:

23 Ethernet Topology of 10Base-T:

24 Ethernet Topology of 1Base5:

25 Other Ethernet Implementations Switched Ethernet Idea: Switch instead of hub Hub broadcasts/Switch unicasts Bandwidth x N (N stations) Fast Ethernet Idea: Reduce maximum distance md (station to switch/hub)  collision detected earlier  higher offered bandwidth 100Base-T4 : 4 pairs of UTP, md =100 m 100Base-TX: 2 Pairs of UTP or STP, md =100 m 100Base-FX: 2 optical fibers, md = 2000 m Gigabit Ethernet Idea: Like Fast Ethernet Rather for optical fibers (e.g. backbone between Fast Ethernets) 1000Base-SX: short wave laser, 550 m 1000Base-LX: long-wave laser, 550 m (multimode) 5000 m (single mode) 1000Base-CX: STP, electrical, 25 m 1000Base-T : UTP, electrical, 25 m

26 Token Ring 1 2 34

27 Rules for the stations (  also for Token Bus = Logical Ring) Recognize packet start (address), destination copies packet into local buffer. If station not sender, forward packet. If sender, get packet with ACK of receiver and generate a new token. To send, first get token (bit pattern) from ring. If not ready to send, token is forwarded. Main advantages Maximum waiting time is guaranteed. Maximum utilization 100% (almost) achievable. No collisions. Disadvantages If load low, waiting time is determined by token round-trip time (not zero). More complex than CSMA. Sensitive to failures. Problems Station crash: might ruin the ring, however, switches are used. Token loss: monitor creates a new one. More than one token: monitor cancels one. Monitor crash: new one is elected. Rotating packet: monitor marks and “absorbs” it next time.

28 Token Ring Topology of a ring Analysis of token ring r: circulation time of token (load dependent) g: propagation time of signals (in whole ring) p: packet time N: number of stations U: utilization of medium E[T]: “mean” packet transfer time

29 Token Ring Analysis of token ring (contd) 1 2 3 4 1 time Node p t1t1 t0t0 t2t2 t3t3 t 0 : 2 wants to send t 1 : 2 gets token t 1 - t 0 : waiting time for token t 2 : 2 is sending t 3 : 2 generates new token 1 2 3 4 1 Node circulating token packet being sent g time r = N.p + g  U = N.p/(N.p + g)

30 Token Ring Analysis of token ring (contd) Transfer time for a packet with highest priority (no queuing time): E[T min ] = r/2 + g/2 + p Why? r/2: mean time in order to get the token g/2: mean time for propagation p: packet time itself In order to guarantee E[T min ] – p, each node is assigned a fixed time q in which data can be sent:  r  N.q + g Hence: E[T min ]  N.q/2 + g + p or E[T min ] – p  N.q/2 + g  Main advantage for real-time processing: token ring guarantees maximum waiting time (for token) for highest priority packets (in CSMA not possible because of collisions). Mean transfer time E[T]: E[T ring ] > E[T csma ] for low load, E[T ring ] < E[T csma ] for high load. g ring g csma p ring csma 100% U E[T] U = N.p/(N.p+g) 0

31 Basic Reservation Protocols ps packets Bit-map protocol 2 Phases : (1) Reservation (2) Transmission Collision-free Number of slots per cycle = Number of stations (= N) U = p/(p + if heavy traffic then s else N.s) (s: slot time, p: packet time) Broadcast Recognition Access Method (BRAM) Reservation slots are cyclically (and deterministically) assigned to stations Also collision-free Channel utilization: U = p/(s + p) Better waiting time in light traffic than bit-map protocol (N/2 instead of N) 1 (1)1 1 (3) (7) 01 23567 s p 1 (1) 01 234 1 (5) 5 670 (2) 1 1 2

32 Binary Countdown Bit-map protocol not scalable for high N Rules Stations are numbered in binary (addresses) Stations wanting to send broadcast their addresses starting from the leftmost bit Bits of addresses of different stations are Boolean ORed Any station having 0 in the current position gives up if it sees a (foreign) 1 on same position The winner is offered the medium for transmission Consequence: Higher-numbered stations have higher priority (always win the competition) Because contention only “during” the binary representation of N: U = p/(p + s.log(N))

33 Again 2 phases: Reservation phase In this phase, the stations use slotted Aloha to transmit a very small (relative to average data frame size) reservation frames. The station that is able to transmit its reservation frame successfully (without collision) reserves the channel for subsequent data frame transmission. This slotted-time reservation phase lasts as long as it takes to transmit a reservation frame successfully. On average, the peak effective channel utilization efficiency is 36% for reservation Aloha (see slotted Aloha). Data Transmission In this phase, the station can transmit the data frame without contention because the channel is reserved for it. Utilization: U = p/(p + s/0.36) Other variations exist (e.g. TDM for heavy traffic and Aloha for light traffic) Reservation Aloha

34 Limited-Contention Protocols Acquisition probability for a symmetric contention channel. General problem: Collision-free protocols (e.g. bit-map protocol) work well for large k Protocols with collision (e.g. slotted Aloha) work well for small k How to combine them? Limited-contention Protocols: Try to solve above problem Basic idea: If k too high lower it in order to maximize p How? Use of groups of stations (1-1/k) k-1 k p

35 Limited-Contention Protocols Adaptive Tree Walk Protocol: Tree(x) = subtree under node x Algorithm(Tree) { Let all stations in Tree try to reserve the channel; if (no collision) return; currentSlot++; Algorithm(left(Tree)); currentSlot++; Algorithm(right(Tree)); } How to call algorithm()? Method M1: Begin with the root //{currentSlot := 0; Algorithm(Tree(1));} M1 bad if load is heavy (because slot 0 will always include a collision) Method M2: Let q be an estimate for the number of stations that are ready to send E(i) = q/2 i is expected number of them under a node at level i E(i) = 1 minimizes the E(i) for i = log(q)  begin with nodes at level log(q) Other optimizations exist (e.g. {G, H} ready to send, slot 2 for Tree(6) not for Tree(3)) Level 0 Level 1 Level 2

36 The 802.11 MAC Sublayer Protocol (a) The hidden station problem. (b) The exposed station problem. Main Differences to Fixed LANs (i.e. Ethernet): Carrier sensing (and transmission) not reliable.  CSMA not sufficient! Different data flows possible if they do not interfere. New Problems:

37 The MACA (Multiple Access with Collision Avoidance) protocol. (a) A sending an RTS (Request To Send) to B. (b) B responding with a CTS (Clear To Send) to A. The 802.11 MAC Sublayer Protocol Basic Idea:

38 The 802.11 MAC Sublayer Protocol CSMA/CA (CSMA with Collision Avoidance): Standard 802.11 protocol in the distributed case (without base station) Mode 1: Ready to send Carrier sense? Send Collision? Wait End No Yes FreeIn use Mode 2: Based on MACA Uses virtual channel sensing Collision detected e.g. if no ACK after timeout Wait until free

39 The 802.11 MAC Sublayer Protocol The use of virtual channel sensing using CSMA/CA. 1. RTS: A asks B to send 2. CTS: B says ok 3. Data: A sends a data frame to B 4. NAV (Network Allocation Vector): 4.1. C sees RTS, so it keeps quiet until ACK 4.2. D sees CTS, so it keeps quiet until ACK (in 4.x, time to sleep part of information in RTS/CTS) CSMA/CA Mode 2 (contd):

40 The 802.11 MAC Sublayer Protocol (3) A fragment burst. CSMA/CA Mode 2 (contd): To minimize effect of noise and increase throughput, frames are fragmented. In principle, NAV until last ACK

41 Networking and Internetworking Devices Connecting Devices and the OSI Model: Repeaters and hubs: operate on layer 1 only. Bridges and switches: operate mostly on layer 2 (and also on layers < 2). Routers: operate mostly on layer 3 (and also on layers < 3). Gateway: operate mostly on layer 7 (and also only layers < 7). Gateway is the general term: Repeaters and hubs = Layer-1 gateways Bridges and switches = Layer-2 gateways Routers = Layer-3 gateways Bridge, Switch Repeater, Hub Router Physical Data Link Network Transport Session Presentation Application Gateway Physical Data Link Network Transport Session Presentation Application

42 Networking and Internetworking Devices Repeaters in the OSI Model: Main Characteristics of a Repeater: Analog device (has no ideas about protocols etc.) Regeneration of signals Mainly used to connect 2 or more cable segments (as in Ethernet).

43 Networking and Internetworking Devices Repeater (contd): It is tempting to compare a repeater to an amplifier However, comparison not correct, since: Amplifier amplifies input signals (including noise!) only Repeater really regenerates the signal (hence removing effect of noise) Signal Regeneration: Hub: Connects a number of input lines as a star Broadcasts any input (frame) to all other lines (in general without regeneration) A B C Corrupted signal Regenerated signal Repeater D E F G Hub

44 Networking and Internetworking Devices Switch: Joins a number of stations in a star (similar to hub) More intelligent than a hub, because it understands layer-2 addresses Traditionally, includes buffers for each line Any input frame is actively forwarded to its destination only (no broadcast) Terms switch and bridge are used interchangeably Cut-trough switch: Begins to forward a frame as soon as its destination has been scanned No buffering (not a store-and-forward switch) In general implemented in hardware Store-and-forward switch: Has buffers (problem of buffer overflow!) In general implemented in software (real computer) A B C E F G Switch

45 Networking and Internetworking Devices Bridge: Joins a number of LANs Includes a lookup table for localizing the output of a specific destination: {(station, line, arrival time)} Algorithm in a Bridge: Get next frame with destination d from input line i; Get current time t; Get source s of frame and insert (s, i, t) in lookup table; // backward learning Search in lookup table the output line j corresponding to d; if(found) then // known destination if(i = j) then // input LAN = output LAN Discard frame; else Forward frame to j; else Forward frame to all lines except i (Flooding); The backward learning step is needed to build up (and update) the lookup table (which is initially empty) Also (in another thread) the lookup table is periodically scanned and entries that are more than x time units old are discarded (x parameter of bridge) ASK FD B Bridge LAN i LAN j H

46 Networking and Internetworking Devices Issues if a Bridge Connects Different LANs: Example Wireless LAN and Ethernet or Token Ring Frame Format Bridge should be able to transform one format to another Payload Size Maximum allowed size of a frame varies from a LAN to another. Problem arises when input frame is larger than maximum allowed size of output LAN (fragmentation does not help, since layer 2 does not do that in general). Data Rate Different LANs allow different data rates. The bridge should be able to cope with that (e.g. a Gigabit Ethernet may overwhelm a bridge connecting to a 10 Mbps LAN). Checksum Recalculation Is needed, since the destination LAN may use another generator polynomial Security The destination LAN (e.g. Ethernet) may not provide security measures whereas the source LAN (e.g. wireless LANs) may include security. Bridge would forward frame without security measures. If frame is in plaintext, this would lead to insecure communication. If not, frame is forwarded but it is useless for receiver, since receiver (layer 2) cannot decrypt it. (Solution may be to do encryption solely in higher layers, but standards do not adhere to that)

47 Networking and Internetworking Devices Reliability of Bridges: What a bridge can perform is much-needed However, what if a bridge is down? (  no inter-LAN communication is possible!) Solution: Use of redundant bridges Problem: Frame F will be infinitely forwarded by the two bridges (if both up) Why? 1. B1 receives F and forwards it to LAN2 (suppose destination D unknown) 2. B2: 2.1 Receives F1 and forwards it to LAN1 2.2 Side effect: B2 will falsely assume that S is in LAN2 and updates its table 3. B1 receives F1 and forwards it again to LAN2 4. … D S

48 Networking and Internetworking Devices Solution for the Endless Forwarding Problem of Bridges: Do not allow cycles in the network; use all LANs and as many bridges as possible (for redundancy). Spanning Tree: Idea: Construct a tree of bridges by eliminating cycles in the network (i.e. eliminating bridges). Assumptions: Group address in order to address all bridges in the network. Unique bridge IDs and unique port IDs in each bridge. Path costs in each port of a bridge (e.g. number hops, sum 1/bit rates). Algorithm: 1. Determining the root bridge (root of tree). 1.1 Initially, each bridge thinks it is the root bridge. 1.2 Then minimum ID of the bridges decides: 1.2.1 (Current) root bridges periodically broadcast frames containing their IDs. 1.2.2 Any bridge that receives a frame with a lower ID subordinates itself to root (i.e. it desists from sending frames). 2. Determining the root port for each bridge: 2.1 For each port determine path with minimum costs to root. 2.2 Root port is port with minimum costs to root. 3. Determining the designated ports for each bridge: 3.1 For each LAN the port connecting to the bridge with minimum path (to root) from its root port is observed as a designated port. 3.2 All ports of the root bridge are designated ports. 4. Eliminating bridges: All remaining ports are blocking ports (i.e. bridges do not forward frames along them).

49 Networking and Internetworking Devices B3 B4 B1 B2 B6 LAN1 LAN4 LAN5LAN6 LAN2 B5 Example for a Spanning Tree: LAN3 ID = 101 ID = 58 ID = 23ID = 77 ID = 11 ID = 34 Designated port Root port Root bridge Blocking port

50 Networking and Internetworking Devices Routers: Are not frame-based: do not use physical addresses (e.g. Ethernet 48 Bit address) Are packet-based: use network addresses included in the payload of a frame Are in general powerful computers with considerable amount of software Main function: connect different networks Routers in OSI Model:

51 Networking and Internetworking Devices Gateway: Is a protocol converter (in any layer) Transport gateway: e.g. converts from TCP to ATM Application gateway: e.g. email over ftp Usually software resides in a router Other devices : Multiprotocol router: can handle more than one network protocol e.g. IP and IPX packets Brouter: a bridge/router, acts as both, if it understands packet format it acts as a router, otherwise as a bridge (processing whole frame)


Download ppt "The Medium Access Control Sublayer Chapter 4. Medium Access Control (MAC) Sublayer Basic Problem in broadcast networks: Many stations and a single medium."

Similar presentations


Ads by Google