Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4 The Medum Access Sublayer. MA Sublayer Additional Reference –Local and Metropolitan Area Networks, William Stallings, Prentice Hall, 2000, 6th.

Similar presentations


Presentation on theme: "Chapter 4 The Medum Access Sublayer. MA Sublayer Additional Reference –Local and Metropolitan Area Networks, William Stallings, Prentice Hall, 2000, 6th."— Presentation transcript:

1 Chapter 4 The Medum Access Sublayer

2 MA Sublayer Additional Reference –Local and Metropolitan Area Networks, William Stallings, Prentice Hall, 2000, 6th ed. Networks could be point to point or broadcast. Key issue: who gets access to the (single) channel when there is competition Key parameters in any medium access control technique are where and how. WHERE - refers to whether control is exercised in a distributed or centralized fashion.

3 MA Sublayer HOW - is constrained by topology and is a trade off among competing factors including –cost –performance –complexity Protocols used to determine who goes next on a multiaccess channel are part of a sublayer of the data link layer (DLL) called MAC (Medium Access Control) sublayer. MAC sublayer is important in LAN’s

4 Channel Allocation Problem How to allocate a single broadcast channel among multiple (competing) users. Static Allocation in LAN’s and MAN’s Traditional way is to use FDM. Review FDM here. When # of senders is large & frequently changing, or traffic is bursty, FDM presents problems. –If freq. range has N bands and less than N users are using it then we are wasting bandwidth –More than N, some users will have to wait.

5 Static Allocation in LAN’s and MAN’s FDM problems (continued). –Even if there were only N users, when some user is silent (e.g., not speaking) their frequency range is wasted. (Dog in the manger syndrome) –Also, computer traffic is bursty, thereby most of the bands will be idle most of the time. Let us calculate: –Mean time delay is T –Channel capacity is C bps –Arrival rate is frames/sec –Length of frame is exponential, mean = 1/  bits/frame (next slide)

6 Static Allocation in LAN’s and MAN’s Calculations (continued): –T = 1/(  C - ) –If single channel is split into N independent subchannels each having capacity C/N bps. Then mean input rate on subchannels will be /N. –Therefore T FDM = 1/(  C/N - /N) = NT, i.e., the mean time delay using FDM is N times worse if we had only used a single queue. Dynamic Channel alloc in LAN + MAN (ASSUMPTIONS) –Station Model, Single Channel Assumption, Collision Assumption, Continuous time, Slotted time, Carrier sense, no carrier sense.

7 Dynamic Channel alloc in LAN + MAN (Assumptions) Station Model - –The model assumes N independent stations (terminals, telephones, personal communicators etc). –Each station has a program (user) that generates frames for transmission –Probability of a frame being generated in an interval of length  t is  t, where is a constant (the arrival rate of new frames). –Once a frame is generated, the station is blocked, i.e., it waits till frame is successfully transmitted.

8 Dynamic Channel alloc in LAN + MAN (Assumptions) Single Channel Assumption –A single channel is available for all communication. –All stations can communicate and receive on this channel. –The protocol may consider each station to have a different priority

9 Dynamic Channel alloc in LAN + MAN (Assumptions) Single Channel Assumption –A single channel is available for all communication. –All stations can communicate and receive on this channel. –The protocol may consider each station to have a different priority

10 Dynamic Channel alloc in LAN + MAN (Assumptions) Collision Assumption –If two frames are submitted simultaneously, they overlap in time and the resulting signal is garbled. (This is called a collision). –All stations are capable of detecting collisions. –Collided frames must be transmitted again later –There are no errors other than those generated by collisions

11 Dynamic Channel alloc in LAN + MAN (Assumptions) Continuous Time –Time is not discrete - i.e., no master clock. i.e., frame transmissions can occur at any time. Slotted Time –Time is divided into discrete intervals (slots). –Frame transmissions always begin at the start of the slot. –Slots may contain 0, 1 or more frames (idle slot, successful transmission or collision)

12 Dynamic Channel alloc in LAN + MAN (Assumptions) Carrier Sense –Stations can tell if the channel is in use before attempting to transmit. If channel is busy then no station will transmit until it goes idle. No carrier sense –Stations cannot sense the channel before trying to use it. –Successful transmissions are determined after the fact.

13 Multiple Access Protocols ALOHA –Useful in which uncoordinated users are competing for the use of a single shared channel. –Pure Aloha (no global time synchronization) and Slotted Aloha (global time synch. required) PURE ALOHA –Let users transmit at all times. –Collisions occur, colliding frames destroyed –Frame destruction detected by listening to the channel

