1 of 32

Module 6: Data Link Layer & Module 7: Ethernet Switching

CCNA Routing and Switching:

Introduction to Networks v7.0 (ITN)

This Slides is prepared by:

Eng. Rawan Aljamal

​

Cisco Certified CCNA Instructor Trainer

​

1

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

2 of 32

The Data Link Layer

  • The Data Link layer is responsible for communications between network interface cards (NICs) in the end-devices.
  • It allows upper layer protocols to access the physical layer media and encapsulates Layer 3 packets (IPv4 and IPv6) into Layer 2 Frames.
  • It also performs error detection and rejects corrupts frames.
  • Ethernet operates in the data link layer and the physical layer.
  • It is a family of networking technologies defined in the IEEE 802.2 and 802.3 standards.

​

​

​

2

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

3 of 32

IEEE 802 LAN/MAN Data Link Sublayers

  • The Data Link Layer consists of two sublayers: Logical Link Control (LLC) and Media Access Control (MAC).

​

      • The LLC sublayer (IEEE 802.2) provides communication between the networking software at the upper layers (e.g., IP) and the device hardware at the lower layers (MAC & hardware). It allows upper layers to send data in the same way regardless of the underlying network type.

​

      • LLC sublayer responsibilities:
            • Protocol identification: Determines if data is IPv4, ARP, etc.
            • Flow control: Prevents sender from overwhelming receiver.
            • Error control: Detecting lost or corrupted frames and managing retransmissions.

3

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

4 of 32

IEEE 802 LAN/MAN Data Link Sublayers

      • The MAC sublayer (IEEE 802.3, 802.11, or 802.15) is responsible for data encapsulation, addressing, media access control, frame synchronization (Delimiting تحديد) and Error detection.

​

      • IEEE 802 standards are specific to the network type, such as IEEE 802.3 Ethernet, IEEE 802.11 WLAN, and IEEE 802.15 WPAN.

​

      • MAC sublayer responsibilities:
            • Framing: Encapsulates data into frames.
            • Physical addressing: Adding source and destination MAC addresses for transporting the Layer 2 frame between devices.
            • Media access control: Decides when a device can transmit using mechanisms like CSMA/CD (Ethernet), CSMA/CA (Wi-Fi).
            • Error detection: The MAC sublayer includes a trailer used to detect transmission errors.

4

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

5 of 32

Physical and Logical Topologies

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 – Shows device locations (room, shelf, ..etc), physical connections (wired, wireless), and how devices are interconnected (bus, ring, ..etc).
    • Logical topology – Identifies the virtual connections between devices using addressing schemes (such as MAC and IP addresses) and describes how data flows in a network. In other words, it explains how devices send, receive, and share data, including access control methods and transmission types (unicast, broadcast, etc.).

​

The data link layer "sees" the logical topology of a network when controlling data access to the media. Logical topology influences the type of network framing and media access control used.

5

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

6 of 32

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 point-to-point links.
    • Mesh – provides high availability but requires every end system to be connected to every other end system.

Hub and spoke

Point-to-point

Mesh

6

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

7 of 32

Point-to-Point WAN Topology

  • Physical point-to-point topologies directly connect two nodes.
  • According to the fact that 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.

7

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

8 of 32

LAN Topologies

End devices on LANs are typically interconnected using a star or extended star topology.

​

Star and extended star topologies are easy to install, very scalable, and easy to troubleshoot.

​

Early Ethernet and Legacy Token Ring technologies provide two additional topologies:

    • Bus – All end devices chained together and terminated on each end.
    • Ring – Each end device is connected to its respective neighbors to form a ring.

8

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

9 of 32

Half-duplex communication

    • Only allows one device to send or receive at a time on a shared medium.
    • Used on WLANs, legacy bus topologies, and networks with hubs.

​

Full-duplex communication

    • Allows both devices to simultaneously transmit and receive on a shared medium.
    • Ethernet switches operate in full-duplex mode.

​

