How Half-Duplex and Full-Duplex Ethernet Work

<<>>

Half-Duplex: The half-duplex transmission mode implements Ethernet Carrier Sense Multiple Access with Collision Detection. Traditional shared LANs operate in half-duplex, meaning they can only transmit data in one direction at a time. When data is transmitted simultaneously in both directions, collisions occur, which reduces Ethernet efficiency.

Full-Duplex: Full-duplex transmission uses point-to-point connections. This arrangement has no collisions because it uses two independent wire pairs within twisted-pair cable, which effectively increases bandwidth without installing new media. For example, imagine adding a parallel railway track between stations, allowing two trains to travel in both directions simultaneously. In full-duplex mode, the collision detection circuit is unavailable, so each full-duplex connection uses only one port for point-to-point connections. Standard Ethernet transmission efficiency can reach 50% to 60% of the bandwidth, while full-duplex provides 100% efficiency in both directions.

△ How Ethernet Works

Ethernet uses the Carrier Sense Multiple Access with Collision Detection (CSMA/CD) mechanism. Nodes in an Ethernet network can see all information sent across the network, which is why we say Ethernet is a broadcast network.

The Ethernet working process is as follows:

When a host on the Ethernet network wants to transmit data, it proceeds as follows:

1. Listen on the channel to see if there is a signal being transmitted. If so, it indicates the channel is busy, and it continues listening until the channel is idle.

2. If no signal is detected, it transmits data.

3. Continue listening during transmission. If a collision is detected, execute the backoff algorithm, wait a random period, and then restart from step 1. (When a collision occurs, the computers involved in the collision will send a jam sequence to warn all nodes, then return to the listening state.)

Note: Each computer is allowed to send only one packet at a time.

4. If no collision is detected, the transmission is successful. All computers must wait 9.6 microseconds (when running at 10Mbps) after their last transmission before attempting to send data again.

△ Frame Structure

Overview of Ethernet Frames:

An Ethernet frame is the encapsulation of the Data Link layer. Network layer data packets have a frame header and frame trailer added to become data frames recognizable by the Data Link layer (framing). Although the number of bytes used for the frame header and trailer is fixed, the length of the Ethernet frame varies depending on the size of the encapsulated data packet, ranging from 64 to 1518 bytes (not including the 8-byte preamble).

△ Collision/Collision Domain

Collision: In Ethernet, a data collision occurs when two data frames are sent onto the physical transmission medium simultaneously and completely or partially overlap. When a collision occurs, the data on the physical network segment is no longer valid.

Collision Domain: Every node within the same collision domain can receive all frames that are sent.

Factors Affecting Collisions: Collisions are a significant factor affecting Ethernet performance. Due to collisions, traditional Ethernet efficiency drops noticeably when the load exceeds 40%. There are many reasons for collisions, such as the greater the number of nodes in the same collision domain, the higher the probability of collisions. In addition, factors such as the length of data packets (the maximum Ethernet frame length is 1518 bytes) and the network diameter also affect collision occurrence. Therefore, when the scale of Ethernet increases, measures must be taken to control the spread of collisions. Common methods involve using bridges and switches to segment the network, dividing a large collision domain into several smaller ones.

△ Broadcast/Broadcast Domain

Broadcast: In network transmission, sending a message to all connected nodes is called a broadcast.

Broadcast Domain: The set of all devices on a network that can receive broadcast frames sent by any device.

Difference between Broadcast and Broadcast Domain: A broadcast network refers to a network where all nodes can receive transmitted data frames, regardless of whether the frame is addressed to them. Non-destination hosts receive the data frame but do not process it.

Broadcast refers to the data traffic composed of broadcast frames. These broadcast frames use a broadcast address (where every bit of the address is “1”) as the destination address, informing all computers on the network to receive and process this frame.

△ Shared Ethernet

Typical examples of shared Ethernet are bus-type networks using 10Base2/10Base5 and star-type networks centered around hubs. In Ethernet using hubs, the hub concentrates many Ethernet devices onto one central device, all connected to the same physical bus structure within the hub. Fundamentally, Ethernet centered around a hub is no different from the original bus-type Ethernet.

Hub Working Principle:

A hub does not process or inspect the traffic on it; it merely extends the physical medium by repeating signals received on one port and distributing them to all other ports. All devices connected to the hub share the same medium, resulting in them sharing the same collision domain, broadcast domain, and bandwidth. Therefore, a hub and the devices connected to it form a single collision domain. If a node sends out a broadcast message, the hub propagates this broadcast to all nodes connected to it, thus it is also a single broadcast domain.

