76
Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved. Introduction to iSCSI - 1 © 2008 EMC Corporation. All rights reserved. Introduction to iSCSI Introduction to iSCSI Welcome to Introduction to iSCSI. Copyright © 2008 EMC Corporation. All rights reserved. These materials may not be copied without EMC's written consent. EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice. THE INFORMATION IN THIS PUBLICATION IS PROVIDED “AS IS.” EMC CORPORATION MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLY DISCLAIMS IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Use, copying, and distribution of any EMC software described in this publication requires an applicable software license. EMC2, EMC, EMC ControlCenter, AlphaStor, ApplicationXtender, Captiva, Catalog Solution, Celerra, CentraStar, CLARalert, CLARiiON, ClientPak, Connectrix, Co-StandbyServer, Dantz, Direct Matrix Architecture, DiskXtender, DiskXtender 2000, Documentum, EmailXaminer, EmailXtender, EmailXtract, eRoom, FLARE, HighRoad, InputAccel, Navisphere, OpenScale, PowerPath, Rainfinity, RepliStor, ResourcePak, Retrospect, Smarts, SnapShotServer, SnapView/IP, SRDF, Symmetrix, TimeFinder, VisualSAN, VSAM-Assist, WebXtender, where information lives, Xtender, Xtender Solutions are registered trademarks; and EMC Developers Program, EMC OnCourse, EMC Proven, EMC Snap, EMC Storage Administrator, Acartus, Access Logix, ArchiveXtender, Authentic Problems,Automated Resource Manager, AutoStart, AutoSwap, AVALONidm, C-Clip, Celerra Replicator, Centera, CLARevent, Codebook Correlation Technology, EMC Common Information Model, CopyCross, CopyPoint, DatabaseXtender, Direct Matrix, EDM, E-Lab, Enginuity, FarPoint, Global File Virtualization, Graphic Visualization, InfoMover, Infoscape, Invista, Max Retriever, MediaStor, MirrorView, NetWin, NetWorker, nLayers, OnAlert, Powerlink, PowerSnap, RecoverPoint, RepliCare, SafeLine, SAN Advisor, SAN Copy, SAN Manager, SDMS, SnapImage, SnapSure, SnapView, StorageScope, SupportMate, SymmAPI, SymmEnabler, Symmetrix DMX, UltraPoint, UltraScale, Viewlets, VisualSRM are trademarks of EMC Corporation. All other trademarks used herein are the property of their respective owners.

Introduction to Iscsi - Srg

  • Upload
    eraltaf

  • View
    295

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 1

© 2008 EMC Corporation. All rights reserved.

Introduction to iSCSIIntroduction to iSCSI

Welcome to Introduction to iSCSI.

Copyright © 2008 EMC Corporation. All rights reserved.

These materials may not be copied without EMC's written consent.

EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice.

THE INFORMATION IN THIS PUBLICATION IS PROVIDED “AS IS.” EMC CORPORATION MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLY DISCLAIMS IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Use, copying, and distribution of any EMC software described in this publication requires an applicable software license.

EMC2, EMC, EMC ControlCenter, AlphaStor, ApplicationXtender, Captiva, Catalog Solution, Celerra, CentraStar, CLARalert, CLARiiON, ClientPak, Connectrix, Co-StandbyServer, Dantz, Direct Matrix Architecture, DiskXtender, DiskXtender 2000, Documentum, EmailXaminer, EmailXtender, EmailXtract, eRoom, FLARE, HighRoad, InputAccel, Navisphere, OpenScale, PowerPath, Rainfinity, RepliStor, ResourcePak, Retrospect, Smarts, SnapShotServer, SnapView/IP, SRDF, Symmetrix, TimeFinder, VisualSAN, VSAM-Assist, WebXtender, where information lives, Xtender, Xtender Solutions are registered trademarks; and EMC Developers Program, EMC OnCourse, EMC Proven, EMC Snap, EMC Storage Administrator, Acartus, Access Logix, ArchiveXtender, Authentic Problems,Automated Resource Manager, AutoStart, AutoSwap, AVALONidm, C-Clip, Celerra Replicator, Centera, CLARevent, Codebook Correlation Technology, EMC Common Information Model, CopyCross, CopyPoint, DatabaseXtender, Direct Matrix, EDM, E-Lab, Enginuity, FarPoint, Global File Virtualization, Graphic Visualization, InfoMover, Infoscape, Invista, Max Retriever, MediaStor, MirrorView, NetWin, NetWorker, nLayers, OnAlert, Powerlink, PowerSnap, RecoverPoint, RepliCare, SafeLine, SAN Advisor, SAN Copy, SAN Manager, SDMS, SnapImage, SnapSure, SnapView, StorageScope, SupportMate, SymmAPI, SymmEnabler, SymmetrixDMX, UltraPoint, UltraScale, Viewlets, VisualSRM are trademarks of EMC Corporation.

All other trademarks used herein are the property of their respective owners.

Page 2: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 2

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 2

Course Objectives

After completing this course, you will be able to:

Explain the basic concepts of the iSCSI protocol

List the iSCSI login processes

Explain how data is carried between the initiator and the target

The objectives for this course are shown here. Please take a moment to read them.

Page 3: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 3

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 3

SCSI Concepts

Upon completion of this module, you will be able to:

List the basic components of the SCSI environment

Explain the differences between a Logical Unit and a Logical Unit Number

Define a SCSI task

The objectives for this module are shown here. Please take a moment to read them.

Page 4: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 4

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 4

Target and Initiator

The basic components of the SCSI environment include target, initiator, logical units, and logical unit number.

SCSI is a client-server architecture. Clients of a SCSI interface are called initiators.

Initiators issue SCSI commands to request services from components and logical units of a server known as a target. The device server on the logical unit accepts SCSI commands and processes them.

Page 5: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 5

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 5

NodesA single Initiator or Target

Names are assigned to all Nodes

Independent of IP address

Independent of MAC address

Within iSCSI, a node is defined as a single initiator or target. These definitions map to the traditional SCSI target/initiator model.

iSCSI names are assigned to all nodes and are independent of the associated address.

Page 6: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 6

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 6

Logical Unit Number

Target

LUNs

1 2 3 4

At the highest level, SCSI is a family of interfaces for requesting services from I/O devices, including hard drives, tape drives, CD and DVD drives, printers, and scanners. In SCSI terminology, an individual I/O device is called a logical unit (LU).

A SCSI transport maps the client-server SCSI protocol to a specific interconnect. Initiators are one endpoint of a SCSI transport. The target is the other endpoint. A target can contain multiple Logical Units (LUs). Each Logical Unit has an address within a target called a Logical Unit Number (LUN).

A LUN is the logical unit address. A single address is used to identify individual logical units.

Page 7: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 7

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 7

SCSI Tasks

Target

LUNs

1 2 3 4

A SCSI task is a SCSI command or possibly a linked set of SCSI commands. Some LUs support multiple pending (queued) tasks, but the queue of tasks is managed by the Logical Unit. The target uses an initiator provided task tag to distinguish between tasks. Only one command in a task can beoutstanding at any given time.

