Gateway
The central gateway connects the vehicle's networks. Learn routing between CAN, LIN, FlexRay and Ethernet domains, signal vs PDU routing, latency and bus-load effects, diagnostic routing (DoIP to CAN), firewalling and cybersecurity (SecOC, IDS), and evolution toward zonal architectures.
Modern cars have many separate networks — powertrain CAN, chassis CAN FD, body LIN clusters, infotainment Ethernet. The gateway ECU sits in the middle, forwarding only the messages each domain needs and blocking everything else.
It's also the security checkpoint between the outside world (OBD port, telematics) and safety-critical ECUs.
An analogy
A gateway is like an airport's passport control between terminals: it lets authorised passengers (messages) through to the right gate and stops everyone else.
Why a gateway
Separating networks by domain limits bus load, contains faults and protects safety-critical ECUs. The gateway forwards selected messages between domains and translates protocols (CAN ↔ LIN ↔ Ethernet).
Routing types
Frame/PDU routing forwards whole frames (fast, low CPU). Signal routing unpacks signals and repacks them into different messages (flexible, more CPU and latency). Diagnostic routing forwards UDS requests from the OBD/DoIP port to the target ECU.
Timing and load
Each routed message adds latency (queueing, processing) and load on the destination bus. Designers route only what's needed, downsample where acceptable, and verify end-to-end timing for functions spanning domains.
Security and zonal evolution
Gateways act as firewalls (whitelists), host intrusion detection, verify SecOC MACs, rate-limit diagnostic access and support secure OTA. In zonal architectures, zone controllers and central compute take over gateway roles with Ethernet backbones and TSN.
Formulas
- End-to-end latency:
t = t_tx,src + t_route + t_queue,dst + t_tx,dst - Added destination load:
ΔU = Σ routed frames/s × bits per frame / bit rate - Signal gateway rate conversion:
output period = configured period (may downsample)
Worked example: Latency across the gateway
Given: Source CAN frame 0.25 ms; Gateway processing 0.3 ms; Destination queueing up to 1 ms, frame 0.25 ms
Find: Worst-case end-to-end latency.
- t = 0.25 + 0.3 + 1.0 + 0.25 = 1.8 ms
Answer: ≈ 1.8 ms
Worked example: Added bus load
Given: Routing 30 messages at 100 Hz onto a 500 kbit/s body bus; 125 bits per frame
Find: Extra load.
- ΔU = 30 × 100 × 125/500 000 = 75 %
Answer: 75 % — far too much; downsample to 10 Hz (7.5 %) or route only needed signals
Simplified routing table (C)
#include <stdint.h>
#include <stdbool.h>
typedef enum { BUS_PT_CAN, BUS_CHASSIS_CANFD, BUS_BODY_CAN, BUS_ETH } bus_t;
typedef struct {
bus_t src; uint32_t src_id;
bus_t dst; uint32_t dst_id;
uint16_t min_period_ms; /* rate limiting / downsampling */
} route_t;
static const route_t routes[] = {
{ BUS_PT_CAN, 0x0C8, BUS_BODY_CAN, 0x0C8, 100 }, /* engine speed -> cluster, 10 Hz */
{ BUS_CHASSIS_CANFD, 0x1A0, BUS_PT_CAN, 0x1A0, 10 }, /* wheel speeds -> ECM */
{ BUS_ETH, 0x7E0, BUS_PT_CAN, 0x7E0, 0 }, /* DoIP diagnostics -> ECM (after auth) */
};
bool route_allowed(bus_t src, uint32_t id, const route_t **out)
{
for (unsigned i = 0; i < sizeof routes / sizeof routes[0]; i++) {
if (routes[i].src == src && routes[i].src_id == id) { *out = &routes[i]; return true; }
}
return false; /* default deny: firewall behaviour */
}Default-deny routing is a basic security principle: anything not explicitly configured is dropped (and can be logged by the IDS).
Common mistakes
- Wrong: Routing everything everywhere 'just in case'. — Right: Route only required messages at required rates.
- Wrong: Open diagnostic access to safety buses. — Right: Authenticate testers and restrict services by session and role.
Applications
- Domain separation: Powertrain, chassis, body and infotainment isolated for safety and load.
- Diagnostics & OTA: Central point for tester access and software distribution.
- Cybersecurity: Firewall, IDS and secure key management.
Key takeaways
- Connects and isolates network domains.
- PDU vs signal routing; mind latency and load.
- Firewall, authentication, IDS for security.
- Evolving into zonal controllers + central compute.
Going further
- SecOC verification: Gateways may verify MACs before forwarding.
- Intrusion detection: Frequency and content anomalies flag attacks (ISO 21434 monitoring).
- Service-oriented gateways: Translate CAN signals into SOME/IP services for central software.