[CentOS] Possible to run iscsi-target and initiator on same server?

Mon Oct 12 04:10:45 UTC 2009
C Linus Hicks <linush at verizon.net>

On Sun, 2009-10-11 at 23:26 -0400, Ross Walker wrote:
> Can you send a short tcpdump between initiator and target during  
> discovery/login?

Sure. Note that all this traffic is on the "lo" interface.

The discovery command and tcpdump output:

[root at lh6 ~]# iscsiadm -m discovery -t st -p 10.200.1.6:3260 -P 1
    Target: iqn.2009-10.net.linush:storage.disk1.sys1.asmdg
        Portal: 10.200.1.6:3260,1
           Iface Name: iface0


[root at lh6 iscsi]# tcpdump -i lo -n -vv
00:03:04.584545 IP (tos 0x0, ttl  64, id 55720, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: S, cksum 0x4851 (correct), 3727115272:3727115272(0) win 32792 <mss 16396,sackOK,timestamp 296394144 0,nop,wscale 8>
00:03:04.584547 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20331: S, cksum 0x6389 (correct), 3721615280:3721615280(0) ack 3727115273 win 32768 <mss 16396,sackOK,timestamp 296394144 296394144,nop,wscale 8>
00:03:04.584559 IP (tos 0x0, ttl  64, id 55721, offset 0, flags [DF], proto: TCP (6), length: 52) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: ., cksum 0x4c2e (correct), 1:1(0) ack 1 win 129 <nop,nop,timestamp 296394144 296394144>
00:03:04.584608 IP (tos 0x0, ttl  64, id 55722, offset 0, flags [DF], proto: TCP (6), length: 100) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: P 1:49(48) ack 1 win 129 <nop,nop,timestamp 296394145 296394144>
00:03:04.584615 IP (tos 0x0, ttl  64, id 51728, offset 0, flags [DF], proto: TCP (6), length: 52) 10.200.1.6.iscsi-target > 10.200.1.6.20331: ., cksum 0x4bfd (correct), 1:1(0) ack 49 win 128 <nop,nop,timestamp 296394145 296394145>
00:03:04.584623 IP (tos 0x0, ttl  64, id 55723, offset 0, flags [DF], proto: TCP (6), length: 304) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: P 49:301(252) ack 1 win 129 <nop,nop,timestamp 296394145 296394145>
00:03:04.584626 IP (tos 0x0, ttl  64, id 51729, offset 0, flags [DF], proto: TCP (6), length: 52) 10.200.1.6.iscsi-target > 10.200.1.6.20331: ., cksum 0x4afc (correct), 1:1(0) ack 301 win 133 <nop,nop,timestamp 296394145 296394145>
00:03:04.584668 IP (tos 0x0, ttl  64, id 51730, offset 0, flags [DF], proto: TCP (6), length: 244) 10.200.1.6.iscsi-target > 10.200.1.6.20331: P 1:193(192) ack 301 win 133 <nop,nop,timestamp 296394145 296394145>
00:03:04.584684 IP (tos 0x0, ttl  64, id 55724, offset 0, flags [DF], proto: TCP (6), length: 52) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: ., cksum 0x4a3c (correct), 301:301(0) ack 193 win 133 <nop,nop,timestamp 296394145 296394145>
00:03:04.584706 IP (tos 0x0, ttl  64, id 55725, offset 0, flags [DF], proto: TCP (6), length: 100) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: P 301:349(48) ack 193 win 133 <nop,nop,timestamp 296394145 296394145>
00:03:04.584714 IP (tos 0x0, ttl  64, id 55726, offset 0, flags [DF], proto: TCP (6), length: 68) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: P, cksum 0x17d2 (incorrect (-> 0x3b43), 349:365(16) ack 193 win 133 <nop,nop,timestamp 296394145 296394145>
00:03:04.584719 IP (tos 0x0, ttl  64, id 51731, offset 0, flags [DF], proto: TCP (6), length: 52) 10.200.1.6.iscsi-target > 10.200.1.6.20331: ., cksum 0x49fc (correct), 193:193(0) ack 365 win 133 <nop,nop,timestamp 296394145 296394145>
00:03:04.584908 IP (tos 0x0, ttl  64, id 51732, offset 0, flags [DF], proto: TCP (6), length: 192) 10.200.1.6.iscsi-target > 10.200.1.6.20331: P 193:333(140) ack 365 win 133 <nop,nop,timestamp 296394145 296394145>
00:03:04.586785 IP (tos 0x0, ttl  64, id 55727, offset 0, flags [DF], proto: TCP (6), length: 52) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: F, cksum 0x4969 (correct), 365:365(0) ack 333 win 137 <nop,nop,timestamp 296394147 296394145>
00:03:04.586807 IP (tos 0x0, ttl  64, id 51733, offset 0, flags [DF], proto: TCP (6), length: 52) 10.200.1.6.iscsi-target > 10.200.1.6.20331: F, cksum 0x496a (correct), 333:333(0) ack 366 win 133 <nop,nop,timestamp 296394147 296394147>
00:03:04.586816 IP (tos 0x0, ttl  64, id 55728, offset 0, flags [DF], proto: TCP (6), length: 52) 10.200.1.6.20331 > 10.200.1.6.iscsi-target: ., cksum 0x4966 (correct), 366:366(0) ack 334 win 137 <nop,nop,timestamp 296394147 296394147>

16 packets captured
32 packets received by filter
0 packets dropped by kernel


------------------------------------------------------------------------------

Check the timestamps and you will see either three or six second delays
between groups of three packets.

[root at lh6 ~]# iscsiadm -m node -T iqn.2009-10.net.linush:storage.disk1.sys1.asmdg -p 10.200.1.6:3260 -I iface0 -l 
Logging in to [iface: iface0, target: iqn.2009-10.net.linush:storage.disk1.sys1.asmdg, portal: 10.200.1.6,3260]
iscsiadm: Could not login to [iface: iface0, target: iqn.2009-10.net.linush:storage.disk1.sys1.asmdg, portal: 10.200.1.6,3260]: 
iscsiadm: initiator reported error (8 - connection timed out)


[root at lh6 iscsi]# tcpdump -i lo -n -vv
00:01:07.521652 IP (tos 0x0, ttl  64, id 4451, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20326 > 10.200.1.6.iscsi-target: S, cksum 0x9796 (correct), 3606955323:3606955323(0) win 32792 <mss 16396,sackOK,timestamp 296277080 0,nop,wscale 8>
00:01:07.521653 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20326: S, cksum 0xe4a1 (correct), 3609851344:3609851344(0) ack 3606955324 win 32768 <mss 16396,sackOK,timestamp 296277080 296277080,nop,wscale 8>
00:01:07.521661 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20326 > 10.200.1.6.iscsi-target: R, cksum 0x9fe8 (correct), 3606955324:3606955324(0) win 0
00:01:10.521958 IP (tos 0x0, ttl  64, id 4452, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20326 > 10.200.1.6.iscsi-target: S, cksum 0x8bde (correct), 3606955323:3606955323(0) win 32792 <mss 16396,sackOK,timestamp 296280080 0,nop,wscale 8>
00:01:10.521977 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20326: S, cksum 0x0501 (correct), 3612851667:3612851667(0) ack 3606955324 win 32768 <mss 16396,sackOK,timestamp 296280080 296280080,nop,wscale 8>
00:01:10.521983 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20326 > 10.200.1.6.iscsi-target: R, cksum 0x9fe8 (correct), 3606955324:3606955324(0) win 0
00:01:16.521838 IP (tos 0x0, ttl  64, id 4453, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20326 > 10.200.1.6.iscsi-target: S, cksum 0x746e (correct), 3606955323:3606955323(0) win 32792 <mss 16396,sackOK,timestamp 296286080 0,nop,wscale 8>
00:01:16.521852 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20326: S, cksum 0x48c2 (correct), 3618851542:3618851542(0) ack 3606955324 win 32768 <mss 16396,sackOK,timestamp 296286080 296286080,nop,wscale 8>
00:01:16.521859 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20326 > 10.200.1.6.iscsi-target: R, cksum 0x9fe8 (correct), 3606955324:3606955324(0) win 0
00:01:23.334823 IP (tos 0x0, ttl  64, id 58953, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20327 > 10.200.1.6.iscsi-target: S, cksum 0x29cb (correct), 3622433876:3622433876(0) win 32792 <mss 16396,sackOK,timestamp 296292893 0,nop,wscale 8>
00:01:23.334838 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20327: S, cksum 0xc911 (correct), 3634521175:3634521175(0) ack 3622433877 win 32768 <mss 16396,sackOK,timestamp 296292893 296292893,nop,wscale 8>
00:01:23.334844 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20327 > 10.200.1.6.iscsi-target: R, cksum 0x6fe2 (correct), 3622433877:3622433877(0) win 0
00:01:26.334655 IP (tos 0x0, ttl  64, id 58954, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20327 > 10.200.1.6.iscsi-target: S, cksum 0x1e13 (correct), 3622433876:3622433876(0) win 32792 <mss 16396,sackOK,timestamp 296295893 0,nop,wscale 8>
00:01:26.334668 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20327: S, cksum 0xeb5f (correct), 3637521003:3637521003(0) ack 3622433877 win 32768 <mss 16396,sackOK,timestamp 296295893 296295893,nop,wscale 8>
00:01:26.334674 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20327 > 10.200.1.6.iscsi-target: R, cksum 0x6fe2 (correct), 3622433877:3622433877(0) win 0
00:01:32.334544 IP (tos 0x0, ttl  64, id 58955, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20327 > 10.200.1.6.iscsi-target: S, cksum 0x06a3 (correct), 3622433876:3622433876(0) win 32792 <mss 16396,sackOK,timestamp 296301893 0,nop,wscale 8>
00:01:32.334562 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20327: S, cksum 0x2f0e (correct), 3643520897:3643520897(0) ack 3622433877 win 32768 <mss 16396,sackOK,timestamp 296301893 296301893,nop,wscale 8>
00:01:32.334568 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20327 > 10.200.1.6.iscsi-target: R, cksum 0x6fe2 (correct), 3622433877:3622433877(0) win 0
00:01:38.394538 IP (tos 0x0, ttl  64, id 19618, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20328 > 10.200.1.6.iscsi-target: S, cksum 0xe197 (correct), 3645440083:3645440083(0) win 32792 <mss 16396,sackOK,timestamp 296307953 0,nop,wscale 8>
00:01:38.394553 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20328: S, cksum 0x9cf7 (correct), 3634105712:3634105712(0) ack 3645440084 win 32768 <mss 16396,sackOK,timestamp 296307953 296307953,nop,wscale 8>
00:01:38.394559 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20328 > 10.200.1.6.iscsi-target: R, cksum 0x6283 (correct), 3645440084:3645440084(0) win 0
00:01:41.394358 IP (tos 0x0, ttl  64, id 19619, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20328 > 10.200.1.6.iscsi-target: S, cksum 0xd5df (correct), 3645440083:3645440083(0) win 32792 <mss 16396,sackOK,timestamp 296310953 0,nop,wscale 8>
00:01:41.394372 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20328: S, cksum 0xbf4f (correct), 3637105530:3637105530(0) ack 3645440084 win 32768 <mss 16396,sackOK,timestamp 296310953 296310953,nop,wscale 8>
00:01:41.394378 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20328 > 10.200.1.6.iscsi-target: R, cksum 0x6283 (correct), 3645440084:3645440084(0) win 0
00:01:47.394244 IP (tos 0x0, ttl  64, id 19620, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20328 > 10.200.1.6.iscsi-target: S, cksum 0xbe6f (correct), 3645440083:3645440083(0) win 32792 <mss 16396,sackOK,timestamp 296316953 0,nop,wscale 8>
00:01:47.394262 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20328: S, cksum 0x0301 (correct), 3643105421:3643105421(0) ack 3645440084 win 32768 <mss 16396,sackOK,timestamp 296316953 296316953,nop,wscale 8>
00:01:47.394269 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20328 > 10.200.1.6.iscsi-target: R, cksum 0x6283 (correct), 3645440084:3645440084(0) win 0
00:01:53.454247 IP (tos 0x0, ttl  64, id 28155, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20329 > 10.200.1.6.iscsi-target: S, cksum 0xbbdb (correct), 3661949502:3661949502(0) win 32792 <mss 16396,sackOK,timestamp 296323013 0,nop,wscale 8>
00:01:53.454261 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20329: S, cksum 0xc398 (correct), 3661464733:3661464733(0) ack 3661949503 win 32768 <mss 16396,sackOK,timestamp 296323013 296323013,nop,wscale 8>
00:01:53.454268 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20329 > 10.200.1.6.iscsi-target: R, cksum 0x779b (correct), 3661949503:3661949503(0) win 0
00:01:56.454072 IP (tos 0x0, ttl  64, id 28156, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20329 > 10.200.1.6.iscsi-target: S, cksum 0xb023 (correct), 3661949502:3661949502(0) win 32792 <mss 16396,sackOK,timestamp 296326013 0,nop,wscale 8>
00:01:56.454087 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20329: S, cksum 0xe5ea (correct), 3664464557:3664464557(0) ack 3661949503 win 32768 <mss 16396,sackOK,timestamp 296326013 296326013,nop,wscale 8>
00:01:56.454093 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20329 > 10.200.1.6.iscsi-target: R, cksum 0x779b (correct), 3661949503:3661949503(0) win 0
00:02:02.453964 IP (tos 0x0, ttl  64, id 28157, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20329 > 10.200.1.6.iscsi-target: S, cksum 0x98b3 (correct), 3661949502:3661949502(0) win 32792 <mss 16396,sackOK,timestamp 296332013 0,nop,wscale 8>
00:02:02.453982 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20329: S, cksum 0x2998 (correct), 3670464452:3670464452(0) ack 3661949503 win 32768 <mss 16396,sackOK,timestamp 296332013 296332013,nop,wscale 8>
00:02:02.453989 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20329 > 10.200.1.6.iscsi-target: R, cksum 0x779b (correct), 3661949503:3661949503(0) win 0
00:02:08.513957 IP (tos 0x0, ttl  64, id 33753, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20330 > 10.200.1.6.iscsi-target: S, cksum 0x2948 (correct), 3674292544:3674292544(0) win 32792 <mss 16396,sackOK,timestamp 296338073 0,nop,wscale 8>
00:02:08.513971 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20330: S, cksum 0x276b (correct), 3674690201:3674690201(0) ack 3674292545 win 32768 <mss 16396,sackOK,timestamp 296338073 296338073,nop,wscale 8>
00:02:08.513977 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20330 > 10.200.1.6.iscsi-target: R, cksum 0x1fdc (correct), 3674292545:3674292545(0) win 0
00:02:11.513788 IP (tos 0x0, ttl  64, id 33754, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20330 > 10.200.1.6.iscsi-target: S, cksum 0x1d90 (correct), 3674292544:3674292544(0) win 32792 <mss 16396,sackOK,timestamp 296341073 0,nop,wscale 8>
00:02:11.513803 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20330: S, cksum 0x49b6 (correct), 3677690032:3677690032(0) ack 3674292545 win 32768 <mss 16396,sackOK,timestamp 296341073 296341073,nop,wscale 8>
00:02:11.513809 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20330 > 10.200.1.6.iscsi-target: R, cksum 0x1fdc (correct), 3674292545:3674292545(0) win 0
00:02:17.513675 IP (tos 0x0, ttl  64, id 33755, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.20330 > 10.200.1.6.iscsi-target: S, cksum 0x0620 (correct), 3674292544:3674292544(0) win 32792 <mss 16396,sackOK,timestamp 296347073 0,nop,wscale 8>
00:02:17.513695 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 10.200.1.6.iscsi-target > 10.200.1.6.20330: S, cksum 0x8d66 (correct), 3683689924:3683689924(0) ack 3674292545 win 32768 <mss 16396,sackOK,timestamp 296347073 296347073,nop,wscale 8>
00:02:17.513702 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: TCP (6), length: 40) 10.200.1.6.20330 > 10.200.1.6.iscsi-target: R, cksum 0x1fdc (correct), 3674292545:3674292545(0) win 0

45 packets captured
90 packets received by filter
0 packets dropped by kernel