Документ взят из кэша поисковой машины. Адрес оригинального документа : http://acat02.sinp.msu.ru/presentations/GGtut/Dev-05-Communication1.pdf
Дата изменения: Sat Jul 6 22:29:40 2002
Дата индексирования: Mon Oct 1 20:34:56 2012
Кодировка:
I/O & Secure Communication
Globus ToolkitTM Developer Tutorial The Globus ProjectTM
Argonne National Laboratory USC Information Sciences Institute http://www.globus.org/
Copyright (c) 2002 University of Chicago and The University of Southern California. All Rights Reserved. This presentation is licensed for use under the terms of the Globus Toolkit Public License. See http://www.globus.org/toolkit/download/license.html for the full text of this license.


Motivation
l

Numerous applications already use combinations of TCP, UDP, IP multicast, and file I/O.
­ Reinvents the wheel, many times! ­ Security is rarely employed.

l

Advantages of globus_io
­ Ease of use of security, socket options, QoS ­ Easier Win32 portability ­ Very similar to existing BSD socket calls

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

2


Approach
l l

Provide familiar socket and file abstractions Provide both synchronous and asynchronous versions of everything
­ Can easily write code that will not block for anything

l

Handle security, socket options, and QoS through attributes
­ Easy to change options for each I/O handle

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

3


Win32
l

Unlike Unix, in Win32 "file handles" and "socket handles" are treated differently
­ Select only works on socket handles ­ Different Win32 calls for file and socket I/O ­ globus_io allows us to mask this difference

l

Win 32 "completion ports" give the best I/O performance
­ globus_io's asynchronous callback interface matches well with completion ports ­ globus_callback also designed for this

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

4


Core Functions
l

Common functions used for all forms of I/O
­ globus_io_[register]_select() ­ globus_io_[register]_cancel() ­ globus_io_[register]_close() ­ globus_io_[register]_read() ­ globus_io_[register]_write() ­ globus_io_[register]_writev() ­ globus_io_try_{read,write,writev}() ­ globus_io_get_handle_type() ­ globus_io_handle_{set,get}_user_pointer()

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

5


TCP Connection Setup
l

Typical functions for creating TCP connections
­ globus_io_tcp_create_listener() ­ globus_io_tcp_[register]_listen() ­ globus_io_tcp_[register]_accept() ­ globus_io_tcp_[register]_connect()

l

Setting and getting attributes
­ globus_io_tcp_set_attr() ­ globus_io_tcp_get_attr()

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

6


File Setup
l

Typical functions for establishing file I/O
­ globus_io_file_open() ­ globus_io_file_seek()

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

7


TCP Security Attributes
l

TCP authentication and delegation characteristics
­ globus_io_attr_set_secure_authentication_mode()
> GLOBUS_IO_SECURE_AUTHENTICATION_MODE_NONE > GLOBUS_IO_SECURE_AUTHENTICATION_MODE_GSSAPI

­ globus_io_attr_set_secure_delegation_mode()
> GLOBUS_IO_SECURE_DELEGATION_MODE_NONE > GLOBUS_IO_SECURE_DELEGATION_MODE_LIMITED_PROXY > GLOBUS_IO_SECURE_DELEGATION_MODE_FULL_PROXY

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

8


TCP Security Attributes
l

TCP authorization and channel characteristics
­ globus_io_attr_set_secure_authorization_mode()
> GLOBUS_IO_SECURE_AUTHORIZATION_MODE_SELF > GLOBUS_IO_SECURE_AUTHORIZATION_MODE_IDENTITY > GLOBUS_IO_SECURE_AUTHORIZATION_MODE_CALLBACK

­ globus_io_attr_set_secure_channel_mode()
> GLOBUS_IO_SECURE_CHANNEL_MODE_CLEAR > GLOBUS_IO_SECURE_CHANNEL_MODE_GSI_WRAP > GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

9


TCP Socket Attributes
l

TCP socket options
­ globus_io_attr_set_socket_reuseaddr() ­ globus_io_attr_set_socket_keepalive() ­ globus_io_attr_set_socket_linger() ­ globus_io_attr_set_socket_oobinline() ­ globus_io_attr_set_socket_sndbuf() ­ globus_io_attr_set_socket_rcvbuf() ­ globus_io_attr_set_tcp_nodelay()

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

10


Other Attributes
l

File attributes
­ globus_io_attr_set_file_type()
> GLOBUS_IO_FILE_TYPE_TEXT > GLOBUS_IO_FILE_TYPE_BINARY

l

Restricting anonymous ports to a particular port range
­ globus_io_attr_set_tcp_restrict_port()

l

IP multicast
­ globus_io_attr_set_udp_multicast_loop() ­ globus_io_attr_set_udp_multicast_ ttl()

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

11


globus_io exercises
l l

Go to the "io" subdirectory Documentation
­ http://www.globus.org/io

l

Follow instructions in the file README

March 25, 2002

Globus ToolkitTM Developer Tutorial: Communication

12