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 FECcpm0β 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:
- Locate the END device
- Retrieve MIB-II information
- Attach the IP stack
- Configure the interface
- 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.