I/O & Secure Communication Globus Toolkit™ Developer Tutorial The Globus Project™ Argonne National Laboratory USC Information Sciences Institute 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 for the full text of this license.
June 17, Globus Toolkit™ Developer Tutorial: Communication 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
June 17, Globus Toolkit™ Developer Tutorial: Communication Approach l Provide familiar socket and file abstractions l 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
June 17, Globus Toolkit™ Developer Tutorial: Communication 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
June 17, Globus Toolkit™ Developer Tutorial: Communication 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()
June 17, Globus Toolkit™ Developer Tutorial: Communication 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()
June 17, Globus Toolkit™ Developer Tutorial: Communication File Setup l Typical functions for establishing file I/O –globus_io_file_open() –globus_io_file_seek()
June 17, Globus Toolkit™ Developer Tutorial: Communication 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
June 17, Globus Toolkit™ Developer Tutorial: Communication 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
June 17, Globus Toolkit™ Developer Tutorial: Communication 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()
June 17, Globus Toolkit™ Developer Tutorial: Communication 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()
June 17, Globus Toolkit™ Developer Tutorial: Communication globus_io exercises l Go to the “io” subdirectory l Documentation – l Follow instructions in the file README