Hub Working Characteristics:

Hubs are mostly used in small-scale Ethernet networks. As hubs typically use an external power supply (active), they amplify the received signals. In some contexts, hubs are also called “multi-port repeaters.”

Like repeaters, hubs are network devices operating at the Physical layer.

Disadvantages of Shared Ethernet: Since all nodes are connected within the same collision domain, regardless of where a frame comes from or goes to, all nodes can receive this frame. As nodes increase, numerous collisions will lead to a sharp decline in network performance. Furthermore, a hub can only transmit one data frame at a time, meaning all hub ports must share the same bandwidth.

△ Switched Ethernet

Switched Architecture:

In switched Ethernet, the switch determines which port to forward a data frame to based on the MAC address contained in the received data frame. Because frame transmissions between ports are isolated from each other, nodes do not need to worry about whether the frames they send will collide with frames sent by other nodes as they pass through the switch.

Why Replace Shared Networks with Switched Networks:

·Reduce Collisions: Switches isolate collisions to each port (each port is a collision domain), preventing the spread of collisions.

·Increase Bandwidth: Each node connected to the switch can use the full bandwidth, rather than sharing bandwidth among all nodes.

△ Ethernet Switch

Switch Working Principle:

·The switch establishes a mapping between the source MAC address in the received data frame and the switch port, writing this into the MAC address table.

·The switch compares the destination MAC address in the data frame against the established MAC address table to determine which port to forward it to.

·If the destination MAC address in the data frame is not in the MAC address table, the frame is forwarded to all ports. This process is called flooding.

·Broadcast frames and multicast frames are forwarded to all ports.

Three Main Functions of a Switch:

·Learning: The Ethernet switch learns the MAC address of the device connected to each port and stores the mapping between the address and the corresponding port in the MAC address table in the switch’s cache.

·Forwarding/Filtering: When the destination address of a data frame has a mapping in the MAC address table, it is forwarded only to the port connected to the destination node rather than all ports (if the data frame is a broadcast/multicast frame, it is forwarded to all ports).

·Loop Elimination: When a switch includes a redundant loop, the Ethernet switch uses the Spanning Tree Protocol to avoid loop creation while allowing backup paths.

Switch Working Characteristics:

·The network segment connected to each port of a switch is an independent collision domain.

·Devices connected to the switch are still within the same broadcast domain, meaning the switch does not isolate broadcasts (the sole exception is in environments configured with VLANs).

·Switches forward based on information in the frame header, so switches are network devices operating at the Data Link layer.

△ Switch Classification:

Based on the different operating modes for processing frames, switches can be mainly divided into two types.

Store-and-Forward: The switch must receive the entire frame before forwarding it and performs error checking. If there are no errors, it forwards the frame to the destination address. The forwarding delay of a frame passing through the switch varies with the length of the frame.

Cut-Through: The switch forwards the frame immediately upon checking the destination address contained in the frame header, without waiting for the entire frame to be received or performing error checking. Since the length of the Ethernet frame header is always fixed, the forwarding delay through the switch remains constant.

Note:

The forwarding speed of cut-through mode is significantly faster than store-and-forward mode, but its reliability is lower because it might forward collision frames or frames with CRC errors.

△ Spanning Tree Protocol

Eliminating Loops:

Redundant links and devices are often designed into switched networks composed of switches. The purpose of this design is to prevent a single point of failure from causing a loss of entire network functionality. Although redundant design can eliminate single points of failure, it also leads to the creation of switching loops, which can cause the following problems.

·Broadcast Storms

·Multiple Copies of the Same Frame

·Unstable MAC Address Tables

Therefore, a mechanism must exist in switched networks to prevent loops, and the Spanning Tree Protocol (STP) serves exactly this purpose.

Spanning Tree Working Principle:

The international standard for Spanning Tree Protocol is IEEE802.1d. Bridges/switches running the spanning tree algorithm exchange configuration information with other switches at specified intervals (default 2 seconds) via multicast frames called Bridge Protocol Data Units (BPDUs). The working process is as follows:

·Select the root bridge by comparing bridge priorities (there is only one root bridge within a given broadcast domain).

·The remaining non-root bridges each have only one port leading to the root switch, called the root port.

·Each network segment has only one forwarding port.

·All connected ports on the root switch are forwarding ports.

Note: Spanning Tree Protocol is typically enabled by default on switches and can operate normally without manual intervention. However, this automatically generated scheme might result in suboptimal data transmission paths. Therefore, the outcome of spanning tree generation can be influenced by manually setting bridge priorities.