14 ALOHA PURE ALOHA (continued) –In LAN feedback is immediate. For satellite broadcast 270msec delay. –In both cases, if the frame is destroyed, user waits random amount of time before transmitting. –Such a system is called a contention system. –Figure on the next page …

15 ALOHA

16 PURE ALOHA (Refer to prev. figure) –Frames are the same size. –Whenever two frames try to occupy the channel at the same time collision occurs and there will be garbling. –If first bit of a frame overlaps with last bit of an earlier frame then both will be destroyed –What is the efficiency of an ALOHA channel? I.e., what percent of all transmitted frames escape collisions? –Next slide

17 ALOHA Efficiency of PURE ALOHA (Continued) –Frames time is the amount of time needed to transmit a fixed length frame (frame length/bit rate) –Consider infinite number of stations –Station user is in one of 2 states (typing, waiting). Initially all users are in same state - typing. –When a line is finished, user stops typing waiting for a response. –Station transmits a frame containing the line and checks channel for success

18 ALOHA Efficiency of PURE ALOHA (Continued) –If success, user sees reply & goes back typing –If unsuccessful user must wait while frame is retransmitted till ultimate success is met –Frame time = frame length/bit rate –Assume infinite population of users generates new frames according to Poisson distribution with mean N frames per frame time. (Infinite population ensures N does not decrease as users become blocked) –N > 1: frames generated at higher rate than channel can handle

19 ALOHA Efficiency of PURE ALOHA (Continued)

20 ALOHA SLOTTED ALOHA –This method doubles the capacity of ALOHA –Divide time up into discrete intervals - each interval corresponding to one frame. –Users agree to slot boundaries - synchronization is necessary a clock could be used by a special station (“a metronome.”) –S = G e^{-G}. –Slotted ALOHA has a throughput twice that of pure ALOHA.

21 ALOHA

22 CSMA (Carrier sense multiple access) In LAN’s it is possible for stations to detect what other stations are doing and reactively change. With Slotted ALOHA utilization is 1/e. With CSMA we can improve performance. These protocols are called carrier sense protocols. They are named 1-persistent CSMA, non- persistent CSMA, p-persistent CSMA

23 1-persistent CSMA –When station has data to send, it listens to channel. –Channel busy: station waits till channel is idle –Channel idle: station transmits frame –Collision: Station waits random time and transmits frame again –Propagation delay: If first station is sending and its signal has not yet reached second one (due to propagation delay) then second one detects idle channel and submits frame - collision.

24 1-persistent CSMA 1-persistent CSMA (continued) –Propagation delay II: If propagation delay is zero, collision may still occur. Example - station 1 transmits. Stations 2, 3 simultaneously realize that line is busy and wait. When line is free, stations 2, 3 simultaneously transmit. Collision. –This is better than pure ALOHA since interference is reduced.

25 Non-persistent CSMA –(A) Before sending, station senses channel. –If no transmission, station starts sending. –However, if busy, it does not continuously sense the channel in order to start transmitting –Instead, it waits random period before repeating from (A) –this is better than 1-persistent CSMA

26 p-persistent CSMA –(A) Before sending, station senses channel. –If no transmission, station starts sending. –However, if busy, it does not continuously sense the channel in order to start transmitting –Instead, it waits random period before repeating from (A) –this is better than 1-persistent CSMA

27 p-persistent CSMA –Applied to slotted channels. –When station is ready to send, it checks the channel. –If channel idle, it transmits with probability p. –therefore with probability q = 1 - p it defers till the next slot. –If next slot is idle it transmits or defers with probabilities p, q (as before) –Process continues until the frame is transmitted or another station has begun transmitting.

28 p-persistent CSMA p-persistent CSMA (cont’d) –If another station has begun transmitting, it waits a random time and starts once more –If channel is initially busy, it waits until the next slot and applies the above algorithm –Figure on next slide shows the comparison between these protocols and pure and slotted ALOHA.

29 Comparison of multiple access protocols G (transmission attempts per frame time)

30 CSMA with Collision Detection CSMACD –If two stations detect that channel is idle and simultaneously begin transmission, they will detect collision immediately. –In such a case, they immediately stop transmitting. –This saves bandwidth. –If time to transmit signal between two furthest stations is  then the contention interval is 2  (read 2nd para on page 253 on your own) –Conceptual model on the next page.

31 CSMA with Collision Detection At time t0, a station has finished transmitting its frame. Now any other station with a frame to send may do so. Collisions are detected by looking at the power of the received signal and comparing it to the transmitted signal (signals are specially encoded in order to enable detection)

