Presentation is loading. Please wait.

Presentation is loading. Please wait.

Communication Networks Lecture 5 NETW 501-L5: NETW 501-L5: Medium Access Control Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204,

Similar presentations


Presentation on theme: "Communication Networks Lecture 5 NETW 501-L5: NETW 501-L5: Medium Access Control Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204,"— Presentation transcript:

1 Communication Networks Lecture 5 NETW 501-L5: NETW 501-L5: Medium Access Control Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204, Email: khaled.shawky@guc.edu.eg

2 Data Link Layer LLC MAC Network Physical Framing (Grouping Bits into Frames) Error Control Flow Control Medium Access Control

3 Multiple Access Communications Key issue: How to share the medium?  1 2 3 4 5 M Shared multiple access medium

4 Multiple-Access Protocols:

5 EXAMPLE FOR CONTROLLED ACCESS

6 Ring networks A Scheduling Method: Token-Passing token Station that holds token transmits into ring token Data to M

7 RANDOM ACCESS PROTOCOLS

8 Multiple-Access Protocols Discussed 1.In random access or contention methods, no station is superior to another station and no one is assigned higher priority over any other station. 1.No station permits, or does not permit, another station to send (every one is free). 1.At each instance, a station that has data to send uses a procedure defined by (WHATEVER) protocol to make a decision on whether or not to send. ALOHA (slotted and reservation) Carrier Sense Multiple Access Carrier Sense Multiple Access with Collision Detection Carrier Sense Multiple Access with Collision Avoidance Topics discussed so far:

9 Multitapped Bus Random Access Transmit when ready Crash!! Transmissions collision can occur; THEREFORE, we need retransmission strategy

10 Two stations are trying to share a common medium Two-Station MAC Example A transmits at t = 0 Distance d meters t prop = d / seconds AB AB B does not transmit before t = t prop.'. A captures the channel successfully Case 1 B transmits before t = t prop and detects collision.'. A & B transmissions are corrupted AB Case 2 A detects collision at t = 2 t prop A B

11 ALOHA Operation Collision definition: – Transmissions from two or more terminals overlap in time (this time is called collision region or duration) ALOHA Operation: – Messages transmitted once they are available – Suddenly, messages may collide (treated as erroneous frames) – The terminal knows that its messages was corrupted when it receives no acknowledgements within 2t prop + T t (i.e., a timeout is used) – Recovery by the use of retransmissions Can we simply apply retransmission directly after timeouts? – NO! Retransmissions will collide again – SOLUTION: Retransmission after random intervals from timeouts (Backoff Algorithm) Terminal A Terminal B Terminal A Terminal B Collision Terminal A Terminal B No CollisionCollision Collision Region

12 ALOHA Model Wireless link to provide data transfer between main campus & remote campuses of University of Hawaii islands Simplest solution: just do it – A station transmits whenever it has data to transmit – If more than one frames are transmitted, they interfere with each other (collide) and are lost – If ACK not received within timeout, then a station picks random backoff time (to avoid repeated collision) – Station retransmits frame after backoff time t t0t0 t 0 -T t t 0 +T t t 0 +T t +2t prop t 0 +T t +2t prop + B Vulnerable period = 2T t Time-out Backoff period “B” First transmission Retransmission

