Diploma in Computer Architecture and Networking
Computer Organization and Architecture
•
Diploma
Network-Oriented Computer Architecture
Introduction and Context
A computer connected to a network is not merely a conventional computer with a cable attached. Network communication changes how the processor, memory system, operating system, buses, and peripheral controllers interact. A modern host may receive millions of packets per second, move data directly between memory and a network interface controller (NIC), classify traffic, calculate checksums, encrypt payloads, and distribute work across several processor cores.
Network-oriented computer architecture therefore studies the boundary between host architecture and communication networks. It explains how packets enter and leave a computer, how data is buffered, how interrupts are managed, and how hardware and software cooperate to provide throughput, low latency, reliability, and security.
This chapter focuses on Ethernet-based systems, although many principles also apply to wireless adapters, storage fabrics, telecommunications equipment, routers, firewalls, and software-defined networking platforms.
Learning Objectives
After studying this chapter, you should be able to:
describe the role and internal organization of a network interface controller;
explain packet transmission and reception from the wire to application memory;
distinguish programmed I/O, interrupt-driven I/O, and DMA;
explain checksums, segmentation, receive-side scaling, and other hardware offloads;
analyze buffering, queueing, latency, throughput, and packet loss;
explain interrupt moderation and multi-queue operation;
relate host architecture to routers, switches, firewalls, and network appliances;
identify hardware requirements for software-defined networking; and
evaluate practical design trade-offs in a networked computer system.
1. The Network Data Path
A packet follows a sequence of hardware and software stages. On reception, the physical medium delivers electrical, optical, or radio signals to the NIC. The NIC converts the signal into a frame, checks its integrity, identifies the frame type, and places packet data into host memory. The operating system then processes protocol headers, applies filtering and routing rules, and delivers data to a socket or application.
On transmission, the direction is reversed. An application writes data to a socket. The operating system constructs protocol headers and gives the NIC a description of the packet. The NIC retrieves the data from memory, performs any enabled offloads, and transmits the resulting frame.
Network packet path through a host computer
Figure: Network packet path through a host computer
Figure: Principal data path between a network medium, NIC, memory, and host software.
The path is not necessarily a single linear operation. Modern NICs may classify packets, place them into different receive queues, discard invalid frames, timestamp packets, or execute cryptographic and protocol functions before the operating system sees them.
2. Network Interface Controllers
A NIC is a specialized I/O subsystem. Its major components commonly include:
a physical layer interface (PHY), which converts between network signals and digital symbols;
a media access controller (MAC), which handles frame formation, addressing, and link-level checks;
transmit and receive queues;
descriptor-ring management logic;
a DMA engine;
control and status registers;
interrupt-generation logic; and
optional packet-processing engines.
The NIC communicates with the host through an interconnect such as PCI Express. The driver maps NIC registers into the processor's address space, configures queue memory, supplies buffer addresses, and handles completion events.
Frames, packets, and segments
The terms frame, packet, datagram, and segment refer to different protocol layers, although they are often used informally. An Ethernet frame normally contains a link-layer header, an IP packet, and a transport-layer segment such as TCP or UDP. A frame also includes a frame check sequence (FCS) used to detect transmission errors.
A NIC generally operates at the link layer, while the operating system protocol stack interprets IP and transport headers. Increasingly, however, NIC hardware examines higher-layer headers for filtering, steering, and offload functions.
Descriptor rings
A descriptor is a small data structure containing information about a buffer. A transmit descriptor may specify a memory address, length, packet flags, and checksum instructions. A receive descriptor usually identifies an empty buffer available for incoming data. Descriptors are arranged in circular rings, allowing the NIC and driver to exchange ownership efficiently.
A ring has finite capacity. If incoming packets arrive while no receive descriptors or buffers are available, packets may be dropped. Increasing ring size can absorb short bursts, but it cannot solve sustained overload and may increase latency.
3. Programmed I/O, Interrupts, and DMA
Programmed I/O
With programmed I/O, the processor repeatedly reads device registers or copies data between the device and memory. This approach is simple but wastes processor cycles and is unsuitable for high-speed network traffic because each byte or small unit may require software intervention.
Interrupt-driven I/O
In interrupt-driven I/O, the NIC signals the processor when an event occurs, such as packet arrival or completion of a transmission. The processor temporarily suspends normal execution, enters an interrupt handler, and invokes the driver.
Interrupts reduce unnecessary polling, but an interrupt for every packet can become expensive. Each interrupt causes context and state-management work, cache disruption, and possible scheduling overhead. High-speed NICs therefore combine interrupts with batching and polling.
Direct memory access
DMA allows the NIC to transfer packet data directly between the device and main memory without requiring the CPU to copy every word. The CPU still configures the transfer and processes packet metadata, but the bulk movement is performed by the NIC's DMA engine.
A typical receive operation is:
The driver allocates or obtains receive buffers.
It writes their physical or I/O virtual addresses into receive descriptors.
The NIC receives a valid frame.
The NIC performs DMA into a selected buffer.
The NIC marks the descriptor complete and records packet length and status.
The NIC raises an interrupt or is noticed by a polling routine.
The driver passes the completed buffer upward and replenishes the ring.
DMA introduces important architectural concerns. The device and CPU may have different views of memory, requiring cache coherence or explicit synchronization. An IOMMU can translate device addresses and restrict a device to approved memory regions, reducing the consequences of a faulty or compromised device. Buffers must also satisfy alignment, lifetime, and ownership rules.
4. Packet Processing and Offloading
Packet processing includes parsing headers, validating checksums, copying or referencing data, classifying flows, updating counters, and passing packets between layers. A host architecture must balance work between the CPU, NIC, and sometimes programmable accelerators.
Checksum offload
Internet checksums detect many common transmission and processing errors. A NIC may calculate a transmit checksum or verify a receive checksum. This reduces CPU instructions, particularly when many packets are processed.
Checksum offload does not provide end-to-end security or guarantee that all corruption is detected. It is a performance mechanism, not a replacement for cryptographic integrity protection.
TCP segmentation offload and large send offload
Normally, software divides a large application write into maximum transmission unit (MTU)-sized segments. With TCP segmentation offload (TSO), software supplies a larger logical block and the NIC divides it into suitable TCP segments. Large send offload is a related term used by some systems.
The feature reduces per-packet software work, but it can make packet accounting and troubleshooting less intuitive because a large software packet becomes multiple wire packets.
Receive-side coalescing
Generic receive offload (GRO) or hardware receive coalescing may combine related incoming packets for more efficient software processing. Coalescing lowers per-packet overhead but may increase processing latency and obscure the exact wire-level packet sequence.
VLAN, tunnel, and cryptographic offloads
NICs may insert or remove VLAN tags, classify tunneled traffic, calculate encapsulation checksums, and assist with IPsec or TLS-related operations. The exact feature set depends on the device and driver. Offloads must be validated carefully because incorrect configuration can cause interoperability, security, or diagnostic problems.
5. Throughput, Latency, and Packet Rate
Network performance is multidimensional. Throughput is the amount of useful data delivered per unit time. Latency is the delay experienced by a packet or transaction. Packet rate is the number of packets processed per second. A system can have high throughput but poor latency, particularly when it uses large batches or deep queues.
For a stream of packets, the average packet rate is:
P = R ÷ (8L)
where:
P is packet rate in packets per second;
R is bit rate in bits per second; and
L is packet size in bytes.
This simplified relationship assumes that L represents the relevant average packet size and ignores or separately accounts for physical-layer overhead. It is useful for estimating CPU pressure.
Worked example. A 1 Gb/s link carries packets averaging 500 bytes. The approximate packet rate is:
P = 1,000,000,000 ÷ (8 × 500) = 250,000 packets per second.
If software requires 1,200 CPU cycles per packet, the processing requirement is:
250,000 × 1,200 = 300,000,000 cycles per second.
On a 3 GHz core, this is approximately 10% of one core under ideal conditions, since 300,000,000 ÷ 3,000,000,000 = 0.10. Real utilization is higher or lower depending on memory stalls, cache behavior, driver design, protocol processing, and other tasks.
For a link with nominal rate R and useful application throughput U, efficiency may be expressed as:
η = U ÷ R
Here η is dimensionless. The measure is meaningful only when the numerator and denominator use compatible units and the same observation interval. Headers, retransmissions, encryption overhead, and idle periods affect the result.
6. Buffering and Queueing
Buffers absorb temporary differences between arrival and service rates. Important buffers include NIC rings, driver queues, socket buffers, protocol queues, and application queues.
If packets arrive faster than they are serviced for a sustained interval, the queue eventually fills and packets are dropped. If service is faster than arrival, the queue tends to drain. A simple conservation relationship for a queue is:
Qt+1 = max(0, Qt + At − St)
where Qt is the queue occupancy at time interval t, At is arrivals, and St is service capacity during that interval. All three quantities must be measured in the same units, such as packets or bytes. The formula is a discrete bookkeeping model, not a complete latency model.
Large buffers protect against bursts but can create bufferbloat: packets wait in queues for a long time, increasing latency even though no packet is lost. Small buffers reduce waiting time but may cause loss during short bursts. Good design uses appropriate queue limits, traffic shaping, congestion control, and monitoring.
Zero-copy and memory efficiency
Copying a packet through several software buffers consumes memory bandwidth and CPU time. Zero-copy techniques allow an application to access packet data without unnecessary copying, often through shared buffers, memory mapping, or kernel-bypass frameworks. These approaches can improve throughput but complicate protection, ownership, synchronization, and programming models.
7. Interrupt Moderation and Multi-Queue Operation
Interrupt moderation
A NIC may delay an interrupt until a specified number of packets arrive or a short timer expires. This combines multiple completions into one notification. The trade-off is clear:
aggressive moderation reduces interrupt overhead and improves throughput;
minimal moderation reduces notification delay and may improve latency;
excessive moderation can cause queue buildup and application delay.
Many systems use adaptive moderation, changing the policy according to traffic conditions.
Receive-side scaling
A single receive queue and CPU become a bottleneck on a multicore host. Receive-side scaling (RSS) uses a hash of selected packet-header fields, commonly source and destination addresses and ports, to distribute flows across receive queues. Each queue can be associated with a processor core.
Keeping all packets of one flow on the same queue preserves ordering and improves cache locality. However, uneven traffic patterns can produce a hot queue, where one core is overloaded while others are underused. RSS indirection tables and CPU affinity can be adjusted to improve balance.
Other mechanisms include transmit-side scaling, receive packet steering, receive flow steering, and explicit flow rules. Multi-queue operation requires coordination among hardware queues, interrupt vectors, driver data structures, and operating-system scheduling.
8. Host Architecture and Memory-System Effects
Network performance depends strongly on the memory hierarchy. Packet descriptors and frequently used metadata should ideally remain in cache. Poor data layout can cause cache misses and consume memory bandwidth. NUMA systems add another concern: a NIC attached to one processor socket may perform best when its queues and buffers are managed by cores and memory located on the same NUMA node.
PCI Express provides the link between many NICs and the host. Its capacity depends on lane count, generation, encoding, protocol overhead, and other devices sharing the path. A NIC capable of a high line rate can be limited by an insufficient PCIe connection or by memory and CPU resources.
A practical capacity analysis should examine at least:
line rate and actual payload rate;
packet size distribution and packet rate;
PCIe bandwidth;
DMA and memory bandwidth;
CPU cycles per packet;
number of queues and cores;
interrupt and polling behavior; and
protocol, encryption, and application costs.
9. Network Appliances
A network appliance is a specialized system whose primary role is to forward, filter, transform, or inspect traffic. Examples include switches, routers, firewalls, load balancers, intrusion-prevention systems, VPN gateways, and network address translators.
Switches and routers
A switch usually forwards frames using a MAC-address table, while a router forwards packets using an IP routing table. High-performance devices often use hardware lookup tables, packet buffers, and dedicated forwarding pipelines. The control plane computes configuration and routing information; the data plane performs repeated packet forwarding.
Firewalls and load balancers
A firewall evaluates packets or flows against security policy. Stateful firewalls maintain connection state, which requires memory for flow tables and mechanisms for handling table exhaustion. Load balancers classify flows and select servers according to policies such as round robin, least connections, health status, or consistent hashing.
Hardware and software forwarding
ASICs provide high throughput and predictable latency for a fixed set of functions. CPUs and general-purpose software provide flexibility and easier updates. Network processors, programmable ASICs, field-programmable gate arrays (FPGAs), and smart NICs occupy intermediate positions.
The choice depends on required performance, feature stability, development cost, power, observability, and update frequency. A fast forwarding engine is not sufficient if control-plane failures, memory exhaustion, or poor management interfaces make the appliance unreliable.
Software-defined networking (SDN) separates or logically distinguishes a control plane from a programmable data plane. A controller or control application defines forwarding intent, while switches and other devices enforce rules.
SDN hardware commonly requires:
programmable match-action tables;
sufficient table capacity for flows, groups, and meters;
fast rule installation and update mechanisms;
counters, timestamps, and telemetry;
adequate packet buffers;
secure control-plane communication;
redundant management and power arrangements; and
support for abstraction interfaces such as OpenFlow, P4Runtime, vendor APIs, or management protocols.
The control plane cannot assume that hardware has unlimited table space or instantaneous updates. Rule installation may be delayed, and conflicting updates may temporarily produce inconsistent behavior. Therefore, SDN designs need versioning, transactional updates where available, rollback procedures, and monitoring.
Programmable data planes offer flexibility, but programmability does not eliminate hardware limits. Parser depth, match-key width, pipeline stages, memory type, action resources, and recirculation capacity constrain what can be implemented at line rate.
11. Applied Case: Designing a Multicore Web Gateway
Background
This illustrative case concerns a web gateway receiving encrypted HTTPS traffic over two 10 Gb/s links. The gateway performs connection tracking, access control, TLS termination, and load balancing to internal servers.
Problem
The initial design uses one receive queue and interrupt-per-packet processing. During busy periods, CPU core 0 reaches saturation, receive queues fill, and latency increases. Average bandwidth appears acceptable, but short packets create a very high packet rate.
Analysis
The engineering team measures packet-size distribution, queue occupancy, interrupt rate, CPU cycles per packet, NUMA placement, and TLS workload. They find that the bottleneck is not simply link bandwidth. Small control and acknowledgment packets create substantial per-packet overhead, while all traffic is directed to one core.
Approach and solution
The redesign includes:
enabling multiple NIC receive and transmit queues;
configuring RSS and steering rules so independent flows are distributed across cores;
assigning queues and packet buffers to the NUMA node local to the NIC;
enabling validated checksum and segmentation offloads;
applying adaptive interrupt moderation;
separating packet-processing cores from management and logging cores;
using bounded socket and application queues to avoid excessive buffering; and
monitoring drops, retransmissions, queue depth, CPU utilization, and tail latency.
TLS processing is distributed separately because cryptographic work may become the next bottleneck. The gateway also uses hardware or software cryptographic acceleration only after verifying its security configuration and performance under realistic connection patterns.
Outcome
The redesigned system handles the same traffic with better core utilization and lower tail latency. It remains possible for a single very large flow or an adversarial traffic pattern to create imbalance, so the design includes flow-level monitoring and a capacity margin.
Learning points
The case demonstrates that effective network architecture requires end-to-end analysis. Increasing link speed alone does not solve a queue, CPU, memory locality, interrupt, or cryptographic bottleneck. Measurements must include packet rate and latency, not only average throughput.
12. Reliability, Security, and Governance
DMA and privileged device access create security responsibilities. An incorrectly configured NIC or malicious peripheral could read or overwrite memory. IOMMU protection, secure boot, signed drivers, least-privilege device assignment, and careful virtualization boundaries reduce risk.
Network telemetry may contain addresses, identifiers, payload metadata, or user-related information. Organizations should define retention, access control, and privacy policies. Packet capture must comply with law, contracts, institutional policy, and legitimate-use principles.
Offloads and programmable hardware expand the trusted computing base. Firmware vulnerabilities can affect every virtual machine or service using a device. Regular firmware updates, configuration baselines, vulnerability management, and rollback plans are therefore part of architecture, not merely administration.
Reliability engineering should address link redundancy, NIC failover, power loss, queue exhaustion, firmware failure, controller unavailability, and software upgrade procedures. Testing should include bursts, minimum-size packets, fragmented traffic, malformed packets, link changes, and failover conditions.
13. Contemporary Developments and Best Practices
Smart NICs and data-processing units (DPUs) can execute networking, storage, encryption, and isolation functions away from the host CPU. They are useful in cloud and data-centre environments, but introduce additional programming models and operational dependencies.
Kernel-bypass frameworks can provide very high packet rates by allowing applications to poll device queues directly. They are appropriate for selected workloads, such as packet brokers and trading systems, but may reduce compatibility with ordinary operating-system networking and require careful isolation.
Best practices include:
measure real traffic rather than relying only on nominal link speed;
distinguish throughput, packet rate, average latency, and tail latency;
configure queue counts and CPU affinity deliberately;
keep buffers near the processing NUMA node;
enable offloads only after compatibility and security testing;
monitor drops at every layer, not only at the application;
use bounded queues and congestion control;
maintain firmware, drivers, and configuration documentation; and
test failure, overload, and upgrade scenarios.
Chapter Summary
Network-oriented computer architecture explains how a host transforms network signals into application data and application data into transmitted frames. The NIC combines PHY and MAC functions with queues, descriptor rings, DMA engines, registers, and interrupt facilities. DMA reduces processor copying, while interrupts, polling, batching, and moderation determine how efficiently the CPU responds to device activity.
Packet rate is often as important as bandwidth. Buffering absorbs bursts but can cause loss or bufferbloat. Multi-queue NICs, RSS, CPU affinity, cache locality, and NUMA-aware memory placement allow multicore systems to scale. Checksum, segmentation, coalescing, VLAN, tunnel, and cryptographic offloads reduce selected costs but introduce configuration and diagnostic trade-offs.
Routers, switches, firewalls, and load balancers combine forwarding hardware with control software. SDN adds programmable control and data planes, but hardware table capacity, pipeline structure, buffering, telemetry, and secure updates remain limiting factors. Reliable designs evaluate performance, security, privacy, maintainability, and failure behavior as an integrated system.
Key Terms
NIC: Network interface controller that connects a host to a network.
PHY: Physical-layer component that converts network signals and digital data.
MAC: Media access control function responsible for link-layer frame operations.
DMA: Direct memory access performed by a device without CPU copying of every word.
Descriptor: Metadata structure describing a packet buffer or device operation.
Descriptor ring: Circular collection of descriptors shared by a driver and device.
Interrupt moderation: Deliberate aggregation or delay of device notifications.
RSS: Receive-side scaling that distributes flows across receive queues and CPU cores.
Offload: A function moved from general-purpose software to NIC or accelerator hardware.
TSO: TCP segmentation offload performed by a transmitting NIC.
GRO: Generic receive offload that combines packets for more efficient processing.
NUMA: Non-uniform memory access architecture in which memory locality affects performance.
Bufferbloat: Excessive latency caused by persistently deep queues.
Packet rate: Number of packets processed or transmitted per second.
Data plane: System component that performs repeated packet forwarding or processing.
Control plane: Component that computes policy, routes, and forwarding decisions.
SDN: Software-defined networking using programmable, logically separated control and data functions.
DPU: Data-processing unit that offloads infrastructure services from a host CPU.
IOMMU: Hardware unit that translates and restricts device memory accesses.
Tail latency: High-percentile latency experienced by the slowest transactions.
Review Questions
Short Answer Questions
What are the main functions of a network interface controller?
Why is DMA preferable to CPU-controlled copying for high-speed packet transfer?
What is the purpose of a descriptor ring?
How does receive-side scaling distribute network work?
Why can a large buffer increase latency?
Long Answer Questions
Explain the complete receive path from a network medium to an application, including the roles of the NIC, DMA, driver, operating system, and memory.
Compare programmed I/O, interrupt-driven I/O, and DMA for network communication.
Explain checksum offload, TCP segmentation offload, and receive coalescing, including their advantages and limitations.
Discuss how CPU affinity, cache locality, NUMA placement, and multi-queue operation affect network performance.
Compare ASIC-based, CPU-based, FPGA-based, and programmable data-plane approaches in network appliances.
Analytical / Application Questions
A 10 Gb/s link carries an average packet size of 1,000 bytes. Estimate the packet rate using the relationship in this chapter and explain why packet rate matters to CPU design.
A server has four receive queues, but one queue is consistently full while the others are lightly loaded. Identify likely causes and propose an investigation and corrective actions.
Design a high-level architecture for an SDN firewall that must support secure rule updates, flow counters, failover, bounded buffering, and protection against unauthorized DMA.
Multiple Choice Questions with Answers
Question 1
Which component usually performs direct transfers of packet data between a NIC and main memory?
A. DMA engine
B. PHY oscillator
C. Application scheduler
D. MAC address table
Correct Answer: A. DMA engine
Question 2
What is the primary purpose of a descriptor ring?
A. To store user passwords
B. To describe packet buffers and device operations
C. To amplify optical signals
D. To replace the operating system
Correct Answer: B. To describe packet buffers and device operations
Question 3
A 1 Gb/s link carries packets averaging 500 bytes. Ignoring overhead, what is the approximate packet rate?
A. 25,000 packets/s
B. 125,000 packets/s
C. 250,000 packets/s
D. 2,000,000 packets/s
Correct Answer: C. 250,000 packets/s
Question 4
What is a principal benefit of interrupt moderation?
A. It eliminates the need for packet buffers
B. It reduces interrupt overhead by combining events
C. It guarantees zero packet loss
D. It increases the physical cable speed
Correct Answer: B. It reduces interrupt overhead by combining events
Question 5
What does receive-side scaling generally distribute across multiple queues?
A. Independent network flows
B. Power supply voltages
C. Firmware images
D. Disk partitions
Correct Answer: A. Independent network flows
Question 6
Which statement best describes TCP segmentation offload?
A. The NIC combines unrelated routes into one table
B. The NIC divides a large logical TCP transmission into wire-sized segments
C. The CPU disables TCP acknowledgements
D. The switch encrypts every application file
Correct Answer: B. The NIC divides a large logical TCP transmission into wire-sized segments
Question 7
What is bufferbloat?
A. Corruption of a NIC firmware image
B. Latency caused by persistently excessive queue depth
C. A method of reducing packet size
D. A physical-layer modulation scheme
Correct Answer: B. Latency caused by persistently excessive queue depth
Question 8
Which architecture is especially associated with memory locality across processor sockets?
A. NUMA
B. ASCII
C. RAID
D. FIFO
Correct Answer: A. NUMA
Question 9
In an SDN system, what is a typical data-plane responsibility?
A. Repeated packet matching and forwarding
B. Writing university examinations
C. Allocating employee salaries
D. Replacing all physical links
Correct Answer: A. Repeated packet matching and forwarding
Question 10
What security function restricts and translates device memory accesses?
A. IOMMU
B. GRO
C. RSS
D. TSO
Correct Answer: A. IOMMU
Computer Organization and Architecture
Chapter 10
of 14