Each SCSI command results in an optional data phase and a required response phase. In the data phase, information can travel from the initiator to the target (e.g., WRITE), target to initiator (e.g., READ), or in both directions.

In the response phase, the target returns the final status of the operation, including any errors.

Page 8: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 8

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 8

iSCSI Concepts

Upon completion of this module, you will be able to:

Define iSCSI

Identify the advantages and disadvantages of iSCSI

Explain the three protocols used in an IP storage network

Identify the IP storage deployment models

The objectives for this module are shown here. Please take a moment to read them.

Page 9: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 9

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 9

What is iSCSI?

A method to transfer blocks of data using the TCP/IP network

Serialized service delivery subsystem

SCSI protocol over IP (Internet Protocol)– TCP is a reliable transport that retransmits dropped packets– IP is an unreliable transport mechanism (packet dropping allowed)– Ethernet (10/100/1G/10G) is a popular Physical Transport layer

The iSCSI (Internet Small Computer Systems Interface) protocol provides a means of transporting SCSI packets over TCP/IP. iSCSI works by wrapping SCSI commands into TCP and transporting them over an IP network. Since iSCSI is IP-based traffic, it can be routed or switched on standard Ethernetequipment.

Page 10: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 10

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 10

iSCSI is Still SCSI…

iSCSI architecture follows the typical SCSI model

LUTargetInitiatorOS

TCP / IP Network

With the invention of Fibre Channel, the SCSI cables between the initiator and target have been replaced with fiber cables. Now with the invention of iSCSI, the fiber cables are being replaced with less expensive network cables and existing TCP/IP networks.

Page 11: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 11

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 11

Advantages of iSCSI

Many customers are moving from distributed to centralized data storage

SCSI is already installed for storage connections

TCP/IP is already installed for LAN communications

LAN switching is currently cheaper than FC switching

iSCSI also leverages IP knowledge and infrastructure. iSCSI leverages SCSI knowledge and standards.

IP is more common and less expensive than Fibre Channel.

Page 12: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 12

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 12

Disadvantages of iSCSI

FC is more mature and better understood in the storage world

Standard Ethernet interfaces do not have the throughput for practical iSCSI work, so you need to use GigE– GigE interfaces tend to chew up CPU time– TOEs (TCP/IP Offload Engines – dedicated TCP processors on the

NIC) would help solve this problem but…TOEs are not quite mature and there are a few significant technical issues with themNo EMC support for TOEs yet

iSCSI doesn’t really work well over most shared wide area networks. As of 1 June 2004, EMC requires a non-routing Layer 2 network dedicated to storage traffic.

Page 13: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 13

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 13

Protocols Used in an IP Storage Network

iSCSI

FC

iSCSI/FC Gateway

FC

FCIPRouter

FCIPRouter

FC

FC

iFCPSwitch

iFCPSwitch

FC

IPNetwork

IPNetwork

IPNetwork

IPNetwork

iFCPFCIP

Today, there are three protocols used in block storage over IP approaches in development:iSCSI – Native TCP/IP protocol. An IP-based protocol for establishing and managing connections between IP-based storage devices, hosts, and clients. No Fibre Channel content, but bridging between iSCSI and FC is possible.FCIP – TCP/IP-based tunneling/encapsulating protocol for connecting/extending Fibre Channel SANS. More IP content, little Fibre Channel content. FCIP is a protocol used to merge two or more SANS together using IP.iFCP – Gateway to gateway protocol for FC over IP. Mapping natively in IP across Fibre Channel and IP. An IP-based tunneling protocol for interconnecting Fibre Channel devices together in place of Fibre Channel switches. iFCP allows fabrics to remain independent.

Page 14: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 14

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 14

IP Storage Deployment Models

= IP= FC

Native All Ethernet (No Fibre Channel)iSCSI ProtocolEthernet Switches & Routers

Bridging Servers Ethernet AttachedStorage FC Attached (SAN or DAS)iSCSI Protocol

ExtensionServers & Storage SAN AttachedFCIP or iFCP ProtocolSRDF

The IP storage models are: native, bridging, and extension.

Native iSCSI allows for all communications using Ethernet. Initiators may be directly attached to iSCSI targets or may be connected using standard Ethernet routers and switches.

Bridging architectures allow for the initiators to exist in an Ethernet environment while the storage remains in a Fibre Channel SAN.

Extension architectures are most often used to provide connectivity across large distances. Either FCIP or iFCP bring the long distance benefits of IP to Fibre Channel.

Page 15: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 15

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 15

Can We Bridge FC to iSCSI?

Host still sees LUNswhether FC or iSCSI

Symm still arbitrates accessvia Volume Logix;

switch zoning still applies

Router can determinewhich IP portals are seen

by hosts

IP FC

Can we bridge FC to iSCSI? Yes, with qualified bridges. See the latest EMC support Matrix in Powerlink.

Restrictions on the environment:The network must be a local Layer 2 network dedicated solely to the iSCSI configuration. The network must be designed with no packet loss or duplication.iSCSI sessions may need to be manually re-established. A PSQ (Pre-site Qualification) is required for each implementation.

Network design is key to making sure iSCSI works. Real-world implementations require Gigabit Ethernet.Consider iSCSI a local area technology.Segregate iSCSI traffic from general traffic. Layer 2 VLANs are particularly good for this type of design.Oversubscription is OK for general user LANs, but not for iSCSI.

Page 16: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 16

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 16

Specificationswww.ietf.org– The IP Storage workgroup maintains current drafts

www.t10.org

The Internet Engineering Task Force (IETF) is a community of network designers, operators, vendors, and researchers concerned with the evolution of Internet architecture and the smooth operation of the Internet. The actual technical work of the IETF is done in its working groups, which are organized by topic into several areas (e.g., routing, transport, security, etc.). The current draft specifications for iSCSI are in the RFC process and can be located at http://ietf.org.

T10 is a technical committee of the International Committee on Information Technology Standards (INCITS). INCITS is accredited by, and operates under rules that are approved by the American National Standards Institute (ANSI). These rules are designed to ensure that voluntary standards are developed by the consensus of industry groups.

INCITS develops Information Processing System standards, while ANSI approves the process under which they are developed and publishes them. Related specifications on the SCSI architectural model are located at http://www.t10.org.

Page 17: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 17

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 17

Protocol Mapping

EthernetHeader

EthernetHeader

IPHeader

TCPHeader

iSCSIHeader

SCSI Commands& Data

CRC

The iSCSI protocol is a mapping of the SCSI remote procedure invocation model over the TCP protocol. SCSI commands are carried by iSCSI requests. SCSI responses and status are carried by iSCSI responses. iSCSI also uses the request response mechanism for iSCSI protocol mechanisms.

Page 18: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 18

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 18

iSCSI PDU

Expected Data Transfer Length or Opcode Specific FieldsInitiator Task Tag or Opcode specificLogical Unit Number (LUN)

