layer 2 : concept
DESCRIPTION
Layer 2 : Concept. Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology [email protected] http://www.cse.dlit.edu.tw/~andres. Overview. Reliable transit of data - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/1.jpg)
Layer 2 : Concept
Andres, Wen-Yuan Liao
Department of Computer Science and Engineering
De Lin Institute of Technology
http://www.cse.dlit.edu.tw/~andres
![Page 2: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/2.jpg)
![Page 3: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/3.jpg)
Overview
Reliable transit of data
Physical addressing, network topology, line discipline, error notification, ordered delivery of frames, and flow control
![Page 4: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/4.jpg)
6.1 LAN Standards
Layer 2
Comparing OSI Layers 1 and 2 with various LAN standards
Comparing the IEEE model with the OSI model
Logical Link Control (LLC)
MAC sublayers
LLC as one of four concepts of Layer 2
![Page 5: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/5.jpg)
Layer 2 Addresses these limitations of layer 1Logical Link Control (LLC): Communicate with the upper-level layers
Framing: describe streams of bits
Media Access Control (MAC):decide which computer will transmit binary
data
MAC address: name or identify computers
![Page 6: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/6.jpg)
Comparing OSI Layers 1/2 with various LAN standards
IEEE divides the OSI data link layer into two separate sublayers
Media Access Control (MAC)transitions down to media
Logical Link Control (LLC)transitions up to the network layer
![Page 7: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/7.jpg)
![Page 8: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/8.jpg)
Comparing the IEEE model with the OSI model
LLC: Protocol Data Unit (PDU)
MAC : 802.3 and 802.5, cross over the Layer2/Layer1 interface
NIC as both a Layer 1 and a Layer 2 device MAC address & Transceiver
![Page 9: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/9.jpg)
Logical Link Control (LLC)
Allow part of the data link layer to function independently from existing technologies
Two addressing Destination Service Access Point (DSAP)Source Service Access Point (SSAP)
![Page 10: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/10.jpg)
LLC
Manages communications Connectionless and connection-
oriented services
Enable multiple higher-layer protocols to share a single physical data linkIEEE 802.2
![Page 11: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/11.jpg)
MAC Sublayers
Deals with the protocols that a host follows in order to access the physical media
![Page 12: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/12.jpg)
LLC as one of Four Concepts of Layer 2
1. Communicates with the upper-level layers through LLC
2. Uses a flat addressing convention
3. Use framing to organize or group the data
4. Use MAC to choose which computer will transmit binary data
![Page 13: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/13.jpg)
6.2 Hexadecimal Numbers
Hexadecimal numbers as MAC addresses
Basic hexadecimal (hex) numbering
Converting decimal numbers to hexadecimal numbers
Converting hexadecimal numbers to decimal numbers
Methods for working with hexadecimal and binary numbers
![Page 14: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/14.jpg)
6.3 MAC Address
Organization Unique Identifier (OUI):Administered by the IEEE
Burned-in addresses (BIAs)Be burned into read-only memory (R
OM) and are copied into random-access memory (RAM) when the NIC initializes
![Page 15: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/15.jpg)
![Page 16: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/16.jpg)
MAC Addressing
Data link layer MAC identifiers
MAC address and NICs
How the NIC uses MAC addresses
Layer 2 address encapsulation and decapsulation
Limitations of MAC addressing
![Page 17: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/17.jpg)
![Page 18: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/18.jpg)
MAC address and NICs
Every computer has a unique way of identifying itself
No two physical addresses are alike
The physical address is located on the Network Interface Card (NIC)
Two formats for MAC addresses: 0000.0c12.3456 or 00-00-0c-12-34-56
![Page 19: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/19.jpg)
How the NIC uses MAC addresses
Ethernet and 802.3 LANs are broadcast networks
All stations see all frames
Each station must examine every frame to determine whether that station is a destination
![Page 20: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/20.jpg)
![Page 21: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/21.jpg)
Limitations of MAC addressing
The number of possible addresses is not going to run out anytime soon
They have no structure, and are considered flat address spaces
![Page 22: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/22.jpg)
![Page 23: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/23.jpg)
6.4 Framing Why framing is necessary
Frame format diagram
Three analogies for frames
A generic frame format
Frame start fields, Address fields
Length/type fields, Data fields
Frame error problems and solutions
Stop frame field
![Page 24: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/24.jpg)
Why framing is necessary
Which computers are communicating with one another
When communication between individual computers begins and when it terminates
A record of errors
Whose turn it is to "talk" in a computer "conversation"
![Page 25: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/25.jpg)
![Page 26: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/26.jpg)
![Page 27: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/27.jpg)
![Page 28: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/28.jpg)
Frame start fieldsGrab the attention of other computers
Address fieldSource and destination MAC address
Length/type fields Length field: exact length of a frame Type field: specifies the Layer 3 protocol
Data fieldsHigher-layer data/padding bytes
![Page 29: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/29.jpg)
Frame Check Sequence (FCS) field Error detectionContains a number that is based on the
data in the frame
Three primary ways Cyclic redundancy check (CRC) Two-dimensional parity Internet checksum
Stop frame field Indicate the end of frame
![Page 30: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/30.jpg)
6.5 Media Access Control (MAC)
Definition of MAC
Three analogies for MAC
Deterministic MAC protocols
Non-deterministic MAC protocols
Three specific technical implementations and their MACs
![Page 31: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/31.jpg)
Definition of MAC
Protocols that determine which computer on a shared-medium environment (collision domain) is allowed to transmit the data
Two broad categories of MACDeterministic (taking turns)Non-deterministic (first come, first
served)
![Page 32: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/32.jpg)
![Page 33: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/33.jpg)
MAC
Classification of MAC protocols
Topologies of broadcast links
Contention MAC
Round Robin MAC
Reservation MAC
Dedicated MAC
![Page 34: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/34.jpg)
Classification of MAC Protocols
MAC protocols
Contetion (Non-Deterministic)
ALOHA, CSMA/CD, CSMA/CA
Round Robin (Deterministic)
token ring, token bus, FDDI
Reservation DQDB
Dedicated TDMA, FDMA, WDMA, CDMA
Note : Some systems use a combination of above schemes.
![Page 35: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/35.jpg)
Topologies of Broadcast
station
(a) Busrepeater
station
(b) Ring
base station
mobile station
(d) Wireless--celluar(c) Star
Star coupler (active
or passive)
station
![Page 36: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/36.jpg)
Topologies and Standard Protocols
Bus CSMA/CD (802.3), Token Bus (802.4), DQDB(802.6)
Ring Token Ring (802.5), FDDI
Star WDMA
Wireless ALOHA, CSMA/CA (802.11), FDMA+TDMA (GSM),
CDMA
![Page 37: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/37.jpg)
Dedicated MAC
WDMA Wavelength Division Multiple Access
FDMA on passive fiber optic LANsFrequency Division Multiple Access
TDMA on passive fiber optic LANsTime Division Multiple Access
CDMACode Division Multiple Access
![Page 38: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/38.jpg)
Deterministic MAC protocols
A form of "taking your turn"
Token Ring network
A special data token circulates around the ring
When a host wants to transmit, it seizes the token, transmits the data for a limited time, and then places the token back in the ring
![Page 39: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/39.jpg)
Token Ring
receiver
sender(expecting token)
token
sender(releasing token)
token
receiver
sender(txing data)
receiver
sender(draining data)
receiverframe copied
![Page 40: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/40.jpg)
![Page 41: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/41.jpg)
Token Bus
A logical ring on a physical bus, a ring maintenan
ce protocol is required.
Run a token protocol similar to token ring, except
that the token rotation time is controlled. FDDI’s t
imed token rotation protocol follows the same me
chanism as token bus.
![Page 42: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/42.jpg)
FDDI
backup ringoperational ring
Fiber Distributed Dual Interface
![Page 43: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/43.jpg)
Non-deterministic MAC protocols
First-come, first-served (FCFS) approach Allow anyone to transmit at willThis led to collisions Carrier Sense Multiple Access with Collision Detection (CSMA/CD)Everyone else on the system also hears the collision, waits for silence, and then tries to transmit
![Page 44: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/44.jpg)
ALOHA
Transmit whenever it wants
Listen to know if it’s a success or collisio
n
Wait a random time to retx, if collided
![Page 45: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/45.jpg)
![Page 46: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/46.jpg)
CSMA/CACarrier Sense Multiple Access with Collision Avoidance
Before sending the data frame, send a RTS (Request To Send) mini-frame to receiver, (RTS declares the length of data frame) If Collided, backoff exponentially and retry.
Receiver sends back a CTS (Clear To Send) mini-frame to ask the other stations keep silent for the period of data frame. If collided, backoff exponentially and retry.
Transmit the data frame when the CTS is received.
C A B. . .
.E
A B D. . .
.E
RTS CTSD .
C .
![Page 47: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/47.jpg)
Three specific technical implementations
EthernetLogical bus topology Physical star or extended star
Token Ring Logical ring topology Physical star topology
FDDILogical ring topology Physical dual-ring topology
![Page 48: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/48.jpg)
![Page 49: Layer 2 : Concept](https://reader035.vdocuments.net/reader035/viewer/2022062408/568143ee550346895db07376/html5/thumbnails/49.jpg)
Summary
Institute of Electrical and Electronic Engineers (IEEE)
Media Access Control (MAC)
Logical Link Control (LLC)