CCNA | P2: Implementing Ethernet LANs | C2: Analyzing Ethernet LAN Switching

CCNA | P2: Implementing Ethernet LANs | C2: Analyzing Ethernet LAN Switching

Welcome to the exciting world of Ethernet LANs 🎉
In this post, we’ll dive into the basics of Analyzing ethernet LANs including its components and functions. Let’s get started! 🚀

Decoding Ethernet LAN Switching

Ethernet LAN switching is a pivotal element in networking that facilitates effective data transfer across networks. This article will explore the complexities of Ethernet LAN switching, its significance, and its functioning.

Lesson Contents

Understanding Ethernet LAN Switching

Ethernet LAN (Local Area Network) switching is a technique employed in computer networking where a network bridge, utilizing multiple ports, forms an expanded Ethernet network. This procedure enables the division of a network into distinct collision domains. Each port on the switch signifies a separate collision domain and possesses a dedicated bandwidth. This segmentation is crucial as it reduces the chances of packet collision, thereby enhancing the overall efficiency of data transmission across the network.

The Significance of Ethernet LAN Switching

Ethernet LAN switching brings several advantages:
• Collision Domains: Each port on a switch denotes a distinct collision domain, considerably minimizing the likelihood of collisions. This is particularly important in large networks where the probability of packet collisions can be high.
• Dedicated Bandwidth: Every port on a switch offers dedicated bandwidth, enhancing network performance. This means that each connected device gets its own bandwidth, thereby preventing network slowdowns due to shared bandwidth.
• Full-Duplex Communication: Switches facilitate full-duplex communication, permitting simultaneous sending and receiving of data. This is a significant upgrade over half-duplex communication, where data transmission could occur in only one direction at a time.

The Functioning of Ethernet LAN Switching

Ethernet switches function at the data link layer (Layer 2) of the OSI (Open Systems Interconnection) model. They utilize the MAC (Media Access Control) addresses from the headers of incoming frames to construct a MAC address table. This table is employed to ascertain the port to which the frame should be forwarded. This process of forwarding is what enables the switch to direct traffic efficiently across the network, ensuring that data packets reach their intended destination.

Switching & Functions Components

MAC Address Table

Each Ethernet network interface is allocated a unique physical hardware address, known as a MAC address, by the manufacturer. Furthermore, all network devices are assigned a MAC address. The MAC address serves as a unique Layer 2 identifier, facilitating communication between devices within the same or different VLAN. The switch forwards frames based on the MAC address and the assigned port. This table is dynamic and continuously updated, ensuring that the switch can adapt to changes in the network.

Broadcast Frame

Initially, the host dispatches an ARP request packet to ascertain the MAC address of a target server. This happens irrespective of whether the host and server are assigned to the same VLAN or different VLANs (subnets). Layer 2 broadcast frames are generated by switches for the purpose of transmitting an ARP request and are not learned from inbound switch ports. The switch creates a broadcast frame using FFFF.FFFF.FFFF as the destination MAC address. The broadcast frame is forwarded out of all switch ports and eventually reaches the default gateway. The ARP request is then dispatched from the default gateway (router or Layer 3 switch) to ascertain the MAC address of the server. This process is crucial in maintaining the accuracy of the MAC address table.

MAC Address Lookup

All hosts and network devices have MAC addressing that is used for Layer 2 connectivity. Each data message contains a frame with both source and destination MAC address. The host sending data is the source MAC address. The destination MAC address is the Layer 3 next hop. The switch builds a MAC address table with MAC addresses, assigned switch port, and VLAN membership.
Layer 2 network switches do not rewrite the frame header MAC addressing. They examine the source MAC address and destination MAC address. The source MAC address and associated port are added to the MAC address table if it isn’t listed. The switch then does a lookup of the destination MAC address in the MAC address table to make a forwarding decision. The frame is forwarded out the switch port associated with the destination MAC address.

MAC Learning and Aging

MAC address learning occurs when the destination MAC address is not in the MAC address table. MAC learning is triggered as well when the aging time expires for an address. The switch removes MAC address table entries every 300 seconds as a default. Configuring the MAC aging timer to zero disables aging of MAC addresses. The switch will unicast flood a frame to update the MAC address table.

MAC Flooding

