RFC connection
- 格式:pdf
- 大小:460.81 KB
- 文档页数:7
connection方法的作用摘要:一、Connection方法概述二、Connection方法的作用1.数据库连接2.网络连接3.文件连接4.调用其他功能模块三、实战应用案例四、总结与建议正文:一、Connection方法概述在编程领域,Connection方法是指建立连接的一种技术,广泛应用于各种编程语言和开发环境中。
它主要用于实现不同系统、模块或设备之间的互联互通,为后续的数据传输和业务处理提供基础。
二、Connection方法的作用1.数据库连接Connection方法在数据库编程中发挥着至关重要的作用。
通过Connection对象,程序员可以实现与数据库的连接,进行数据的增删改查等操作。
例如,在Java中,使用JDBC(Java Database Connectivity)API,可以实现与各种关系型数据库(如MySQL、Oracle等)的连接。
2.网络连接在网络编程中,Connection方法用于建立服务器与客户端之间的连接。
通过TCP/IP协议,实现数据在不同设备间的传输。
例如,在Python中,使用Socket库可以实现网络通信功能。
3.文件连接在文件处理方面,Connection方法用于实现文件之间的关联。
例如,在C++中,使用iostream库读写文件,通过文件指针实现文件连接。
4.调用其他功能模块在一些大型软件系统中,Connection方法还用于调用其他功能模块。
通过封装好的接口,实现不同模块之间的协同工作。
例如,在Web开发中,使用RESTful API调用后端接口,实现前后端数据交互。
三、实战应用案例以Java为例,下面给出一个简单的数据库连接示例:```javaimport java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.Statement;public class DBConnectionExample {public static void main(String[] args) {try {// 1.加载驱动Class.forName("com.mysql.jdbc.Driver");// 2.建立连接String url = "jdbc:mysql://localhost:3306/test_db";String username = "root";String password = "123456";Connection connection =DriverManager.getConnection(url, username, password);// 3.执行SQL语句Statement statement = connection.createStatement();ResultSet resultSet = statement.executeQuery("SELECT * FROM users");// 4.处理结果while (resultSet.next()) {System.out.println("ID: " + resultSet.getInt("id") + ", Name: " + resultSet.getString("name"));}// 5.关闭资源resultSet.close();statement.close();connection.close();} catch (Exception e) {e.printStackTrace();}}}```四、总结与建议Connection方法在编程中具有重要意义,掌握好Connection方法的运用,能有效提高开发效率和程序的可维护性。
博学笃行自强不息
rfc是什么意思
RFC (Request for Comments) 是一种用于制定和定义互联网标准的文件。
在计算机科学和信息技术领域,RFC被用作一种文档类型来描述互联网协议、方法和技术。
每个RFC都是由个人、团体或组织提交,并由互联网工程任务组(IETF)进行审核、讨论和批准。
RFC最早是由斯蒂夫·克罗克(Steve Crocker)提出的概念,用于共享与ARPANET(互联网的前身)相关的思想和想法。
起初,RFC被用于叙述和记录与ARPANET相关的协议和实现细节,但随着互联网的发展,其应用范围已经延伸至各个方面,如网络架构、安全机制、路由协议、编码规范等。
RFC是一个开放的、持续发展的过程,任何人都可以提交RFC。
然后,所有的RFC都会进入一个公开的文档库,供全球的网络专家、研究人员和从业者参考和使用。
RFC的目的是促进全球互联网的互操作性和稳定性。
每个RFC都具有独特的数字标识符,用于在文档库中进行标示和索引。
RFC的命名规则是\
1。
rfc协议RFC (Request for Comments)协议是互联网工程任务组(IETF)发布的一系列文件,它描述了互联网的各种协议、技术和标准。
RFC文档由IETF的成员和其他网络专业人士撰写,并经过同行审查后发布。
本文将对RFC协议进行简要介绍。
RFC协议的历史可以追溯到1969年,当时互联网的前身ARPANET刚刚建立,人们需要一个组织用于记录和交流互联网的相关协议。
随着时间的推移,RFC协议逐渐成为互联网标准发展的重要组成部分。
RFC协议的目的是促进全球范围内的技术合作和共享。
它提供了一种开放的、民主的方法,使任何人都可以参与到互联网协议的发展过程中来。
RFC协议的草案可以由任何人提交。
一旦提交,草案将经过同行审查,并由IETF进行讨论和投票,最终形成正式的RFC文档。
RFC协议的内容非常丰富,涵盖了从网络协议到应用程序的各个方面。
其中一些最著名的RFC文档包括TCP/IP协议族、HTTP协议、SMTP协议等。
RFC文档的编写方式相对自由,作者可以使用他们认为合适的格式和语言进行描述。
但是,RFC文档必须包含一些必要的内容,如标题、摘要、问题陈述、解决方案、安全考虑等。
这些要求确保了RFC文档的一致性和可读性。
RFC协议的发布对互联网的发展起到了重要的推动作用。
它促进了网络标准的制定和统一,使得不同厂商的设备能够互相通信,从而实现了互联网的互联互通。
同时,RFC协议的开放性也鼓励了创新和技术发展,使互联网能够不断适应新的需求和挑战。
总之,RFC协议是互联网发展的重要支撑和推动力量。
它通过开放、民主的方式推动着互联网的各个方面的发展,使得互联网成为了一个全球范围内的共享资源。
在未来的发展中,RFC协议将继续发挥其作用,推动互联网技术的创新和进步。
How-to GuideSAP NetWeaver 7.1How to …Configure UD Connect on the J2EE Server for JDBC Access to External DatabasesVersion 1.01 – Dec. 2011Applicable Releases:SAP NetWeaver 7.1(SAP BW3.5)© Copyright 2004 SAP AG. All rights reserved.No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries.Oracle is a registered trademark of Oracle Corporation.UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarksor registered trademarks of Citrix Systems, Inc.HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.Java is a registered trademark of Sun Microsystems, Inc.JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.MaxDB is a trademark of MySQL AB, Sweden.SAP, R/3, mySAP, , xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentionedare the trademarks of their respective companies. Data contained in this document serves informationalpurposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of anykind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.These materials are provided “as is” without a warrantyof any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials.SAP does not warrant the accuracy or completeness ofthe information, text, graphics, links or other items contained within these materials. SAP has no controlover the information that you may access through theuse of hot links contained in these materials and does not endorse your use of third party web pages nor provideany warranty whatsoever relating to third party web pages.SAP NetWeaver “How-to” Guides are intended tosimplify the product implementation. While specific product features and procedures typically are explainedin a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using SAP NetWeaver. Should you wish to receive additional information, clarificationor support, please refer to SAP Consulting.Any software coding and/or code lines / strings (“Code”) included in this documentation are only examples andare not intended to be used in a productive system environment. The Code is only intended better explainand visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shallnot be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent.ScenarioYou have data in a non-SAP database that you wish to report against using the new Universal Data Connect (UDC) functionality introduced in SAP BW 3.5. By using a remote cube to access the external data, you can create queries, use the Bex Analyzer and create web applications just like you would for SAP BW data.IntroductionUD Connect utilizes the J2EE engine of the SAP Web Application server to access external data. This Howto will deal with the set-up and configuration of the relational JDBC connector. Connectors to access multi-dimensional OLAP databases are also available, but not covered in this guide.This guide will detail the steps necessary to connect the SAP BW ABAP stack with the J2EE stack via RFC as well as configuring the JDBC connector to use the database vendor provided JDBC driver. It is assumed you have installed the J2EE server and the Universal Data Integration (UDI) specific add-ons from the installation DVD.The Step By Step Solution1) Install the JDBC Driverrun java URL: http(s)://<j2eehostname>:<j2eeport>/startPage clik at:or use direct URL alias: http(s)://<j2eehostname>:<j2eeport>/nwa after login, open "Application Resources"Select "JDBC Drivers""Create New Resource". For example, for MSSQL 2005 Name resource "mssql2005"Upload MSSQL 2005 JDBC driver. It may be "C:\Program Files\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.x\enu\sqljdbc.jar" if you installed it in standard location.Note: remember the name see chapter: 2) Add reference to your driver to UDI JDBC resource adapter"library:mssql2005"2) Add reference to your driver to UDI JDBC resource adapterGo to "Resource Adapters" and select "com.sap.ip.bi.sdk.dac.connector.jdbc"In Resource Details select tab "Loader References"Add new reference for your JDBC driver. Example for MS SQL2005 drivertype reference "library:mssql2005" and save it!3) Configure connection (driver) propertiesGo to "JCA Connection Factories" and select "SDK_JDBC" from Resource List In Resource Details go to "Configuration Properties" tabFill in properties. See example for MS SQL 2005UserName: DBUserPassword: administratorDriverName: com.microsoft.sqlserver.jdbc.SQLServerDriverURL: jdbc:sqlserver://localhost;databaseName=NorthwindFixedCatalog:FixedSchema:Note: recommend setting for lifetime values see also note:1050748 - UD Connect: connection pooling interfere with data load4) Create Jco RFC connector for connection to backend BWFrom NWA -> go to Application Resources and select “Resource Adapters”Select SAPJavaResourceAdapter15Open the Properties Tab and fill in all the properties that you use to set in the Jco RFC Destination in old NW70 Important Note1: Make sure that there is no Jco RFC Destination with the same name that is started on the Java side! If there is one stop it … otherwise the connection will go through the old route and UDI won’t workImportant Note2: If the value for MaxReaderThreadCount is set to 0 RFC connection test will fail on ABAP side, solution is to increase that value!On the ABAP side everything is the same … just create an RFC destination with the matching name and check connection by the “Connection Test” button.。
.Net 调用SAP RFC接口来读取数据实战纪实这几天研究.Net 如何调用SAP RFC接口来读取数据,搞得我重装了三次系统,找资料找到吐血,看了德文、日文、英文、中文几乎所有可以参考的资料,师傅亲自出马,并请教了一堆高手还包括IBM的帅锅,还割舍了阳光明媚的周日来研究,终于功夫不负有心人,最终还是解决了,汗啊~~下面把我调试的全过程都记录一下,以后有人遇到相同问题就可以参考了。
1.【关键前提】:(1) 你安装了VS2003 (注意:一定要VS2003,原因在下面)(2)安装 Connector 2.0 (这东东目前只支持.net framework 1.X, 即IDE 7.5版本,所以只能用VS2003)(3) 有Java runtime environment (后面导入SAP的Function时有用)(4) 安装SAP Logon原理图如下:2.【开始编程】(1)首先是在SAP里面创建RFC(2) VS里面编程先以Winform程序为例吧a.新建winform项目,因为装了 Connector,所以可以添加对SAP.Connector.dll和SAP.Connector .Rfc.dll的引用。
在项目中新建类,你会发现多了一个SAP Connector Proxy的类,新建一个,就是下面图中的SAPProxy1.sapwsdl文件啦。
b.在Form1.cs中添加控件(比较简陋,凑合看了)c.在SAP Test的Button事件里面加入以下代码private void button1_Click(object sender, System.EventArgs e){SAP.Connector.SAPLogonDestination myDest;SAP.Connector.SAPConnection myConn;SAPProxy1 myProx;BRFCKNA1Table xMara;System.Data.DataTable dMara;try{myDest = new SAP.Connector.SAPLogonDestination();myDest.DestinationName = "这里输入SAP服务器上的系统名称";myDest.Client = 这里输入SAP服务器的客户端号;ername = "这里输入SAP服务器访问的用户名";myDest.Password = "这里输入SAP服务器访问的密码";myConn = new SAP.Connector.SAPConnection(myDest);myConn.Open();xMara = new BRFCKNA1Table();//注意,这个BRFCKNA1Table可不是随便写的哈,看到下面就明白了myProx = new SAPProxy1();myProx.Connection = myConn;myProx.Rfc_Customer_Get("", this.textBox1.Text, ref xMara);// 注意,这个Rfc_Customer_Get就是你要call的RFC的function名称dMara = new System.Data.DataTable();dMara = xMara.ToADODataTable();dataGrid1.DataSource = dMara;dataGrid1.Refresh();myConn.Close();}catch(Exception ex){textBox1.Text = ex.ToString();}}d.从SAP服务器上导入RFC Function不要小看这一步哦【支线任务1】在C:\WINDOWS找到saplogon.ini,打开后把SysName和SrvPort下面的内容清空,不清空的话他会引导你去找SAP 服务器上的Messaging server,总是告诉你无法打开或者无法找到sapmsg.ini的文件,非常麻烦。
Network Working Group T. Ylonen Request for Comments: 4254 SSH Communications Security Corp Category: Standards Track C. Lonvick, Ed. Cisco Systems, Inc. January 2006 The Secure Shell (SSH) Connection ProtocolStatus of This MemoThis document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions forimprovements. Please refer to the current edition of the "InternetOfficial Protocol Standards" (STD 1) for the standardization stateand status of this protocol. Distribution of this memo is unlimited.Copyright NoticeCopyright (C) The Internet Society (2006).AbstractSecure Shell (SSH) is a protocol for secure remote login and othersecure network services over an insecure network.This document describes the SSH Connection Protocol. It providesinteractive login sessions, remote execution of commands, forwardedTCP/IP connections, and forwarded X11 connections. All of thesechannels are multiplexed into a single encrypted tunnel.The SSH Connection Protocol has been designed to run on top of theSSH transport layer and user authentication protocols.Ylonen & Lonvick Standards Track [Page 1]Table of Contents1. Introduction (2)2. Contributors (3)3. Conventions Used in This Document (3)4. Global Requests (4)5. Channel Mechanism (5)5.1. Opening a Channel (5)5.2. Data Transfer (7)5.3. Closing a Channel (9)5.4. Channel-Specific Requests (9)6. Interactive Sessions (10)6.1. Opening a Session (10)6.2. Requesting a Pseudo-Terminal (11)6.3. X11 Forwarding (11)6.3.1. Requesting X11 Forwarding (11)6.3.2. X11 Channels (12)6.4. Environment Variable Passing (12)6.5. Starting a Shell or a Command (13)6.6. Session Data Transfer (14)6.7. Window Dimension Change Message (14)6.8. Local Flow Control (14)6.9. Signals (15)6.10. Returning Exit Status (15)7. TCP/IP Port Forwarding (16)7.1. Requesting Port Forwarding (16)7.2. TCP/IP Forwarding Channels (18)8. Encoding of Terminal Modes (19)9. Summary of Message Numbers (21)10. IANA Considerations (21)11. Security Considerations (21)12. References (22)12.1. Normative References (22)12.2. Informative References (22)Authors’ Addresses (23)Trademark Notice (23)1. IntroductionThe SSH Connection Protocol has been designed to run on top of theSSH transport layer and user authentication protocols ([SSH-TRANS]and [SSH-USERAUTH]). It provides interactive login sessions, remote execution of commands, forwarded TCP/IP connections, and forwardedX11 connections.The ’service name’ for this protocol is "ssh-connection".Ylonen & Lonvick Standards Track [Page 2]This document should be read only after reading the SSH architecture document [SSH-ARCH]. This document freely uses terminology andnotation from the architecture document without reference or further explanation.2. ContributorsThe major original contributors of this set of documents have been:Tatu Ylonen, Tero Kivinen, Timo J. Rinne, Sami Lehtinen (all of SSHCommunications Security Corp), and Markku-Juhani O. Saarinen(University of Jyvaskyla). Darren Moffat was the original editor of this set of documents and also made very substantial contributions.Many people contributed to the development of this document over the years. People who should be acknowledged include Mats Andersson, Ben Harris, Bill Sommerfeld, Brent McClure, Niels Moller, Damien Miller, Derek Fawcus, Frank Cusack, Heikki Nousiainen, Jakob Schlyter, JeffVan Dyke, Jeffrey Altman, Jeffrey Hutzelman, Jon Bright, JosephGalbraith, Ken Hornstein, Markus Friedl, Martin Forssen, NicolasWilliams, Niels Provos, Perry Metzger, Peter Gutmann, SimonJosefsson, Simon Tatham, Wei Dai, Denis Bider, der Mouse, andTadayoshi Kohno. Listing their names here does not mean that theyendorse this document, but that they have contributed to it.3. Conventions Used in This DocumentAll documents related to the SSH protocols shall use the keywords"MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD","SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" to describerequirements. These keywords are to be interpreted as described in[RFC2119].The keywords "PRIVATE USE", "HIERARCHICAL ALLOCATION", "FIRST COMEFIRST SERVED", "EXPERT REVIEW", "SPECIFICATION REQUIRED", "IESGAPPROVAL", "IETF CONSENSUS", and "STANDARDS ACTION" that appear inthis document when used to describe namespace allocation are to beinterpreted as described in [RFC2434].Protocol fields and possible values to fill them are defined in this set of documents. Protocol fields will be defined in the messagedefinitions. As an example, SSH_MSG_CHANNEL_DATA is defined asfollows.byte SSH_MSG_CHANNEL_DATAuint32 recipient channelstring dataYlonen & Lonvick Standards Track [Page 3]Throughout these documents, when the fields are referenced, they will appear within single quotes. When values to fill those fields arereferenced, they will appear within double quotes. Using the aboveexample, possible values for ’data’ are "foo" and "bar".4. Global RequestsThere are several kinds of requests that affect the state of theremote end globally, independent of any channels. An example is arequest to start TCP/IP forwarding for a specific port. Note thatboth the client and server MAY send global requests at any time, and the receiver MUST respond appropriately. All such requests use thefollowing format.byte SSH_MSG_GLOBAL_REQUESTstring request name in US-ASCII onlyboolean want reply.... request-specific data followsThe value of ’request name’ follows the DNS extensibility namingconvention outlined in [SSH-ARCH].The recipient will respond to this message withSSH_MSG_REQUEST_SUCCESS or SSH_MSG_REQUEST_FAILURE if ’want reply’ is TRUE.byte SSH_MSG_REQUEST_SUCCESS.... response specific dataUsually, the ’response specific data’ is non-existent.If the recipient does not recognize or support the request, it simply responds with SSH_MSG_REQUEST_FAILURE.byte SSH_MSG_REQUEST_FAILUREIn general, the reply messages do not include request typeidentifiers. To make it possible for the originator of a request to identify to which request each reply refers, it is REQUIRED thatreplies to SSH_MSG_GLOBAL_REQUESTS MUST be sent in the same order as the corresponding request messages. For channel requests, repliesthat relate to the same channel MUST also be replied to in the right order. However, channel requests for distinct channels MAY bereplied to out-of-order.Ylonen & Lonvick Standards Track [Page 4]5. Channel MechanismAll terminal sessions, forwarded connections, etc., are channels.Either side may open a channel. Multiple channels are multiplexedinto a single connection.Channels are identified by numbers at each end. The number referring to a channel may be different on each side. Requests to open achannel contain the sender’s channel number. Any other channel-related messages contain the recipient’s channel number for thechannel.Channels are flow-controlled. No data may be sent to a channel untila message is received to indicate that window space is available.5.1. Opening a ChannelWhen either side wishes to open a new channel, it allocates a localnumber for the channel. It then sends the following message to theother side, and includes the local channel number and initial window size in the message.byte SSH_MSG_CHANNEL_OPENstring channel type in US-ASCII onlyuint32 sender channeluint32 initial window sizeuint32 maximum packet size.... channel type specific data followsThe ’channel type’ is a name, as described in [SSH-ARCH] and[SSH-NUMBERS], with similar extension mechanisms. The ’senderchannel’ is a local identifier for the channel used by the sender of this message. The ’initial window size’ specifies how many bytes of channel data can be sent to the sender of this message withoutadjusting the window. The ’maximum packet size’ specifies themaximum size of an individual data packet that can be sent to thesender. For example, one might want to use smaller packets forinteractive connections to get better interactive response on slowlinks.The remote side then decides whether it can open the channel, andresponds with either SSH_MSG_CHANNEL_OPEN_CONFIRMATION orSSH_MSG_CHANNEL_OPEN_FAILURE.Ylonen & Lonvick Standards Track [Page 5]byte SSH_MSG_CHANNEL_OPEN_CONFIRMATIONuint32 recipient channeluint32 sender channeluint32 initial window sizeuint32 maximum packet size.... channel type specific data followsThe ’recipient channel’ is the channel number given in the originalopen request, and ’sender channel’ is the channel number allocated by the other side.byte SSH_MSG_CHANNEL_OPEN_FAILUREuint32 recipient channeluint32 reason codestring description in ISO-10646 UTF-8 encoding [RFC3629]string language tag [RFC3066]If the recipient of the SSH_MSG_CHANNEL_OPEN message does not support the specified ’channel type’, it simply responds withSSH_MSG_CHANNEL_OPEN_FAILURE. The client MAY show the ’description’ string to the user. If this is done, the client software should take the precautions discussed in [SSH-ARCH].The SSH_MSG_CHANNEL_OPEN_FAILURE ’reason code’ values are defined in the following table. Note that the values for the ’reason code’ are given in decimal format for readability, but they are actually uint32 values.Symbolic name reason code------------- -----------SSH_OPEN_ADMINISTRATIVELY_PROHIBITED 1SSH_OPEN_CONNECT_FAILED 2SSH_OPEN_UNKNOWN_CHANNEL_TYPE 3SSH_OPEN_RESOURCE_SHORTAGE 4Requests for assignments of new SSH_MSG_CHANNEL_OPEN ’reason code’values (and associated ’description’ text) in the range of 0x00000005 to 0xFDFFFFFF MUST be done through the IETF CONSENSUS method, asdescribed in [RFC2434]. The IANA will not assign Channel Connection Failure ’reason code’ values in the range of 0xFE000000 to0xFFFFFFFF. Channel Connection Failure ’reason code’ values in that range are left for PRIVATE USE, as described in [RFC2434].While it is understood that the IANA will have no control over therange of 0xFE000000 to 0xFFFFFFFF, this range will be split in twoparts and administered by the following conventions.Ylonen & Lonvick Standards Track [Page 6]o The range of 0xFE000000 to 0xFEFFFFFF is to be used in conjunction with locally assigned channels. For example, if a channel isproposed with a ’channel type’ of "example_session@",but fails, then the response will contain either a ’reason code’assigned by the IANA (as listed above and in the range of0x00000001 to 0xFDFFFFFF) or a locally assigned value in the range of 0xFE000000 to 0xFEFFFFFF. Naturally, if the server does notunderstand the proposed ’channel type’, even if it is a locallydefined ’channel type’, then the ’reason code’ MUST be 0x00000003, as described above, if the ’reason code’ is sent. If the serverdoes understand the ’channel type’, but the channel still fails to open, then the server SHOULD respond with a locally assigned’reason code’ value consistent with the proposed, local ’channeltype’. It is assumed that practitioners will first attempt to use the IANA assigned ’reason code’ values and then document theirlocally assigned ’reason code’ values.o There are no restrictions or suggestions for the range startingwith 0xFF. No interoperability is expected for anything used inthis range. Essentially, it is for experimentation.5.2. Data TransferThe window size specifies how many bytes the other party can sendbefore it must wait for the window to be adjusted. Both parties use the following message to adjust the window.byte SSH_MSG_CHANNEL_WINDOW_ADJUSTuint32 recipient channeluint32 bytes to addAfter receiving this message, the recipient MAY send the given number of bytes more than it was previously allowed to send; the window size is incremented. Implementations MUST correctly handle window sizesof up to 2^32 - 1 bytes. The window MUST NOT be increased above2^32 - 1 bytes.Data transfer is done with messages of the following type.byte SSH_MSG_CHANNEL_DATAuint32 recipient channelstring dataThe maximum amount of data allowed is determined by the maximumpacket size for the channel, and the current window size, whicheveris smaller. The window size is decremented by the amount of datasent. Both parties MAY ignore all extra data sent after the allowed window is empty.Ylonen & Lonvick Standards Track [Page 7]Implementations are expected to have some limit on the SSH transport layer packet size (any limit for received packets MUST be 32768 bytes or larger, as described in [SSH-TRANS]). The implementation of theSSH connection layero MUST NOT advertise a maximum packet size that would result intransport packets larger than its transport layer is willing toreceive.o MUST NOT generate data packets larger than its transport layer is willing to send, even if the remote end would be willing to accept very large packets.Additionally, some channels can transfer several types of data. Anexample of this is stderr data from interactive sessions. Such data can be passed with SSH_MSG_CHANNEL_EXTENDED_DATA messages, where aseparate integer specifies the type of data. The available types and their interpretation depend on the type of channel.byte SSH_MSG_CHANNEL_EXTENDED_DATAuint32 recipient channeluint32 data_type_codestring dataData sent with these messages consumes the same window as ordinarydata.Currently, only the following type is defined. Note that the valuefor the ’data_type_code’ is given in decimal format for readability, but the values are actually uint32 values.Symbolic name data_type_code------------- --------------SSH_EXTENDED_DATA_STDERR 1Extended Channel Data Transfer ’data_type_code’ values MUST beassigned sequentially. Requests for assignments of new ExtendedChannel Data Transfer ’data_type_code’ values and their associatedExtended Channel Data Transfer ’data’ strings, in the range of0x00000002 to 0xFDFFFFFF, MUST be done through the IETF CONSENSUSmethod as described in [RFC2434]. The IANA will not assign Extended Channel Data Transfer ’data_type_code’ values in the range of0xFE000000 to 0xFFFFFFFF. Extended Channel Data Transfer’data_type_code’ values in that range are left for PRIVATE USE, asdescribed in [RFC2434]. As is noted, the actual instructions to the IANA are in [SSH-NUMBERS].Ylonen & Lonvick Standards Track [Page 8]5.3. Closing a ChannelWhen a party will no longer send more data to a channel, it SHOULDsend SSH_MSG_CHANNEL_EOF.byte SSH_MSG_CHANNEL_EOFuint32 recipient channelNo explicit response is sent to this message. However, theapplication may send EOF to whatever is at the other end of thechannel. Note that the channel remains open after this message, and more data may still be sent in the other direction. This messagedoes not consume window space and can be sent even if no window space is available.When either party wishes to terminate the channel, it sendsSSH_MSG_CHANNEL_CLOSE. Upon receiving this message, a party MUSTsend back an SSH_MSG_CHANNEL_CLOSE unless it has already sent thismessage for the channel. The channel is considered closed for aparty when it has both sent and received SSH_MSG_CHANNEL_CLOSE, andthe party may then reuse the channel number. A party MAY sendSSH_MSG_CHANNEL_CLOSE without having sent or receivedSSH_MSG_CHANNEL_EOF.byte SSH_MSG_CHANNEL_CLOSEuint32 recipient channelThis message does not consume window space and can be sent even if no window space is available.It is RECOMMENDED that all data sent before this message be delivered to the actual destination, if possible.5.4. Channel-Specific RequestsMany ’channel type’ values have extensions that are specific to that particular ’channel type’. An example is requesting a pty (pseudoterminal) for an interactive session.All channel-specific requests use the following format.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring request type in US-ASCII characters onlyboolean want reply.... type-specific data followsYlonen & Lonvick Standards Track [Page 9]If ’want reply’ is FALSE, no response will be sent to the request.Otherwise, the recipient responds with eitherSSH_MSG_CHANNEL_SUCCESS, SSH_MSG_CHANNEL_FAILURE, or request-specific continuation messages. If the request is not recognized or is notsupported for the channel, SSH_MSG_CHANNEL_FAILURE is returned.This message does not consume window space and can be sent even if no window space is available. The values of ’request type’ are local to each channel type.The client is allowed to send further messages without waiting forthe response to the request.’request type’ names follow the DNS extensibility naming conventionoutlined in [SSH-ARCH] and [SSH-NUMBERS].byte SSH_MSG_CHANNEL_SUCCESSuint32 recipient channelbyte SSH_MSG_CHANNEL_FAILUREuint32 recipient channelThese messages do not consume window space and can be sent even if no window space is available.6. Interactive SessionsA session is a remote execution of a program. The program may be ashell, an application, a system command, or some built-in subsystem. It may or may not have a tty, and may or may not involve X11forwarding. Multiple sessions can be active simultaneously.6.1. Opening a SessionA session is started by sending the following message.byte SSH_MSG_CHANNEL_OPENstring "session"uint32 sender channeluint32 initial window sizeuint32 maximum packet sizeClient implementations SHOULD reject any session channel openrequests to make it more difficult for a corrupt server to attack the client.Ylonen & Lonvick Standards Track [Page 10]6.2. Requesting a Pseudo-TerminalA pseudo-terminal can be allocated for the session by sending thefollowing message.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "pty-req"boolean want_replystring TERM environment variable value (e.g., vt100)uint32 terminal width, characters (e.g., 80)uint32 terminal height, rows (e.g., 24)uint32 terminal width, pixels (e.g., 640)uint32 terminal height, pixels (e.g., 480)string encoded terminal modesThe ’encoded terminal modes’ are described in Section 8. Zerodimension parameters MUST be ignored. The character/row dimensionsoverride the pixel dimensions (when nonzero). Pixel dimensions refer to the drawable area of the window.The dimension parameters are only informational.The client SHOULD ignore pty requests.6.3. X11 Forwarding6.3.1. Requesting X11 ForwardingX11 forwarding may be requested for a session by sending aSSH_MSG_CHANNEL_REQUEST message.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "x11-req"boolean want replyboolean single connectionstring x11 authentication protocolstring x11 authentication cookieuint32 x11 screen numberIt is RECOMMENDED that the ’x11 authentication cookie’ that is sentbe a fake, random cookie, and that the cookie be checked and replaced by the real cookie when a connection request is received.X11 connection forwarding should stop when the session channel isclosed. However, already opened forwardings should not beautomatically closed when the session channel is closed.Ylonen & Lonvick Standards Track [Page 11]If ’single connection’ is TRUE, only a single connection should beforwarded. No more connections will be forwarded after the first, or after the session channel has been closed.The ’x11 authentication protocol’ is the name of the X11authentication method used, e.g., "MIT-MAGIC-COOKIE-1".The ’x11 authentication cookie’ MUST be hexadecimal encoded.The X Protocol is documented in [SCHEIFLER].6.3.2. X11 ChannelsX11 channels are opened with a channel open request. The resultingchannels are independent of the session, and closing the sessionchannel does not close the forwarded X11 channels.byte SSH_MSG_CHANNEL_OPENstring "x11"uint32 sender channeluint32 initial window sizeuint32 maximum packet sizestring originator address (e.g., "192.168.7.38")uint32 originator portThe recipient should respond with SSH_MSG_CHANNEL_OPEN_CONFIRMATIONor SSH_MSG_CHANNEL_OPEN_FAILURE.Implementations MUST reject any X11 channel open requests if theyhave not requested X11 forwarding.6.4. Environment Variable PassingEnvironment variables may be passed to the shell/command to bestarted later. Uncontrolled setting of environment variables in aprivileged process can be a security hazard. It is recommended that implementations either maintain a list of allowable variable names or only set environment variables after the server process has droppedsufficient privileges.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "env"boolean want replystring variable namestring variable valueYlonen & Lonvick Standards Track [Page 12]6.5. Starting a Shell or a CommandOnce the session has been set up, a program is started at the remote end. The program can be a shell, an application program, or asubsystem with a host-independent name. Only one of these requestscan succeed per channel.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "shell"boolean want replyThis message will request that the user’s default shell (typicallydefined in /etc/passwd in UNIX systems) be started at the other end. byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "exec"boolean want replystring commandThis message will request that the server start the execution of the given command. The ’command’ string may contain a path. Normalprecautions MUST be taken to prevent the execution of unauthorizedcommands.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "subsystem"boolean want replystring subsystem nameThis last form executes a predefined subsystem. It is expected that these will include a general file transfer mechanism, and possiblyother features. Implementations may also allow configuring more such mechanisms. As the user’s shell is usually used to execute thesubsystem, it is advisable for the subsystem protocol to have a"magic cookie" at the beginning of the protocol transaction todistinguish it from arbitrary output generated by shellinitialization scripts, etc. This spurious output from the shell may be filtered out either at the server or at the client.The server SHOULD NOT halt the execution of the protocol stack whenstarting a shell or a program. All input and output from theseSHOULD be redirected to the channel or to the encrypted tunnel.It is RECOMMENDED that the reply to these messages be requested andchecked. The client SHOULD ignore these messages.Ylonen & Lonvick Standards Track [Page 13]Subsystem names follow the DNS extensibility naming conventionoutlined in [SSH-NUMBERS].6.6. Session Data TransferData transfer for a session is done using SSH_MSG_CHANNEL_DATA andSSH_MSG_CHANNEL_EXTENDED_DATA packets and the window mechanism. The extended data type SSH_EXTENDED_DATA_STDERR has been defined forstderr data.6.7. Window Dimension Change MessageWhen the window (terminal) size changes on the client side, it MAYsend a message to the other side to inform it of the new dimensions. byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "window-change"boolean FALSEuint32 terminal width, columnsuint32 terminal height, rowsuint32 terminal width, pixelsuint32 terminal height, pixelsA response SHOULD NOT be sent to this message.6.8. Local Flow ControlOn many systems, it is possible to determine if a pseudo-terminal is using control-S/control-Q flow control. When flow control isallowed, it is often desirable to do the flow control at the clientend to speed up responses to user requests. This is facilitated bythe following notification. Initially, the server is responsible for flow control. (Here, again, client means the side originating thesession, and server means the other side.)The message below is used by the server to inform the client when it can or cannot perform flow control (control-S/control-Q processing). If ’client can do’ is TRUE, the client is allowed to do flow control using control-S and control-Q. The client MAY ignore this message.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "xon-xoff"boolean FALSEboolean client can doNo response is sent to this message.Ylonen & Lonvick Standards Track [Page 14]6.9. SignalsA signal can be delivered to the remote process/service using thefollowing message. Some systems may not implement signals, in which case they SHOULD ignore this message.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "signal"boolean FALSEstring signal name (without the "SIG" prefix)’signal name’ values will be encoded as discussed in the passagedescribing SSH_MSG_CHANNEL_REQUEST messages using "exit-signal" inthis section.6.10. Returning Exit StatusWhen the command running at the other end terminates, the followingmessage can be sent to return the exit status of the command.Returning the status is RECOMMENDED. No acknowledgement is sent for this message. The channel needs to be closed withSSH_MSG_CHANNEL_CLOSE after this message.The client MAY ignore these messages.byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "exit-status"boolean FALSEuint32 exit_statusThe remote command may also terminate violently due to a signal.Such a condition can be indicated by the following message. A zero’exit_status’ usually means that the command terminated successfully. byte SSH_MSG_CHANNEL_REQUESTuint32 recipient channelstring "exit-signal"boolean FALSEstring signal name (without the "SIG" prefix)boolean core dumpedstring error message in ISO-10646 UTF-8 encodingstring language tag [RFC3066]Ylonen & Lonvick Standards Track [Page 15]The ’signal name’ is one of the following (these are from [POSIX]).ABRTALRMFPEHUPILLINTKILLPIPEQUITSEGVTERMUSR1USR2Additional ’signal name’ values MAY be sent in the format"sig-name@xyz", where "sig-name" and "xyz" may be anything aparticular implementer wants (except the "@" sign). However, it issuggested that if a ’configure’ script is used, any non-standard’signal name’ values it finds be encoded as "SIG@xyz.config.guess",where "SIG" is the ’signal name’ without the "SIG" prefix, and "xyz" is the host type, as determined by "config.guess".The ’error message’ contains an additional textual explanation of the error message. The message may consist of multiple lines separatedby CRLF (Carriage Return - Line Feed) pairs. The client software MAY display this message to the user. If this is done, the clientsoftware should take the precautions discussed in [SSH-ARCH].7. TCP/IP Port Forwarding7.1. Requesting Port ForwardingA party need not explicitly request forwardings from its own end tothe other direction. However, if it wishes that connections to aport on the other side be forwarded to the local side, it mustexplicitly request this.byte SSH_MSG_GLOBAL_REQUESTstring "tcpip-forward"boolean want replystring address to bind (e.g., "0.0.0.0")uint32 port number to bindYlonen & Lonvick Standards Track [Page 16]。
翻译自:/rfc/rfc6455.txtInternet Engineering Task Force (IETF) I. Fette Request for Comments: 6455 Google, Inc. Category: Standards Track A. Melnikov ISSN: 2070-1721 Isode Ltd. December 2011WebSocket 协议摘要WebSocket协议使在控制环境下运行不受信任代码的客户端和能够选择与那些代码通信的远程主机之间能够双向通信。
用于这个的安全模型是以origin为基础的安全模型,一般被浏览器使用。
协议包含打开握手,其次是基本消息框架,在TCP之上。
这项技术的目的是为基于浏览器的、需要与服务器双向通信的应用程序提供一种不依赖于打开多个HTTP连接的机制(例如,使用XMLHttpRequest 或<iframe> 和长轮询)。
本备忘录的状态这是一个Internet标准跟踪文件。
这个文档是因特网工程师任务组(IETF)的一个产品。
它代表了IETF社区的共识。
它已接受公众审查,因特网工程指导组(IESG)证明可出版。
关于互联网标准的进一步信息在RFC5741的第2章节。
关于本文档当前状态的信息、勘误表和如何提供反馈,可以在/info/rfc6455找到。
版权声明Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating to IETF Documents (/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.1.介绍1.1.背景这部分是不规范的。
1使用RFC的意义RFC是实现接口的主要方式之一,不但是一种函数,更是一种数据通信协议,类TCP/IP。
RFC不仅是一个函数,也是一个数据通信协议,SAP显然是吃定大集团的管理应用,在大集团通常分散了若干Sap应用,可通过RFC协议进行连接,Tcode:SM59 ,典型应用在如下的几个方面:(1)MDM:总部MDM做整个集团的主数据编码规划,通过XI+RFC连接自动分发到各分散服务器。
(2)BI数据仓库系统通过RFC从分散的R/3应用服务器中抽取数据,做报表分析和数据挖掘。
(3)SLM(SoLution Management),SLM通过RFC连接各企业,在SLM统一登录,R/3那边设置好RFC用户可自动登录,当然SLM还提供了完善的问题处理流程跟踪。
2 SAP RFC几种模式(1)sRFC(synchronous RFC)是RFC的第一个版本,它要求连接的双方是同步的工作方式,即都是在可用状态才能够实现成功调用。
(2)aRFC(asynchronous RFC)这种RFC可以实现异步的RFC调用方式,它可以进行多个并发调用,并且不要求被调用系统的可用状态。
发出调用系统会一直尝试直到获得被调用系统的应答。
它通常用于当你需要提高系统并行调用多个RFC的效率,相对于强制等待程序的结果,它的效率更高。
(3)tRFC(transactional RFC)是对aRFC进行相关技术改进后的一个RFC版本,其于ARFC相同点是实现异步调用,其优点是可以将多个调用进行LUW分组处理,并只执行一次运行。
现在aRFC基本上已经停用。
(4)qRFC(queue(d) RFC)是tRFC的一个增强版本,它保证了所传输数据的处理次序。
(5)pRFC(Parallel RFC)是一种特殊的RFC,它是aRFC的一种扩展类型。
因为它改善了系统的性能,在执行大量的aRFC时。
SAP 使用它在MRP里面提高速度。
但是它只能执行在同一个系统和同一个client里。
rfc相关设置及使用RFC(Request for Comments)是一种用于定义互联网协议、标准和相关问题的文档。
RFC的格式由互联网工程任务组(IETF)统一规定,它们记录了网络技术的发展和演进过程。
在本文中,我们将介绍RFC相关的设置和使用。
1. 了解RFC的作用和历史:RFC是由IETF组织制定的一种标准化文档,它记录了互联网协议的设计、开发和演化过程。
RFC起源于20世纪60年代的ARPANET,是一种社区驱动的文档,通过共享和讨论来推动互联网技术的发展。
RFC文档旨在提供指南、建议和最佳实践,帮助网络技术人员解决问题。
2. 寻找和阅读RFC文档:RFC文档可以在互联网上免费获取,IETF的官方网站和其他资源库都有存档。
这些文档按照顺序编号,并且以RFC开头,比如RFC 791定义了IPv4协议。
通过搜索引擎或在IETF网站上使用关键词搜索,可以找到特定主题的RFC文档。
阅读RFC文档时,应该注意文档的状态,有一些可能已经被更新或废弃。
3. 使用RFC文档:RFC文档在网络技术的发展过程中起着重要的指导作用。
它们提供了协议规范、算法实现、安全性和隐私等方面的建议。
网络管理员、网络工程师和开发人员可以使用RFC文档来了解和理解特定协议或标准的设计原理和要求。
此外,RFC文档还常用于进行互联网协议的实现、编程和配置。
4. 参与RFC的制定过程:RFC并不是静止的文件,而是一个持续演进的过程。
任何人都可以参与到RFC的制定过程中。
要参与RFC的制定,可以加入IETF并参与相关的工作组或邮件列表。
通过这种方式,个人可以提出改进建议,参与讨论和标准化的制定。
5. 遵循RFC的指导原则:在网络技术领域,遵循RFC的指导原则是至关重要的。
这些指导原则包括设计原则、协议分层、安全性和互操作性等要求。
遵循RFC的指导原则可以确保网络协议的正确性、稳定性和可靠性,同时也可以促进网络技术的发展和创新。
总结起来,RFC在互联网技术领域起着重要的作用,它们记录了互联网协议的发展历程和指导原则。