Auto-negotiation التفاوض الذاتي is an optional function that enables two devices to automatically negotiate the best speed and duplex capabilities. It is found on most Ethernet switches and NICs.

Half and Full Duplex Communication

9

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

10 of 32

Duplex and Speed Settings

  • Duplex mismatch is one of the most common causes of performance issues on Ethernet links.
  • It occurs when one port on the link operates at half-duplex while the other port operates at full-duplex.
  • This can occur when one or both ports on a link are reset, and the autonegotiation process does not result in both link partners having the same configuration.
  • It also can occur when users reconfigure one side of a link and forget to reconfigure the other. Both sides of a link should have autonegotiation on, or both sides should have it off. Best practice is to configure both Ethernet switch ports as full-duplex.

10

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

11 of 32

  • 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.

​

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 (turn) on the medium.
    • Used on legacy networks such as Token Ring.

Access Control Methods

11

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

12 of 32

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

    • 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.

​

CSMA/CD collision detection process:

      • Devices transmitting simultaneously will result in a signal collision on the shared media.
      • Devices detect the collision.
      • Devices wait a random period of time and retransmit data.

​

​

​

​

​

​

Contention-Based Access – CSMA/CD

12

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

13 of 32

CSMA/CA (Carrier Sense Multiple Access/Collison Avoidance)

    • Used by IEEE 802.11 WLANs.
    • 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.

​

CSMA/CA collision avoidance process:

    • When transmitting, devices also include the time duration needed for the transmission.
    • Other devices on the shared medium receive the time duration information and know how long the medium will be unavailable.

Contention-Based Access – CSMA/CA

13

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

14 of 32

Data Link Frame

14

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

14

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

14

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

15 of 32

Encapsulation in the Ethernet MAC Sublayer

  • The MAC sublayer in the Ethernet standard is responsible for data encapsulation and accessing the media.

​

  • There is no one frame structure that meets the needs of all data transportation across all types of media. Depending on the environment, the amount of control information needed in the frame varies to match the access control requirements of the media and logical topology.

​

IEEE 802.3 data encapsulation includes the following:

      • Ethernet frame - This is the internal structure of the Ethernet frame.
      • Ethernet addressing - The Ethernet frame includes both a source and destination MAC address to deliver the Ethernet frame from Ethernet NIC to Ethernet NIC on the same LAN.
      • Ethernet error detection - The Ethernet frame includes a trailer containing a Frame Check Sequence (FCS) field used for error detection.

15

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

16 of 32

Frame Fields

Data is encapsulated by the data link layer with a header and a trailer to form a frame.

    • The fields of the header and trailer vary according to data link layer protocol.

​

    • The amount of control information carried within a frame varies according to access control information and logical topology.

​

Field

Description

Frame Start and Stop

Identifies beginning and end of a frame

Addressing

Indicates source and destination nodes

Type

Identifies encapsulated Layer 3 (network layer) protocol

Control

Identifies flow control services

Data

Contains the frame payload

Error Detection

Used to determine transmission errors

16

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

17 of 32

Layer 2 Addresses

  • Also referred to as a physical address.
  • Contained in the frame header.
  • Used only for local delivery of a frame on the link.
  • Updated by each device that forwards the frame.

​

17

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

18 of 32

Ethernet MAC Address

  • MAC addressing provides a method for device identification at the data link layer of the OSI model.
  • An Ethernet MAC address is a 48-bit (6 bytes) address expressed using 12 hexadecimal digits.
  • All MAC addresses must be unique to the Ethernet device or Ethernet interface.

​

  • An Ethernet MAC address consists of a 6-digit hexadecimal digits known as organizationally unique identifier (OUI) followed by a 6-digit hexadecimal vendor-assigned value.

​

  • To ensure uniqueness, all vendors that sell Ethernet devices must register with the IEEE to obtain a unique 6 hexadecimal (i.e., 24-bit or 3-byte) code called the organizationally unique identifier (OUI).
  • The vendor-assigned value is a unique number assigned by the manufacturer to each device, ensuring that no two devices from the same vendor have the same MAC address.