DataSegmentLengthTotalAHSLengthOpcode Specific Fields.|I| Opcode

BasicHeader

Segment

BasicHeader

Segment

AdditionalHeader

Segment

AdditionalHeader

SegmentHeaderDigest

HeaderDigest

SCSI Command & Data

SCSI Command & Data

HeaderData

Digest

HeaderData

Digest

In keeping with similar protocols, the initiator and target divide their communications into messages. This message is the iSCSI Protocol Data Unit (PDU).

Page 19: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 19

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 19

Architectural Model

iSCSI Node

TargetIP Network

Network Portal

10.1.2.1TCP port

3250

Network Portal

10.1.2.2TCP port

3260

iSCSI Node

Initiator

Network Portal

10.1.1.1

Network Portal

10.1.1.2

Network EntityiSCSI Client

Network EntityiSCSI Server

There are two major network components associated with iSCSI. The first is the Network Entity, the specific device or gateway accessible to the IP network. This device must have one or more Network Portals available for use.

The second network component is the Network Portal. This component of the Network Entity has an assigned IP address and a listening TCP port.

Page 20: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 20

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 20

iSCSI Portal Groups

iSCSI Node

TargetIP Network

Network Portal

10.1.2.1TCP port

3250

Network Portal

10.1.2.2TCP port

3260

iSCSI Node

Initiator

Network Portal

10.1.1.1

Network Portal

10.1.1.2

Network EntityiSCSI Client

Network EntityiSCSI Server

iSCSI supports multiple connections within the same session. Some implementations have the ability to combine connections in a session across multiple Network Portals.

A Portal Group defines a set of Network Portals within an iSCSI node that collectively supports the capability of coordinating a session with connections that span these portals. Portal Groups are identified within an iSCSI node by a portal group tag, a simple unsigned integer between 0 and 65535. Both iSCSI initiators and iSCSI targets have portal groups, though only the iSCSI Target Portal Groups are used directly in the iSCSI protocol.

Page 21: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 21

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 21

iSCSI Layers

Upon completion of this module, you will be able to:

List the layers of the iSCSI architectural model

Explain the concept of TOE and how it is used to increase performance

Describe the iSCSI frame composition

The objectives for this module are shown here. Please take a moment to read them.

Page 22: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 22

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 22

iSCSI Layers

Ethernet

Command Descriptor Blocks

Builds/receives iSCSI PDUs

Control messages, SCSI commands, parameters, data

Packet transmission protocol

Optical and electrical Interfaces, cables, connectors, etc.

Volume managers, file systems, applications

IP

TCP

iSCSI

SCSI Device Driver

Application

The iSCSI protocol is broken up into logical layers.

Page 23: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 23

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 23

Ethernet

Ethernet

Command Descriptor Blocks

Builds/receives iSCSI PDUs

Control messages, SCSI commands, parameters, data

Packet transmission protocol

Optical and electrical interfaces, cables, connectors, etc.

Volume managers, file systems, applications

IP

TCP

iSCSI

SCSI Device Driver

Application

Ethernet is the most widely installed local area network (LAN) technology. Specified in a standard, IEEE 802.3, Ethernet was originally developed by Xerox and then developed further by Xerox, Digital Equipment Corporation, and Intel. An Ethernet LAN typically uses coaxial cable or special grades of twisted pair wires.

Ethernet systems provide transmission speeds up to 1 Gbps throughput and may use traditional copper or fiber optic cable. Devices are connected to the cable and compete for access using a Carrier Sense Multiple Access with Collision Detection (CSMA/CD) protocol.

Fast Ethernet or 100BASE-T provides transmission speeds up to 100 megabits per second and is typically used for LAN backbone systems, supporting workstations with 10BASE-T cards.

Gigabit Ethernet provides an even higher level of backbone support at 1000 megabits per second (1 gigabit or 1 billion bits per second). 10-Gigabit Ethernet provides up to 10 billion bits per second.

Page 24: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 24

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 24

NIC and TOEChecksum offload– Fragmentation, out of order

packets handled by host– Could hurt system performance

Full TCP/IP offload– Fragmentation, out of order

packets handled by TOE– Increased memory/processing

requirements– iSCSI & SCSI handled by host

Full TCP/IP+iSCSI/SCSI– Completes storage connection– Runs all layers on TOE (HBA)

Traditional Ethernet adapters (NICs) are designed to transfer packetized file-level data among PCs, servers, and storage devices, such as NAS appliances. However, NICs do not traditionally transfer block level data, which is handled by a storage host bus adapter, such as Fibre Channel or parallel SCSI. In order for a NIC to process block-level data, the data needs to be placed into a TCP/IP packet before being sent over the IP network.

Through the use of iSCSI drivers on the host or server, a NIC can transmit packets of block-level data over an IP network. When using a NIC, the server handles the packet creation of block-level data and performs all of the TCP/IP processing. This is extremely CPU intensive and lowers overall server performance.

The TCP/IP processing performance bottleneck has been the driving force behind the development of TCP/IP offload engines (TOE) on adapter cards. A TOE removes the TCP/IP processing from the host CPU and completes TCP/IP processing and packet creation on the HBA. Thus a TCP/IP offload storage NIC operates more like a storage HBA rather than a standard NIC.

Page 25: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 25

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 25

IP

Ethernet

Command Descriptor Blocks

Builds/receives iSCSI PDUs

Control messages, SCSI commands, parameters, data

Packet transmission protocol

Optical and electrical interfaces, cables, connectors, etc.

Volume managers, file systems, applications

IP

TCP

iSCSI

SCSI Device Driver

Application

The Internet Protocol (IP) is the method or protocol by which data is sent from one computer to another. Each host on the network has at least one IP address that uniquely identifies it from all other computers on the Internet. When you send or receive data, the message gets divided into chunks called packets. Each of these packets contains both the sender's address and the receiver's address.

Page 26: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 26

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 26

Packets

iSCSI PDU

IP Packet

TCP Segment

BasicHeader

Segment

AdditionalHeader

SegmentData

HeaderData

Digest

HeaderDigest

TCPHeader

IPHeader

Because a message is divided into a number of packets, each packet can, if necessary, be sent by a different route across the network. Packets can arrive in a different order than the order in which they were sent. The Internet Protocol simply delivers them. It is up to another protocol, the Transmission Control Protocol (TCP), to put them back in the correct order.

An "iSCSI packet" contains SCSI data and the iSCSI header, which is created by the iSCSI initiator, and is then wrapped in other protocol layers to facilitate its transport.

The Ethernet Header is used to provide the physical network capability (CAT5, MAC, FDX, etc.).

The IP Header provides packet routing information used for moving the information across the network. The TCP Header contains the information needed to guarantee delivery to the target destination.

The iSCSI Header explains how to extract SCSI commands and data.

Page 27: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 27

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 27

SCSI to iSCSI Mapping

SCSI Command and DataSCSI Command and Data

Header DataHeader Data

PDU PDU

Header DataHeader Data

PDU

Header DataHeader Data

PDU

