500 likes | 643 Views
Layer 2 : Concept. Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw http://www.cse.dlit.edu.tw/~andres. Overview. Reliable transit of data
E N D
Layer 2 : Concept Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw http://www.cse.dlit.edu.tw/~andres
Overview • Reliable transit of data • Physical addressing, network topology, line discipline, error notification, ordered delivery of frames, and flow control
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
Layer 2 • Addresses these limitations of layer 1 • Logical 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
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
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
Logical LinkControl (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)
LLC • Manages communications • Connectionless and connection-oriented services • Enable multiple higher-layer protocols to share a single physical data link • IEEE 802.2
MAC Sublayers • Deals with the protocols that a host follows in order to access the physical media
LLC as one ofFour Concepts of Layer 2 • Communicates with the upper-level layers through LLC • Uses a flat addressing convention • Use framing to organize or group the data • Use MAC to choose which computer will transmit binary data
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
6.3 MAC Address • Organization Unique Identifier (OUI): • Administered by the IEEE • Burned-in addresses (BIAs) • Be burned into read-only memory (ROM) and are copied into random-access memory (RAM) when the NIC initializes
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
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
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
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
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
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"
Frame start fields • Grab the attention of other computers • Address field • Source and destination MAC address • Length/type fields • Length field: exact length of a frame • Type field: specifies the Layer 3 protocol • Data fields • Higher-layer data/padding bytes
Frame Check Sequence (FCS) field • Error detection • Contains 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
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
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 MAC • Deterministic (taking turns) • Non-deterministic (first come, first served)
MAC • Classification of MAC protocols • Topologies of broadcast links • Contention MAC • Round Robin MAC • Reservation MAC • Dedicated MAC
Classification of MAC Protocols Note : Some systems use a combination of above schemes.
station station repeater (a) Bus (b) Ring station base station mobile station Star coupler (active or passive) (d) Wireless--celluar (c) Star Topologies of Broadcast
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
Dedicated MAC • WDMA • Wavelength Division Multiple Access • FDMA on passive fiber optic LANs • Frequency Division Multiple Access • TDMA on passive fiber optic LANs • Time Division Multiple Access • CDMA • Code Division Multiple Access
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
receiver receiver receiver receiver frame copied token token sender (expecting token) sender (txing data) sender (draining data) sender (releasing token) Token Ring
Token Bus • A logical ring on a physical bus, a ring maintenance protocol is required. • Run a token protocol similar to token ring, except that the token rotation time is controlled. FDDI’s timed token rotation protocol follows the same mechanism as token bus.
FDDI • Fiber Distributed Dual Interface operational ring backup ring
Non-deterministic MAC protocols • First-come, first-served (FCFS) approach • Allow anyone to transmit at will • This 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
ALOHA • Transmit whenever it wants • Listen to know if it’s a success or collision • Wait a random time to retx, if collided
C A B . . . D . C . A B D . . . RTS CTS . E . E CSMA/CA • Carrier 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.
Three specific technical implementations • Ethernet • Logical bus topology • Physical star or extended star • Token Ring • Logical ring topology • Physical star topology • FDDI • Logical ring topology • Physical dual-ring topology
Summary • Institute of Electrical and Electronic Engineers (IEEE) • Media Access Control (MAC) • Logical Link Control (LLC)