The Data Link Layer – Layer 2

The Data Link layer performs a number of separate activities, including:

The Data Link Layer Layer 2 246x300 The Data Link Layer – Layer 2

  • Physical addressing
  • Network topoloty
  • Error notification
  • Access to the physical medium
  • Flow control
  • Different data link layer specifications define different network and protocol characteristics, including physical addressing, network topology, error notification, sequencing of frames, and flow control.

    Physical addressing, is not to be confused with network or IP addresing. The physical address defines how devices are labeled in the data link layer. This physical address is most commonly called the Media Access Control (MAC) address. The MAC address is a unique number assigned by the manufacturer. This numbering system is actually administered by one of the networking governing bodies.

    Network topology consists of the data-link layer specifications that often define how devices are to be physically connected, such as in a bus or a ring topology. Error notification alerts upper layer protocols that a transmission error has occurred, and the sequencing of data frames reorders frames that are transmitted out of sequence. Finally, flow control moderates the transmission of data so that the receiving device is not overwhelmed with more traffic than it can handle at one time.

    Switches and bridges use MAC addressing to make networking decisions and therefore these types of equipment function on the data link layer.

    IEEE 802 Standards

    The 802 Project defines 12-plus subcommittee standards groups. Some are as follows:

    802.1 Internetworking/LAN Protocols Defines routing, bridging, and internetwork communications
    802.2 Logical Link Control (LLC) Allows Network layer protocols to link to Physical layer and MAC sublayer protocols
    802.3 Ethernet The Ethernet standard; defines CSMA/CD
    802.5 Token Ring Defines logical ring topology, media, and interfaces
    802.12 High-speed networks Defines 100 Mbps technologies

    Ethernet – 802.3

    The Data Link layer is divided into two sublayer by the 802 standards: the Logical Link Control (LLC) and Media Access Control (MAC) sublayers. The LLC sublayer is defined in 802.1 and 802.2. The MAC sublayer is defined in the 802.1, 802.3, 802.5 and 802.12.

    Logical Link Control (LLC)

    Conceptually, the LLC sublayer sits on top of the MAC sublayer. It’s defined by the 802.2 standard to be topology independent.

    The LLC functions include:

  • Managing frames to upper and lower layers
  • Error Control
  • Flow control
  • The LLC works with the transport layer by providing connection-oriented and connectionless services. It manages and creates the communication link.

    The LLC sublayer transfers data in two ways:

  • Connectionless services: Messages are not acknowledged by the receiving device, which speeds up the processing. Although it sounds unreliable, this type of transfer is commonly used at this level because the upper OSI layers implement their own error-checking and control.
  • Connection-oriented services: Because each message is acknowledged, this service is much slower than connectionless services, but it’s much more reliable.
  • Flow Control

    Another communications control defined on the LLC sublayer is flow control. The Transport layer of the OSI model actually manages the mechanisms used to control the flow of data between two hosts. The Data Link layer defines the data values used in the flow control signaling between two transmitting hosts.

    There are two types of flow control implemented in data communications – software and hardware:

  • Software flow control, common to networking, involves a process called XON/XOFF, whih roughly stands for transmission on/transmission off.
  • Hardware flow control, also called RTS/CTS (ready to send/clear to send), uses two wires in a cable, one for RTS and one for CTS. When either is turned off, the flow is interrupted.
  • Error Detection

    Another function of the Data Link layer is error detection. Error detection is the process of detecting whether errors occurred during the transmission of the bits across the wire. The Data Link layer uses a calculated value called the CRC (Cyclic Redundancy Check) that’s placed into the Data Link trailer that’s added to the message frame before it’s sent to the Physical layer. The receiving computer recalculates the CRC and compares it to the one sent with the data. If the two alues are equal, it’s assumed that the data arrived without errors. Otherwise, the message frame may need to be retransmitted under control of an upper layer. Although the Data Link layer implements error detection, it does not include a function to perform error recovery. This is left for the upper layers to deal with, primarily on the Transport layer.

    MAC

    The MAC sublayer carries the physical address of each device on the network. This address is more commonly called a device’s MAC address. The MAC address is a 48-bit address that’s encoded on each network device by its manufacturer. It’s the MAC address that the Physical layer uses to move data between nodes of the network.

    ARP (Address Resolution Protocol)

    ARP maintains a small database in memory, called the ARP cache, that crossreferences physical and logical addresses. When a device wants to communicate with a local device, it checks its ARP cache to determine whether it has that device’s MAC address. If it doesn’t, it sends out an ARP broadcast request to all devices on the local network. Each device examines the message to see whether the request is intended for it. If it is, the device responds with its MAC address, which is stored in the sending device’s ARP cache.

    CSMA/CD (Carrier Sense Multiple Access/Collision Detection)

    CSMA/CD is the method used in Ehternet networks for controlling access to the physical media by network nodes.

    CSMA/CD process can be described as follows:

  • Listen to see whether the wire is being used.
  • If the wire is busy, wait.
  • If the wire is quiet, send.
  • If a collision occurs while sending, stop wait a specific amount of time, and send again.
  • Segmentation

    Dividing up a LAN into smaller collision domains (segments) is called segmentation.

    General benefits of LAN segmentation:

  • Increased bandwidth per user
  • Keeping local traffic local
  • Reduced broadcasts
  • Decreased collisions
  • Bridge

    A bridge is used to break larger network segments into smaller network segments. It works much like a reapeater, but because a bridge works solely with Layer 2 protocols and layer 2 MAC sublayer addresses, it operates at the Data Link layer.

    A bridge uses the MAC address to perform its tasks, including:

  • Monitoring network traffic
  • Identifying the destination and source addresses of a message
  • Creating a routing table that identifies MAC addresses to the network segment on which they’re located
  • Sending messages to only the network segment on which its destination MAC address is located
  • Know the following about bridges:

  • Bridges operate at Layer 2 and usually do not reduce broadcasts because a bridge forwards broadcast packets to all of its ports except the port on which the broadcast packet arrived. On the other hand, a router usually blocks broadcast packets.
  • Bridges expand the distance of an Ethernet network becuase each segment can be built to the maximum distance.
  • Bridges filter some traffic based upon MAC addresses.
  • Bandwidth is used more effeciently.
  • Local traffic is kept local.
  • Switch

    In networking, a switch is a device responsible for multiple functions such as filtering, flooding, and sending frames. Broadly, a switch is any electronic/mechanical device allowing connections to be established as needed and terminated if no longer necessary.

    Layer-2 switching is shardware based, which means it uses the MAC address from the host’s NIC cards to filter the network. Layer-2 switches are fast because they do not look at the Network layer header information, looking instead at the frame’s hardware addresses before deciding to either forward the frame or drop it.

    Three Switch Functions at layer 2

    1. Address learning – Layer-2 switches and bridges remember the source hardware address of each frame received on an interface and enter this information into a MAC database
    2. Forward/filter decisions – When a frame is received on an interface, the switch looks at the destination hardware address and finds the exit interface in the MAC database
    3. Loop avoidance – If multiple connections between switches are created for redundancy, network loops can occur. The Spanning-Tree Protocol (STP) is used to stop network loops and allow redundance.

    Bridging versus LAN Switching

    Layer-2 switches are really just bridges with more ports. However, there are some important differences you should be aware of:

    • Bridges are software based, while switches are hardware based because they use an ASICs chip to help make filtering decisions.
    • Bridges can only have one spanning-tree instance per bridge, shile switches can have many.
    • Bridges can only have up to 16 ports, whereas a switch can have hundreds.

    Five steps of encapsulation:

    User Information into Data
    Data into Segments
    Segments into Packets
    Packets into Frames
    Frames to Bits

    1. User information is converted into data.
    2. Data is converted into segments for transport across the network.
    3. Segments are converted into segments for transport across the network.
    4. Packets and datagrams are converted into frames and the Data Link header is added.
    5. The data in the frames is converted into bits for transmission over the physical media.

    Five steps of encapsulation that occur when a user uses a browser to open a Web page:
    1. The user requests that the browser open a Web page.
    2. The transport layer adds a header indicating that an HTTP process is requested.
    3. The Network layer puts a source and destination address into its packet header that helps indicate the path across the network.
    4. The Data Link layer frame puts in the hardware addresses of both the source node and the next directly connected network device.
    5. The frame is converted into bits for transmission over the media.

    Data encapsulation by OSI Layer:

    OSI Layer Encapsulation
    Transport Segment
    Network Packet
    Data Link Frame
    Physical Bits
    Tags: data link layer, link layer, What acronym is used to reference the data link sublayer that identifies the network layer protocol encapsulated in the frame?

    Leave a Comment


    NOTE - You can use these HTML tags and attributes:
    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>