Header DataHeader Data

IP packetIP packet IP packetIP packet IP packetIP packet IP packetIP packet IP packetIP packet IP packetIP packet IP packetIP packet IP packetIP packet

As in most networking protocols, the data is broken up and encapsulated within packets for transmission. In iSCSI, the SCSI commands are issued and broken into iSCSI PDUs. These, in turn, are broken into IP packets and transmitted across the physical level. The receiving node then reassembles the data and passes it up the network stack until a SCSI command is extracted.

Page 28: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 28

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 28

TCP

Ethernet

Command Descriptor Blocks

Builds/receives iSCSI PDUs

Control messages, SCSI commands, parameters, data

Packet transmission protocol

Optical and electrical interfaces, cables, connectors, etc.

Volume managers, file systems, applications

IP

TCP

iSCSI

SCSI Device Driver

Application

Communication between the initiator and target occurs over one or more TCP connections. The TCP connections carry control messages, SCSI commands, parameters, and data within iSCSI PDUs. The group of TCP connections that link an initiator with a target form a session (loosely equivalent to a SCSI I_T nexus).

Page 29: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 29

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 29

iSCSI Session ID

TSIH

ISID

The two principal Session IDs in iSCSI are the ISID (Initiator Session ID) and the TSIH (Target Session Identifying Handle).

The ISID is generated by the initiator during session login. There is one ISID for each session between a target and initiator pair and is used for all additional logins during that session.

The TSIH is an assigned tag by the target for a session with a specific initiator.

Page 30: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 30

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 30

iSCSI

Ethernet

Command Descriptor Blocks

Builds/receives iSCSI PDUs

Control messages, SCSI commands, parameters, data

Packet transmission protocol

Optical and electrical interfaces, cables, connectors, etc.

Volume managers, file systems, applications

IP

TCP

iSCSI

SCSI Device Driver

Application

The iSCSI layer builds or receives iSCSI PDUs and relays or receives them to or from one or more TCP connections.

Page 31: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 31

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 31

PDU Template

Data Digest (Optional)

DataSegment, Command Data (Optional)

AHS (Optional)

Header Digest (Optional)

SCSI Command Descriptor Block (CDB)

ExpStatSN

CmdSN

z

y

x

48

32

28

24

Expected Data Transfer Length or Opcode Specific Fields20

Initiator Task Tag or Opcode specific

8

16

4

0

Byte 3Byte 2Byte 1Byte 0

Logical Unit Number (LUN)

DataSegmentLengthTotalAHSLength

Opcode Specific Fields.|I| Opcode

7 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 0

iSCSI PDUs are used to carry messages between the target and the initiator. It is within the PDU that the actual mapping of SCSI data, commands, and responses to iSCSI take place.

PDUs are padded to the closest integer number of four byte words. The padding bytes should be sent as 0. Each of the segments within the PDU is described in the above illustration.

Page 32: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 32

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 32

Basic Header Segment

48

44

40

36

32

28

24

Expected Data Transfer Length or Opcode Specific Fields20

Initiator Task Tag or Opcode specific16

12

8

4

0

Byte 3Byte 2Byte 1Byte 0

Logical Unit Number (LUN)

DataSegmentLengthTotalAHSLength

Opcode Specific Fields.|I| Opcode

7 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 0

The Basic Header Segment (BHS) is 48 bytes long. The Opcode and DataSegmentLength fields appear in all iSCSI PDUs.

When used, the Initiator Task Tag and Logical Unit Number always appear in the same location in the header.

The Immediate Delivery (I) bit is used to mark a request for immediate execution, however, the operations involved (all or part of them) may be postponed to allow the target to receive all relevant tasks.

Page 33: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 33

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 33

OpcodesInitiator opcodes – NOP-Out– SCSI Command – SCSI Task Management request– Login Request– Text Request– SCSI Data-out for write operations– Logout Request– SNACK Request– Vendor specific codes

Target opcodes– NOP-In– SCSI Response– SCSI Task Management response– Login Response– Text Response– SCSI Data-in for read operations– Logout Response– Ready To Transfer (R2T) – Asynchronous Message– Vendor specific codes– Reject

The Opcode indicates the type of iSCSI PDU the header encapsulates. Opcodes are divided into two categories: initiator opcodes and target opcodes.

Initiator opcodes are in PDUs sent by the initiator (request PDUs). Target opcodes are in PDUs sent by the target (response PDUs).

Examples include the Login commands and Text Requests which assist in the discovery process.

Page 34: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 34

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 34

Additional Header Segment

Data-Digest (optional)m

Data Segment (optional)l

Header Digest (optional)k

Additional Header Segment (AHS) (optional)+

48

0

Byte 3Byte 2Byte 1Byte 0

Basic Header Segment (BHS)

7 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 0

The AHS (Additional Header Segments) are optional and when present follow the BHS (Basic Header Segment). The AHS is used for extended CDB information and bi-directional Read-Data requests.

Page 35: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 35

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 35

Data Segment

Data-Digest (optional)m

Data Segment (optional)l

Header Digest (optional)k

Additional Header Segment (AHS) (optional)+

48

0

Byte 3Byte 2Byte 1Byte 0

Basic Header Segment (BHS)

7 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 0

The (optional) Data Segment contains PDU associated data. Its payload effective length is provided in the BHS field – DataSegmentLength. The Data Segment is also padded to an integer number of 4 byte words.

Some SCSI commands require additional parameter data to accompany the SCSI command. This data may be placed beyond the boundary of the iSCSI header in a data segment. Alternatively, user data (e.g., from a WRITE operation) can be placed in the data segment. Both cases are referred to as immediate data.

Page 36: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 36

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 36

Header and Data Digest

Data-Digest (optional)m

Data Segment (optional)l

Header Digest (optional)k

Additional Header Segment (AHS) (optional)+

48

0

Byte 3Byte 2Byte 1Byte 0

Basic Header Segment (BHS)

7 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 0

Optional header and data digests protect the integrity of the header and data, respectively. The digests, if present, are located after the header and PDU-specific data, and cover the data and the padding bytes. The decision as to whether there will be digests is negotiated during the Login Phase.

The separation of the header and data digests is useful in iSCSI routing applications, where only the header changes when a message is forwarded. In this case, only the header digest is recalculated. Digests are not included in data or header length fields.

Page 37: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 37

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 37

SCSI

Ethernet

Command Descriptor Blocks

Builds/receives iSCSI PDUs

Control messages, SCSI commands, parameters, data

Packet transmission protocol

Optical and electrical interfaces, cables, connectors, etc.

Volume managers, file systems, applications

IP

TCP

iSCSI

SCSI Device Driver

Application

The SCSI layer builds/receives SCSI Command Descriptor Blocks (CDBs) and passes/receives them with the remaining command parameters to/from the iSCSI layer.

Page 38: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 38

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 38

Command Descriptor Blocks

Reserved0x01

x

4

0

Byte 3Byte 2Byte 1Byte 0

ExtendedCDB...+padding

AHSLength (CDBLength-15)

