Concepts & Keywords: Ethernet L2 Addresses, Data Link Frame, Data link layer frame Trailer, Frame Encapsulation, logical point-to-point topology, LLC, MAC, CRC Calculation, CSMA/CD, CSMA/CA, preample Ethernet frame, Logical Topology, Physical Topology, logical token-passing topology, contention-based media , Controlled Based, 802.11, 802.1, 802.2
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 is placed onto the media and is received from the media using techniques such as media access control and error detection
As with each of the OSI layers, there are terms specific to this layer:
Frame - The Data Link layer PDU
Node - The Layer 2 notation for network devices connected to a common medium
Media/medium (physical)* - The physical means for the transfer of information between two nodes
Network (physical)** - Two or more nodes connected to a common medium
The Data Link layer is responsible for the exchange of frames between nodes over the media of a physical network.
* It is important to understand the meaning of the words medium and media within the context of this chapter. Here, these words refer to the material that actually carries the signals representing the transmitted data. Media is the physical copper cable, optical fiber, or atmosphere through which the signals travel. In this chapter media does not refer to content programming such as audio, animation, television, and video as used when referring to digital content and multimedia.
** A physical network is different from a logical network. Logical networks are defined at the Network layer by the arrangement of the hierarchical addressing scheme. Physical networks represent the interconnection of devices on a common media. Sometimes, a physical network is also referred to as a network segment.
Layer 2 protocols specify the encapsulation of a packet into a frame and the techniques for getting the encapsulated packet on and off each medium. The technique used for getting the frame on and off media is called the media access control method. For the data to be transferred across a number of different media, different media access control methods may be required during the course of a single communication.
Each network environment that packets encounter as they travel from a local host to a remote host can have different characteristics. For example, one network environment may consist of many hosts contending to access the network medium on an ad hoc basis. Another environment may consist of a direct connection between only two devices over which data flows sequentially as bits in an orderly way.
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.
A node that is an end device uses an adapter to make the connection to the network. For example, to connect to a LAN, the device would use the appropriate Network Interface Card (NIC) to connect to the LAN media. The adapter manages the framing and media access control.
At intermediary devices such as a router, where the media type could change for each connected network, different physical interfaces on the router are used to encapsulate the packet into the appropriate frame, and a suitable media access control method is used to access each link. The router in the figure has an Ethernet interface to connect to the LAN and a serial interface to connect to the WAN. As the router processes frames, it will use Data Link layer services to receive the frame from one medium, decapsulate it to the Layer 3 PDU, re-encapsulate the PDU into a new frame, and place the frame on the medium of the next link of the network.
The description of a frame is a key element of each Data Link layer protocol. Data Link layer protocols require control information to enable the protocols to function. 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
The Data Link layer prepares a packet for transport across the local media by encapsulating it with a header and a trailer to create a frame.
Unlike the other PDUs that have been discussed in this course, the Data Link layer frame includes:
Data - The packet from the Network layer
Header - Contains control information, such as addressing, and is located at the beginning of the PDU
Trailer - Contains control information added to the end of the PDU
These frame elements will be discussed in more detail later in this chapter.
Data Link Sublayers
To support a wide variety of network functions, the Data Link layer 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.
Separating the Data Link layer into sublayers allows for one type of frame defined by the upper layer to access different types of media defined by the lower layer. Such is the case in many LAN technologies, including Ethernet.
The two common LAN sublayers are:
Logical Link Control
Logical Link Control (LLC) places information in the frame that identifies which Network layer protocol is being used for the frame. This information allows multiple Layer 3 protocols, such as IP and IPX, to utilize the same network interface and media.
Media Access Control
Media Access Control (MAC) provides Data Link layer addressing and delimiting of data according to the physical signaling requirements of the medium and the type of Data Link layer protocol in use.
Regulating the placement of data frames onto the media is known as media access control. Among the different implementations of the Data Link layer protocols, there are different methods of controlling access to the media. These media access control techniques define if and how the nodes share the media.
Some network topologies share a common medium with multiple nodes. At any one time, there may be a number of devices attempting to send and receive data using the network media. There are rules that govern how these devices share the media.
There are two basic media access control methods for shared media:
Controlled - Each node has its own time to use the medium
Contention-based - All nodes compete for the use of the medium
Click the tabs in the figure to see the differences in the two methods.
Controlled Access for Shared Media
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. If a device does not need to access the medium, the opportunity to use the medium passes to the next device in line. When one device places a frame on the media, no other device can do so until the frame has arrived at the destination and has been processed by the destination.
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.
Contention-based Access for Shared Media
Also referred to as non-deterministic, contention-based methods allow any device to try to access the medium whenever it has data to send. 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. If a carrier signal on the media from another node is detected, it means that another device is transmitting. When the device attempting to transmit sees that the media is busy, it will wait and try again after a short time period. If no carrier signal is detected, the device transmits its data. Ethernet and wireless networks use contention-based media access control.
It is possible that the CSMA process will fail and two devices will transmit at the same time. This is called a data collision. If this occurs, the data sent by both devices will be corrupted and will need to be resent.
Contention-based media access control methods do not have the overhead of controlled access methods. A mechanism for tracking whose turn it is to access the media is not required. However, the contention-based systems do not scale well under heavy media use. As use and the number of nodes increases, the probability of successful media access without a collision decreases. Additionally, The recovery mechanisms required to correct errors due to these collisions further diminishes the throughput.
CSMA is usually implemented in conjunction with a method for resolving the media contention. The two commonly used methods are:
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.
In CSMA/Collision Avoidance (CSMA/CA), the device examines the media for the presence of a data signal. If the media is free, the device sends a notification across the media of its intent to use it. The device then sends the data. This method is used by 802.11 wireless networking technologies.
Note: CSMA/CD will be covered in more detail in Chapter 9.
The topology of a network is the arrangement or relationship of the network devices and the interconnections between them. Network topologies can be viewed at the physical level and the logical level.
The physical topology is an arrangement of the nodes and the physical connections between them. The representation of how the media is used to interconnect the devices is the physical topology. These will be covered in later chapters of this course.
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. 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.
The physical or cabled topology of a network will most likely not be the same as the logical topology.
Logical topology of a network is closely related to the mechanism used to manage network access. Access methods provide the procedures to manage network access so that all stations have access. When several entities share the same media, some mechanism must be in place to control access. Access methods are applied to networks to regulate this media access. Access methods will be discussed in more detail later.
Logical and physical topologies typically used in networks are:
The logical implementations of these topologies and their associated media access control methods are considered in the following sections.
A point-to-point topology connects two nodes directly together, as shown in the figure. In data networks with point-to-point topologies, the media access control protocol can be very simple. All frames on the media can only travel to or from the two nodes. The frames are placed on the media by the node at one end and taken off the media by the node at the other end of the point-to-point circuit.
ogical Point-to-Point Networks
The end nodes communicating in a point-to-point network can be physically connected via a number of intermediate devices. However the use of physical devices in the network does not affect the logical topology. As shown in the figure, the source and destination node may be indirectly connected to each other over some geographical distance. In some cases, the logical connection between nodes forms what is called a virtual circuit. 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. This occurs even if the frames are directed through intermediary devices. Virtual circuits are important logical communication constructs used by some Layer 2 technologies.
The media access method used by the Data Link protocol is determined by the logical point-to-point topology, not the physical topology. This means that the logical point-to-point connection between two nodes may not necessarily be between two physical nodes at each end of a single physical link.
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.
Having many nodes share access to the medium requires a Data Link media access control method to regulate the transmission of data and thereby reduce collisions between different signals.
The media access control methods used by logical multi-access topologies are typically CSMA/CD or CSMA/CA. However, token passing methods can also be used.
In a logical ring topology, each node in turn receives a frame. If the 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.
Nodes in a logical ring topology remove the frame from the ring, examine the address, and send it on if it is not addressed for that node. In a ring, all nodes around the ring- between the source and destination node examine the frame.
There are multiple media access control techniques that could be used with a logical ring, depending on the level of control required. For example, only one frame at a time is usually carried by the media. If there is no data being transmitted, a signal (known as a token) may be placed on the media and a node can only place a data frame on the media when it has the token.
Remember that although there are many different Data Link layer protocols that describe Data Link layer frames, each frame type has three basic parts:
All Data Link layer protocols encapsulate the Layer 3 PDU within the data field of the frame. However, the structure of the frame and the fields contained in the header and trailer vary according to the protocol.
The Data Link layer protocol describes the features required for the transport of packets across different media. These features of the protocol are integrated into the encapsulation of the frame. When the frame arrives at its destination and the Data Link protocol takes the frame off the media, the framing information is read and discarded.
There is no one frame structure that meets the needs of all data transportation across all types of media. As shown in the figure, depending on the environment, the amount of control information needed in the frame varies to match the media access control requirements of the media and logical topology.
As shown in the figure, the frame header contains the control information specified by the Data Link layer protocol for the specific logical topology and media used.
Frame control information is unique to each type of protocol. It is used by the Layer 2 protocol to provide features demanded by the communication environment.
Typical frame header fields include:
Start Frame field - Indicates the beginning of the frame
Source and Destination address fields - Indicates the source and destination nodes on the media
Priority/Quality of Service field - Indicates a particular type of communication service for processing
Type field - Indicates the upper layer service contained in the frame
Logical connection control field - Used to establish a logical connection between nodes
Physical link control field - Used to establish the media link
Flow control field - Used to start and stop traffic over the media
Congestion control field - Indicates congestion in the media
The data Link layer provides addressing that is used in transporting the frame across the shared local media. Device addresses at this layer are referred to as physical addresses. Data Link layer addressing is contained within 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.
Unlike Layer 3 logical addresses that are hierarchical, physical addresses do not indicate on what network the device is located. If the device is moved to another network or subnet, it will still function with the same Layer 2 physical address.
Because the frame is only used to transport data between nodes across the local media, the Data Link layer address is only used for local delivery. Addresses at this layer have no meaning beyond the local network. Compare this to Layer 3, where addresses in the packet header are carried from source host to destination host regardless of the number of network hops along the route.
If the packet in the frame must pass onto another network segment, the intermediate device - a router - will decapsulate the original frame, create a new frame for the packet, and send it onto the new segment. The new frame will use source and destination addressing as necessary to transport the packet across the new media.
The need for Data Link layer addressing at this layer depends on the logical topology.
Point-to-point topologies, with just two interconnected nodes, do not require addressing. Once on the medium, the frame has only one place it can go.
Because ring and multi-access topologies can connect many nodes on a common medium, addressing is required for these typologies. When a frame reaches each node in the topology, the node examines the destination address in the header to determine if it is the destination of the frame.
Frame Check Sequence
The Frame Check Sequence (FCS) field is used to determine if errors occurred in the transmission and reception of the frame. Error detection is added at the Data Link layer because this is where data is transferred across the media. The media is a potentially unsafe environment for data. The signals on the media could be subject to interference, distortion, or loss that would substantially change the bit values that those signals represent. The error detection mechanism provided by the use of the FCS field discovers most errors caused on the media.
the cyclic redundancy check (CRC) value.
Practical Labs: 7.5.2