Skip to main content

Implementing Multi-Port Ethernet in VxWorks Using END and MUX

·1216 words·6 mins
VxWorks Ethernet Embedded Systems RTOS Networking Tcp-Ip Device-Drivers PowerPC Mux End-Driver
Table of Contents

Implementing Multi-Port Ethernet in VxWorks Using END and MUX

Reliable networking is a foundational requirement for modern embedded systems. As industrial controllers, communication gateways, and edge computing devices evolved toward Ethernet-based architectures, embedded real-time operating systems needed scalable and modular networking frameworks capable of supporting multiple interfaces simultaneously.

This article explores the implementation of dual Ethernet interfaces in VxWorks running on the Motorola MPC860T processor. The design leverages the END (Enhanced Network Driver) architecture and the MUX networking layer to support:

  • Multiple Ethernet controllers
  • Flexible protocol integration
  • Independent network interfaces
  • Modular TCP/IP communication

The implementation demonstrates how VxWorks can efficiently manage both a traditional 10 Mbps Ethernet interface and a 10/100 Mbps adaptive Fast Ethernet interface within the same embedded platform.


🌐 Why Ethernet and TCP/IP Dominate Embedded Networking
#

TCP/IP and Ethernet became dominant in embedded communication systems for several reasons:

  • Low deployment cost
  • Standardized interoperability
  • Scalable network topology
  • Mature software ecosystem
  • Broad hardware availability
  • Strong protocol extensibility

Compared with proprietary fieldbus or serial communication systems, Ethernet provides significantly greater flexibility for:

  • Industrial automation
  • Networked control systems
  • Remote diagnostics
  • Embedded gateways
  • Distributed processing systems

As embedded platforms grew more sophisticated, RTOS environments such as VxWorks became critical for maintaining deterministic network behavior under real-time workloads.


βš™οΈ Why VxWorks Was Used
#

VxWorks has historically been a preferred RTOS in networking and telecommunications infrastructure because it combines:

  • Deterministic scheduling
  • High interrupt responsiveness
  • Small kernel footprint
  • Mature TCP/IP stack
  • Modular driver architecture
  • Strong BSP portability

The implementation described here was developed using:

  • Tornado 2.0
  • VxWorks networking stack
  • MPC860T Board Support Package (BSP)

🧠 Hardware Platform: Motorola MPC860T
#

The Motorola MPC860T PowerPC processor integrates several communication-oriented peripherals directly into the SoC.

Integrated Ethernet Capabilities
#

The processor provides:

Controller Type Capability
SCC (Serial Communication Controllers) Up to four 10 Mbps Ethernet interfaces
FEC (Fast Ethernet Controller) One 10/100 Mbps adaptive interface

This architecture allows flexible multi-port Ethernet configurations using relatively minimal external hardware.

Implemented Ethernet Configuration
#

The project successfully implemented:

Interface Type
CPM/SCC Port 10 Mbps Ethernet
FEC Port 10/100 Mbps adaptive Ethernet

The actual number of usable Ethernet interfaces depends on:

  • CPU frequency
  • Packet throughput
  • Interrupt load
  • Overall task scheduling pressure

The system described operated at:

  • 50 MHz CPU clock frequency

πŸ—οΈ VxWorks Networking Architecture
#

VxWorks includes a complete TCP/IP networking stack with BSD-compatible socket APIs.

Applications interact with networking services using familiar interfaces such as:

socket()
bind()
send()
recv()

Driver Integration Models
#

VxWorks supports two major networking driver architectures:

Driver Model Characteristics
BSD 4.4 Driver Tightly coupled to TCP/IP stack
END Driver Modular and protocol-independent

The project selected the END driver model because it provides better scalability and supports multiple interfaces cleanly.


πŸ”€ The END Driver and MUX Architecture
#

The END architecture separates network drivers from protocol implementations through the MUX layer.

Role of the MUX Layer
#

The MUX layer acts as an intermediary between:

  • Data link layer drivers
  • Network protocol stacks

This decoupling provides several advantages:

  • Multi-protocol support
  • Cleaner modularity
  • Better extensibility
  • Multicast support
  • Polling-mode capability

Receive Path
#

Hardware β†’ END Driver β†’ MUX β†’ TCP/IP Stack

Transmit Path
#

TCP/IP Stack β†’ MUX β†’ END Driver β†’ Hardware

This architecture became the standard networking framework for modern VxWorks deployments.


πŸš€ END Driver Initialization Flow
#

During system startup, VxWorks initializes the networking subsystem in stages.

Initialization Sequence
#

usrRoot()
    β†’ usrNetworkInit()
        β†’ usrNetProtoInit()
        β†’ muxLibInit()
        β†’ usrEndLibInit()

Driver Loading Process
#

The following functions are central to END driver activation:

Function Purpose
muxDevLoad() Load END driver
muxDevStart() Start driver
sysIntConnect() Register ISR handlers
netJobAdd() Schedule deferred network processing

Interrupt Processing Strategy
#

To reduce interrupt latency:

  • ISRs perform minimal work
  • Packet processing is deferred
  • Heavy workloads run inside NetTask

This approach improves determinism and system responsiveness.


🧩 Enabling Multiple Network Interfaces
#

Most VxWorks BSPs initially support only one network interface.

Supporting multiple Ethernet ports requires BSP-level modifications.

Key Configuration Files
#

File Purpose
config.h Hardware feature definitions
configNet.h Network interface configuration

βš™οΈ Modifying config.h
#

The CPM-based Ethernet controller must be explicitly enabled.

