I'm trying to understand the low-level details of SCSI. The SCSI standards (such as the SAM-5 SCSI Architecture document) state that a single SCSI device can have multiple "target ports", and also multiple "logical units". When an initiator sends a request to read/write data to a target, it needs to specify both the desired target port and the logical unit number.
It seems that either just a port number or just a logical unit number would be enough to perform the needed multiplexing, so a single SCSI interface can provide access to multiple data sources/sinks.
Do SCSI devices in the real world actually provide multiple target ports and multiple logical units?
If you can provide an example of a device which has multiple target ports, and one which has multiple logical units, giving an idea of what ports/LUNs are used for in practice, that would be very helpful.
Any SAN device provides multiple ports (multiple FC ports and/or multiple iSCSI ports) and also provides multiple LUNs over each of these ports. The exposed LUNs may differ from port to port and the mapping of LUN ID to a volume may differ between the ports so LUN 1 may be volume 23 on port FC1 and LUN 3 on port iSCSI 2.
The port is the physical connection to the world. The LUN is a logical identifier for a volume on a port. The volume is the logical entity that is exposed to the world through the LUN and port mappings.