​

​

18

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

19 of 32

Ethernet Frame Fields

  • In old and modern Ethernet, the minimum frame size is 64 bytes and the maximum is 1518 bytes. The preamble field is not included when describing the size of the frame.
  • Any frame less than 64 bytes in length is considered a “runt frame” and is automatically discarded. If the runt frame is caused by a collision, it is called “collision fragment”.
  • Frames with more than 1518 bytes are considered “baby giant frames” or “jumbo”. The name depends on how many bytes exceed the standard maximum size.
  • If the size of a received frame is less than the minimum, or greater than the maximum, the receiving device drops the frame. Dropped frames are likely to be the result of collisions or other unwanted signals (noise/interference).
  • Jumbo frames are usually supported by Gigabit Ethernet and higher-speed networks, depending on device support. However, they must be enabled and consistently supported across all devices in the communication path to function correctly.

​

19

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

20 of 32

Field

Bytes

Description

Preamble

7

Bit patterns that synchronize timing.

SFD (Start Frame Delimiter)

1

Bit pattern that signals the start of a frame.

Destination MAC

6

The unique physical address of the receiving NIC.

Source MAC

6

The unique physical address of the sending NIC.

Type / Length

2

Indicates the L3 protocol (e.g., IPv4) or the size of the data payload.

Data (Payload)

46–1500

The encapsulated packet. Includes padding if the data is under 46 bytes.

FCS (Frame Check Sequence)

4

A CRC value calculated from the frame’s data and used to check for bit errors.

Ethernet Frame Fields

20

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

21 of 32

Frame Processing

  • Any device that is the source or destination of an Ethernet frame, will have an Ethernet NIC and a MAC address.
  • When a device sends a message to an Ethernet network, the Ethernet header include a Source MAC address and a Destination MAC address.

​

  • In bus topology, when a NIC receives an Ethernet frame, it examines the destination MAC address to see if it matches its physical MAC address copied to RAM. If there is no match, the device discards the frame. If there is a match, it passes the frame up the OSI layers.

​

  • In Ethernet, different MAC addresses are used for Layer 2: unicast, multicast, and broadcast communications.

​

.

21

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

22 of 32

Unicast MAC Address

  • A unicast MAC address is the unique address that is used when a frame is sent from a single transmitting device to a single destination device.

​

  • The process that a source host uses to determine the destination MAC address associated with an IPv4 address is known as Address Resolution Protocol (ARP).

​

  • The process that a source host uses to determine the destination MAC address associated with an IPv6 address is known as Neighbor Discovery (ND).

​

22

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

23 of 32

Broadcast MAC Address

An Ethernet broadcast frame is received and processed by every device on the Ethernet LAN.

The features of an Ethernet broadcast are as follows:

  • It has a destination MAC address of FF-FF-FF-FF-FF-FF in hexadecimal (48 ones in binary).

​

  • It is flooded out all Ethernet switch ports except the incoming port. It is not forwarded by a router.

​

  • If the encapsulated data is an IPv4 broadcast packet, then the destination IPv4 address has all ones (1s). In other words, the broadcast address is 255.255.255.255, which represents sending a message to all hosts on a local network.

23

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

24 of 32

Multicast MAC Address

An Ethernet multicast frame is received and processed by a group of devices that belong to the same multicast group.

  • A frame has a destination MAC address of 01-00-5E when the encapsulated data is an IPv4 multicast packet.

​

  • It is not forwarded by a router, unless the router is configured to route multicast packets.

​

  • Because multicast addresses represent a group of addresses (sometimes called a host group), they can only be used as the destination of a packet.

​

  • As with the unicast and broadcast addresses, the multicast IP address requires a corresponding multicast MAC address. The range of IPv4 multicast addresses is 224.0.0.0 to 239.255.255.255.

24

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

25 of 32

The MAC Address Table

25

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

25

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

25

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

26 of 32

Switch Fundamentals

  • A Layer 2 Ethernet switch uses Layer 2 MAC addresses to make forwarding decisions.