Example Modification
#

#define INCLUDE_CPM

The FADS_860T macro controls which interface becomes the default network interface:

  • motfec0 β†’ 10/100 Mbps FEC
  • cpm0 β†’ 10 Mbps SCC

🌐 Expanding Interface Support in configNet.h
#

By default:

IP_MAX_UNITS = 1

This must be increased.

Example Modification
#

#undef IP_MAX_UNITS
#define IP_MAX_UNITS 2

This allows the TCP/IP stack to manage multiple interfaces simultaneously.


πŸ”§ Starting Additional Ethernet Interfaces
#

Additional interfaces are initialized manually during network startup.

Example Addition
#

usrCPMEndDevStart(
    "cpm",
    1,
    lpInfo[0].target_name,
    lpInfo[0].ip_address,
    lpInfo[0].netmask
);

routeAdd(...);

Interface Naming Convention
#

Interface Unit Number
Primary FEC motfec0
Secondary CPM cpm1

The second interface typically uses unit number 1.


πŸ“¦ Network Configuration Structures
#

Custom interface configuration structures simplify interface initialization.

Example Structure
#

struct cpmlpInfo {
    char *target_name;
    char *ip_address;
    char *network;
    int   netmask;
    char *gateway;
};

Example Interface Table
#

struct cpmlpInfo lpInfo[] = {
    {"baby", "128.10.1.60", "128.10.1.0",
     0xffffffff, "128.10.1.60"},

    {NULL, NULL, NULL, 0, NULL}
};

This structure stores per-interface networking parameters.


πŸ› οΈ Core Implementation of usrCPMEndDevStart()
#

The initialization routine performs several critical tasks:

  1. Locate the END device
  2. Retrieve MIB-II information
  3. Attach the IP stack
  4. Configure the interface
  5. Activate routing

Example Implementation
#

void usrCPMEndDevStart(
    char *pDevName,
    int unitNum,
    char *pTgtName,
    char *pAddrString,
    int netmask
)
{
    END_OBJ* pEnd;
    M2_INTERFACE_TBL endM2Tbl;

    pEnd = endFindByName(pDevName, unitNum);

    if (pEnd == NULL) {
        printf("Could not find %s%d\n",
               pDevName, unitNum);
        return;
    }

    if (ipAttach(unitNum, pDevName) != OK) {
        printf("Failed to attach device\n");
        return;
    }

    if (usrNetIfConfig(
            pDevName,
            unitNum,
            pAddrString,
            pTgtName,
            netmask) != OK)
    {
        printf("Configuration failed\n");
        return;
    }

    printf("Attached TCP/IP interface\n");
}

⚠️ Important Multi-Interface Considerations
#

Use Separate Network Segments
#

Each Ethernet interface should operate on a distinct subnet.

Example:

Interface Network
motfec0 192.168.1.x
cpm1 10.0.0.x

This avoids routing ambiguity and improves network isolation.

Bootline Configuration
#

VxWorks boot parameters define:

  • IP address
  • Netmask
  • Gateway
  • Hostname

These values are typically configured via:

DEFAULT_BOOT_LINE

inside config.h.

Multiple IP Addresses
#

Each interface may also support multiple IP addresses if required by the application.


πŸ” END Driver Advantages in Embedded Systems
#

Compared with legacy BSD drivers, END drivers provide:

Capability Benefit
Protocol independence Easier future expansion
MUX abstraction Cleaner architecture
Multiple interfaces Native multi-port support
Multicast support Improved network flexibility
Polling support Deterministic operation under load

This architecture became essential for increasingly network-centric embedded systems.


πŸš€ Real-Time Networking Considerations
#

Multi-interface embedded systems introduce additional real-time challenges:

  • Packet interrupt storms
  • Context-switch overhead
  • Buffer management complexity
  • Shared memory contention

Optimization Techniques
#

Typical optimizations include:

  • Deferred interrupt handling
  • DMA-based packet movement
  • Prioritized networking tasks
  • Buffer pool tuning
  • Reduced ISR workload

VxWorks’ deterministic scheduler makes these optimizations easier to manage under constrained hardware conditions.


πŸ“Œ Conclusion
#

This implementation demonstrates how VxWorks can efficiently support multiple Ethernet interfaces using the END driver framework and MUX networking layer on the Motorola MPC860T platform.

Through targeted BSP modifications and custom interface startup logic, the system successfully achieved:

  • Dual-port Ethernet communication
  • Flexible TCP/IP networking
  • Modular driver integration
  • Scalable architecture for future expansion

The END/MUX model remains one of the most important architectural improvements in VxWorks networking, providing a clean and extensible foundation for complex embedded communication systems.

Although the original implementation targeted legacy PowerPC hardware and Tornado-era VxWorks environments, the same architectural principles continue to influence modern RTOS networking stacks today.

Related

VxWorks in VoIP Gateways: BSP, Drivers, and H.323 Integration
·1236 words·6 mins
VxWorks RTOS Voip Embedded Systems H323 Telecommunications Device-Drivers Networking BSP Real-Time Systems
Essential VxWorks RTOS Functions: Kernel, Tasks and IPC
·538 words·3 mins
VxWorks RTOS Embedded Systems Real-Time Ipc Task-Management Semaphores Queues Kernel Device-Drivers
VxWorks Boot Process Explained: VxBL, BootApp and Two-Stage Boot
·647 words·4 mins
VxWorks Bootloader Vxbl Bootapp RTOS Embedded Systems BSP Kernel-Boot Device-Tree Firmware