7 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 07 6 5 4 3 2 1 0

Command Descriptor Blocks (CDB) are the data structures used to contain the command parameters that an initiator sends to a target. The CDB content and structure is defined by device-type specific SCSI standards.

There are 16 bytes in the CDB field to accommodate commonly used CDBs. Whenever the CDB is larger than 16 bytes, an Extended CDB AHS MUST be used to contain the CDB spillover.

Page 39: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 39

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 39

iSCSI Address and Names

Upon completion of this module, you will be able to:

Identify the parts of the iSCSI name

List the parts of the iSCSI address

The objectives for this module are shown here. Please take a moment to read them.

Page 40: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 40

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 40

iSCSI Names

iSCSI names contain three parts– Type designator– Naming Authority– String determined by naming authority

iqn. – iSCSI Qualified Name– iqn.2003-04.com.emc.symmetrix.0093– iqn.2003-04.com.emc.symmetrix.0093:diskarray.1

eui. – Extended Unique Identifier– eui.50060482AEA5574E

Names enable iSCSI storage resources to be managed regardless of address. An iSCSI node name is also the SCSI device name of an iSCSI device. The iSCSI name of a SCSI device is the principal object used in authentication of targets to initiators and initiators to targets. It is also used to identify and manage iSCSI storage resources. They are associated with iSCSI nodes, but not iSCSI network adapter cards, so the replacement of network adapter cards does not require reconfiguration of all SCSI and iSCSI resource allocation information.

iSCSI names must be unique within the operational domain of the end user. However, because the operational domain of an IP network is potentially worldwide, the iSCSI name formats are worldwide unique. To assist naming authorities in the construction of worldwide unique names, iSCSI provides two name formats for different types of naming authorities.

iSCSI Qualified Name – To generate names of this type, the person or organization generating the name must own a registered domain name. This domain name does not have to be active, and does not have to resolve to an address; it simply needs to be reserved to prevent others from generating iSCSI names using the same domain name.

Since a domain name can expire, be acquired by another entity, or be used to generate iSCSI names by both owners, the domain name must be additionally qualified by a date during which the naming authority owned the domain name. A date code is provided as part of the "iqn." format for this reason.

Extended Unique Identifier – The iSCSI format is "eui." followed by an EUI-64 identifier (16 ASCII-encoded hexadecimal digits).

The IEEE Registration Authority provides a service for assigning globally unique identifiers [EUI]. The EUI-64 format is used to build a global identifier in other network protocols. For example, Fibre Channel defines a method of encoding it into a World Wide Name.

Page 41: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 41

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 41

iSCSI Addresses

Address is the path to end point (iSCSI node) which is a combination of– IP address (v4 or v6)– TCP Port– iSCSI name

The address usually corresponds to the Network Portal

Can be changed at any time except for the target TCP Port (3260)

An iSCSI address is comprised of the iSCSI Name and its location. The location is a combination of the host name, the IP address and, in the case of a target, the TCP port number.

Page 42: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 42

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 42

iSCSI Login

Upon completion of this module, you will be able to:

List the steps of the iSCSI login process

Explain the purposes of the iSCSI login process

Identify the types of iSCSI security

The objectives for this module are shown here. Please take a moment to read them.

Page 43: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 43

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 43

OverviewLogin– Validate user – Validate access rights

Negotiate parameters for that session– PDU size – Immediate data support

Initiator (host) sends CMD as OPCODE encapsulated in an iSCSI PDU

Target (storage) receives command, replies with R2T

For a Write/Data Out (Read/Data In), host (target) sends data encapsulated in an iSCSI PDU

Target sends encapsulated status back to initiator

The iSCSI login process includes several stages. During the login, the user is authenticated and security parameters are exchanged. Once the session is established, the initiator is able to send SCSI commands to the target. Normal SCSI command procedures are followed including status replies.

Page 44: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 44

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 44

accept

login

Purpose of LoginEnable a TCP connection

Authenticate

Negotiate session parameters

Mark the connection

The purpose of the iSCSI login is to enable a TCP connection for iSCSI use, authentication of the parties, negotiation of the session's parameters, and marking of the connection as belonging to an iSCSI session.

A session is used to identify to a target all the connections with a given initiator that belong to the same I_T nexus. The targets listen on a well-known TCP port or other TCP port for incoming connections. The initiator begins the login process by connecting to one of these TCP ports.

Page 45: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 45

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 45

Login Stages

Security Negotiation

Operational Parameter

Negotiation

The Login process proceeds in two stages—the security negotiation stage and the operational parameter negotiation stage. Both stages are optional but at least one of them has to be present to enable setting some mandatory parameters.

Page 46: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 46

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 46

Login

Login Response

Login Request

The iSCSI Login Phase is carried through login requests and responses. Once suitable authentication has occurred and operational parameters have been set, the session transitions to Full Feature Phase and the initiator may start to send SCSI commands.

Page 47: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 47

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 47

Login Phase Start

Protocol versioniSCSI names

Negotiation state

The Login Phase starts with a login request from the initiator to the target. The initial login request includes:

Protocol version supported by the initiatoriSCSI Initiator Name and iSCSI Target NameNegotiation stage that the initiator is ready to enter

A login may create a new session or it may add a connection to an existing session—between a given iSCSI Initiator Node selected by an InitiatorName and a given iSCSI target defined by an iSCSI TargetName and a Target Portal Group Tag.

Page 48: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 48

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 48

Login Security Negotiations

Security LoginKey Value

Parameters

The security exchange sets the security mechanism and authenticates the initiator user and the target to each other. The exchange proceeds according to the authentication method chosen in the negotiation phase and is conducted using the login requests' and responses' key=value parameters.

Page 49: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 49

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 49

Types of iSCSI Security

iSCSI supports several different types of security– Encryption

IPsecIKE

– AuthenticationKerberos v5SRP (Secure Remote Password)SPKM1 / 2CHAP (possibly using RADIUS servers but not the protocol itself)

CHAP is the only “must-support” protocol in the current iSCSI spec, and it is the only one EMC supports at this time.

iSCSI Security – CHAP basics: CHAP (Challenge Handshake Authentication Protocol) verifies identity using a hashed transmission. A “Secret” key is known by both parties. Periodic re-challenges guard against replay attacks.The target (not necessarily the iSCSI target, but the security requestor) initiates the challenge.CHAP is a one-way protocol but may be implemented in two directions to provide security for both ends.

Page 50: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 50

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 50

iSCSI Security – CHAP Process

Challenge

Target compares hashes;If they match, passwords

must be the same.

HashCHAP target sends out a

random challenge message& hashes it with the locally-stored key.

Requestor builds hashwith its locally-stored

key and sends it back.

Keyfhash

Challenge fhash Key Hash

Hash Hash

=

=

(Transmit)

(Transmit)

A key is never sent over the link. Hash is a one-way function; a key cannot be mathematically derived from hash.

Page 51: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 51

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 51

Session Establishment

ISIDTSIH

