Lec08_Data Link Layer
Lec08_Data Link Layer
•The LLC sublayer takes the network protocol data, which is typically an IPv4 or IPv6 packet,
and adds Layer 2 control information to help deliver the packet to the destination node.
•The MAC sublayer controls the NIC and other hardware that is responsible for sending and
receiving data on the wired or wireless LAN/MAN medium.
•Addressing: The MAC sublayer provides source and destination addressing for
transporting the Layer 2 frame between devices on the same shared medium .
•Error detection: The MAC sublayer includes a trailer used to detect transmission
errors
•The MAC sublayer also provides media access control, allowing multiple devices to
communicate over a shared (half-duplex) medium. Full-duplex communications do not
require access control.
Half and Full Duplex Communication
Understanding duplex communication is important when discussing LAN topologies because it refers to the
direction of data transmission between two devices. There are two common modes of duplex: half-duplex
and full-duplex.
Half-duplex communication
• Only allows one device to send or receive at a time on a shared medium.
• Used on WLANs and legacy bus topologies with Ethernet hubs.
Full-duplex communication
• Allows both devices to simultaneously transmit and receive on a shared medium.
• Ethernet switches operate in full-duplex mode.
In summary, half-duplex restricts the exchange of data to one direction at a time. Full-duplex allows the
sending and receiving of data to happen simultaneously.
Two interconnected interfaces, such as a host NIC and an interface on an Ethernet switch, operate using the
same duplex mode. Otherwise, there is a duplex mismatch, which creates inefficiency and latency on the link.
Purpose of the Data Link Layer: Providing Access to
Media
• Each network environment that packets encounter as they travel from a local host to
a remote host can have different characteristics. For example, an Ethernet LAN
usually consists of many hosts contending for access on the network medium. The
MAC sublayer resolves this.
• At each hop along the path, a router performs four basic Layer 2 functions:
1. Accepts a frame from the network medium.
2. De-encapsulates the frame to expose the encapsulated packet.
3. Re-encapsulates the packet into a new frame.
4. Forwards the new frame on the medium of the next network segment.
Purpose of the Data Link Layer: Data Link Layer
Standards
Data link layer protocols are defined by engineering
organizations.
• Engineering organizations define open standards and
protocols that apply to the network access layer (that is,
the OSI physical and data link layers)
They include the following:
• Institute for Electrical and Electronic Engineers
(IEEE).
• International Telecommunications Union (ITU).
• International Organizations for Standardization (ISO).
• American National Standards Institute (ANSI).
Topologies: Physical and Logical Topologies
• The data link layer prepares network data for the physical network.
• It must know the logical topology of a network in order to be able to determine what is needed to
transfer frames from one device to another
• The topology of a network is the arrangement and relationship of the network devices and the
interconnections between them.
• There are two types of topologies used when describing networks:
• Physical topology – Identifies the physical connections and how end devices and intermediary devices
(that is, routers, switches, and wireless access points) are interconnected. The topology may also
include specific device location information, such as room number and location on the equipment rack.
Physical topologies are usually point-to-point or star
• Logical topology – Refers to the way a network transfers frames from one node to the next. This
topology identifies virtual connections using device interfaces and Layer 3 IP addressing schemes.
• 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.
Topologies: WAN Topologies
There are three common physical WAN topologies:
• Point-to-point – the simplest and most common WAN topology. Consists of a
permanent link between two endpoints.
• Hub and spoke – similar to a star topology where a central site interconnects
branch sites through the use of point-to-point links. In this topology, branch sites
cannot exchange data with other branch sites without going through the central site.
• Mesh – provides high availability but requires every end system to be connected to
every other end system. Therefore, the administrative and physical costs can be
significant. Each link is essentially a point-to-point link to the other node.
Topologies: Point-to-Point WAN Topology
• Physical point-to-point topologies directly connect two nodes.
• The nodes may not share the media with other hosts.
• In addition, when using a serial communications protocol such as Point-to-Point
Protocol (PPP), a node does not have to make any determination about whether an
incoming frame is destined for it or another node.
• Because all frames on the media can only travel to or from the two nodes, Point-to-
Point WAN protocols can be very simple.
• The node places the frames on the media at one end, and those frames are taken
from the media by the node at the other end of the point-to-point circuit.
Topologies: Access Control Methods
•Ethernet LANs and WLANs are examples of multiaccess networks.
•A multiaccess network is a network that can have two or more end devices attempting to access the
network simultaneously.
•Some multiaccess networks require rules to govern how devices share the physical media. There
are two basic access control methods for shared media:
Contention-based access
All nodes operating in half-duplex, competing for use of the medium. Examples are:
• Carrier sense multiple access with collision detection (CSMA/CD) as used on legacy bus-topology
Ethernet.
• Carrier sense multiple access with collision avoidance (CSMA/CA) as used on Wireless LANs.
Controlled access
• Deterministic access where each node has its own time on the medium.
• Used on legacy networks such as Token Ring and ARCNET.
• These deterministic legacy networks are inefficient because a device must wait its turn to access the
medium.
Topologies: Contention-Based Access – CSMA/CD
Examples of contention-based access networks include: Wireless LAN (uses CSMA/CA), Legacy bus
topology Ethernet LAN (uses CSMA/CD), Legacy Ethernet LAN using a hub (uses CSMA/CD)
These networks operate in half-duplex mode, meaning only one device can send or receive at a time.
Therefore, a process is needed to govern when a device can send and what happens when multiple
devices send at the same time. If two devices transmit at the same time, a collision occurs.
CSMA/CD
• Used by legacy Ethernet LANs.
• Operates in half-duplex mode where only one device sends or receives at a time.
• Uses a collision detection process to govern when a device can send and what happens if multiple
devices send at the same time.
The Ethernet hub receives and sends the frame. An Ethernet hub is also known as a multiport
repeater. Any bits received on an incoming port are regenerated and sent out all other ports
Topologies: Contention-Based Access – CSMA/CA
CSMA/CA
• Used by IEEE 802.11 WLANs.
• CMSA/CA does not detect collisions but attempts
to avoid them by waiting before transmitting
• Operates in half-duplex mode where only one
device sends or receives at a time.
• Uses a collision avoidance process to govern when
a device can send and what happens if multiple
devices send at the same time.
Field Description
Frame Start and Stop Identifies beginning and end of frame
Addressing Indicates source and destination nodes
Type Identifies encapsulated Layer 3 protocol
Control Identifies flow control services
Data Contains the frame payload
Error Detection Used for determine transmission errors
Data Link Frame: Layer 2 Addresses
• The data link layer provides the addressing used in transporting a frame across a shared
local medium. Also referred to as a physical address.
• Contained in the frame header and specifies the frame destination node on the local
network, the frame header may also contain the source address of the frame
• Used only for local delivery of a frame on the link.
• Updated by each device that forwards the frame.