780 likes | 797 Views
Chapter 4. The Medum Access Sublayer. 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
E N D
Chapter 4 The Medum Access Sublayer
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.
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
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.
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)
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 TFDM= 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.
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.
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
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
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
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)
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.
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
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 …
ALOHA • 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
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
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
ALOHA • Efficiency of PURE ALOHA (Continued)
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.
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
1-persistent CSMA • 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.
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.
Non-persistent CSMA • 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
p-persistent CSMA • 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
p-persistent CSMA • 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.
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.
Comparison of multiple access protocols G (transmission attempts per frame time)
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.
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)
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.
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
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.
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))
CSMA - Collision free protocols Stations 0010, 0100, 1001 and 1010 are trying to get channel. In the first bit time stations submit 0 0 1 1. 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
IEEE 802.3 • IEEE 802.3 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 (cabling) Name Cable Advantages Max. Seg Nodes/seg Thick Coax 10Base5 500m 100 Good for backbones 10Base2 Thin Coax 200m 30 Cheapest system 10BaseT Twisted Pair 100m 1024 Easy maintenance Fiber Optics Best between buildings 10BaseF 2000m 1024 10 Base 5 = 10Mbps, base band signaling, segment size is 500m
IEEE 802.3 (cabling cont’d) 10Base2 (Thin ethernet) 10BaseT 10Base5
IEEE 802.3-Manchester encoding • 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 802.3-Manchester encoding • 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 802.3-Frame Format Preamble contains bit pattern 10101010 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 10101011 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).
IEEE 802.3-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. 48-2 bits are available or 7x10^13 global addresses are possible.
IEEE 802.3-Frame Format Length field tells receiver how many bytes are available in the data field. This could be from 0 to 1500. To distinguish valid frames from garbage IEEE 802.3 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.
IEEE 802.3-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.
IEEE 802.3-Frame Format Read why the minimum frame size should be 64 bytes on your own.
IEEE 802.3-Frame Format Checksum is the CRC that we did earlier.
IEEE 802.3-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)
IEEE 802.3 • 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.
IEEE 802.3 • 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)