Data link layer

Data link layer


The data link layer, or layer 2, is the second layer of the seven-layer OSI model of computer networking.
This layer is the protocol layer that transfers data between adjacent network nodes in a wide area network (WAN) or between nodes on the same local area network (LAN) segment.

The data link layer is concerned with local delivery of frames between nodes on the same level of the network.
Data-link frames do not cross the boundaries of a local area network. Data-link protocols focus on local delivery, addressing, and media arbitration.
The data link layer is used to arbitrate between parties contending for access to a physical medium, without concern for their ultimate destination.
When devices attempt to use a medium simultaneously, frame collisions occur. Data-link protocols specify how devices detect and recover from such collisions, and may provide mechanisms to reduce or prevent them.

Examples of data link protocols are IEEE 802.3 Ethernet and IEEE 802.11 wireless.

Within the semantics of the OSI network architecture, the protocols of the data link layer respond to service requests from the network layer, and perform their function by issuing service requests to the physical layer. That transfer can be reliable or unreliable; many data link protocols do not have acknowledgments of successful frame reception and acceptance, and some data link protocols might not even perform any check for transmission errors. In those cases, higher-level protocols must provide flow control, error checking, acknowledgments, and retransmission.

In IEEE 802 local area networks, the data link layer is described in more detail with media access control (MAC) and logical link control (LLC) sublayers;

Logical link control sublayer


The uppermost sublayer, LLC, multiplexes protocols running at the top of data link layer, and optionally provides flow control, acknowledgment, and error notification. The LLC provides addressing and control of the data link. It specifies which mechanisms are to be used for addressing stations over the transmission medium and for controlling the data exchanged between the originator and recipient machines.


Media access control sublayer


MAC may refer to the sublayer that determines who is allowed to access the media at any one time (e.g. CSMA/CD). Other times it refers to a frame structure delivered based on MAC addresses inside.

There are generally two forms of media access control: distributed and centralized.

The Media Access Control sublayer also performs frame synchronization, which determines the start and end of each frame of data in the transmission bitstream. It entails one of several methods: timing-based detection, character counting, byte stuffing, and bit stuffing.

Services


The services provided by the data link layer are:
  • Encapsulation of network layer data packets into frames
  • Frame synchronization
  • In the logical link control (LLC) sublayer
    • Error control
    • Flow control
    • Data-link-layer flow control is not used in Ethernet, but in modems and wireless networks.
  • In the medium access control (MAC) sublayer
    • access methods
    • CSMA/CD protocols for collision detection, CSMA/CA protocol for collision avoidance
    • Physical addressing (MAC addressing)
    • LAN switching (packet switching)
    • MAC filtering, Spanning Tree Protocol (STP) and Shortest Path Bridging (SPB)
    • Data packet queuing or scheduling
    • Store-and-forward switching or cut-through switching
    • Quality of Service (QoS) control
    • Virtual LANs (VLAN)

Layer 2 Networking


Overview of Layer 2 Networking


A frame is a protocol data unit, the smallest unit of bits on a Layer 2 network.
Not all frames carry user data. The network uses some frames to control the data link itself..

Multiple packet collisions were significantly slowing down the larger LANs.
The IEEE 802.1D-2004 standard defined the concept of transparent bridging (generally called simply bridging).
Segments of a LAN can be linked at the frame level using bridges.


Bridging divides a single physical LAN (now called a single broadcast domain) into two or more virtual LANs, or VLANs.
Each VLAN is a collection of some of the LAN nodes grouped together to form individual broadcast domains.
When VLANs are grouped logically by function or organization, a significant percentage of data traffic stays within the VLAN. This relieves the load on the LAN because all traffic no longer has to be forwarded to all nodes on the LAN.
Packets that are not destined for the local VLAN are the only ones forwarded to other broadcast domains.

This way, bridging and VLANs limit the amount of traffic flowing across the entire LAN by reducing the possible number of collisions and packet retransmissions within VLANs and on the LAN as a whole.

Layer 2 broadcast traffic stays within a local area network (LAN) boundary; known as the broadcast domain. Layer 2 broadcast traffic is sent to the broadcast domain using a MAC address of FF:FF:FF:FF:FF:FF.

Forwarding is the relaying of packets from one network segment to another by nodes in the network.
On a VLAN, a frame whose origin and destination are in the same VLAN are forwarded only within the local VLAN.

The VLAN and Bridge application allows you to configure groups of ports independent of their physical location as a virtual LAN.
Ports or groups of ports in a VLAN are called VLAN members.
VLANs prevent traffic, including broadcasts and multicasts, from being propagated to members of other VLANs.
When you configure a VLAN, Layer 2 address learning is enabled by default.
The VLAN learns unicast MAC addresses to avoid flooding the packets to all the ports in the VLAN.
Each VLAN creates a source MAC entry in its source and destination MAC tables for each source MAC address learned from packets received on the ports that belong to the VLAN.



留言

熱門文章