4. MAC protocols and LANs 1
Outline MAC protocols and sublayers, LANs: Ethernet, Token ring and Token bus Logic Link Control (LLC) sublayer protocol Bridges: transparent (spanning tree), source routing and remote bridges 2
Multiple Access Control (MAC) Protocols There are two categories of networks: One uses point to point connections: computer dial-up links, using SLIP, PPP, HDLC The other uses broadcast channels: more than one stations share the same channel, such as LANs using random access or token MAC protocols is used to determine which station goes next to access the shared channels 3
Random Access: Aloha and Slotted Aloha User transmit whenever they have data Listen to the channel to see if the frame is OK Contention system 4
Channel efficiency Throughput S = GP 0 Poisson distribution: P[k] = G k e -G / k! In 2 frame interval, the number of frames generated is 2G, thus P 0 = e -2G => S = G e -2G Max. throughput S = 1/2e, when G=1/2 For slotted Aloha the vulnerable period is 1 frame period (halved), thus P 0 = e -G => S = G e -G 5
Carrier Sense Multiple Access (CSMA) 1-persistent: the station listens before sending. if the channel is busy, it waits until it idle. Transmit when the channel is idle. if collision, the station waits a random amount of time and start all over again non-persistent: If busy, the station does not continually sense. Instead, waiting for a random period, then repeating the algorithm p-persistent: It applies to slotted channel. If it is idle, it transmits with probability of p. 6
CSMA/CD Further improvement than persistent and non-persistent over Aloha, by aborting transmission as soon as stations detect a collision Contention period is 2τ where τ is propagation delay Example: for a 1 km cable, the τ is about 5 µseconds Ethernet is one of this version No MAC-sublayer protocol guarantees reliable delivery 7
Collision free protocols A bit map protocol: it is also called reservation protocol. Each contention period consists of exactly N slots for N stations. Efficiency = d/(d+1) Binary countdown: each station has a binary address, start to broadcast with the high order bit. It stops as soon as a high order position 0 is overwritten with a 1. Efficiency = d/(d+log 2 N) 8
Limited contention protocols 1/e = 0.368 Two important performance measures: delay at low load and channel efficiency at high load. At low load, contention is preferable due to low delay. At high load, reservation is preferable due to high efficiency. The adaptive tree walk protocol: dynamically allocate time slots. If a collision occurs during slot 1, the entire tree is searched, depth first to allocate all the ready stations. 9
IEEE 802.3 and Ethernet Bus Topology Whole family of 1-persistent CSMA/CD From 1-10 Mbit/s on different media Switched Ethernet 10
Ethernet MAC Frame For a 10-Mbit/s LAN Max. 2500 meters and 4 repeaters (500 m/segment) Min. allowed frame must take 51.2 µ seconds (corresponds to 64 bytes) If operating at 1 Gbit/s Max. 250 meters, and Min. frame size 640 bytes 11
IEEE 802.5 Token Ring Ring topology, suitable for real time Token holding time is 10 ms Speed 1 and 4 Mbit/s Delimiter, access control, frame control sources and destination address, checksum are the same as the 802.3 12
IEEE 802.4 Token Bus Logical ring, suitable for real time For priorities: 0, 2, 4, 6 Speed 1, 5, and 10 Mbit/s Preamble, delimiter, control, Sources and destination address, checksum are the same as the 802.3 13
IEEE 802.2 Logical link control Hide difference between the various 802 networks by providing a single format and interface to the network layer Based on HDLC, provide 3 service options as the link layer Error control using acknowledgment Flow control using a slide window All 802 LANs and MAN offer best-efforts service 14
Bridges Why using bridges? 1. Different department have different LANs initially; 2. geographical separated; 3. Accommodate the load; 4. Physical distance limit; 5. Reliability, 6. Security A bridge connecting k different LANs will have k different MAC layers and k different physical layers, one for each type. 15
Bridges from 802.x to 802.y Operation of a LAN bridge from 802.11 to 802.3. 16
Bridges from 802.x to 802.y (frame format) Problems with bridging different LANs: 1. Different frame format, 2. Different rate, 3. Different maximum frame length 17
Transparent (spanning tree) bridge Forwarding (Filtering) If destination & source address is the same, discard the frame If different, forward the frame Destination unknown, use flooding Spanning tree solve loop problem Address learning Initialise the forwarding database to empty Update the entry in the routing table (make one if it does not exit) with the frame address and arrival time Periodically scan the routing table and purge all old entries (more than a few minutes. 18
Spanning tree algorithm Root bridge RPC = 1, 4 RPC = 2, 5 RPC = 1, 4 RPC = 2, 3 RPC = 3, 4 RPC = 2, 3 RPC = 2, 5 X RPC = 3, 4 X X RPC = 4,3,4 Exchange bridge protocol data units (BPDUs) to elect root bridge with highest priority and smallest bridge identifier Each bridge selects root port with minimum root path cost (RPC) from the root to the port Bridges connected to the same segment elect a designated bridge with a port having minimum path cost from the port to the root Port identifiers are used as tiebreakers 19
Source routeing bridges Transparent bridges use only subset of the topology (the tree) Source routeing assumes that the sender knows whether or not the destination is on its own LAN. Implicit in that every machine can find the best path to the other machine Discovery frame flooding is used if destination unknown Frame explosion is solved by flooding along the spanning tree 20
Comparison of 802 bridges 21
Remote bridges It connect two or more distant LANs Put a bridge in each LAN and connect the bridge pairwise with point to point lines (such as leased telephone line) Various protocols can be used on the point to point lines (such as data link protocol) putting complete MAC frame in the payload Or strip off the MAC header and trailer at the sources and put it back at the destination 22
Repeaters, Hubs, Bridges and Switches (1/2) (a) Which device is in which layer. (b) Frames, packets, and headers. 23
Repeaters, Hubs, Bridges, Switches (2/2) (a) A hub. (b) A bridge. (c) a switch. 24
Virtual LANs (a) (b) Four physical LANs organized into two VLANs, by two bridges. The same LANs organized into two VLANs by switches. 25
The IEEE 802.1Q Standard Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not. 26
The IEEE 802.1Q Standard (2) The 802.3 (legacy) and 802.1Q Ethernet frame formats. 27
Summary MAC protocols and sublayers, LANs: Ethernet, Token ring Token bus Logic Link Control (LLC) LAN interconnections: Transparent (spanning tree) bridge Source routing bridge VLAN 28