28
Computer and Data Networks, 4. MAC protocols and LANs 1 ©Dr.Z.Sun 4. MAC protocols and LANs

4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 1 ©Dr.Z.Sun

4. MAC protocols and LANs

Page 2: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 2 ©Dr.Z.Sun

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

Page 3: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 3 ©Dr.Z.Sun

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

Page 4: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 4 ©Dr.Z.Sun

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

Page 5: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 5 ©Dr.Z.Sun

Channel efficiency

� Throughput S = GP0

� Poisson distribution:P[k] = Gk e-G / k!

In 2 frame interval, the number of frames generated is 2G, thus P0 = e -2G

=> S = G e -2G

� Max. throughputS = 1/2e, when G=1/2

� For slotted Alohathe vulnerable period is 1 frame period

(halved), thus P0 = e -G

=> S = G e -G

Page 6: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 6 ©Dr.Z.Sun

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.

Page 7: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 7 ©Dr.Z.Sun

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

Page 8: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 8 ©Dr.Z.Sun

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+log2N)

Page 9: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 9 ©Dr.Z.Sun

Limited contention protocols

� 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.

1/e = 0.368

Page 10: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 10 ©Dr.Z.Sun

IEEE 802.3 and Ethernet

� Bus Topology � Whole family of 1-persistent

CSMA/CD� From 1 - 10 Mbit/s on different

media� Switched Ethernet

Page 11: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 11 ©Dr.Z.Sun

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

Page 12: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 12 ©Dr.Z.Sun

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

Page 13: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 13 ©Dr.Z.Sun

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

Page 14: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 14 ©Dr.Z.Sun

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

Page 15: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 15 ©Dr.Z.Sun

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.

Page 16: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 16 ©Dr.Z.Sun

Bridges from 802.x to 802.y

Operation of a LAN bridge from 802.11 to 802.3.

Page 17: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 17 ©Dr.Z.Sun

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

Page 18: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 18 ©Dr.Z.Sun

Transparent (spanning tree) bridgeForwarding (Filtering)• If destination & source address is the

same, discard the frame• If different, forward the frame• Destination unknown, use flooding• Spanning tree solve loop problemAddress 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.

Page 19: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 19 ©Dr.Z.Sun

Spanning tree algorithm

� Exchange bridge protocol data units (BPDUs) to elect root bridge with highest priority and smallest bridge identifier

� Each bridge selects root portwith 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 tie-breakers

Root bridge

RPC = 1, 4 RPC = 2, 5

X

X

X

RPC = 1, 4 RPC = 2, 3 RPC = 3, 4RPC = 2, 3

RPC = 2, 5

RPC = 3, 4

RPC = 4,3,4

Page 20: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 20 ©Dr.Z.Sun

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

Page 21: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 21 ©Dr.Z.Sun

Comparison of 802 bridges

Page 22: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 22 ©Dr.Z.Sun

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

Page 23: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 23 ©Dr.Z.Sun

Repeaters, Hubs, Bridges and Switches (1/2)

(a) Which device is in which layer.(b) Frames, packets, and headers.

Page 24: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 24 ©Dr.Z.Sun

Repeaters, Hubs, Bridges, Switches (2/2)

(a) A hub. (b) A bridge. (c) a switch.

Page 25: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 25 ©Dr.Z.Sun

Virtual LANs

(a) Four physical LANs organized into two VLANs, by two bridges. (b) The same LANs organized into two VLANs by switches.

Page 26: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 26 ©Dr.Z.Sun

The IEEE 802.1Q Standard

Transition from legacy Ethernet to VLAN-aware Ethernet. The shaded symbols are VLAN aware. The empty ones are not.

Page 27: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 27 ©Dr.Z.Sun

The IEEE 802.1Q Standard (2)

The 802.3 (legacy) and 802.1Q Ethernet frame formats.

Page 28: 4. MAC protocols and LANs - University of Surreyinfo.ee.surrey.ac.uk/Teaching/Courses/ee2.cdn/sun/cdn_slides_4.pdf · „ The adaptive tree walk protocol: dynamically allocate time

Computer and Data Networks, 4. MAC protocols and LANs 28 ©Dr.Z.Sun

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