13 ALOHA Model (Cont.) Definitions and assumptions – T t frame transmission time (assume constant) – S: throughput (average # successful frame transmissions per T t seconds) – G: load (average # transmission attempts per T t sec.) – P success : probability a frame transmission is successful TtTt TtTt frame transmission Prior interval Note: Any transmission that begins during vulnerable period leads to collision

14 Vulnerable time for pure ALOHA protocol

15 Frames overview in pure ALOHA

16 Throughput of ALOHA ● our analysis assumed that many nodes share a common channel ● if only 1 node uses the medium, S=1 ● Max throughput is  max =  1/2e (18.4%), when G=1/2 ‘one frame per vulnerable period’ ● G increases S increases until it reaches S max – after that point the network enters ‘unstable operating conditions’ in which collisions become more likely and the number of backlogged stations increases 1/2e -1 = 0.184 Stable Unstable

17 Vulnerable time Example A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps. What is the requirement to make this frame collision- free? Solution Average frame transmission time T fr is 200 bits/200 kbps or 1 ms. The vulnerable time (from figure) is 2 × 1 ms = 2 ms. This means that no station should send later than the 1 ms before this station will start its transmission (is it reasonable ??) And no station should start sending during the one 1-ms period that this station is sending.

18 Procedure of ALOHA (Case to study with maximum transmission attempts)

19 Slotted ALOHA ● Time is slotted (divided) in T t = L/R seconds slots ● Stations synchronized to frame times so that each node knows when ● the slots begin ● Stations transmit frames only at the beginning of slots, and only after frame is ready ● Backoff intervals can be easily multiples of slots t (k+1)T t kT t t 0 +T t +2t prop + B Vulnerable period = T t Time-out Backoff period B t 0 +T t +2t prop Only frames that arrive during prior T t seconds collide: Avoid partial collisions t0t0 Position depends on the length of the slot

20 ALOHA Performance ➢ max throughput of Slotted ALOHA (S max = 0.36) occurs at G=1, which corresponds to a total arrival rate of ‘one frame per vulnerable period’ ➢ S max = 0.36 ⇒ max Slotted ALOHA throughput = 36% of the actual channel capacity Slotted ALOHA vs. Pure ALOHA ● slotted ALOHA reduces vulnerability to collision ● Higher overall throughput

21 Vulnerable time for slotted ALOHA protocol

22 Collision in slotted ALOHA protocol

23 Throughput for pure/slotted ALOHA protocol pure S = G × e −2G The throughput for pure ALOHA is S = G × e −2G. The maximum throughput S max = 18.4% S max = 18.4% when G (load in frame/msec)= (1/2). pure S = G × e −2G The throughput for pure ALOHA is S = G × e −2G. The maximum throughput S max = 18.4% S max = 18.4% when G (load in frame/msec)= (1/2). slotted S = G × e −G The throughput for slotted ALOHA is S = G × e −G. The maximum throughput S max = 36.8% S max = 36.8% when G (load in frame/msec)= (1). slotted S = G × e −G The throughput for slotted ALOHA is S = G × e −G. The maximum throughput S max = 36.8% S max = 36.8% when G (load in frame/msec)= (1).

24 Carrier Sensing Multiple Access (CSMA) A Station A begins transmission at t = 0 A Station A captures channel at t = t prop Low throughput of ALOHA is due to waste of bandwidth due to collisions CSMA: Sense (i.e., Listen) the medium for presence of a carrier signal before transmission A terminal transmit only if it senses an idle channel Widely used in LAN with Bus Topology Vulnerable period = t prop Network Diameter

25 Transmitter behavior when busy channel is sensed – 1-persistent CSMA (most greedy [trial and error]) Start transmission as soon as the channel becomes idle Low delay and low efficiency – Non-persistent CSMA (least greedy) If channel is busy, immediately run the backoff algorithm to set a time to re-sense the channel High delay and high efficiency – p-persistent CSMA (adjustable/adaptive greedy) If the channel is busy, wait till channel becomes idle, transmit with prob. p; or wait one mini-slot time & re-sense with probability 1-p Delay and efficiency can be balanced CSMA Options

26 CSMA of three persistence methods

27 CSMA with Collision Detection (CSMA/CD) ‘collision detection’ is another level of CSMA CSMA-CD reduces wastage to time to detect collision and abort transmission in CSMA/CD – station listens while transmitting – if a station hears something different than what it is sending, it immediately stops (this happens when 2 or more transmitting signals garble each other) – in addition, if a collision is detected, a short jamming signal is subsequently sent to ensure that other stations know that collision has occurred (thus, all stations discard the part of frame received) – reschedule random backoff times, and try again at scheduled times

28 CSMA/CD reaction time It takes 2* t prop to find out if channel has been captured Note 1: This is called “ reaction time” Note 2: collision detection works only as long as frame-size is sufficiently long to require more than a round-trip time for transmission A begins to transmit at t = 0 A B B begins to transmit at t = t prop -  ; B detects collision at t = t prop A B A B A detects collision at t= 2 t prop -  frame size/R (T t ) > 2 * t prob

29 Analysis of p-persistent CSMA/CD channel can be in three states: – busy transmitting / idle / contention period Def: contention period – stations attempt to capture the channel by transmitting during mini-slots and listening whether they have successfully captured the channel or not each contention interval (minislot) = 2*t prop BusyContentionBusy Time IdleContentionBusy Assume n stations contend for the channel, each station transmits during a contention mini-slot with probability p.

30 Vulnerable time in CSMA

31 Space/time model of the collision in CSMA

32 Contention Resolution Performance For small a: CSMA-CD has best throughput For small a: CSMA-CD has best throughput For larger a: Aloha & slotted Aloha better throughput For larger a: Aloha & slotted Aloha better throughput T prop /T t =a

33 Collision of the first bit in CSMA/CD

34 Collision and abortion in CSMA/CD

35 Flow diagram for the CSMA/CD <= For non-contention period

36 CSMA/CD Example A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum propagation time (including the delays in the devices and ignoring the time needed to send a jamming signal) is 25.6 μs, In this case, what is the minimum size of the frame? Solution The frame transmission time is T fr = 2 × T p = 51.2 μs. This means, in the worst case, a station needs to transmit for a period of 51.2 μs to detect the collision. The minimum size of the frame is: The minimum size of the frame is: 10 Mbps × 51.2 μs = 512 bits or 64 bytes. This is actually the minimum size of the frame for Standard Ethernet.

37 Energy level during transmission, idleness, or collision


Download ppt "Communication Networks Lecture 5 NETW 501-L5: NETW 501-L5: Medium Access Control Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204,"

Similar presentations


Ads by Google