The login PDU includes the ISID part of the session ID (SSID). The target portal group that services the login is implied by the selection of the connection endpoint. For a new session, the TSIH is zero. As part of the response, the target generates a TSIH.

Page 52: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 52

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 52

Full Feature Phase

SCSI commands

Once the initiator is authorized to do so, the iSCSI session is in the iSCSI Full Feature Phase. A session is in Full Feature Phase after successfully finishing the Login Phase on the first (leading) connection of a session. A connection is in Full Feature Phase if the session is in Full Feature Phase and the connection login has completed successfully.

An iSCSI connection is not in Full Feature Phase if it does not have an established transport connection or when it has a valid transport connection, but a successful login was not performed or the connection is currently logged out.

In a normal Full Feature Phase, the initiator may send SCSI commands and data to the various LUNs on the target by encapsulating them in iSCSI PDUs that go over the established iSCSI session.

Page 53: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 53

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 53

Operational Parameter NegotiationHeaderDigest and DataDigest (CRC32)

MaxConnections

SendTargets

TargetName

InitiatorName

TargetAlias

InitiatorAlias

TargetAddress

TargetPortalGroupTag

R2T

ImmediateData

MaxRecvDataSegmentLength (PDU data size)

MaxBurstSize

FirstBurstSize

DefaultTime2Wait

DefaultTime2Retain

MaxOutstandingR2T

DataPDUInOrder

DataSequenceInOrder

ErrorRecoveryLevel

SessionType

Vendor Specific Key Format

Operational parameter negotiation during the login may occur in two situations. The first situation starts with the first Login request—if the initiator does not propose any security/integrity option.

The other situation is immediately after the security negotiation—if the initiator and target perform such a negotiation.

Operational parameter negotiation may involve several Login request-response exchanges started and terminated by the initiator. The initiator MUST indicate its intent to terminate the negotiation by setting the T bit to 1; the target sets the T bit to 1 on the last response.

Page 54: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 54

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 54

iSCSI Connection Termination

TCP FIN

Graceful TCP connection shutdowns are done by sending TCP FINs. A graceful transport connection shutdown should only be initiated by either party when the connection is not in iSCSI Full Feature Phase.

A target may terminate a Full Feature Phase connection on internal exception events, but it should announce the fact by means of an Asynchronous Message PDU.

Page 55: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 55

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 55

iSCSI Discovery

Upon completion of this module, you will be able to:

List the iSCSI Discovery methods

Explain the purposes of the iSNS service

Describe Discovery using Service Location Protocol

The objectives for this module are shown here. Please take a moment to read them.

Page 56: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 56

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 56

iSCSI Discovery

Defines how the Initiator finds the Target

Methods of discovery– Manual Configuration (SendTarget)– The initiator queries an iSNS– The initiator uses SLP

iSCSI Discovery is the process where the Initiator finds the Target. This process is required before discovery of Logical Units and LUNs.

Page 57: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 57

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 57

Manual Configuration

Initiator is configured with the iSCSI address of the Target– Up to 255 characters long– iSCSI addresses (IP,TCP port)

Initiator connects to an iSCSI server and initiates an iSCSI Discovery session

Upon successful login, the initiator issues SendTargets command

Target returns a list of targets with the address, names, and aliases

The ability to define a Target manually places the control into the administrator’s hands. Each Target must be identified to each Initiator by its iSCSI name. This method could be difficult to manage since it requires direct changes to each Initiator within the storage network.

Additionally the iSCSI name can be up to 255 characters long—opening the potential for mistypes.

Page 58: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 58

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 58

SendTargets Example

TargetName=iqn.1992-04.com.emc.5006048 861e46c0TargetAddress=10.1.1.2:3260

SendTargets=All

SessionType=Discovery

Status=success

Initiator

10.1.1.1 5850

Target

10.1.1.2 3260

In this example, we see the manual Discovery process between an initiator, the host, and a target, the Symmetrix. As the normal iSCSI logins take place, the session type is set to Discovery. Once a successful acknowledgment is received, the initiator issues the SendTargets=All command. The target replies with the target’s information.

Page 59: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 59

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 59

Storage Name Server Overview

iSNS is a client/server model

The iSNS server is passive – May send state change notifications to the registered clients in

response to an action by an iSNS client

iSNS clients register & manipulate the objects in the iSNS server– initiators, targets, management stations, switches

An iSNS server can be hosted on a target, switch, initiator, or stand-alone server with specified IP address

The iSNS database is the information repository for the iSNS server(s). It maintains information about iSNS client attributes. A directory-enabled implementation of iSNS may store client attributes in anLDAP directory infrastructure.

There are four main functions of the iSNS:

1) A Name Service Providing Storage Resource Discovery

2) Discovery Domain (DD) and Login Control Service

3) State Change Notification Service

4) Open Mapping of Fibre Channel and iSCSI Devices

Page 60: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 60

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 60

iSNS Domain Discovery

Discovery Domains

Device B

Host B

Host A

Host C

Device A

Discovery Domains (DD) are a security and management mechanism used to partition storage resources. Discovery Domains limit the discovery process to the administrator-configured subset of relevant storage devices, preventing initiators from attempting login to devices to which they should not have access.

When queried, the iSNS server provides information only for storage entities that share at least one common DD. Initiators are not able to "see" devices that they do not have at least one common DD.

Page 61: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 61

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 61

iSNS Example

SecurityKeys

Management Platform

iSNS

Device B

Host B

Host A

Host C

Device A

iSNS protocol registration and query messages are sent by iSNS clients to servers, while notification messages are sent by iSNS servers to iSNS clients. Messages originating at the client are sent to the iSNS server at the well-known iSNS TCP or UDP port number.

The iSNS provides a registration function to allow all entities in a storage network to register and query the iSNS database. Both targets and initiators can register in the iSNS database, as well as query for information about other initiators and targets. This allows a client initiator to obtain information about target devices from the iSNS server, for example.

This service is modeled on the Fibre Channel Generic Services Name Server described in FC-GS-3, with extensions, operating within the context of an IP network.

Page 62: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 62

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 62

State Change

iSNS

Device B

Host B

Host A

Host C

Device A

Hostlogsout

SCNservice

The State Change Notification (SCN) service allows the iSNS to issue notifications about network events that affect the operational state of iSNS clients. The iSNS client can register for notification of events detected by the iSNS. The types of events for which SCNs can be sent include change in Discovery Domain membership and device registration updates.

The State Change Notification service utilizes the Discovery Domain Service to control the distribution of notification messages. Notifications about changes within a DD are limited to members of that DD.

Page 63: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 63

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 63

Service Location Protocol (SLP)

A discovery mechanism with minimal configuration– A good choice for small or medium networks

The Service Agent advertises the iSCSI address as URL– iSCSI://<domain name>[:<port>]/<iSCSI-name>– <domain name> = IP address– <port> = optional and can be the IANA assigned (3260)– <iSCSI-name> = target iSCSI name

This address is primarily used for discovery