32 CSMA - Collision free protocols Collision free protocols (Bit-Map Protocol): –ASSUMPTION: N stations exist (0 to N-1). –Each contention period consists of exactly N slots. –If station 0 has a frame to send it transmits a 1bit during the slot of the contention period. –Station 1 gets to transmit a 1bit during the 1st slot of the contention period ONLY if it has a frame to send. –This generalizes to the jth station - 1 bit into the jth slot if it has a frame to transmit.

33 CSMA - Collision free protocols Bit-Map Protocol (continued): –After N slots pass by, all stations have complete knowledge on which station is going to transmit –Transmission then begins is numerical order. –There will never be any collisions –After all stations transmit, N bit contention period starts again –Reservation protocols. Here the desire to transmit is expressed prior to transmission. –Low numbered stations wait on average 1.5N slots & high numbered stations wait 0.5N slots

34 CSMA - Collision free protocols Bit-Map Protocol (continued): –Mean wait for all stations is N slots –at low loads the overhead per frame is N bits and the amount of data is d bits. Eff = d/(N+d) –at high loads the efficiency is d/(d+1), I.e., one bit per dbit frame.

35 CSMA - Collision free protocols Binary countdown –Overhead (for bit-map protocols) is one bit per station –Use binary station addresses - a station desiring to use a channel now broadcasts its address as a binary bit string - starting with higher order bit –The bits are Boolear Ored. –This is like bidding based on station addresses. –Explained by means of a figure (next slide). –Channel efficiency = d/(d + log2(N))

36 CSMA - Collision free protocols Stations 0010, 0100, 1001 and 1010 are trying to get channel. In the first bit time stations submit ORed together to get 1. (I.e., 1 wins over 0) Therefore 1001 and 1010 continue. Bit by bit ORing occurs until bit time 2 when station 1001 sees a 1 and gives up

37 IEEE is a standard for a 1-persistent CSMA/CD Lan. –If cable is busy, station waits until cable is idle. –If 2 or more stations simultaneously transmit on an idle cable, they will collide. –All colliding stations then terminate their transmission and, wait random time and then start process again. Ethernet is a specific implementation. IEEE 802.3

38 IEEE (cabling) NameCable Max. Seg Nodes/seg Advantages 10Base5 10Base2 10BaseT 10BaseF Thick Coax Thin Coax Twisted Pair Fiber Optics 2000m1024 Best between buildings 100m 200m 500m Good for backbones Cheapest system Easy maintenance 10 Base 5 = 10Mbps, base band signaling, segment size is 500m

39 IEEE (cabling cont’d) 10Base5 10Base2 (Thin ethernet) 10BaseT

40 Basic problem - How to tell the diff. betn an idle sender (0 volts) and a 0 bit (0 volts). Needed: A way to unambiguously determine the start, end or middle of each bit without reference to an external clock. Solution: Manchester encoding or differential Manchester encoding. Manchester encoding: A binary 1 bit has high during first interval and low in second. Binary 0 is opposite. IEEE Manchester encoding

41 Differential Manchester encoding: 1 bit is indicated by absence of transition at the beginning of the interval. 0 bit is indicated by the presence of a transition at the beginning of the interval. IEEE Manchester encoding

42 IEEE Frame Format Preamble contains bit pattern in each of its 7 bytes Manchester encoding produces 10MHz square wave for 5.6microsec to allow the receivers clock to synch. with senders Start of frame byte contains to indicate start of frame Higher order bit of destination address is 0 for ordinary addresses and 1 for group addresses. This allows multicast (i.e., a group of workstations - not necessarily all).

43 IEEE Frame Format A frame consisting of all 1’s in the destination field is for all stations on the network - broadcast. Bit 46 (bit 47 is used for ordinary or group addresses) is used to distinguish local from global addresses. Local addresses are given by the local sysadmin. And have no significance outside the local network. Global addresses are given by IEEE bits are available or 7x10^13 global addresses are possible.

44 IEEE Frame Format Length field tells receiver how many bytes are available in the data field. This could be from 0 to To distinguish valid frames from garbage IEEE states that valid frames must be at least 64 bytes from dest address to checksum. If data field is < 46 bytes the pad field is used to fill out frame to minimum size.

45 IEEE Frame Format Having a minimum length frame also prevents a station from completing a transmission of a short frame before the first bit has even reached the end of the cable. If delay is tau (from A to B - A at one end and B at other end of cable) then if station tries to send a short frame it is possible that collision occurs but before B’s transmission (or noise burst) reaches A. A will then think that transmission was successful.

46 IEEE Frame Format Read why the minimum frame size should be 64 bytes on your own.

47 IEEE Frame Format Checksum is the CRC that we did earlier.