​

  • It is completely unaware of the data (protocol) being carried in the data portion of the frame, such as an IPv4 packet, an ARP message, or an IPv6 ND packet.

​

  • An Ethernet switch examines its MAC address table to make a forwarding decision for each frame, unlike legacy Ethernet hubs that repeat bits out all ports except the incoming port.

​

  • When a switch is turned on, the MAC address table is empty.

​

  • The MAC address table is sometimes referred to as a content addressable memory (CAM) table.

​

26

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

27 of 32

Switch Learning and Forwarding

Examine the Source MAC Address (Learn)

  • Every frame that enters a switch is checked for new information to learn.

​

  • It does this by examining the source MAC address of the frame and the port number where the frame entered the switch:
          • If the source MAC address does not exist, it is added to the table along with the incoming port number.

​

          • If the source MAC address exist, the switch updates the refresh timer for that entry. By default, most Ethernet switches keep an entry in the table for 5 minutes.

​

          • If the source MAC address exist in the table but on a different port, the switch treats this as a new entry. The entry is replaced using the same MAC address but with the more current port number.

27

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

28 of 32

Switch Learning and Forwarding

Find the Destination MAC Address (Forward)

  • If the destination MAC address is a unicast address, the switch will look for a match between the destination MAC address of the frame and an entry in its MAC address table.
          • If the destination MAC address is in the table, it will forward/ filter the frame out that specified single port. This is called known unicast.
          • If the destination MAC address is not in the table, the switch will forward the frame out all ports except the incoming port. This is called unknown unicast.
  • If the destination MAC address is a broadcast or a multicast, the frame is flooded out all ports except the incoming port.

​

​

28

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

29 of 32

Frame Forwarding Methods on Cisco Switches

Switches use one of the following forwarding methods for switching data between network ports:

  • Store-and-forward switching
  • Switch receives the entire frame and computes the CRC. If the CRC is valid, the complete the process of MAC address table lookup and forward the frame.
  • When an error is detected in a frame, the switch discards the frame to reduces the amount of bandwidth consumed by corrupt data.
  • This method is required for quality of service (QoS) analysis on converged networks where frame classification for traffic prioritization is necessary.

​

  • Cut-through switching
  • Switch forwards the frame before it is entirely received.
  • At a minimum, the destination MAC address is read before the frame can be forwarded.
  • Generally, the switch does not perform error checking on the frame.
  • There are two variants of cut-through switching: fast-forward switching, and fragment-free switching.

29

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

30 of 32

Cut-Through Switching Variants

    • Fast-forward switching
    • Fast-forward switching is the typical cut-through method of switching.
    • Offers the lowest level of latency by immediately forwarding a packet after reading the destination MAC address (The first 6 bytes only).
    • Packets forwarded using this method are relayed despite errors.

​

    • Fragment-free switching
    • A compromise method between the high latency and high integrity of store-and-forward switching and the low latency and reduced integrity of fast-forward switching.
    • The switch stores and performs an error check on the first 64 bytes of the frame before forwarding.
    • Because most network errors and collisions occur during the first 64 bytes, this ensures that a collision has not occurred before forwarding the frame.

30

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

31 of 32

Memory Buffering Techniques on Switches

An Ethernet switch may use a buffering technique to store frames before forwarding them or when the destination port is busy because of congestion.

​

​

​

​

​

​

​

​

​

Method

Description

Port-based memory

  • Frames are stored in buffers that are linked to specific incoming and outgoing ports.
  • A frame is transmitted to the outgoing port only when all the frames ahead in the queue have been successfully transmitted.
  • It is possible for a single frame to delay the transmission of all the frames in memory because of a busy destination port.

Shared memory

  • Deposits all frames into a common memory buffer shared by all switch ports and the amount of buffer memory required by a port is dynamically allocated.
  • Shared memory buffering results in larger number of frames that can be transmitted without being dropped. This is due to dynamic buffer size allocation.

31

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential

32 of 32

32

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential