Overview
Em Tnn0n000104I1 SACHIKHOA NETWORKING ACADEMY
Upon completion of this chapter, you will be able to:
Explain the role of Data Link layer protocols in data transmission Describe how the Data Link layer prepares data for transmission on network media
Describe the different types of media access control methods
Identify several common logical network topologies and describe how the logical topology determines the media access control method for that network
Explain the purpose of encapsulating packets into frames to.faeilitate media access
Describe the Layer 2 frame structure and identify generic fields Explain the role of key frame header and trailertfields,»including addressing, QoS, type of protocol, and Frame Check Sequence
Trang 4IS l [111 TT BACHKHOA NETWORKING ACADEMY
Data Link Layer — Accessing the Media
Trang 5Supporting & Connecting to Upper Layer Services ,lI(lllllllllllllllIIlIlIIIIIIIIIIIIIIIlI Application Presentation Session Transport Network Data Link Physical Frame Media Data Link Layer Terms PDU Qo a aa koef a
A PDU at the Data
Link layer is called
a frame
A node is a device on a network
The media are the physical means used to carry data signals
A network is two or more devices connected to a common medium
Hoc vién mang Bach khoa - Website: www.bkacad.com
BACHKHOA NETWORKING ACADEMY
The Data Link layer provides a means for exchanging data over a common local media The Data Link layer
performs two basic
services:
— Allows the upper layers to access the media using
techniques such as framing
— Controls how data
Trang 6Supporting & Connecting to Upper Layer Services
FT) BACHKHOA NETWORKING ACADEMY
The Data Link Layer
Data link layer protocols Different protocols may be
govern how to format a in use for different media
frame for use on different
media,
At each hop along the path, an intermediary device accepts frames from one medium, decapsulates the rame and then forwards the packets in a new frame The 2 headers of each frame are formatted for the specific
medium that it will cross
e The Data Link layer effectively insulates the communhication*processes at the higher layers from the media transitions that mayoccurend-to-end
° A packet is received from and directed to an upper layer protocol, in this case
IPv4 or IPv6, that does not need to be aware of which media the communication
will use
Trang 7Controlling Transfer across Local Media
_,Ill(I(IlllllllIlllIIlIIIUIIlIIIIIlIIIIU( BACHKHOA NETWORKING ACADEMY ‘ ‹ ——ễễễ —————
¬Y —— wAN Header WAN Trailer
WAN Header WAN Treiber ee l HUỘ ee ` Serial Connection
Ethernet The Data Link layer is Connection responsible for controlling
the transfer of frames across the media
e The media access control methods described by:the Data Link layer protocols define the processes by which network devices can-access the network media and transmit frames in diverse network environments
Trang 8Creating a Frame
_/IÌl(llllIIlllIIIlIlllIIIIIIII((IlIIIIlIIIlIlIlIlI BACHKHOA NETWORKING ACADEMY
Data Link Layer Services 3 Network Layer Packet HEADER (Data) TRAILER Y \ Frame 1 Physical Layer
° Control information may tell:
— Which nodes are in communication with each other:
— When communication between individual nodes begins and when it ends
— Which errors occurred while the nodes communicated — Which nodes will communicate next
Trang 9Creating a Frame
EMMWs [II BACHKHOA NETWORKING ACADEMY
Formatting Data for Transmission ( Ầ Packet Frame Addressina Start ressing | lype ÍT Quality Ki DATA L rror Detection D : E rame Stop S 1010 0 1 1 41 0 0 1 14 0 0 1 1 1 0 0.1 0 0 1
A specific bit pattern Another specific bit denotes the start of the pattern denotes the end
frame of the frame
e Framing breaks the stream into decipherable greupings, with control information inserted in the header and trailer as values in different fields
° This format gives the physical signals a structure that can be received by nodes and decoded into packets at the destination
Trang 10Connecting Upper Layer Services to the Media
EMWEEETTITIIIIITT BACHKHOA NETWORKING ACADEY
Connecting Upper Layer Services to the Media
The Data Link layer links Physical devices devoted to the the software and l Data Link layer have both hardware layers hardware and software components 7 Application <-—— ” ` n _ 6 Presentation Implemented in 5 Session | software 4 Transport | 3 Network | 2 Data Link | Implemented in ———— hardware 1 Physical PC NIC
e The Data Link layer exists as a connecting layer between the software orocesses of the layers above it and the Physical layer below it
° As such, it prepares the Network layer packets for transmission across some form of media, be it copper, fiber, or the atmosphere
Trang 11Connecting Upper Layer Services to the Media
FT) BACHKHOA NETWORKING ACADEMY
Data Link Sublayers
[ 3 Network Layer |
HEADER Packet TRAILER A packet is encapsulated into a frame
LOGICAL LINK CONTROL
«= Frames the Network layer packet = Identifies the Network layer protocol
< 2 Data Link Layer PN
MEDIA ACCESS CONTROL
» Addresses the frame
* Marks the beginning and ending ofthe frame 10 100 1 1 1 0 0 1 = | | | | | | | | | | | | | | | | | | | | | | The frame is encoded into a signal at the Physical layer [ 1 Physical Layer |
° To support a wide variety of network functions, the.-Data LinkJayer is often divided into two sublayers: an upper sublayer and an lower sublayer
— The upper sublayer defines the software processes that provide services to the Network layer protocols
— The lower sublayer defines the media access processes performed by the hardware
Trang 12Standards
AmMWwfrmTnnmni00iin0Tnnntili: | BACHKHOA NETWORKING ACADEMY
Standards for the Data Link Layer ISO: HDLC (High Level Data Link Control) 802.2 (LLC), IEEE: 802.3 (Ethernet) 802.5 (Token Ring) 802.11 (Wireless LAN)
Q.922 (Frame Relay Standard) ITU: Q.921 (ISDN Data Link Standard)
Trang 13
mm 011 1Ẳ 11111110) BACHKHOA NETWORKING AKADEMY
Media Access Control Techniques
Trang 14Placing Data on the Media
_,Ill(I(IlllllllIlllIIlIIIUIIlIIIIIlIIIIU( BACHKHOA NETWORKING ACADEMY
Media Access Control Methods No control
No control at all would result
in many collisions | Collisions cause corrupted FRAME —
frames that must be resent Shared Media : FRAME 1 »” »” _ >»< FRAME -
Methods that enforce a high Take turns
degree of control prevent
collisions, but the process =
has high overhead Ñ 41 -
> “———————— FRAME
Methods that enforce a low FRAME 2 ——— |
degree of control have low Shared Media 31 |
overhead, but there are FRAME
more frequent collisions là
»
° Regulating the placement of data frames onto the media\is known’as media access control
e The method of media access control used depends on: — Media sharing - If and how the nodes share the media
— Topology - How the connection between the nodes appears to the Data Link layer
Trang 15Media Access Control for Shared Media
AmwwWTnámmim.,.TTTUII BACHKHOA NETWORKING ACADEMY
Media Access Control for Shared Media
We need rules We need rules
for how to for how to We need rules for how to R att l FRAME Shared Media y
e There are two basic media access control methods forshared media: — Controlled - Each node has its own time tose thexmedium
— Contention-based - All nodes compete for the use of the medium
Trang 16
Controlled
àMmwwẽïT 0i0f0fi0000tTini00IiU UUUllIII BACHKHOA NETWORKING ACADEMY
Media Access Control for Shared Media Controlled Access | have a packet to send, but its My turn to | have nothing TO ce FRAME | : Shared Media
Method Characteristics Example > Controlled Access * Only one station transmits at a time * Token Ring
* Devices wishing to transmit must wait their * FDDI turn
* No collisions
* Some deterministic networks use token passing
e When using the controlled access method, network devices.take turns, in sequence, to access the medium This method _is\also known as scheduled access or deterministic
e Although controlled access is well-ordered and provides predictable
throughput, deterministic methods can be inefficient because a device has to wait for its turn before it can use the medium
Trang 17Contention-Based _IllilIllllllllllllllIIIIIIIIIIIIIIIIIIIIIlIIIIIlIlIllW( BACHKHOA NETWORKING ACADEMY l Contention-Based Äccess | try to send | try to send when | am when | am when | am Shared Media
Method Characteristics Example —— Contention Based * Stations can transmit at any time * Ethernet
Access * Collisions exist * Wireless
* Mechanisms exist to resolve contention: * CSMA/CŨD for Ethernet networks * CSMA/CA for 802.11 wireless networks
° Also referred to as non-deterministic, contention-basedmethods allow any device to try to access the medium whenevet_ithas.data to send
e To prevent complete chaos on the media, these methods use a Carrier Sense Multiple Access (CSMA) process to first detect if the media is carrying a
signal
Trang 18Media Access Control for Shared Media SK MMMM TTT SACO NETMGNONG 0V ° CSMA is usually implemented in conjunction with a method for resolving the media contention e The two commonly used methods are: — CSMA/Collision Detection
¢ In CSMA/Collision Detection (CSMA/CD), the device monitors the media for the presence of a data signal If a data signal is absent, indicating that the media is free, the device transmits the data If
signals are then detected that show another device was transmitting at the same time, all devices stop sending and try again later
¢ Traditional forms of Ethernet use this method
— CSMA/Collision Avoidance
¢ In CSMA/Collision Avoidance (CSMA/CA), the device examines the media for the presence of a data signal If the-mediaxis tree, the device sends a notification across the media ofvts'intenfto use it The device then sends the data
¢ This method is used by 802.11 wireless networking technologies
Trang 19Media Access Control for Non-Shared Media
_IllilIllllllllllllllIIIIIIIIIIIIIIIIIIIIIlIIIIIlIlIllW( BACHKHOA NETWORKING ACADEMY
Media Access Control for Non-shared media
Only you and | communicate i làny you and | ,
e Media access control protocols for non-shared media requlire lifle or‹ño control before placing frames onto the media
e These protocols have simpler rules and procedures for media-access control such is the case for point-to-point topologies
e In point-to-point connections, the Data Link layer has to consider whether the communication is half-duplex or full-duplex
Trang 20Media Access Control for Non-Shared Media
Am FHLLlWU) BACHKHOA NETWORKING ACADEMY
Media Access Control for Non-shared media
We can send We can send and receive at
wot senna
vane Network | Transmitting
ee FRAME eo BRAM - FRAME - >
-<.- - PRAME -. - .- ERAMER - - - - ERAMEE - - FRAME
Receiving Receiving
e In full-duplex communication, both devices can transmitand receive on the
media at the same time
e The Data Link layer assumes that the media ¡is available for transmission for both nodes at any time Therefore, there is no media arbitration necessary in the Data Link layer
Trang 21Media Access Control for Non-Shared Media
Am FHLLlWU) BACHKHOA NETWORKING ACADEMY
Media Access Control for Non-shared media
We can send We can send and receive, and receive,
ras 7
Wait until this frame is
received before sending =”
this one Receiving
° Half-duplex communication means that the devices.can both transmit and receive on the media but cannot do so simultameously
e Ethernet has established arbitration rules for resolving conflicts arising from instances when more than one station attempts to transmit at the same time
Trang 22Logical Topology vs Physical Topology
_,IllÌIÍlllllllllllIlIlIIIIIlIlIIIIIIIIIIlIIIlllU BACHKHOA NETWORKING ACADEMY
e The topology of a network is the
Logical Topologies arrangement or relationship of the
Point-to-Point €9 7z (na) + œa network devices and the
interconnections between them
T a e Network topologies can be viewed
Multi-Access
4 h at the physical level and the logical level
Trang 23Logical Topology vs Physical Topology sIIllIIIllIIllIIIIUIIIIIlIlIIIIlIIlIUIIIIIIUUW BACHIKHOA NETWORKING ACADEMY Physical Topologies Topology T 1 † Topology 4 4 Ring Topology Hierarchical Topology
Star Topology Mesh Topology
e The physical topology is an arrangement of the nodesand the physical
connections between them
The representation of how the media is used to interconnect the devices is the physical topology
Trang 24Logical Topology vs Physical Topology
,lI(lllllllllllllllIIlIlIIIIIIIIIIIIIIIlI BACHKHOA NETWORKING ACADEMY
° A logical topology is the way a network transfers frames from one node to the next
— This arrangement consists of virtual connections between the nodes of a network independent of their physical layout
— These logical signal paths are defined by Data Link layer
protocols
e The Data Link layer "sees" the logical topology of a network when controlling data access to the media It is the logical topology that
influences the type of network framing and media access control used e The physical or cabled topology of a network will most likely not be the
same as the logical topology
Trang 25Point-to-Point Topology _,IllÌIÍlllllllllllIlIlIIIIIlIlIIIIIIIIIIlIIIlllU BACHKHOA NETWORKING ACADEMY Point-to-Point Topology ` eS" }- 2 Node 1 Node 2
Limited to two nodes
° A point-to-point topology connects 2 nodes directly together:
e In data networks with point-to-point topologies, the.media access control protocol can be very simple
e In point-to-point networks, if data can only flow in-one direction at a time, it is operating as a hali-duplex link If data can successfully flow across the link from each node simultaneously, it is a full-duplex link
Trang 26Point-to-Point Topology
,IlllllllllllllIllIIIIIlUl(((IIIlIIIllIIIIIIIlI BACHKHOA NETWORKING ACADEMY
Logical Point-to-Point Topology
Adding intermediate physical connections may not change the logical topology mm~ CD » Destination Source Node Node e Insome cases, the logical connection between nodes forms: whatis-called a virtual circuit
e A virtual circuit is a logical connection created within a network between two network devices The two nodes on either end of the-virtual circuit exchange the frames with each other
e Virtual circuits are important logical communication constructs used by some Layer 2 technologies
Trang 27Multi-Access Topology
_,Ill(I(IlllllllIlllIIlIIIUIIlIIIIIlIIIIU( BACHKHOA NETWORKING ACADEMY
Logical Multi-Access Topology I need to transmit to E I check for other transmissions No other tr ected, aT I need to transmit to D Transmission detected rll wait I check for other transmissions
A logical multi-access topology enables a number of nodes to-communicate by using the same shared media
Data from only one node can be placed on the\medium-at any one time
Every node sees all the frames that are on the medium, but only the node to which the frame is addressed processes the contents of the frame
Trang 28Multi-Access Topology
_,Ill(I(IlllllllIlllIIlIIIUIIlIIIIIlIIIIU( BACHKHOA NETWORKING ACADEMY
Logical Multi-Access Topology A C E ae ae B i D | need to transmit to D Transmission detected il wait I check for other No other transmissions
transmissions are detected
Transmitting
The media access control methods used by logical multi-access topologies are typically CSMA/CD or CSMA/CA However, tokenpassing methods can also be used
The Data Link layer protocol specifies the media access control method that will provide the appropriate balance between frame control, frame protection, and network overhead
Trang 29Ring Topology _,Ill(I(IlllllllIlllIIlIIIUIIlIIIIIlIIIIU( BACHKHOA NETWORKING ACADEMY is this frame for me?
° Ina logical ring topology, each node in turn receives @ frame:
e Ifthe frame is not addressed to the node, the-node passes the frame to the next node This allows a ring to use a controlled media access control
technique called token passing
Trang 30
_/IÌl(llllIIlllIIIlIlllIIIIIIII((IlIIIIlIIIlIlIlIlI BACHKHOA NETWORKING ACADEMY
Media Access Control Addressing
& Framing Data
Trang 31Data Link Layer Protocols- The Frame
_IllilIllllllllllllllIIIIIIIIIIIIIIIIIIIIIlIIIIIlIlIllW( BACHKHOA NETWORKING ACADEMY
Data Link Layer Protocols - The Frame
In a fragile environment, Greater effort needed to ensure delivery = higher overhead = slower more controls are needed transmission rates
to ensure delivery The CY
header and trailer fields ow are larger as more control
inf ation is needed
In a protected Less effort needed to ensure delivery = lower overhead = faster
environment, we can count transmission rates
on the frame arriving at its
destination Fewer controls = 2
are needed, resulting in b :
smaller fields and smaller frames i I i FRAME
Trang 32Framing- Role of the Header
IIlll
The Role of the Header
BACHKHOA NETWORKING ACADEMY Header Data FCS STOP FRAME Type/Length
The Type/Length field is an optional field used by some “||protocols to state either what type of data is coming or
possibly the length of the frame Address
The Address field stores the source and destination Data Link addresses
Trang 33
Addressing- Where the Frame Goes I5 (§((01111/11/11fÌ Logical Multi-Access Topology JA C E FRAME | Data Link layer Addresses required A Multi-Access frame has many possible B D destinations is l Logical Point-to-Point Topology Data Link layer Addresses not required sẽ ae ‘ yp FRAME A Point-to-Point frame has only 1 possible destination
Hoc vién mang Bach khoa - Website: www.bkacad.com
BACHKHOA NETWORKING ACADEMY
The data Link layer provides addressing that is used in
transporting the frame across the shared
local media
Unlike Layer 3 logical
Trang 34Framing- Role of the Trailer
MMMM SACTRHOA NETWORKING ACADEMY
The Role of the Trailer Trailer START ADDRESS TYPE/ LENGTH Data FRAME
The Frame Check Sequence field is used for error checking The source calculates a number based on the frame's data and places that number in the FCS field The
destination then recalculates the data to see if the FCS matches If they don't match, the destination deletes the frame
The Stop Frame field, also called the Frame Trailer, is an optional field that is used when the length of the frame is not specified in the Type/Length field It indicates the end
of the frame when transmitted
e Data Link layer protocols add a trailer to the end of,each frame
e The trailer is used to determine if the frame arrived without error This process is called error detection
Trang 35Data Link Layer Protocols- The Frame
Trang 36Data Link Layer Protocols- The Frame HHH] BACHKHOA NETWORKING ACADEMY Ethernet Protocol A Common Data Link Layer Protocol for LANs Frame biel Preamble Destination Source Type Fut 3 name Sequence Size Preamble - used for synchronization; also contains a delimiter to mark the end of he timing inforrnation
Destination Address - 46 bit MAC address for the destination node Source Address - 46 bit MAC address for the source node
Type - value to indicate which upper layer protocol will receive the data after the Ethernet process is complete
Data or payload - this is the PDU, typically an IPv4 packet, that is to be transported over the media
Frame Check Sequence (FCS) - A value used to check for damaged frames
Hoc vién mang Bach khoa - Website: www.bkacad.com
Trang 37Data Link Layer Protocols- The Frame Field name Size (bytes) IIll BACHKHOA NETWORKING ACADEMY Point-to-Point Protocol A Common Data Link Protocol for WANs Frame A Flag Address Control Protocol
Flag - A single byte that indicates the beginning or end of a frame The flag field consists of the binary sequence 01111110
Address - A single byte that contains the standard PPP broadcast address PPP does not assign individual station addresses
Control - A single byte that contains the binary sequence 00000011, which calls for transmission of user data in an unsequenced frame
Protocol - Two bytes that identify the protocol encapsulated in the data field of the frame The most up-to-date values of the protocol field are specified in the most
recent Assigned Numbers Request For Comments (RFC)
Data - Zero or more bytes that contain the datagram for the protocol specified in the protocol field
Frame Check Sequence (FCS) - Normally 16 bits (2 bytes) By prior agreement, consenting PPP implementations can use a 32-bit (4-byte) FCS for improved error detection
Trang 38Data Link Layer Protocols- The Frame
HHH] BA@CHKHOA NETWORKING ACADEMY 802.11 Wireless LAN Protocol Octets: 2 2 6 6 6 2 6 0-2312 4 B3B4 Sequence Number Number, >< > 4 12 Sequence Control Frame Control BiB B3B B7 BS B10 B11 B12 B13 B14
+ From| More Pwr |More
Version| Per) Subtype) TO) inci irrag joo!) mat |ipata
~ >~ > —~ > <> <> <> tt tt
Bits 2 2 4 1 1 1 1 1 1 1 1
Trang 39Am FHLLlWU) BACHKHOA NETWORKING ACADEMY
Putting it All Together
Trang 40Follow Data Through an Internetwork
Am FHLLlWU) BACHKHOA NETWORKING ACADEMY
A simple data transfer between two hosts across an internetwork
Receiving host Requesting host
Server
Router A Router B
e Inthe WAN connection between the two routers, we are assuming that PPP
has already established a physical circuit and has established a PPP session