The host sends packets with an IP header encapsulated in a frame. The source and destination IP address are required for end-to-end connectivity. Layer 2 switches do not examine or understand IP addressing. They can only examine the Layer 2 frame within a data message for source and destination MAC address.
The following summarizes what happens when a host sends data to a server:
1. The switch adds the source MAC address of the incoming frame if it is not listed in the MAC address table. That is a destination MAC address for any frames destined for that host.
2. The switch does a MAC address table lookup for the server destination MAC address.
3. The switch floods the frame out of all switch ports except the port where the source MAC address was learned. This only occurs when the *destination MAC address is not in the MAC address table.
4. The server with the matching destination MAC address responds to the switch with a frame.
5. The switch then updates the MAC address table with the MAC address of the server.
*The MAC address is already known via the ARP request that the host sent previously. It is included in the Ethernet frame as the destination MAC address. Switches flush MAC table entries every 300 seconds by default. That triggers MAC learning for the destination MAC address and port assigned.
This additional information about MAC Address Lookup further enhances our understanding of how Ethernet LAN switching works. It provides a deeper insight into the mechanisms of MAC addressing, broadcast frames, MAC learning and aging, and MAC flooding. Understanding these concepts is crucial for efficient network design and management. Happy networking!

Step By Step Flow for a Frame Sent from PC1 to PC2 Connected Through Switch1

  1. Arrival of the Frame:
    When a frame reaches a port, the switch identifies the MAC (Media Access Control) address of the device that dispatched the frame. This MAC address, unique to the device, is then added to the switch’s MAC address table, linked with the port number and VLAN (Virtual Local Area Network) ID. This process, known as “learning”, enables the switch to continuously update its MAC address table as it receives frames from various devices. This learning process is fundamental to the operation of the switch, allowing it to keep track of all devices on the network.
  2. Decision-Making Process:
    Having learned the MAC addresses of the connected devices, the switch can decide where to route incoming frames. Upon the arrival of a frame, the switch checks its MAC address table for the destination MAC address. If the address is located, it indicates that the destination device is connected to one of the switch’s ports. The switch then forwards the frame to the appropriate port. If the destination MAC address is not found in the table, the switch resorts to “flooding”, where it forwards the frame to all its ports, excluding the incoming one. This ensures the frame reaches its intended destination, even if the switch is unaware of its location. This decision-making process is what allows the switch to direct traffic efficiently across the network.
  3. Forwarding of the Frame:
    Following the decision-making process, the switch forwards the frame to the destination device using the port identified in the MAC address table. The frame is dispatched only to this specific port, rather than all ports, optimizing data transmission. This is referred to as “unicast” transmission. If the frame was flooded, the destination device would receive it, and the switch would learn its location for future transmissions. This forwarding process is the final step in Ethernet LAN switching, ensuring that data packets reach their intended destination.
    These steps are perpetually repeated, enabling the switch to learn, build its MAC address table, and efficiently forward data across the network. This encapsulates the essence of Ethernet LAN switching - a dynamic process that adapts to the network’s topology and the devices connected to it. By comprehending these steps, you can gain a profound understanding of how data is transmitted across networks.

Common Commands to Analyze Ethernet LAN Switching

Ethernet LAN switching on Cisco switches can be analyzed using specific commands. These commands are instrumental in troubleshooting network issues, monitoring the MAC address table, and verifying the interface settings.

1. show mac address-table dynamic

This command reveals all the learned MAC addresses in the switch’s MAC address table. The MAC address table is a database that associates MAC addresses with switch ports and VLANs. The switch utilizes this table to direct frames to the appropriate destination port based on the destination MAC address.

Example:

# show mac address-table dynamic

VLAN   MAC Address      Type        Ports
----   -----------      --------    -----
   1   0000.0c07.ac01   DYNAMIC     Gi0/1
   1   0000.0c07.ac02   DYNAMIC     Gi0/2
   1   0000.0c07.ac03   DYNAMIC     Gi0/3
   1   0000.0c07.ac04   DYNAMIC     Gi0/4
  10   0009.7c05.4a01   DYNAMIC     Gi0/5
  10   0009.7c05.4a02   DYNAMIC     Gi0/6
  10   0009.7c05.4a03   DYNAMIC     Gi0/7
  10   0009.7c05.4a04   DYNAMIC     Gi0/8

2. show mac address-table dynamic address AAAA.BBBB.CCCC

This command shows the source port for a specified MAC address in the MAC address table. You need to provide the MAC address in the format of three dot-separated hex quartets, not the six colon-separated hex pairs typically shown in other operating systems.

Example:

# show mac address-table dynamic address 0009.7c05.4a03

          Mac Address Table
-------------------------------------------

VLAN    MAC Address       Type      Ports
----    -----------       --------  -----
10      0009.7c05.4a03    DYNAMIC   Gi0/7

3. show mac address-table dynamic interface Gi0/0

This command reveals all the learned MAC addresses on a specific switch port in the MAC address table. You need to specify the interface name after the keyword interface.

Example:

# show mac address-table dynamic interface Gi0/5

          Mac Address Table
-------------------------------------------

VLAN    MAC Address       Type      Ports
----    -----------       --------  -----
10      0009.7c05.4a01    DYNAMIC   Gi0/5

4. show mac address-table dynamic vlan 1