The Service Locator Protocol (SLP) was standardized in the IETF. It provides automatic client configuration for applications and advertisement for network services. The Service Location Protocol eliminates the need for a user to know the name of a network host supporting a service. Rather, the user names the service and supplies a set of attributes which describe the service.

The SLP allows the user to bind this description to the network address of the service. The SLP is comprised of a process working on the client's behalf to establish contact with some service.

The User Agent (UA) retrieves service information from the Service Agents or Directory Agents.

The Service Agent (SA) is a process working on behalf of one or more services to advertise the services and their capabilities. The process that collects service advertisements is called the Directory Agent (DA). There can only be one DA present per given host.

Page 64: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 64

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 64

SLP Example

SLPUA

iSCSI Initiator

TCP/IP

Management Code

SLPUA

iSCSI Initiator

TCP/IP

Management CodeIP Network

SLPDirectory

Agent

In order for SLP to work, the target would advertise its name:IP address:port either to a DA in the network or on its own via its SA. The initiator contacts the DA directly, using its UA, looking for targets or it could multicast looking for an SA to request targets.

All normal login processes follow from this point.

Page 65: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 65

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 65

iSCSI Communications

Upon completion of this module, you will be able to:

Explain the data flow model of iSCSI

List the error correction methods of iSCSI

The objectives for this module are shown here. Please take a moment to read them.

Page 66: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 66

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 66

Ordering and Numbering

Every iSCSI PDU message is numbered

Commands are numbered by CmdSN and are unique per iSCSI session

Status is numbered by StatSN and are unique per TCP connection

Data are numbered by DataSN and are unique per command

CmdSN

StatSN

CmdSN

StatSN StatSN

PDU #1 PDU #1

PDU #2

PDU #3

PDU #1

PDU #2

PDU #3

PDU #4

Similar to Fibre Channel and other network protocols, iSCSI uses a numbering system to manage the breakup of data into smaller packets. At the highest level, the CmdSN (Command Sequence Number) is unique within an iSCSI session. The CmdSN is similar in operation to the OXID in Fibre Channel.

At the TCP connection level, the StatSN is the unique numbering identifier. The StatSN is equivalent to the SEQ_ID. The DataSN field is also sequenced per command and is similar to the SEQ_CNT. Unlike command and status, data PDUs and R2Ts are not acknowledged by a field in regular outgoing PDUs.

Page 67: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 67

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 67

Data Flow

Data transfer on the same path as command and status

Data out may be unsolicited or solicited

Unsolicited data can be– Sent as part of the command message or– Separate data messages (as in WRITE command)

Solicited data is sent– Only in response to a target initiated Ready-to-Transfer (R2T)

message

When there are multiple connections, connection allegiances are distributed for a single session. Data Out indicates data in the direction from the initiator to the target.

Page 68: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 68

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 68

Example of iSCSI Data Flow

192.168.0.58 192.168.0.100 TCP 1039 > 3260 [SYN] Seq=1771272578 Ack=0 192.168.0.100 192.168.0.58 TCP 3260 > 1039 [SYN,ACK] Seq=2980037053 Ack=1771272579 192.168.0.58 192.168.0.100 TCP 1039 > 3260 [ACK] Seq=1771272579 Ack=2980037054 192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1039 [ACK] Seq=2980037054 Ack=1771272779 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1039 [ACK] Seq=2980037118 Ack=1771272827 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1039 [ACK] Seq=2980037166 Ack=1771272875 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 iSCSI SCSI: Inquiry192.168.0.100 192.168.0.58 TCP 3260 > 1039 [ACK] Seq=2980037238 Ack=1771272923 192.168.0.100 192.168.0.58 iSCSI SCSI Data In192.168.0.100 192.168.0.58 iSCSI SCSI Response (Good)192.168.0.58 192.168.0.100 TCP 1039 > 3260 [ACK] Seq=1771272923 Ack=2980037338192.168.0.58 192.168.0.100 iSCSI SCSI: Inquiry192.168.0.100 192.168.0.58 TCP 3260 > 1039 [ACK] Seq=2980037338 Ack=1771272971 192.168.0.100 192.168.0.58 iSCSI SCSI Data In192.168.0.100 192.168.0.58 iSCSI SCSI Response (Good)192.168.0.58 192.168.0.100 TCP 1039 > 3260 [ACK] Seq=1771272971 Ack=2980037438192.168.0.58 192.168.0.100 iSCSI SCSI: Inquiry192.168.0.100 192.168.0.58 TCP 3260 > 1039 [ACK] Seq=2980037438 Ack=1771273019 192.168.0.100 192.168.0.58 iSCSI SCSI Data In192.168.0.100 192.168.0.58 iSCSI SCSI Response (Good)192.168.0.58 192.168.0.100 TCP 1039 > 3260 [ACK] Seq=1771273019 Ack=2980037538

TCP

iSCSILogin

SCSIInquiry

In this example, we see the establishment of the TCP session and then the transition to the iSCSI Login sequence. For each successful login, a Login Response is issued. After the Full feature phase login, the SCSI Inquiry phase begins and we operate under normal SCSI 3 rules of discovery.

Page 69: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 69

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 69

iSCSI CmdSN

iSCSI (SCSI Command)Opcode: SCSI Command (0x01).0.. .... = I: Queued deliveryFlags: 0xc0

1... .... = F: Final PDU in sequence.1.. .... = R: Data will be read from target..0. .... = W: No data will be written to target.... .000 = Attr: Untagged (0x00)

TotalAHSLength: 0x00DataSegmentLength: 0x00000000LUN: 0000000000000000InitiatorTaskTag: 0x48346681ExpectedDataTransferLength: 0x00001000CmdSN: 0x0000015dExpStatSN: 0x00000003

SCSI CDBOpcode: Read(10) (0x28)DPO = 0, FUA = 0, RelAddr = 0Logical Block Address (LBA): 4572840Transfer Length: 8Vendor Unique = 0, NACA = 0, Link = 0

Command Sequence Number

The CmdSN (Command Sequence Number) enables ordered delivery across multiple connections in a single session. For task sets, the CmdSN of the Task Management function request helps identify the tasks upon which to act, namely all tasks associated with a LUN and having a CmdSN preceding the Task Management function request CmdSN.

For Task Management, the coordination between responses to the tasks affected and the Task Management function response is done by the target.

Page 70: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 70

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 70

iSCSI StatSN

iSCSI (SCSI Command) Opcode: SCSI Command (0x01).0.. .... = I: Queued deliveryFlags: 0xa1

1... .... = F: Final PDU in sequence.0.. .... = R: No data will be read from target..1. .... = W: Data will be written to target.... .001 = Attr: Simple (0x01)

TotalAHSLength: 0x00DataSegmentLength: 0x00000000LUN: 0038000000000000InitiatorTaskTag: 0x00000c21ExpectedDataTransferLength: 0x00000800CmdSN: 0x00000c21 ExpStatSN: 0x00000c25HeaderDigest: 0xdc7346d9 (Good CRC32)