48 IEEE Frame Format BINARY EXPONENTIAL BACKOFF ALGORITHM –Randomization when a collision occurs –After collision, time is divided up into discrete slots whose length is the worst case round-trip propagation time (2 tau) –Assuming 2.5km and 4 repeaters the slot time is 51.2 microsec –After i collisions (between one or more stations) each station picks a random number between [0 2^(i-1)] and that number of slots is skipped (work out for 1, 2, 3 collisions)

49 IEEE BINARY EXPONENTIAL BACKOFF ALGORITHM –After 10 collisions the max randomization interval is 1023 slots –After 16 collisions controller gives up and reports a failure. –Note CSMA/CD provides no acknowledgements. There are modifications to deal with this but you are not responsible in this course.

50 IEEE Performance –Channel efficiency = 1/(1 + 2BLe/cF) –B Network bandwidth B (bits/bytes per second) –L Cable length L (m, cm etc) –e Euler’s constant 2.7…. –c speed of propagation (m/s) –F Frame length (bytes, bits)

51 IEEE 802.3

52 IEEE Token Ring “Physical length of a bit” Data rate is R Mbps means a bit is emitted every 1/R microsec. If signal propagation is 200m/microsec, each bit occupies 200/R meters on the ring. Ring of circumference of 1000m at R = 1Mbps can only contain 5 bits. Slide - next

53 IEEE Token Ring While in buffer, bit can be inspected or modified. This causes 1 bit delay at each ring interface.

54 IEEE Token Ring A special bit pattern token circulates around ring when stations are idle. When station wants to transmit, it must take token from ring and then transmit. A single bit in the 3byte token is inverted and this changes it into the first 3 bytes of a normal data frame. There being only one token only one channel can transmit at any time. Thus the ring must have sufficient delay to let token circulate when all stations are idle

55 IEEE Token Ring (Note: There is the 1 bit delay and there is a signal propagation delay) What happens if machines are turned off? If interfaces powered from ring, turning machine off has no effect If powered from station, then input of interface must automatically connect to output of interface when station is turned off. This eliminates 1 bit delay. Ring interface has two operating modes - listen and transmit.

56 IEEE Token Ring Listen mode: Input bits are copied to output with delay of 1 bit time In transmit mode (which occurs after token has been seized) the interface breaks the connection between input and output and enters its own data into the ring. In order to be able to switch from listen to transmit mode in 1 bit time, the interface needs to buffer frames rather than having to fetch them from the station at such short notice.

57 IEEE Token Ring As bits that propagate around ring return to sender, they are removed by sender. Sender can either save them to compare with original data (for reliability) or discard them. Note: The entire frame is never seen simultaneously on the ring - therefore there is no limit on the size of the frames. After last bit of frame is generated, sender must regenerate token, take last bit off ring and switch back to listen mode.

58 IEEE Token Ring Acknowledgement: Frame format has one bit for acks which is initially 0. When destination gets frame it sets ack bit to 1. Note: Ack. Bit must follow the checksum in order to account for errors. Light Traffic: Token circles endlessly except for the rare occasion when a station grabs it and transmits a frame. Next slide

59 IEEE Token Ring Heavy Traffic: A queue to transmit frames is formed at each station. Station finishes transmitting, regenerates token. Next station downstream sees token and takes it. Process continues - round robin fashion. Efficiency: Efficiency can be nearly 100% Token Ring MAC Sublayer Protocol: Figure next slide.

60 IEEE Token Ring Token Ring MAC Sublayer Protocol: –No traffic: 3 byte token goes around & around the ring. –When token is seized, single specific bit is conv. (0 -> 1) - this is start of frame sequence

61 IEEE Token Ring Token Ring MAC Sublayer Protocol: –Since even a long ring will be able to hold more than only a short frame, the transmitter must take transmitted bits off the ring while continuing to transmit. –The maximum time a token may be held, the token-holding time is 10msec unless a sysadmin changes it. –If there is time before token-holding time expires, the transmitter continues sending frames. –After token-holding time station puts 3byte token frame back on ring.

62 IEEE Token Ring Token Ring MAC Sublayer Protocol: –SD (Starting delimiter) and ED (Ending delimiter) have invalid differential Manchester encoding patterns to differentiate them from data bytes. –AC (Access control) byte contains the token bit. –FC (Frame control) byte distinguishes data frames from control frames.

63 IEEE Token Ring Token Ring MAC Sublayer Protocol: –Destination and source address fields are same as in IEEE –Data field can be as long as is possible without exceeding the token holding time. –Ack. Provided by FS (Frame status bit). Contains A, C bits (in two different locations). If destination address is the current stations address, it turns on A bit. (next)

64 IEEE Token Ring Token Ring MAC Sublayer Protocol: –…… If destination address is the current stations address, it turns on A bit. If frame is copied to station C bit is also turned on. (Frame may not be copied due to lack of buffer space) –A=0, C=0: Dest. not present or powered up –A=1, C=0: Dest. present, frame not accepted –A=1, C=1. Dest. present, frame accepted

65 IEEE Token Ring Token Ring MAC Sublayer Protocol: –ED (Ending Delimiter) contains E bit that is set if an interface contains an error. Priority: –Students should read this on their own. NOTE: handles maintenance by having a monitor station that oversees ring. If monitor dies, it is replaced by another station (all stations are capable of being monitors).

66 IEEE 802.3/ Comparison Most widely used, large user base Simple protocol Stations can be installed on the fly Delay at low load is 0 Analog component (e.g., collision detection Min. valid frame=64 bytes (overhd) is non-deterministic (not suitable for real time) Performance is determined by cable length

67 IEEE 802.3/ Comparison Point to point - engg. Is easy, fully digital Priorities are possible Short frames possible as well as long ones (limited by token holding time) Throughput and eff. At high load are excellent Presence of a centralized monitor which is responsible for seeing that ring is running smoothly. Dead monitor can be replaced but a mal- functioning one is hard to deal with. There is a delay at low loads corre- sponding to waiting time for the token

68 What to do with what section IEEE Standard …Ignore IEEE Standard … STUDY ON YOUR OWN

69 Bridges How do we connect multiple LAN’s? Solution: Use bridges which work in the data link layer. Bridges do not examine the network layer header (to be studied) and can thus process packets from any protocol equally well. Reasons to split LAN’s using bridges –Independence of LAN’s (I.e., EE and ME departments may choose their own LAN’s based on their own needs.)

70 Bridges Reasons to split LAN’s (continued) –May need to split one large LAN into separate LAN’s to accommodate load (e.g., consider networking needs of a large organization - –BW reqd would be too much for single LAN)

71 Bridges Reasons to split LAN’s (continued) –Physical distance, i.e., machines are more than 2.5km for IEEE –Reliability: A single defective node (that continuously transmits frames) will cripple LAN. Bridges are like firewalls and prevent a single bad node from bringing down system. Bridges can be programmed to forward and hold back data. –Security: A Promiscuous mode exists in which all frames are given to a computer not just those that are addressed to it. A bridge can be used to not forward sensitive traffic and thereby increase security.

72 Bridges LLC = Logical Link control

73 Bridges - From 802.x to 802.y ISSUES: –Each LAN uses a different frame format, therefore frames have to be reformatted. –Interconnected LAN’s may have different data rates. Buffering becomes an issue. –Each 802.x standard has a different maximum length for the frame. (802.3 is 1500 bytes, has 8191 bytes and has a maximum of 5000 bytes - due to token holding time) –802.3 to no problem. Bridge could be bottle neck

74 Bridges - From 802.x to 802.y ISSUES: –802.5 to has the A and C bits in frame status byte. A, C are set by destination station to indicate to sender whether dest. Saw frame and whether it copied it. Bridge could set these bits but remember makes no provision for this. Therefore if destination is down problems arise. –802.3 to Potential problem with frames that are too long and token handoff problem exists.

75 Transparent Bridges A transparent bridge operates in promiscuous mode - i.e., it accepts all frames from all LAN’s attached to it. Tables on each bridge tell where to send the frame. e.g., B2 lists A as belonging to LAN 2 - all it needs to know that A is on one side and to put frames there. That more forwarding occurs is not B2’s business.

76 Transparent Bridges Initially tables on all bridges are empty. So they flood the network - every frame is sent everywhere (except the LAN from whence it came). Eventually bridges learn what goes where and the tables are filled up. This is done by looking at the source address. Dynamic topologies: There exists an algorithm to deal with machines and bridges that are moved around … read on your own. IGNORE pg. 312, 313

77 Source Routing Bridges Ring topology folks prefer source routing. Source routing assumes that the sender of each frame knows whether the frame is destined for its own LAN. When sending to a diff. LAN, the high order bit of the source address is set to 1. Also in the frame header, the exact path that the frame will follow is written. This is a sequence of LAN, bridge, LAN, bridge, LAN … numbers. Routing becomes important-but this is for later

78 What? Me worry?


Download ppt "Chapter 4 The Medum Access Sublayer. MA Sublayer Additional Reference –Local and Metropolitan Area Networks, William Stallings, Prentice Hall, 2000, 6th."

Similar presentations


Ads by Google