01-01 Ethernet Switching
01-01 Ethernet Switching
Switches
Configuration Guide - Ethernet Switching 1 Ethernet Switching
1 Ethernet Switching
NOTE
To distinguish Ethernet frames of the two types, Ethernet frames defined in RFC 894 are
called Ethernet_II frames and Ethernet frames defined in RFC 1042 IEEE 802.3 are called
frames in this document.
History
In 1972, when Robert Metcalfe (father of Ethernet) was hired by Xerox, his first
job was to connect computers in Xerox's Palo Alto Research Center (PARC) to the
As Ethernet technology develops rapidly, Ethernet has become the most widely
used LAN technology and replaced most of other LAN standards, such as token
ring, fiber distributed data interface (FDDI), and attached resource computer
network (ARCNET). After rapid development of 100M Ethernet in the 20th
century, gigabit Ethernet and even 10G Ethernet are now expanding their
applications as promoted by international standardization organizations and
industry-leading enterprises.
Purpose
Ethernet is a universal communication protocol standard used for local area
networks (LANs). This standard defines the cable type and signal processing
method used for LANs.
Ethernet networks are broadcast networks established based on the Carrier Sense
Multiple Access with Collision Detection (CSMA/CD) mechanism. Collisions restrict
Ethernet performance. Early Ethernet devices such as hubs work at the physical
layer, and cannot confine collisions to a particular scope. This restricts network
performance improvement. Working at the data link layer, switches are able to
confine collisions to a particular scope. Switches help improve Ethernet
performance and have replaced hubs as mainstream Ethernet devices. However,
switches do not restrict broadcast traffic on the Ethernet. This affects Ethernet
performance. Dividing a LAN into virtual local area networks (VLANs) on switches
or using Layer 3 switches can solve this problem.
Ethernet uses passive medium and transmits data in broadcast mode. It defines
protocols used on the physical layer and data link layer, interfaces between the
two layers, and interfaces between the data link layer and upper layers.
Physical Layer
The physical layer determines basic physical attributes of Ethernet, including data
coding, time scale, and electrical frequency.
The physical layer is the lowest layer in the Open Systems Interconnection (OSI)
reference model and is closest to the physical medium (communication channel)
that transmits data. Data is transmitted on the physical layer in binary bits (0 or
1). Transmission of bits depends on transmission devices and physical media, but
the physical layer does not refer to a specific physical device or a physical media.
Actually, the physical layer is located above a physical medium and provides the
data link layer with physical connections to transmit original bit streams.
Network
layer
LLC layer
Data link
layer MA
Physica layer
C
l
layer
The following sections describe concepts involved in the physical layer and data
link layer.
● 10BASE-5
● 10BASE-T
● 10BASE-F
● 100BASE-T4
● 100BASE-TX
● 100BASE-FX
● 1000BASE-SX
● 1000BASE-LX
● 1000BASE-TX
● 10GBASE-T
● 10GBASE-LR
● 10GBASE-SR
In the preceding standards, 10, 100, 1000 and 10G stand for transmission rates,
and BASE represents baseband.
● 10M Ethernet cable standards
Table 1-1 lists the 10M Ethernet cable standards defined in IEEE 802.3.
NOTE
Coaxial cables have a fatal defect: Devices are connected in series and therefore a
single-point failure can cause the breakdown of the entire network. As the physical
standards of coaxial cables, 10BASE-2 and 10BASE-5 have fallen into disuse.
● 100M Ethernet cable standards
100M Ethernet is also called Fast Ethernet (FE). Compared with 10M Ethernet,
100M Ethernet has a faster transmission rate at the physical layer, but they
have no difference at the data link layer.
Table 1-2 lists the 100M Ethernet cable standards.
Both 10Base-T and 100Base-TX apply to Category 5 twisted pair cables. They
have different transmission rates. The 10Base-T transmits data at 10 Mbit/s,
whereas the 100Base-TX transmits data at 100 Mbit/s.
The 100Base-T4 is rarely used now.
● Gigabit Ethernet cable standards
Gigabit Ethernet is developed on the basis of the Ethernet standard defined in
IEEE 802.3. Based on the Ethernet protocol, Gigabit Ethernet increases the
transmission rate to 10 times the FE transmission rate, reaching 1 Gbit/s.
Table 1-3 lists the Gigabit Ethernet cable standards.
Gigabit Ethernet technology can upgrade the existing Fast Ethernet from 100
Mbit/s to 1000 Mbit/s.
The physical layer of Gigabit Ethernet uses 8B10B coding. In traditional
Ethernet technology, the data link layer delivers 8-bit data sets to its physical
layer. After processing the data sets, the physical layer sends them to the data
link layer. The data sets are still 8 bits after processing.
The situation is different on the Gigabit Ethernet of optical fibers. The
physical layer maps the 8-bit data sets transmitted from the data link layer to
10-bit data sets and then sends them out.
● 10G Ethernet cable standards
1.2.3 CSMA/CD
● Definition of CSMA/CD
Ethernet was originally designed to connect computers and other digital
devices on a shared physical line. The computers and digital devices can
access the shared line only in half-duplex mode. Therefore, a mechanism of
collision detection and avoidance is required to prevent multiple devices from
contending for the line. This mechanism is called the carrier Sense Multiple
Access with Collision Detection (CSMA/CD).
The concept of CSMA/CD is described as follows:
– Carrier sense (CS)
Before transmitting data, a station checks whether the line is idle to
reduce chances of collision.
– Multiple access (MA)
Data sent by a station can be received by multiple stations.
– Collision detection (CD)
If two stations transmit electrical signals at the same time, the voltage
amplitude doubles the normal amplitude as signals of the two stations
accumulate. The situation results in collision.
The stations stop transmission after detecting the collision, and resume
the transmission after a random delay.
● CSMA/CD working process
CSMA/CD works as follows:
a. A station continuously detects whether the shared line is idle.
▪ If the line is in use, the station waits until the line becomes idle.
b. If two stations send data at the same time, a collision occurs on the line,
and signals on the line become unstable.
c. After detecting the instability, the station immediately stops sending
data.
d. The station sends a series of disturbing pulses. After a period of time, the
station resumes the data transmission.
The station sends disturbing pulses to inform other stations, especially
the station that sends data at the same time, that a collision occurred on
the line.
After detecting a collision, the station waits for a random period of time,
and then resumes the data transmission.
The use of minimum frame length can prevent the following situation: station A
finishes sending the last bit, but the first bit does not arrive at station B, which is
far from station A. Station B considers that the line is idle and begins to send data,
leading to a collision.
The upper layer protocol must ensure that the Data field of a packet contains at
least 46 bytes, so that the total length of the Data field, the 14-byte Ethernet
frame header, and the 4-byte check code at the frame tail can reach the minimum
frame length, as shown in Figure 1-2. If the Data field is less than 46 bytes, the
upper layer must pad the field to 46 bytes.
● Half-duplex mode
The half-duplex mode has the following features:
– Data can only be sent or received at any time.
– The CSMA/CD mechanism is used.
– The maximum transmission distance is limited.
Hubs work in half-duplex mode.
● Full-duplex mode
After Layer 2 switches replace hubs, the shared Ethernet changes to the
switched Ethernet, and the half-duplex mode is replaced by the full-duplex
mode. As a result, the transmission rate increases greatly, and the maximum
throughput doubles the transmission rate.
The full-duplex mode solves the problem of collisions and eliminates the need
for the CSMA/CD mechanism.
The full-duplex mode has the following features:
– Data can be sent and received at the same time.
– The maximum throughput doubles the transmission rate.
– This mode does not have the limitation on the transmission distance.
All network cards, Layer 2 devices (except hubs), and Layer 3 devices
produced support the full-duplex mode.
The following hardware components are required to realize the full-duplex
mode:
– Full-duplex network cards and chips
– Physical media with separate data transmission and receiving channels
– Point-to-point connection
Broadcast Domain
Packets are broadcast in a collision domain, which results in a low bandwidth
efficiency and degrades packet processing performance of network devices.
Therefore, broadcasting of packets must be restricted. For example, the ARP
protocol sends broadcast packets to obtain MAC addresses mapping specified IP
addresses. The all 1s MAC address FFFF-FFFF-FFFF is the broadcast MAC address.
All nodes must process data frames with this MAC address as the destination MAC
address. A broadcast domain is a group of nodes, among which broadcast packet
from one node can reach all the other nodes. A network bridge forwards unicast
packets according to its MAC address table and forwards broadcast packets to all
its ports. Therefore, nodes connected to all ports of a bridge belong to a broadcast
domain, but each port belongs to a different collision domain.
c. The MAC sub-layer adds the destination MAC address and source MAC
address to the data, calculates the length of the data frame, and forms
an Ethernet frame.
d. The Ethernet frame is sent to the peer according to the destination MAC
address.
e. The peer compares the destination MAC address with entries in the MAC
address table.
Field Description
Type The 2-byte Type field identifies the upper layer protocol of
the Data field. The receiver can know the meaning of the
Data field according to the Type field.
Ethernet allows multiple protocols to coexist on a LAN. The
hexadecimal values in the Type field of an Ethernet_II frame
stand for different protocols.
● Frames with the Type field value 0800 are IP frames.
● Frames with the Type field value 0806 are Address
Resolution Protocol (ARP) frames.
● Frames with the Type field value 8035 are Reverse
Address Resolution Protocol (RARP) frames.
● Frames with the Type field value 8137 are Internetwork
Packet Exchange (IPx) and Sequenced Packet Exchange
(SPx) frames.
As shown in Figure 1-5, the format of an IEEE 802.3 frame is similar to that
of an Ethernet_II frame except that the Type field is changed to the Length
field in an IEEE 802.3 frame, and the LLC field and the Sub-Network Access
Protocol (SNAP) field occupy 8 bytes of the Data field.
Length The Length field specifies the number of bytes in the Data
field.
SNAP The SNAP field consists of the Org Code field and the Type
field. Three bytes in the Org Code field are all 0s. The Type
field functions the same as the Type field in Ethernet_II
frames.
NOTE
For description about other fields, see the description of Ethernet_II frames.
Based on the values of DSAP and SSAP, IEEE 802.3 frames can be divided into
the following types:
– If DSAP and SSAP are both 0xff, the IEEE 802.3 frame changes to a
Netware-Ethernet frame that carries NetWare data.
– If DSAP and SSAP are both 0xaa, the IEEE 802.3 frame changes to an
Ethernet_SNAP frame.
Ethernet_SNAP frames can be encapsulated with data of multiple
protocols. The SNAP can be considered as an extension of the Ethernet
protocol. SNAP allows vendors to define their own Ethernet transmission
protocols.
The Ethernet_SNAP standard is defined by IEEE 802.1 to guarantee
interoperability between IEEE 802.3 LANs and Ethernet networks.
– Other values of DSAP and SSAP indicate IEEE 802.3 frames.
The following is an example that describes the applications of SSAP and DSAP.
Assume that terminals A and B use connection-oriented services. Data is
transmitted in the following process:
A Layer 2 device parses and learns source MAC addresses of Ethernet frames and
maintains a mapping table of MAC addresses and ports. This table is called a MAC
address table. When receiving an Ethernet frame, the device searches for the
destination MAC address of the frame in the MAC table to determine through
which port to forward this frame.
1. When the Layer 2 device receives an Ethernet frame, it records the source
MAC address and the inbound port of the frame in the MAC address table to
guide Layer 2 forwarding. If the same MAC address entry exists in the MAC
address table, the device resets the aging time of the entry. An aging
mechanism is used to maintain entries in the MAC address table. Entries that
are not updated within the aging time are deleted from the MAC address
table.
2. The device looks up the MAC address table based on the destination MAC
address of the Ethernet frame. If no matching entry is found, the device
forwards the frame to all its ports except the port from which the frame is
received. If the destination MAC address of the frame is a broadcast address,
the device forwards the frame to all its ports except the port from which the
frame is received. If a matching entry is found in the MAC address table, the
device forwards the frame to the port specified in the entry.
PC A Port 2
Port 1
Port 3
PC C
MAC C MAC A Type Data MA
CC
MA
CA
Typ
e Dat
a
Although Layer 2 devices can isolate collision domains, they cannot isolate
broadcast domains. As described in the Layer 2 forwarding process, broadcast
packets and packets that do not match nay entry in the MAC address table are
forwarded to all ports (except the port from which the frame is received). Packet
broadcasting consumes much bandwidth on network links and brings security
issues. Routers can isolate broadcast domains, but high costs and low forwarding
performance of routers limit the application of routers in Layer 2 forwarding. The
virtual local area network (VLAN) technology is introduced to solve this problem
in Layer 2 switching.
Figure 1-7 shows the MAC addresses, IP addresses, and gateway addresses of the
hosts, MAC address of the Layer 3 switch, and IP addresses of Layer 3 interfaces
configured in VLANs on the Layer 3 switch. The process of a ping from PC A to PC
B is as follows (the Layer 3 switch has not created any MAC address entry):
1. PC A finds that the destination IP address 10.2.1.2 (PC B) is on a different
network segment than its own IP address. Therefore, PC A sends an ARP
request to request for the MAC address mapping the gateway address
10.1.1.1.
2. L3 Switch receives the ARP request from PC A and finds that 10.1.1.1 is the IP
address of its own Layer 3 interface. L3 switch then sends an ARP reply to PC
A. The ARP reply carries the MAC address of its Layer 3 interface (MAC
Switch). In addition, L3 switch adds the mapping between the IP address and
MAC address of PC A (10.1.1.2 and MAC A) to its ARP table. The IP address
and MAC address of PC A are carried in the ARP request sent from PC A. And
L3 Switch adds the mapping between the source MAC address and VLAN ID
of the packet and outbound port to its MAC table.
3. After PC A receives the ARP reply from the gateway (L3 Switch), it sends an
ICMP request packet. In the ICMP request packet, the destination MAC
address (DMAC) is MAC Switch; the source MAC address (SMAC) is MAC A;
the source IP address (SIP) is 10.1.1.2; the destination IP address (DIP) is
10.2.1.2.
4. When L3 Switch receives the ICMP request packet, it looks up the MAC
address table according to the destination MAC address and VLAN ID of the
packet and finds the entry with the MAC address of its Layer 3 interface, the
packet needs to be forwarded at Layer 3. Then L3 Switch looks up Layer 3
forwarding entries of the switching chip to guide Layer 3 forwarding.
5. The switching chip loops up Layer 3 forwarding entries according to the
destination IP address of the packet. The entry lookup fails because no entry
has been created. The switching chip then sends the packet to the CPU for
software processing.
6. The CPU looks up the software routing table according to the destination IP
address of the packet and finds a directly connected network segment,
network segment of PC B. Then the CPU looks up its ARP table, and the
lookup still fails. Therefore, L3 Switch sends an ARP request to all ports in
VLAN 3 (network segment of PC B), to request the MAC address mapping IP
address 10.2.1.2.
7. After PC B receives the ARP request from L3 Switch, it checks the ARP request
and finds that 10.2.1.2 is its own IP address. PC B then sends an ARP reply
carrying its MAC address (MAC B). Meanwhile, PC B records the mapping
between the IP address and MAC address of L3 Switch (10.2.1.1 and MAC
Switch) in its ARP table.
8. When L3 Switch receives the ARP reply from PC B, it records the mapping
between the IP address and MAC address of PC B (10.2.1.2 and MAC B) in its
ARP table. L3 Switch changes the destination MAC address in the ICMP
request packet sent from PC A to MAC B and changes the source MAC
address to its own MAC address (MAC Switch), and then sends the ICMP
request to PC B. The Layer 3 forwarding entry containing the IP address and
MAC address of PC B, outbound VLAN ID, and outbound port is also added to
the Layer 3 forwarding of the switching chip. Subsequent packets sent from
PC A to PC B are directly forwarded according to this hardware entry.
9. When PC B receives the ICMP request packet from L3 Switch, it sends an ICMP
reply packet to PC A. The forwarding process for the ICMP reply packet is
similar to that for the ICMP request packet except that the ICMP reply packet
is directly forwarded to PC A by the switching chip according to the hardware
entry. The reason is that L3 Switch has obtained the mapping between the IP
address and MAC address of PC A and added matching Layer 3 forwarding
entry to the L3 forwarding table of the switching chip.
10. Subsequent packets exchanged between PC A and PC B are forwarded
following the same process: MAC address table lookup, Layer 3 forwarding
table lookup, and hardware forwarding by the switching chip.
In a summary, a Layer 3 switch provides high-speed Layer 3 switching through one
routing process (forwarding the first packet to the CPU and creating a hardware
Layer 3 forwarding entry) and multiple switching processes (hardware forwarding
of subsequent packets).
Data center
backbone
network
Core Layer
Access Layer
Server
Term Description
MAC Short for Media Access Control. At the data link layer of the
OSI model, the MAC sub-layer is adjacent to the physical
layer.
Abbreviations
Abbreviation Full Name
GE Gigabit Ethernet