SCSI CDBOpcode: Write(10) (0x2a)DPO = 0, FUA = 0, RelAddr = 0Logical Block Address (LBA): 1254559Transfer Length: 4Vendor Unique = 0, NACA = 0, Link = 0

Status Sequence Number

Responses in transit from the target to the initiator are numbered. The StatSN (Status Sequence Number) is used for this purpose. StatSN is a counter maintained per connection. StatSN is a Sequence Number that the target iSCSI layer generates per connection and that, in turn, enables the initiator to acknowledge status reception. StatSN is incremented by 1 for every response/status sent on a connection except for responses sent as a result of a retry or SNACK.

In the case of responses sent due to a retransmission request, the StatSN MUST be the same as the first time the PDU was sent unless the connection has since been restarted.

Status numbering starts with the Login response to the first Login request of the connection. The Login response includes an initial value for status numbering. Any initial value is valid.

Page 71: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 71

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 71

iSCSI R2T

iSCSI (Ready To Transfer)Opcode: Ready To Transfer (0x31)TotalAHSLength: 0x00DataSegmentLength: 0x00000000LUN: 0038000000000000InitiatorTaskTag: 0x00000c21TargetTransferTag: 0x0000001cStatSN: 0x00000c25ExpCmdSN: 0x00000c22MaxCmdSN: 0x00000d22R2TSN: 0x00000000BufferOffset: 0x00000000DesiredDataLength: 0x00000800HeaderDigest: 0xb44fe89f (Good CRC32)

Ready to Transfer

R2T is the mechanism by which the SCSI target "requests" the initiator for output data. R2T specifies to the initiator the offset of the requested data relative to the buffer address from the execute command procedure call and the length of the solicited data.

To help the SCSI target associate the resulting Data-out with an R2T, the R2T carries a Target Transfer Tag that is copied by the initiator in the solicited SCSI Data-out PDUs. There are no protocol specific requirements with regard to the value of these tags, but it is assumed that together with the LUN, they will enable the target to associate data with an R2T.

Page 72: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 72

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 72

SCSI Read Transaction

192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774981054 Ack=1787967638 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774981118 Ack=1787967686 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774981166 Ack=1787967734 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 TCP 1041 > 3260 [ACK] Seq=1787967734 Ack=2774981238192.168.0.58 192.168.0.100 iSCSI SCSI: Read(10)(LBA: 0x0045c6a8, Len: 8)192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774981238 Ack=1787967782 192.168.0.100 192.168.0.58 iSCSI SCSI Data In192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774982698 Ack=1787967782192.168.0.58 192.168.0.100 TCP 1041 > 3260 [ACK] Seq=1787967782 Ack=2774982698 192.168.0.100 192.168.0.58 TCP 3260 > 1041 [PSH,ACK] Seq=2774984158 Ack=178796192.168.0.100 192.168.0.58 iSCSI SCSI Response (Good)192.168.0.58 192.168.0.100 TCP 1041 > 3260 [ACK] Seq=1787967782 Ack=2774985382 192.168.0.58 192.168.0.100 TCP 1041 > 3260 [ACK] Seq=1787967782 Ack=2774985430

iSCSILogin

SCSIREAD

SCSIData and

Status

If an initiator issues a READ command, the target must send the requested data followed by the status to the initiator over the same TCP connection that was used to deliver the SCSI command.

Page 73: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 73

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 73

SCSI Write Transaction

192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774981054 Ack=1787967638 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774981118 Ack=1787967686 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 iSCSI Login Command192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774981166 Ack=1787967734 192.168.0.100 192.168.0.58 iSCSI Login Response (Success)192.168.0.58 192.168.0.100 TCP 1041 > 3260 [ACK] Seq=1787967734 Ack=2774981238 192.168.0.58 192.168.0.100 iSCSI SCSI: Write(10)(LBA: 0x01117480, Len: 8)192.168.0.58 192.168.0.100 TCP 1041 > 3260 [ACK] Seq=1787969242 Ack=2774985430 192.168.0.58 192.168.0.100 iSCSI NOP Out, NOP Out, NOP Out192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774985430 Ack=1787970702 192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774985430 Ack=1787971926 192.168.0.100 192.168.0.58 iSCSI SCSI Response (Good)192.168.0.58 192.168.0.100 iSCSI SCSI: Write(10)(LBA: 0x01117428, Len: 8)192.168.0.58 192.168.0.100 iSCSI SCSI: Write(10)(LBA: 0x01117428, Len: 8)192.168.0.58 192.168.0.100 iSCSI NOP Out, NOP Out, NOP Out, NOP Out, NOP Out, 192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774985478 Ack=1787974846 192.168.0.100 192.168.0.58 TCP 3260 > 1041 [ACK] Seq=2774985478 Ack=1787976070 192.168.0.100 192.168.0.58 iSCSI SCSI Response (Good)

iSCSILogin

SCSIWRITE

Status

SCSIWrite

Status

If an initiator issues a WRITE command, the initiator must send the data for that command over the same TCP connection that was used to deliver the SCSI command. The target must return the status over the same TCP connection that was used to deliver the SCSI command.

Page 74: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 74

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 74

Initiator Error Recovery Mechanisms

The initiator mechanisms defined in connection with error recovery are:NOP-OUT to probe sequence numbers of the target Command retry Recovery R2T support Requesting retransmission of status/data/R2T using the SNACK facility Acknowledging the receipt of the data Reassigning the connection allegiance of a task to a different TCP connection Terminating the entire iSCSI session to start afresh

For outstanding SCSI commands, it is assumed that iSCSI, in conjunction with SCSI at the initiator, is able to keep enough information to be able to rebuild the command PDU, and that outgoing data is available in host memory for retransmission. At the target, incoming data (read data) may be kept for recovery or it can be reread from a device server.

Page 75: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 75

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 75

Target Error Recovery Mechanisms

The target mechanisms defined in connection with error recovery are:NOP-IN to probe sequence numbers of the initiator Requesting retransmission of data using the recovery R2T featureSNACK supportRequesting that parts of read data be acknowledged Allegiance reassignment support Terminating the entire iSCSI session to force the initiator to start over

A target will keep the "status & sense” for a command it has executed if it supports status retransmission. A target that supports data retransmission is expected to be prepared to retransmit the outgoing data (i.e., Data-In) on request until either the status for the completed command is acknowledged, or the data has been separately acknowledged.

Page 76: Introduction to Iscsi - Srg

Copyright © 2008 EMC Corporation. Do not Copy - All Rights Reserved.

Introduction to iSCSI - 76

© 2008 EMC Corporation. All rights reserved. Introduction to iSCSI - 76

Course Summary

Key points covered in this course:

iSCSI is an IP-based storage protocol allowing existing Ethernet equipment to be used for storage networking

The iSCSI protocol is broken into layers

The iSCSI login process allows for authentication and higher level processes to proceed

Data is placed within iSCSI PDUs for transmission

iSCSI maintains error correction within the session

These are the key points covered in this training. Please take a moment to review them.

This concludes the training. Please proceed to the Course Completion slide to take the assessment.