Spanning Tree States:

Ports on a switch running Spanning Tree Protocol are always in one of the following four states. During normal operation, ports are in either the Forwarding or Blocking state. When the device recognizes a change in network topology, the switch automatically transitions states, during which ports temporarily enter the Listening and Learning states.

Blocking: All ports start in the Blocking state to prevent loops. Spanning Tree determines which ports transition to the Forwarding state. Ports in the Blocking state do not forward data but can receive BPDUs.

Listening: Does not forward data; monitors BPDUs (temporary state).

Learning: Does not forward data; learns MAC addresses (temporary state).

Forwarding: The port can forward and receive data.

Tip: In practice, when using switches, a special port state—Disabled state—might also occur. This is a deadlock state caused by port failure or incorrect switch configuration leading to data collisions. If the cause is not a port failure, we can resolve this issue by restarting the switch.

Spanning Tree Recalculation:

When the network topology changes, Spanning Tree Protocol recalculates to generate a new spanning tree structure. When the port states of all switches change to Forwarding or Blocking, it means the recalculation is complete. This state is called Convergence.

Note: During network topology changes, devices cannot communicate until Spanning Tree convergence is complete, which may impact certain applications. Therefore, it is generally considered that a switched network where Spanning Tree operates well should not exceed seven layers. Additionally, some specialized switch technologies can speed up convergence time.

△ Bridge

Bridge Overview:

A Layer 2 network device that forwards based on frame addresses, capable of connecting several LAN segments together. Bridges can connect segments of the same medium or access segments of different media. The main function of a bridge is to segment and reduce collisions. Its working principle is similar to a switch, forwarding via a MAC address table. Therefore, there is no fundamental difference between a bridge and a switch. In some cases, we can consider a bridge to be a switch.

△ Brief Introduction to Routers

What is a Router:

A router is a network device that uses one or more metrics to determine the optimal path through which network communication can pass. Routers forward data packets from one network to another based on Network layer information.

Router Functions:

·Isolate broadcasts, segment broadcast domains

·Determine optimal paths via routing algorithms

·Forward packets based on Layer 3 destination addresses

·Other functions

△ Virtual LAN (VLAN)

The essence and function of bridges/switches are to provide enhanced network services by dividing the network into multiple collision domains. However, bridges/switches still constitute a single broadcast domain; a broadcast data packet can be forwarded by bridges/switches to the entire network. While routers at the third layer of the OSI model provide broadcast domain segmentation, switches also offer a method for broadcast domain segmentation called VLAN.

What is a VLAN:

A VLAN is a logical broadcast domain that spans multiple physical LAN segments. VLANs are designed to provide independent broadcast domains for workstations, which are logically segmented based on their function, project team, or application, regardless of the users’ physical location.

One VLAN = One Broadcast Domain = Logical Network Segment

VLAN Advantages and Installation Characteristics:

VLAN Advantages:

·Security. Broadcast frames within one VLAN will not propagate to other VLANs.

·Network Segmentation. Physical network segments can be divided into several logical network segments as needed.

·Flexibility. Switch ports and connected users can be logically grouped into communities of interest, such as segmenting by department staff, project teams, and various other user groups.

Typical VLAN Installation Characteristics:

·Each logical network segment behaves like an independent physical network segment.

·VLANs can span multiple switches.

·Trunks carry traffic for multiple VLANs.

How VLANs Operate:

·Each VLAN configured on a switch can perform address learning, forwarding/filtering, and loop elimination mechanisms, just like an independent physical bridge. A VLAN may include several ports.

·The switch implements VLANs by forwarding data to the destination port belonging to the same VLAN as the originating port.

·Typically, a port only carries traffic for the VLAN to which it belongs.

VLAN Membership Modes:

Static: Ports assigned to a VLAN are statically (manually) configured by the administrator.

Dynamic: Dynamic VLANs can identify their membership based on MAC addresses, IP addresses, etc. When using MAC addresses, the typical approach is to use a VLAN Membership Policy Server (VMPS) to support dynamic VLANs. VMPS includes a database mapping MAC addresses to VLAN assignments. When a frame arrives at a dynamic port, the switch queries the VMPS based on the frame’s source address to obtain the corresponding VLAN assignment.

Note: Although VLANs are configured on switches, switches are Layer 2 network devices. A network composed solely of switches cannot perform inter-VLAN communication. The solution to this problem is to use a Layer 3 network device—the router. Routers can forward data packets between different VLANs, just as if they were connecting several real

Leave a Comment

Your email address will not be published.