Mac layer


Published on

Published in: Education, Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Mac layer

  1. 1. Chapter 4The Medium Access Control Sublayer 1
  2. 2. The Channel Allocation Problem• The MAC (Medium Access Control) sublayer is between the physical layer and the data link layer.• The MAC sublayer is especially important in LANs, nearly all of which use a multiaccess (or broadcast) channel as the basis of their networks.• This chapter mainly deals with LANs, other broadcast networks and their protocols. The key issue: how to determine who gets to use the channel when there is competition for it ? 1. Static Channel Allocation in LANs and MANs 2. Dynamic Channel Allocation in LANs and MANs 2
  3. 3. Static Channel Allocation• FDM (Frequency-Division Multiplexing): Divide the bandwidth into equal sized portions so that each user can be assigned one portion.• Under what circumstances FDM is efficient ? When there is only a small and fixed number of users, and each of which has a heavy (buffered) load of traffic (e.g., carriers switching offices). 3
  4. 4. Whats the problem with FDM ?1. If fewer than N users are currently interested incommunication, some portions of spectrum willbe wasted.2. If more than N users want to communicate,some of them will be denied permission even ifsome users with allocated frequency hardly evertransmit anything.3. Even the number of users is N and constant,when some users are quiescent, no one else canuse their bandwidth so it is simply wasted.4. For bursty data traffic (peak traffic to meantraffic ratio of 1000:1), the allocated smallsubchannel will be idle most of the time butunable to handle the peak traffic. 4
  5. 5. Dynamic Channel Allocation in LANs and MANs1. Station Model. • Independent stations for generating frames. • Once a frame has been generated, the station is blocked until the frame has been transmitted.1. Single Channel Assumption. A single channel for all communication (send and receive), and all stations are equivalent.2. Collision Assumption. If the transmission of two frames overlap in time, a collision occurs. All stations can detect collisions. A collided frame must be retransmitted.3. Time assumption. (a) Continuous Time. (b) Slotted Time.4. Sense assumption. (a) Carrier sense. Stations can tell if the channel is in use before trying to use it. (b) No carrier sense. Stations cannot sense the channel before trying to use it. 5
  6. 6. Multiple Access Protocols• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols 6
  7. 7. PURE ALOHAThe ALOHA system was used for ground-based radiobroadcasting, but the basic idea is applicable to any systemin which uncoordinated users are competing for the use of asingle shared channel.Basic idea: Let users transmit whenever they have data to be sent. A sender can always find out whether or not its frame was destroyed by listening to the channel output (due to the feedback property of broadcasting). If the frame was destroyed, the sender just waits a random amount of time and sends it again.Systems in which multiple users share a common channel ina way that can lead to conflicts are known as contentionsystems. 7
  8. 8. Pure ALOHAIn pure ALOHA, frames are transmitted at completely arbitrary times. 8
  9. 9. Pure ALOHA (2)Vulnerable period for the shaded frame. 9
  10. 10. Analysis of Pure ALOHA protocol a)Assume that there are a large number (N) of stations in the network b)All stations transmit frames with a fixed (average) length of T seconds c)Each station transmits with a fixed probability (p) in the time period (T) d)Thus, the average number of frames transmitted in the system in the time period T will be Np 10
  11. 11. Analysis of Pure ALOHA protocola) “Danger” period for a station’s transmission starts T seconds before it initiates its frame transmission and ends T seconds after it completes its frameb)During this time period of 2T, the average number of frames transmitted will be E=2Np=2Gc) A Poisson probability distribution indicates the probability of k events occurring in a “unit time” E k e− E p( k ) = k! 11
  12. 12. Analysis of Pure ALOHA protocol a) For transmission to be successful, no other station should transmit during the unit time of interest (2T). Thus the probability of a successful transmission will be p(k=0)=e-E=e-2G a) Therefore, the system throughput for the time period T will be S=Number of transmission attempts in time period T x probability of successful transmission, or S=Ge-2G 12
  13. 13. Pure Aloha Throughput 0.2 0.18 0.16 0.14T rou pu (S) 0.12 h gh t 0.1 0.08 0.06 0.04 0.02 0 0 1 2 3 4 5 A erage N m of fram per u it tim (G v u ber es n e ) 13
  14. 14. Operation of Protocola) Optimum Throughput occurs at G=0.5 or when 1 N= 2pb)Average number of attempts to ensure successful transmission is ∞ N av = ∑ n(1 − e − 2 G ) n −1e − 2 G = e 2 G i =1 Optimum N av = 2.72 attempts 14
  15. 15. Slotted ALOHA protocola) Enhancement of pure ALOHA in that stations can only start to transmit frame so that it arrives at the destination at the beginning of defined time slots of duration Tb)“Danger” period for this system is only the T seconds prior to the start of station’s frame and thus E=Np and S=Ge-Gc) For this system, optimum throughput occurs if G=1 15
  16. 16. Slotted Aloha Throughput 0.4 0.35 0.3 h gh t ) 0.25 T rou pu (S 0.2 0.15 0.1 0.05 0 0 1 2 3 4 5 Average N m of fram per u it tim (G u ber es n e ) 16
  17. 17. Efficiency of Slotted ALOHAa)Successful throughput S read from graph (e.g. Soptimum=0.368 or 36.8% of timeslot contain successful transmissions)b)Number of frames with no transmissions can be found from Poisson distribution p(k=0)=0.368 or 36.8% slotsc)Remaining time slots must contain collisions 17
  18. 18. Slotted ALOHASlotted ALOHA system:• Time is divided up into discrete intervals, each interval corresponding to one frame.• A terminal is not permitted to send until the beginning of the next slot.Slotted ALOHA peaks at G = 1, with S = 1/e ≈ 0.368, twice that of pure ALOHA. The main reason for poor channel utilization of ALOHA (pure or slotted) is that all stations can transmit at will, without paying attention to what the other stations are doing. 18
  19. 19. Multiple Access Protocols• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols 19
  20. 20. Carrier Sense Multiple Access protocolsProtocols in which stations listen for a carrier (i.e., a transmission) and act accordingly are called carrier sense protocols.1-persistent CSMA (Carrier Sense Multiple Access): 1. To send data, a station first listens to the channel to see if anyone else is transmitting. 2. If so, the station waits (keeps sensing it) until the channel becomes idle. Otherwise, it transmits a frame. 3. If a collision occurs, the station waits a random amount of time and starts all over again.It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle. 20
  21. 21. Collisions in CSMAHow could collisions happen in CSMA ?Whenever more than one station detect an idle channel and their transmission times overlap.Discussions: 1. Whats the effect of signal propagation delay ? The longer the delay, the more the collisions, and the worse the performance of the protocol. 2. How about zero propagation delay ? There still exist chances of collisions. 3. Is this protocol any better than ALOHA (both pure and slotted) ? Yes, because both stations have the decency to desist from interfering with the third stations frame. 21
  22. 22. Non-persistent and P-persistent CSMANon-persistent CSMA1. To send data, a station first listens to the channel to see if anyone else is transmitting.2. If so, the station waits a random period of time (instead of keeping sensing until the end of the transmission) and repeats the algorithm. Otherwise, it transmits a frame.3. If a collision occurs, the station waits a random amount of time and starts all over again.This protocol has better channel utilization and longer delays than 1-persistent CSMA.P-persistent CSMA(applied to slotted channels):1. To send data, a station first listens to the channel to see if anyone else is transmitting.2. If the channel is idle, it transmits with a probability p. With a probability q = p – 1, it defers until the next slot. If the next slot is also idle, it either transmits or defers again, with probabilities 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.3. If a collision occurs, the station waits a random amount of time and starts all over again.4. If the channel is (initially) busy, it waits until the next slot and apply the above algorithm. 22
  23. 23. Persistent and Non-persistent CSMA Comparison of the channel utilization versus load for various random access protocols. 23
  24. 24. CSMA with Collision DetectionPersistent and nonpersistent CSMA protocols improve ALOHA by ensuring that no station begins to transmit when it senses the channel busy.CSMA/CD (Carrier Sense Multiple Access with Collision Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected.The conceptual model:• To send data, a station first listens to the channel to see if anyone else is transmitting.• If so, the station waits until the end of the transmission (1-persistent) or wait a random period of time and repeats the algorithm (non- persistent). Otherwise, it transmits a frame.• If a collision occurs, the station will detect the collision, abort its transmission, waits a random amount of time, and starts all over again. 24
  25. 25. CSMA/CD can be in one of three states: contention, transmission, or idle• When two stations both begin transmitting at exactly the same time, how long will it take them to realize that there has been a collision ? The minimum time to detect the collision is the time it takes the signal to propagate from one station to the other.• How long could the transmitting station be sure it has seized the network ? ( τ or 2τ ? where τ is time equal to the full cable propagation)• It is worth noting that no MAC-sublayer protocol guarantees reliable delivery. Even in the absence of collisions, the receiver may not have copied the frame correctly due to various reasons (e.g., lack of buffer space or a missed interrupt). 25
  26. 26. Multiple Access Protocols• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols 26
  27. 27. Collision-Free Protocols• Can we avoid collision all together, even during the contention period ? Yes. But how ?• One assumption: there are N stations, each with a unique address from 0 to N –1 ``wired into it. Which station gets the channel after a successful transmission ?A basic bit-map protocol:• Each contention period consists of exactly N slots, with one slot time being at least 2τ.• If station i (0 ≤ i ≤ N -1) has a frame to send, it transmits 1 bit during the ith slot; otherwise, it transmits 0 bit during the ith slot.• After all slots have passed by, stations begin transmitting in numerical order.• After the last ready station has transmitted its frame, another N-bit contention period is begun. 27
  28. 28. The basic bit-map protocol• Protocols like this in which the desire to transmit is broadcast before the actual transmission are called reservation protocols.• Low load situation: the bit map repeats over and over. 28
  29. 29. The binary countdown protocol A problem with the basic bit-map protocol is that overhead is 1 contention bit slot per station. We can do better than that by using binary station addresses. 1. Each station has a binary address. All addresses are the same length. 2. To transmit, a station broadcasts its address as a binary bit string, starting with high- order bit. 3. The bits in each address position from different stations are BOOLEAN ORed together (so called Binary countdown). 4. As soon as a station sees that a high-order bit position that is 0 in its address has been overwritten with a 1, it gives up. 5. After the winning station has transmitted its frame, there is no information available telling how many other stations to send, so the algorithm begins all over with the next frame. 29
  30. 30. Multiple Access Protocols• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols 30
  31. 31. Limited-Contention ProtocolsTwo basic channel acquisition strategies studied:a) Contention methods. E.g., ALOHA, CSMA.b) Collision-free methods. E.g., basic bit map.Two performance measures:a) Delay at low load. Contention methods are preferable.b) Channel efficiency at high load. Collision-free methods are preferable.Could we combine the best properties of both the contention and collision-free protocols ?Yes. Such new protocols, called limited contention protocols, use a contention method at low loads, but use a collision- free technique at high loads. 31
  32. 32. 32
  33. 33. Basic idea of Limited-Contention Protocols• Stations are divided into groups.• Each group is allocated a slot for transmission.• Members of one group compete for one slot only.How to assign stations to slots (groups) ?Special cases: 1. Each group with only one member (e.g., basic bit-map). Collision- free. 2. Each group with two stations. The probability that both will try to transmit during a slot is p**2, which for small p is negligible. 3. A single group containing all stations (i.e., slotted ALOHA). Zero delay at low load but very high collisions at high load.What we need is a way to assign stations to slots dynamically, with many stations per slot when the load is low and few station per slot when the load is high. 33
  34. 34. Adaptive Tree Walk ProtocolThe algorithm devised by US Army for testing soldiers for syphilis during WW II: 1. The Army took a blood sample from N soldiers. 2. A portion of each sample was poured into a single test tube. The mixed sample was then tested. 3. If no antibodies were found, all the solders in the group were declared healthy. 4. Otherwise, two new mixed samples were prepared, one for soldiers 1 through N/2 and one from the rest. 5. The process was repeated recursively until the infected soldiers were determined.The computer version of this algorithm organizes the stations in a binary tree, as illustrated below. 34
  35. 35. Adaptive Tree Walk Protocol 35
  36. 36. Adaptive Tree Walk ProtocolEach bit slot (group) is associated with a particularnode in the tree, with the root node corresponding toslot 0 for all stations in one group. • Starting from the root node: all stations are permitted to try to acquire the channel. • If a collision occurs, the search continues recursively with the left and right children of that node. • If a bit slot goes idle or if there is exactly one station that transmits into it, the searching of its node can stop. 36
  37. 37. Multiple Access Protocols• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols 37
  38. 38. Wavelength Division Multiple Access ProtocolsA different approach to channel allocation is to divide the channel intosubchannels using FDM, TDM, or both, and dynamically allocate them asneeded. This is commonly used on fiber optic LANs. Wavelength division multiple access. 38
  39. 39. Multiple Access Protocols• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols 39
  40. 40. Wireless LAN ProtocolsA system of computers (e.g., notebook PCs) that communicate by radio canbe regarded as a wireless LAN.Wireless LANs have different properties than conventional wired LANs and require special MAC sublayer protocols.All radio transmitters have some fixed range, so not all stations are necessarily within range of one another.a) A transmitting. C is unable to detect A’s transmission, so it may falsely conclude that it may transmit to B, resulting in collision. This is called the hidden station problem)b) B transmitting. C is able to detect A’s transmission, so it may falsely conclude that it may not send to D, which is called the exposed station problem. 40
  41. 41. Wireless LAN Protocols (2)The MACA (Multiple Access with Collision Avoidance) protocol. (a) A sending an RTS to B. (b) B responding with a CTS to A. 41
  42. 42. Multiple Access Protocols• ALOHA• Carrier Sense Multiple Access Protocols• Collision-Free Protocols• Limited-Contention Protocols• Wavelength Division Multiple Access Protocols• Wireless LAN Protocols 42
  43. 43. IEEE 802 StandardsThe 802 working groups. The important ones are marked with *. Theones marked with  are hibernating. The one marked with † gave up. 43
  44. 44. EthernetIEEE standard 802.3 and EthernetThis standard is for a 1-persistent CSMA/CD LAN:• When a station wants to transmit, it listens to the cable.• If the cable is busy, the station waits until it goes idle, otherwise it transmits immediately.• If a collision occurs, all colliding stations terminate their transmission, wait a random time, and repeat the whole process all over again. 44
  45. 45. Ethernet CablingThe most common kinds of Ethernet cabling. Three kinds of Ethernet cabling. (a) 10Base5, (b) 10Base2, (c) 10Base-T. 45
  46. 46. Cable topologies (a) Linear, (b) Spine, (c) Tree, (d) Segmented.Repeaters are used to connect multiple cables together. It receives, amplifies,and retransmits signals in both directions. Repeaters are physical layerdevices.No two transceivers may be more than 2.5 km apart, and no path between anytwo transceivers may traverse more than four repeaters. 46
  47. 47. Manchester EncodingNone of the Ethernet versions use straight binary encoding since it leads to ambiguities:it cannot tell the difference between an idle sender (0 volts) and a 0 bit (0 volts).What is needed is a way for receivers to unambiguously determine the start, end, ormiddle of each bit without reference to an external clock. (a) Binary encoding, (b) Manchester encoding, (c) Differential Manchester encoding. All Ethernet systems use Manchester encoding due to its simplicity. The high signal is volts and the low signal is volts, giving a DC value of 0 volts. 47
  48. 48. Ethernet MAC Sublayer Protocol Frame formats. (a) DIX Ethernet, (b) IEEE 802.3.Preamble of 8 bytes, each with the bit pattern 10101010. For synchronization between the sender and the receiver. Start of frame (SOF) byte contains 10101011 to denote the start of the frame.Destination and source addresses, each with 2-6 bytes. • Ordinary address: the high-order bit value is 0. • Multicast address: the high-order bit value is 1. • Broadcast address: all bits have a value 48 of 1. • Local address:
  49. 49. Collision detection can take as long as 2τLength: 0 (46) - 1500 bytes. To make it easier to distinguish valid frames fromgarbage, 802.3 states that valid frames must be at least 64 bytes.Another more important reason for having a minimum length frame is to prevent astation from completing the transmission of a short frame before the first bit haseven reached the far end of the cable, which it may collide with another frame, asillustrated below. 49
  50. 50. The binary exponential backoff algorithmAfter a collision, the station waits for a random time and try again. How the randomization is done ?Time is divided into discrete slots whose length is equal to the worst case round trip propagation time (2τ). 1. After the first collision, each station waits either 0 or 1 slot time at random. 2. After the second collision, each station waits either 0, 1, 2, or 3 slot times at random. 3. After i collisions, a random number between 0 and 2**i – 1 is chosen, and that number of slots is skipped. 4. After 10 collisions have been reached, the randomization interval is frozen at 1023 slots. 5. After 16 collisions, the controller gives up and reports failure.What happens if the randomization interval for all collisions is always 1023?Think about the average delay when only a few stations collide.What happens if the randomization interval for all collisions is always 2?Think about the time needed to resolve the collision when 100 stations try to send at once. This might take years to resolve.The mean number of times per transmission is e ≈ 2.72. 50
  51. 51. Ethernet PerformanceEfficiency of Ethernet at 10 Mbps with 512-bit slot times. 51
  52. 52. Switched Ethernet The heart of the system is a switch containing a high-speed (typically over 1 Gbps) backplane and room for multiple plug-in cards (typically 4 to 32), with one to eight connectors in each card.• To transmit, a station outputs a standard 802.3 frame to a plug-in card in the switch.• The plug-in card checks to see if the frame is destined for one of the other stations connected to the same card. If so, the frame is copied there. If not, the frame is sent over the high- speed backplane to the destination stations card. 52
  53. 53. Switched Ethernet (2)What happens if two machines attached to the same plug-in card transmit frames at the same time ?In case that all the ports on the card are wired together to form a local on-card LAN: • Collisions on this on-card LAN will be detected and handled the same as any other collisions on a CSMA/CD network. • Only one transmission per card is possible at any instant, but all the cards can be transmitting in parallel.In case that each input port is buffered, so incoming frames are stored in the cards on-board RAM as they arrive: • Once a frame has been completely received, the card checks to see if the frame is destined for another port on the same card, or for a distant port. In the former case it can be transmitted directly to the destination. • In the latter case, it must be transmitted over the backplane to the proper card. • All input ports can receive (and transmit) frames at the same time, for parallel, full-duplex operation. 53
  54. 54. Fast EthernetThe Fast Ethernet (IEEE 802.3u) is backward compatible with but faster than the existing802.3 standard.All the 802.3 packet formats, interfaces, and procedural rules are kept, but the bit time isreduced from 100 (10 Mbps) nsec to 10 nsec (100 Mbps).Fast Ethernet is based entirely on twisted pair or fiber wiring, as shown below.1. 100Base-T4 uses four twisted pairs (three for traffic from the station to the hub, one for the reverse traffic). Each pair runs at a signaling speed of 25 MHz. 4 bits (by the 8B6T scheme) are transmitted per clock cycle via three twisted pairs (to give 100Mbps), and another twisted pair provides a reverse channel at 33.3 Mbps.2. 100Base-TX uses two twisted pairs (one for each direction), each running at a signaling speed of 125 MHz. The 4B5B scheme is used to transmit 4 bits per 5 clock cycles via each twisted pair (to give a full-duplex 100 Mbps).3. 100Base-F uses two strands of multimode fiber, one for each direction, to give full duplex 100 Mbps. The distance between the station and the hub can be up to 2 km. 54
  55. 55. Gigabit EthernetThe Gigabit Ethernet (IEEE 802.3z) is backward compatible with but faster than theexisting 802.3 and 802.3u standards, but goes 10 times faster than 802.3u.All configurations of gigabit Ethernet are point-to-point. (a) A two-station Ethernet. (b) A multistation Ethernet. 55
  56. 56. Gigabit Ethernet cablingGigabit Ethernet supports both copper and fiber cabling.Gigabit Ethernet uses new encoding schemes, rather than Manchester encoding.Gigabit Ethernet supports flow control: one end can send a special control frame to the other end telling it to pause for some period of time. The time unit is 512 nsec, allowing for pause as long as 33.6 msec.IEEE 802 committee has produced the 10-gigabit Ethernet standard 802.3ae in 2002. 56
  59. 59. Token Ring Operation 59
  60. 60. Token Ring (802.5)a) MAC protocol – Small frame (token) circulates when idle – Station waits for token – Changes one bit in token to make it SOF for data frame – Append rest of data frame – Frame makes round trip and is absorbed by transmitting station – Station then inserts new token when transmission has finished and leading edge of returning frame arrives – Under light loads, some inefficiency – Under heavy loads, round robin 60
  61. 61. 802.5 Physical Layera)Data Rate 4 16 100b)Medium UTP,STP,Fiberc) Signaling Differential Manchesterd)Max Frame 4550 18200 18200Note: 1Gbit in development 61
  62. 62. IEEE 802.2: Logical Link ControlLLC hides the differences between the various kinds of 802 networks by providing a single format and interface to the network layer.LLC provides three service options: unreliable datagram service, acknowledged datagram service, and reliable connection-oriented service. (a) Position of LLC. (b) Protocol formats. 62
  63. 63. Wireless LANs• Wireless LANs are increasingly popular and deployed in office buildings, airports and other public places.• Wireless LANs can operate with or without a base station.• IEEE 802.11 LAN standard makes provision for both arrangements. Part of the 802.11 protocol stack. 63
  64. 64. The 802.11 physical layer• In 1997, three transmission techniques were allowed in the physical layer: 1. The infrared method uses the same technology as television remote controls do. 2. The other two techniques, called FHSS (Frequency Hopping Spread Spectrum) and DSSS (Direct Sequence Spread Spectrum, similar to CDMA), use short- range radio spectrum (a part of the 2.4 GHz ISM band). All techniques operate at 1 or 2 Mbps(a major disadvantage)• In 1999, two new techniques, called OFDM (Orthogonal Frequency Division Multiplexing, used by 802.11a) and HR- DSSS (High Rate Direct Sequence Spread Spectrum, used by 802.11b), were introduced to achieve higher bandwidth, 54 Mbps (narrow range) and 11 Mbps (wider range), respectively.• In 2001, a second OFDM modulation (like 802.11a) but at the narrow 2.4 GHz ISM band (like 802.11b) was introduced and can operate at up to 54 Mbps (802.11g). 64
  65. 65. The 802.11 MAC Sublayer Protocol (a) The hidden station problem. (b) The exposed station problem. 65
  66. 66. DCF (Distributed Coordination Function) mode The DCF mode uses the CSMA/CA (Collision Avoidance) protocol, in which, there is no central control, and stations compete for air time, just as they do with Ethernet: • When a station wants to transmit, it senses the channel. If it is idle, it just starts transmitting. It does not sense the channel while transmitting but emits its entire frame, which may well be destroyed at the receiver due to interference there. • If the channel is busy, the sender defers until it goes idle and then starts transmitting. • If a collision occurs, the colliding stations wait a random time, using Ethernet binary exponential backoff algorithm, and then try again later. 66
  67. 67. The use of virtual channel sensing using CSMA/CA A wants to send to B. C is within range of A. D is within range of B but not within range of A. RTS: Request To Send CTS: Clear To Send. NAV: Network Allocation Vector 67
  68. 68. A fragment burstTo deal with the problem of noisy channels, 802.11 allows frames to be fragmented into smaller pieces, each with its own checksum.Fragments are individually numbered and acknowledged using a stop-and-wait protocol. 68
  69. 69. PCF (Point Coordination Function) modeIn the PCF mode, the base station pools the other stations, asking them if they have any frames to send. No collisions ever occur.PCF and DCF can coexist within one cell, which works by carefully defining the interframe time interval. Four different intervals are defined, as depicted below. Interframe spacing in 802.11. 69
  70. 70. The 802.11 Frame Structure The 802.11 data frame.Version: two versions of the protocol can operate at the same time in the same cell.Type: data, control, or management.Subtype: RTS or CTS.To/from DS: the frame is going to or coming from intercell distribution system.MF: more fragments will follow.Retry marks a retransmission of a frame sent earlier.Power is used by the base station to put/take the receiver into/outof sleep state.More indicates the sender has additional frames for the receiver.W specifies that the frame has been encrypted by Wired Equivalent Privacy algorithm.O tells that a sequence of frames with this bit on must be processed strictly in order. 70
  71. 71. The 802.11 Frame Structure (2)Duration: tells how long the frame and its ack will occupy the channel, which is used to manage NAV mechanism.Addresses: Two addresses are used for source and destination, and other two used for the source and destination base stations for intercell traffic.Sequence: 12 bits for identifying frame and 4 bits for fragment.Data: payload up to 2312 bytes.Management frames are similar to data frames, without one of the base station addresses because management frames are restricted to a single cell.Control frames are even shorter, having only one or two addresses, no Data field, and no Sequence field. Key information is in the Subtype field. 71
  72. 72. 802.11 ServicesDistribution Services:• Association: used by mobile stations to connect themselves to base stations.• Disassociation: used by both mobile stations and the base station to break up their association relationship.• Re-association: used by a mobile station to change its preferred base station.• Distribution: determine how to route frames sent to the base station.• Integration: handle the translation from the 802.11 format to the format required by the non-802.11 destination network. 72
  73. 73. 802.11 ServicesIntracell Services (used after association has taken place):• Authentication: used by a mobile station to authenticate itself (proving it possesses a secret key).• De-authentication: used by a mobile station when leaving the network• Privacy: manage the encryption and decryption.• Data Delivery: data transmission over 802.11 is not 100% reliable (the same as Ethernet). Higher layers must deal with detecting and correcting errors. 73
  74. 74. Broadband WirelessThis section is about wireless local loop or wireless MAN.Comparison of 802.11 and 802.16:• They were all designed in providing high-bandwidth wireless communication.• 802.16 provides service to buildings. Buildings are not mobile (a simplification). Building can have more than one computer in them (a complication). Building owners are willing to spend more money for communication gear than individual notebook owners, so 802.16 can use full- duplex communication.• 802.16 runs over part of a city, covering distance of several kilometers, which means the perceived power at the base station can vary widely, which affects signal-to-noise ratio, which, dictates multiple modulation schemes. Open communication over a city means that security and privacy are essential and mandatory.• Each 802.16 cell has many more users than an 802.11 cell, forcing 802.16 to operate in 10-to-66 GHz frequency range, which has different physical properties and thus requires a different physical layer. Also, error handling is more important.• 802.16 is expected to support telephony and multimedia usage for both residential and business use.• In short, 802.11 was designed to be mobile Ethernet, whereas 802.16 was designed to be wireless, but stationary, cable television. 74
  75. 75. The 802.16 Protocol StackThe 802.16 MAC sublayer uses the base station to manage the channelallocation. It is connection-oriented in order to provide quality-of-serviceguarantees for telephony and multimedia communication. 75
  76. 76. The 802.16 Physical Layer The 802.16 transmission environment. 76
  77. 77. The 802.16 Physical Layer (2) Frames and time slots for time division duplexing. 77
  78. 78. The 802.16 MAC Sublayer Protocol Service Classes • Constant bit rate service • Real-time variable bit rate service • Non-real-time variable bit rate service • Best efforts service 78
  79. 79. The 802.16 Frame Structure(a) A generic frame. (b) A bandwidth request frame. 79
  80. 80. Bluetooth• In 1994, Ericsson, IBM, Intel, Nokia, and Toshiba formed SIG to develop a wireless standard for interconnecting computing and communication devices and accessories using short-range, low-power, inexpensive wireless radios. This project was named Bluetooth, after Harald Blaatand (Bluetooth) II (940- 981), a Viking king who unified Denmark and Norway, also without cables.• The original idea was just to get rid of the cables between devices, but it soon began to expand in scope and encroach on the area of wireless LANs. It creates competition with 802.11 and even interferes with 802.11 electronically (using the same 2.4-GHz ISM band).• In 1999, Bluetooth SIG issued a 1500-page specification V1.0 (from physical to application layers), part of which (physical and data-link layers) was adopted by IEEE as the basis for a wireless PAN (Personal Area Network) standard, 802.15.1 (2002). 80
  81. 81. Bluetooth Architecturea) The basic unit of a Bluetooth system is a piconet, which consists of a master node and up to seven active slave nodes within a distance of 10 meters.b) There can be up to 255 parked nodes in a piconet, which are devices that the master has switched to a low-power state to reduce the drain on their batteries.c) All communication is between the master and a slave, using TDM; no direct slave-slave communication is possible.d) Multiple piconets can exist in the same room and be connected via a bridge node. An interconnected collection of piconet is called a scatternet. 81
  82. 82. Bluetooth Applications The Bluetooth profiles.Conway’s law: if you assign n people to write a compiler, you will get an n-passcompiler, or more generally, the software structure mirrors the structure of thegroup that produced it. 82
  83. 83. The Bluetooth Protocol StackThe 802.15 version of the Bluetooth protocol architecture. 83
  84. 84. The Bluetooth Frame Structure A typical Bluetooth data frame. 84
  85. 85. Data Link Layer Switching• Bridges from 802.x to 802.y• Local Internetworking• Spanning Tree Bridges• Remote Bridges• Repeaters, Hubs, Bridges, Switches, Routers, Gateways• Virtual LANs 85
  86. 86. Data Link Layer SwitchingLANs can be connected by devices called bridges, which operate in the data link layer. This means that bridges do not examine the network layer header and can thus copy IPv4, IPv6, AppleTalk, ATM, IPX, and OSI packets equally well.Most bridges connect 802 LANs, so we will concentrate primarily on 802 bridges.Reasons why a single organization may end up with multiple LANs and bridges are needed: 1. Different goals of different departments. 2. Geographical distance (cheaper and shorter delay). 3. Accommodation of the heavy load. 4. The matter of reliability and security. 86
  87. 87. Data Link Layer SwitchingMultiple LANs connected by a backbone to handle a total load higher than the capacity of a single LAN. 87
  88. 88. HubsandSwitches 88
  89. 89. Bridgesa) Ability to expand beyond single LANb) Provide interconnection to other LANs/WANsc) Use Bridge or routerd) Bridge is simpler – Connects similar LANs – Identical protocols for physical and link layers – Minimal processinga) Router more general purpose – Interconnect various LANs and WANs – see later 89
  90. 90. Why Bridge?a)Reliabilityb)Performancec)Securityd)Geographye)Org Structuref)To accommodate load 90
  91. 91. Functions of a Bridgea) Read all frames transmitted on one LAN and accept those addressed to any station on the other LANb) Using MAC protocol for second LAN, retransmit each framec) Do the same the other way round 91
  92. 92. Bridge Operation 92
  93. 93. Bridge Design Aspectsa) No modification to content or format of frameb) No encapsulationc) Exact bitwise copy of framed) Minimal buffering to meet peak demande) Contains routing and address intelligence – Must be able to tell which frames to pass – May be more than one bridge to crossa) May connect more than two LANsb) Bridging is transparent to stations – Appears to all stations on multiple LANs as if they are on one single LAN 93
  94. 94. Bridge Protocol Architecturea) IEEE 802.1Db) MAC level – Station address is at this levela) Bridge does not need LLC layer – It is relaying MAC framesa) Can pass frame over external comms system – e.g. WAN link – Capture frame – Encapsulate it – Forward it across link – Remove encapsulation and forward over LAN link 94
  95. 95. Connection of Two LANs 95
  96. 96. Fixed Routinga) Complex large LANs need alternative routes – Load balancing – Fault tolerancea) Bridge must decide whether to forward frameb) Bridge must decide which LAN to forward frame onc) Routing selected for each source-destination pair of LANs – Done in configuration – Usually least hop route – Only changed when topology changes 96
  97. 97. Multiple LANs 97
  98. 98. Spanning Treea)Bridge automatically develops routing tableb)Automatically update in response to changesc)Frame forwardingd)Address learninge)Loop resolution 98
  99. 99. Frame forwardinga) Maintain forwarding database for each port – List station addresses reached through each porta) For a frame arriving on port X: – Search forwarding database to see if MAC address is listed for any port except X – If address not found, forward to all ports except X – If address listed for port Y, check port Y for blocking or forwarding state • Blocking prevents port from receiving or transmitting – If not blocked, transmit frame through port Y 99
  100. 100. Address Learninga) Can preload forwarding databaseb) Can be learnedc) When frame arrives at port X, it has come form the LAN attached to port Xd) Use the source address to update forwarding database for port X to include that addresse) Timer on each entry in databasef) Each time frame arrives, source address checked against forwarding database 100
  101. 101. Spanning Tree Algorithma) Address learning works for tree layout – i.e. no closed loopsa) For any connected graph there is a spanning tree that maintains connectivity but contains no closed loopsb) Each bridge assigned unique identifierc) Exchange between bridges to establish spanning tree 101
  102. 102. Loop of Bridges 102
  103. 103. Bridges from 802.x to 802.yOperation of a LAN bridge from 802.11 to 802.3. 103
  104. 104. Bridges from 802.x to 802.y (2) The IEEE 802 frame formats. The drawing is not to scale.General problems: 1. Different frame formats. Solution: reformatting. 2. Different data rates (802.3z 1Gbps and 802.11b 11Mbps). Solution: buffering. 3. Different maximum frame length (e.g., 802.3 1518 bytes, 802.11 2312 bytes, 802.16 1000 (?) bytes, and 802.15.1 2744 bytes). No solution. 4. Security: 802.11 and 802.16 support encryption but 802.3 does not. 5. Quality of service: 802.11 and 802.16 have but 802.3 does not. 104
  105. 105. Local InternetworkingMultiple LANs connected by transparent bridges do not need any change on theirhardware and software.Transparent bridges operate in promiscuous mode, accepting every frame transmitted onall the LANs to which it is attached. A configuration with four LANs and two bridges. When a frame arrives, a bridge must decide whether to discard or forward it, and if the latter, on which LAN to put the frame. This decision is made by looking up the destination address in a big (hash) table inside the bridge. 105
  106. 106. Local Internetworking (2)A bridge maintains a table of destination addresses as follows:1. Initially all the hash tables are empty.2. Every incoming frame for an unknown destination is output on all the LANs to which the bridge is connected except the one it arrived on (flooding).3. By looking at the incoming frames source address (backward learning), a bridge is able to know which machine is accessible on which LAN, so it make an entry in its hash table linking the source machine with the incoming LAN.4. To handle dynamic topologies, whenever a hash table entry is made, the arrival time of the frame is noted in the entry. The entry time is updated whenever a frame from the address in that entry arrives.5. Periodically, a process in the bridge scans the hash table and purges all entries more than a few minutes old.Routing procedure:1. If destination and source LANs are the same, discard the frame.2. If the destination and source LANs are different, forward the frame.3. If the destination LAN is unknown, use flooding.Special purpose VLSI chips exist to do the lookup and update the table entry, all in a few microsecond. 106
  107. 107. Spanning Tree BridgesTo increase reliability, some sites use two or more bridges in parallel betweenpairs of LANs. This arrangement creates loops in the topology.What happens if a frame with an unknown destination arrives ?The solution is for the bridges to communicate with each other and overlay theactual topology with a spanning tree that reaches every LAN.Large networks can be partitioned into multiple communicating spanning trees. 107
  108. 108. Spanning Tree Bridges (2)(a) Interconnected LANs. (b) A spanning tree covering the LANs. The dotted lines are not part of the spanning tree. 108
  109. 109. Remote BridgesRemote bridges can be used to interconnect distant LANs. 109
  110. 110. Repeaters, Hubs, Bridges, Switches, Routers and Gateways (a) Which device is in which layer. (b) Frames, packets, and headers. 110
  111. 111. Hubs, Bridges, and Switches(a) A hub. Different from repeater, hubs do not amplify the incoming signals and are designed to hold multiple line cards each with multiple inputs (one collision domain). Like repeater, hubs do not examine the 802 addresses or use them in any way.(b) A bridge. A bridge has line cards (like a hub) for different network types and speeds. However, each line is its own collision domain, in contrast to a hub.(c) A switch. A switch is similar to bridge in its routing on frame addresses, but is often used to connect individual computers (no collision). 111
  112. 112. Configure LANs logically rather than physically A building with centralized wiring using hubs and a switch. 112
  113. 113. Virtual LANsa) Four physical LANs organized into two VLANs, gray and white, by two VLAN-aware bridges. A VLAN-aware bridge maintains configuration tables which tell which VLANs are accessible via which lines.b) The same 15 machines organized into two VLANs by VLAN-aware switches. 113
  114. 114. The IEEE 802.1Q StandardTransition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not. 114
  115. 115. The IEEE 802.1Q Standard (2)The 802.3 (legacy) and 802.1Q Ethernet frame formats. 115
  116. 116. SummaryChannel allocation methods and systems for a common channel. 116