This command displays all the MAC addresses learned in a specific VLAN in the MAC address table. You need to specify the VLAN number after the keyword vlan.

Example:

# show mac address-table dynamic vlan 1

          Mac Address Table
-------------------------------------------

VLAN    MAC Address       Type      Ports
----    -----------       --------  -----
1       0000.0c07.ac01    DYNAMIC   Gi0/1
1       0000.0c07.ac02    DYNAMIC   Gi0/2
1       0000.0c07.ac03    DYNAMIC   Gi0/3
1       0000.0c07.ac04    DYNAMIC   Gi0/4

5. show mac address-table aging-time [vlan n]

This command shows the global or VLAN-specific aging timer setting for the MAC address table entries. The aging timer is a mechanism that removes old or unused entries from the MAC address table after a certain period of time. This helps to keep the table updated and prevent it from being filled with stale entries.

Example:

# show mac address-table aging-time

Global Aging Time:    300

6. show mac address-table count

This command shows the used and available space in the MAC address table. The MAC address table has a limited size and can store a maximum number of entries. If the table is full, the switch cannot learn any new MAC addresses and may drop frames or flood them to all ports.

Example:

# show mac address-table count

Mac Address Table
-------------------------------------------

Total Mac Addresses for this criterion:

7. show interfaces [ifname] status

This command shows the status (connected/notconnect), VLAN, duplex, speed, and type of all interfaces on the switch. If you specify an interface name after the keyword status, the output is limited to that interface.

Example:

# show interfaces status

Port      Name               Status       Vlan       Duplex  Speed Type
Gi0/1                        connected    1          a-full a-1000 10/100/1000BaseTX
Gi0/2                        connected    1          a-full a-1000 10/100/1000BaseTX
Gi0/3                        connected    1          a-full a-1000 10/100/1000BaseTX
Gi0/4                        connected    1          a-full a-1000 10/100/1000BaseTX
Gi0/5                        connected    10         a-full a-1000 10/100/1000BaseTX
Gi0/6                        connected    10         a-full a-1000 10/100/1000BaseTX
Gi0/7                        connected    10         a-full a-1000 10/100/1000BaseTX
Gi0/8                        connected    10         a-full a-1000 10/100/1000BaseTX

This output tells us that all eight ports are connected, their VLAN assignments, their duplex and speed settings (auto-negotiated), and their interface types. This command is particularly useful for quickly checking the status of all interfaces on a switch or a specific interface. It provides a snapshot of the current state of the interfaces, which can help in troubleshooting network issues.

8. show interfaces [ifname]

This command shows detailed status information about a specific interface on the switch. You need to specify the interface name after the keyword interfaces.

Example:

# show interfaces Gi0/5

GigabitEthernet0/5 is up, line protocol is up (connected)
Hardware is Gigabit Ethernet, address is c201.1d05.4a01 (bia c201.1d05.4a01)
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, Auto-speed, media type is 10/100/1000BaseTX
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 20000 bits/sec, 20 packets/sec
5 minute output rate 20000 bits/sec, 20 packets/sec
L2 Switched: ucast: 9 pkt, 900 bytes - mcast: 3 pkt, 180 bytes
L3 in Switched: ucast: 6 pkt, 600 bytes - mcast: 3 pkt, 180 bytes mcast
L3 out Switched: ucast: 6 pkt, 600 bytes mcast: 3 pkt, 180 bytes
     RX
       ...

This command provides a wealth of information about the interface, including its status, hardware type, MAC address, MTU size, bandwidth, delay, reliability, load, encapsulation type, keepalive setting, duplex setting, speed, media type, flow control setting, ARP type, ARP timeout, last input time, last output time, last output hang time, last clearing of “show interface” counters, input queue size, maximum input queue size, input queue drops, input queue flushes, total output drops, queueing strategy, output queue size, maximum output queue size, 5-minute input rate, 5-minute output rate, L2 switched unicast packets, L2 switched unicast bytes, L2 switched multicast packets, L2 switched multicast bytes, L3 in switched unicast packets, L3 in switched unicast bytes, L3 in switched multicast packets, L3 in switched multicast bytes, L3 out switched unicast packets, L3 out switched unicast bytes, L3 out switched multicast packets, and L3 out switched multicast bytes.

Conclusion

Ethernet LAN switching is a fundamental aspect of networking that ensures efficient and reliable data transmission. By understanding how it works, network administrators can better design, manage, and troubleshoot their networks. Remember, the key to efficient Ethernet LAN switching lies in the proper configuration and management of switches within the network. Happy networking!

Kunal Patel | Contact me
description

Kunal Patel

Working as Assistant Manager IT my curiosity led me to learn technologies beyond networking, including cloud computing, Python, APIs, Rust, Dart/Flutter, Linux, and Virtualization.
Mumbai, India