Backend Development 6 min read

Analysis of iSCSI Enterprise Target (IET) Architecture and I/O Processing

This article examines the kernel‑mode iSCSI Enterprise Target (IET), detailing its component modules (ietadm, ietd, iscsi_trgt), the interaction flow between initiators and the target, and the internal I/O processing pipeline, including thread allocation, work queues, and backend storage handling.

Architect
Architect
Architect
Analysis of iSCSI Enterprise Target (IET) Architecture and I/O Processing

IET (iSCSI Enterprise Target) is a kernel‑mode implementation of an iSCSI target that offers higher stability and performance compared with user‑space targets such as tgt. The article analyses IET’s architecture, covering its program modules, command‑handling flow, initiator‑target interaction, and I/O processing.

1. Program Modules

IET consists of three parts: ietadm (a command‑line tool for creating, deleting, and configuring targets and LUNs), ietd (a user‑space daemon that interacts with ietadm and initiators, handling discovery, login, authentication, and logout), and iscsi_trgt (a kernel module that parses the iSCSI protocol and performs I/O).

The communication flow is as follows: ietadm and ietd exchange messages via IPC; ietd creates a listening socket on port 3260 for each local IP address; initiators connect to this socket, establishing a long‑lived iSCSI session; finally, ietd uses ioctl to forward control commands to iscsi_trgt , which executes them in kernel space.

2. Initiator‑IET Interaction

When an initiator sends a request, ietd processes discovery, login, authentication, and logout operations. For example, during an iSCSI login the initiator’s request is received by ietd , which initializes connection structures, creates a session, and then issues an ioctl to iscsi_trgt to allocate the session in kernel space. After the kernel creates the session, ietd returns a response to the initiator and hands over the file descriptor to iscsi_trgt , allowing subsequent I/O to flow directly through the kernel socket.

3. I/O Processing

Each target created in iscsi_trgt spawns a network thread (named istd ) and a pool of worker threads (named istiod , default 8). The network thread parses incoming iSCSI packets, places commands into a shared work queue, and wakes worker threads. Workers dequeue commands and invoke the appropriate handlers in target_disk.c (e.g., INQUIRY, READ, WRITE, SYNCHRONIZE_CACHE). Depending on the backend storage type (nullio, blockio, fileio), the request is forwarded to the corresponding handler: block I/O builds a bio and calls submit_bio , while file I/O uses vfs_read / vfs_write . After processing, the response is placed in a per‑connection write list, the network thread sends it back through the socket to the initiator.

Backend developmentKernelLinuxstorageiSCSIIET
Architect
Written by

Architect

Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.