2023年全國碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁
已閱讀1頁,還剩19頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、<p>  Programming Overlay Networks with Overlay Sockets</p><p>  The emergence of application-layer overlay networks has inspired the development of new network services and applications. Research on ov

2、erlay net-workshas focused on the design of protocols to maintain and forward data in an overlay network, however, less attention has been given to the software development process of building application programs in suc

3、h an environment. Clearly,the complexity of overlay network protocols calls for suitable application programming interfaces (APIs) and abstract</p><p>  1 Introduction </p><p>  Application-laye

4、r overlay networks [5, 9, 13, 17] provide flexible platforms for develop-ing new network services [1, 10, 11, 14, 18–20] without requiring changes to the network-layer infrastructure. Members of an overlay network, which

5、 can be hosts, routers, servers, or applications, organize themselves to form a logical network topology, and commu-nicate only with their respective neighbors in the overlay topology. A member of an overlay network send

6、s and receives application data, and also fo</p><p>  We present a software module, called overlay socket, that intends to simplify the task of overlay network programming. The design of the overlay socket p

7、ursues the following set of objectives: First, the application programming interface (API) of the overlay socket does not require that an application programmer has knowledge of the overlay network topology. Second, the

8、overlay socket is designed to accommodate dif-ferent overlay network topologies. Switching to different overlay network topolog</p><p>  Fig. 1. The overlay network is a collection of overlay sockets. Root

9、(sender) Root (receiver) (a) Multicast (b) Unicast. </p><p>  Fig. 2. Data forwarding in overlay networks. </p><p>  The rest of the paper is organized as following. In Section 2 we introduce c

10、on-cepts, abstractions, and terminology needed for the discussion of the overlay socket. In Section 3 we present the design of the overlay socket, and discuss its components. In Section 4 we show how to write programs us

11、ing the overlay socket. We present brief conclusions in Section 5. </p><p>  2 Basic Concepts </p><p>  An overlay socket is an endpoint for communication in an overlay network, and an overlay n

12、etwork is seen as a collection of overlay sockets that self-organize using an overlay protocol (see Figure 1). An overlay socket offers to an application programmer a Berkeley socket-style API [3] for sending and receivi

13、ng data over an overlay network. Each overlay socket executes an overlay protocol that is responsible for maintaining the membership of the socket in the overlay network topology. Each overl</p><p><b>

14、  _ </b></p><p><b>  x </b></p><p><b>  _ </b></p><p><b>  y </b></p><p><b>  _ </b></p><p>  coordin

15、ates, where x and y are positive 32-bit positive integers. The physical address is a transport layer address where overlay sockets receive messages from the overlay network. On the Internet, the physical address is an IP

16、 address and a TCP or UDP port number. Application programs that use overlay sockets only work with logical addresses, and do not see physical addresses of overlay nodes. When an overlay socket is created, the socket is

17、configured with a set of configu-ration parameters, c</p><p>  3 The Components of an Overlay Socket </p><p>  An overlay socket consists of a collection of components that are configured when t

18、he overlay socketis created, using the supplied set of attributes. These components include the overlay protocol, which helps to build and maintain the overlay network topology, a component that processes application dat

19、a, and interfaces to a transport-layer network. The main components of an overlay socket, as illustrated in Figure 3, are as follows: </p><p>  The overlay node implements an overlay protocol that establishe

20、s and maintains the overlay network topology. The overlay node sends and receives overlay protocol messages, and maintains a set of timers. The overlay node is the only component of an overlay socket that is aware of the

21、 overlay topology. In the HyperCast 2.0. Overlay socket </p><p>  Forwarding Engine </p><p>  Application Programming Interface </p><p>  Statistics Interface </p><p> 

22、 Protocol Messages </p><p>  Application </p><p><b>  Receive </b></p><p><b>  Buffer </b></p><p>  Application </p><p><b>  

23、Transmit </b></p><p>  Buffer Overlay Node </p><p>  O verlay Node </p><p>  Interfac e </p><p>  Node Adapter </p><p>  Adapter Interface </p>

24、<p>  Socket Adapter </p><p>  A dapter Interface </p><p>  Application Messages </p><p>  Application Program </p><p>  Transport-layer Network </p><

25、p>  Application Messages </p><p>  Fig. 3. Components of an overlay socket. </p><p>  software, there are overlay nodes that build a logical hypercube [15] and a logical Delaunay triangu-<

26、/p><p>  lartion [16]. </p><p>  The forwarding engine performs the functions of an application-layer router, that sends, receives, and forwards formatted application-layer messages in the overlay

27、network. The forwarding engine communicates with the overlay node to query next hop routing information for application messages. The forwarding decision is made using logical addresses of the overlay nodes. Each overlay

28、 socket has two network adapters that each provides an interface to transport-layer protocols, such as TCP or UDP. T</p><p>  The application receive buffer and application transmit buffer can temporarily st

29、ore messages that, respectively, have been received by the socket but not been deliv-ered to theapplication, or that have been released by the application program, but not been transmitted by the socket. The application

30、transmit buffer can play a role when messages cannot be transmitted due to rate control or congestion control con-straints. The application transmit buffer is not implemented in the HyperCast 2.0 sof</p><p>

31、  4 Overlay Network Programming </p><p>  An application developer does not need to be familiar with the details of the components of an overlay socket as described in the previous section. The developer is

32、exposed only to the API of the overlay socket and to a file with configuration parameters. The configuration file is a text file which stores all attributes needed to configure an overlay socket. The configuration file i

33、s modified whenever a change is needed to the transport protocol, the overlay protocol, or some other parameters of</p><p>  4.1 Overlay Socket API </p><p>  Since the overlay topology and the f

34、orwarding of application-layer data is transparent to the application program, the API for overlay network programming can be made simple. Applications need to be able to create a new overlay network, join and leave an e

35、xisting overlay network, send data to and receive data from other members in the overlay. </p><p>  The API of the overlay socket is message-based, and intentionally stays close to the familiar Berkeley sock

36、et API [3]. Since space considerations do not permit a description of the full API, we sketch the API with the help of a simplified example. Figure 4 shows the fragment of a Java program that uses an overlay socket. An a

37、pplication program configures and creates an overlay socket with the help of an overlay manager (o m). The overlay manager reads configuration parameters for the overlay soc</p><p>  // Generate the configur

38、ation object </p><p>  OverlayManager om = new </p><p>  OverlayManager("hypercast.prop"); </p><p>  String MyOverlay = om.getDefaultProperty("OverlayID"); </

39、p><p>  OverlaySocketConfig config = new om.getOverlaySocketConfig(MyOverlay); </p><p>  // create an overlay socket </p><p>  OL Socket socket = config.createOverlaySocket(callback);

40、</p><p>  // Join an overlay </p><p>  socket.joinGroup(); </p><p>  // Create a message </p><p>  OL Message msg = socket.createMessage(byte[] data, int length); </

41、p><p>  // Send the message to all members in overlay network </p><p>  socket.sendToAll(msg); </p><p>  // Receive a message from the socket </p><p>  OL Message msg = so

42、cket.receive(); </p><p>  Fig. 4. Program with overlay sockets. </p><p>  # OVERLAY Server: </p><p>  OverlayServer = </p><p>  # OVERLAY ID: </p><p>  Ov

43、erlayID = 1234 </p><p>  KeyAttributes= Socket,Node,SocketAdapter </p><p>  # SOCKET: </p><p>  Socket = HCast2-0 </p><p>  HCAST2-0.TTL = 255 </p><p>  HC

44、AST2-0.ReceiveBufferSize = 200 </p><p>  # SOCKET ADAPTER: </p><p>  SocketAdapter = TCP </p><p>  SocketAdapter.TCP.MaximumPacketLength = 16384 </p><p><b>  # NO

45、DE: </b></p><p>  Node = DT2-0 </p><p>  DT2-0.SleepTime = 400 </p><p>  # NODE ADAPTER: </p><p>  NodeAdapter = NodeAdptUDPServer </p><p>  NodeAdap

46、ter.UDP.MaximumPacketLength = 8192 </p><p>  NodeAdapter.UDPServer.UdpServer0 = </p><p>  128.143.71.50:8081 </p><p>  Fig. 5. Configuration file (simplified) given overlay ID. The

47、 configuration object also loads all configuration information from the configuration file, and then creates the overlay socket(config.create</p><p>  OverlaySocke t). </p><p>  Once the overlay

48、 socket is created, the socket joins the overlay network (socket.join-Grou p). When a socket wants to multicast a message, it instantiates a new message (socket.createMessage) and trans</p><p>  -mits the me

49、ssage using the sendToAll method. Other transmission options are send-To-Parent, send-</p><p>  To-Children, sendToNeighbors, and sendToNode, which, respectively, send a message to the upstream neighbor with

50、 respect to a given root (see Figure 2), to the downstream neighbors, to all neighbors, or to a particular node with a given logical address. </p><p>  4.2 Overlay Network Properties Management </p>&

51、lt;p>  As seen, the properties of an overlay socket are configured by setting attributes in a configuration file. The overlay manager in an application process uses the attributes to create a new overlay socket. By mo

52、difying the attributes in the configuration file, an application programmer can configure the overlay protocol or transport protocol that is used by the overlay socket. Changes to the file must be done before the socket

53、is created. Figure 5 shows a (simplified) example of a configuration f</p><p>  DT2-0 ’), and it sets the transport protocol of the socket adaptor to TCP(‘SocketAdapter=TCP ’). </p><p>  Each ov

54、erlay network is associated with a set of attributes that characterize the properties of the over</p><p>  -lay sockets that participate in the overlay network. As mentioned earlier, the most important attri

55、bute is the overlay ID, which is used to identify an over-.lay network, and which can be used as a key to</p><p>  access all other attributes of an overlay network. The overlay ID should be a globally uniqu

56、e identifier. </p><p>  A new overlay network is created by generating a new overlay ID and associating a set of attributes that specify the properties of the overlay sockets in the overlay network. To join

57、an overlay network, an overlay socket must know the overlay ID and the set of attributes for this overlay ID. This information can be obtained from a configuration file, as shown in Figure 5. </p><p>  All a

58、ttributes have a name and a value, both of which are strings. For example, the overlay protocol of an overlay socket can be determined by an attribute with name NODE. If the attribute is set to NOD</p><p>  

59、-E=DT2- 0, then the overlay node in the overlay socket runs the DT (version 2) overlay protocol. The overlay socket distinguishes between two types of attributes: key attributes and configurable attributes. Key attribute

60、s are specific to an overlay network with a given overlay ID. Key attributes are selected </p><p>  when the overlay ID is created for an overlay network, and cannot be modified after-wards. </p><

61、p>  Overlay sockets that participate in an overlay network must have identical key attributes, but can have different configurable attributes. The attributes OverlayID and KeyAttributes are key attributes by default i

62、n all overlay networks. Configurable at-tributes specify parameters of an overlay socket, which are not considered essential for establishing communication between overlay sockets in the same overlay network, and which a

63、re considered ‘tunable’. </p><p>  5 Conclusions </p><p>  We discussed the design of an overlay socket which attempts to simplify the task of overlay network programming. The overlay socket ser

64、ves as an end point of commu-nication in the overlay network. The overlay socket can be used for various overlay topologies and support different transport protoc-</p><p>  ols. The overlay socket supports a

65、 simple API for joining and leaving an overlay network, and for sending and receiving data to and from other sockets in the overlay network. The main advantage of the overlay socket is that it is relatively easy to chang

66、e the configuration of the overlay network. An implementation of the overlay socket is distributed with the HyperCast2.0 soft-ware. The software has been extensively tested. A variety of different applications, such as d

67、istributed whiteboard and </p><p>  Acknowledgement. In addition to the authors of this article the contributors include Bhupinder Sethi, Tyler Beam, Burton Filstrup, Mike Nahas, Dongwen Wang, Konrad Lorincz

68、, Jean Ablutz, Haiyong Wang, Weisheng Si, Huafeng Lu, and Guangyu Dong. </p><p>  基于Socket的網(wǎng)絡編程</p><p>  應用層覆蓋網(wǎng)絡的出現(xiàn)促進了新網(wǎng)絡服務和應用的發(fā)展。對面向網(wǎng)絡的研究集中于協(xié)議的設(shè)計,并且在網(wǎng)絡中傳輸數(shù)據(jù),無論怎樣,在應用程序軟件的開發(fā)過程中已對這個問題引起了一定的注意。 顯然

69、,面向網(wǎng)絡的網(wǎng)絡協(xié)議的復雜性要求合適應用程序設(shè)計接口(API)和抽象觀念,不需要面向網(wǎng)絡協(xié)議的詳細知識,因此,簡化了應用程序員的任務。在這篇文章里,我們提出作為聯(lián)系在一個覆蓋網(wǎng)絡內(nèi)的終點的新程序設(shè)計抽象觀念的一個面向網(wǎng)絡上的Socket的概念。面向網(wǎng)絡上的Socket預防不依賴選擇的一基于Socket的API 涂上拓撲學,并且可能成形為不同的面向網(wǎng)絡工作上的拓撲學。 面向網(wǎng)絡上的Socket能在TCP,UDP或者其他傳送協(xié)議上方支持應用

70、數(shù)據(jù)傳輸。 這篇文章描述面向網(wǎng)絡上的Socket設(shè)計并且討論API 和配置選擇。</p><p><b>  1.引言</b></p><p>  介紹應用層覆蓋網(wǎng)絡為發(fā)展新網(wǎng)絡服務提供靈活的平臺,沒有要求轉(zhuǎn)換成網(wǎng)絡層基礎(chǔ)設(shè)施。一個覆蓋網(wǎng)絡的成員,可能是主機,路由器,服務器或者應用,組織自己形成合乎邏輯的網(wǎng)絡拓撲,并且只與在面向網(wǎng)絡上拓撲學方面的各自的鄰居通信。一個覆

71、蓋網(wǎng)絡的成員并且得到申請數(shù)據(jù),以及準備給其他成員傳輸?shù)臄?shù)據(jù)。我們使用網(wǎng)絡程序設(shè)計指的是在應用層上與另一個應用程序通信的應用程序軟件開發(fā)過程。大樓的差異和復雜性和保養(yǎng)的覆蓋網(wǎng)絡使它不實用對以程序開發(fā)員可能關(guān)心管理應用程序在網(wǎng)絡技術(shù)的一些細節(jié)內(nèi)的復雜性。</p><p>  我們提出一個軟件模塊,叫Ovlay Socket,打算簡化面向網(wǎng)絡上的網(wǎng)絡程序設(shè)計的任務。面向網(wǎng)絡上的Socket的設(shè)計追隨這套以下的目標:首先

72、,面向網(wǎng)絡上的Socket的設(shè)計追隨這套以下的目標:首先,面向網(wǎng)絡上的Socket的應用程序設(shè)計接口(API)不要求一個應用程序員有面向網(wǎng)絡上的網(wǎng)絡拓撲的知識。其次,面向網(wǎng)絡網(wǎng)絡拓撲上,面向網(wǎng)絡上的Socket被用于適應。轉(zhuǎn)向不同的面向網(wǎng)絡通過在一件配置文件里修改參數(shù)被做上的網(wǎng)絡拓撲。第三,面向網(wǎng)絡上的Socket,在應用層操作,能適應不同的類型傳送層協(xié)議。這通過使用聯(lián)接于非derlying的運輸層網(wǎng)絡并且通過面向網(wǎng)絡執(zhí)行信息交換的封裝

73、和解封裝上的Socket的網(wǎng)絡轉(zhuǎn)接器被完成。目前可得到的網(wǎng)絡轉(zhuǎn)接器是TCP,UDP 和UDP多路傳送。第四,面向網(wǎng)絡上的Socket為bootstrapping新覆蓋網(wǎng)絡提供機制。</p><p>  在這文章內(nèi),我們提供一面向網(wǎng)絡上的Socket設(shè)計的概述并且討論過于放網(wǎng)絡程序設(shè)計與涂上的Socket一起。面向網(wǎng)絡上的Socket作為HyperCast的部分2.0種軟件配給在java是imple-mented[

74、12].軟件已經(jīng)用于各種各樣的面向網(wǎng)絡上的應用,并且已經(jīng)被在兩個局部地區(qū)以及廣闊地區(qū)測試確定。HyperCast2.0軟件實現(xiàn)描述在里的面向網(wǎng)絡上的topolo-gies[15]并且[16].這文章最精彩場面面向網(wǎng)絡上的Socket,另外信息的重要期刊可能被在可以從設(shè)計文獻編制中獲得內(nèi)發(fā)現(xiàn)[12].幾項研究在我們面前已經(jīng)提出面向網(wǎng)絡上的網(wǎng)絡程序設(shè)計問題。即使早期的覆蓋網(wǎng)絡提議,例如Yoid[9],劃線于[4],并且Scattercast

75、[6],已經(jīng)提出立志爭取從使用的面向網(wǎng)絡取得API的獨立上的網(wǎng)絡拓撲的APIs。尤其,Yoid 和Scattercast使用Socket一樣的API,到底怎樣,當相同的API被不同的面向網(wǎng)絡使用上的網(wǎng)絡拓撲時,這些APIs不處理出現(xiàn)的問題。幾工作在應用層多路傳送上涂上inte 磨擦應用程序與負責沒有明確地提供通用APIs保持覆蓋網(wǎng)絡的軟件一起。</p><p><b>  2.基本概念</b>

76、;</p><p>  一個面向網(wǎng)絡上的Socket是在一個覆蓋網(wǎng)絡里的通訊的endpoint,并且一個覆蓋網(wǎng)絡被作為一次面向網(wǎng)絡看見上自我組織的Socket使用一份面向網(wǎng)絡。一個面向網(wǎng)絡上的Socket把一伯克利Socket風格API提供給一個申請程序員 [3]為送和得到在一個覆蓋網(wǎng)絡上的數(shù)據(jù)。每一個面向網(wǎng)絡Socket上執(zhí)行是負責保持Socket在被涂上的網(wǎng)絡拓撲內(nèi)的會員的一份面向網(wǎng)絡上的協(xié)議。面向網(wǎng)絡Soc

77、ket上的每一個在覆蓋網(wǎng)絡里有邏輯地址和物理地址。面向網(wǎng)絡使用的協(xié)議上,邏輯地址依賴類型。在面向網(wǎng)絡里上的協(xié)議目前在HyperCast2.0實現(xiàn),邏輯地址是32位整數(shù)。物理地址是涂上Socket的運輸層地址從覆蓋網(wǎng)絡得到消息。在因特網(wǎng)上,物理地址是IP 地址和一TCP或者UDP港口數(shù)目。使用的應用程序涂上Socket只與邏輯地址合作,并且面向網(wǎng)絡上的節(jié)點的物理地址。物理地址在哪里涂上Socket得到消息從一個涂上的Socket被創(chuàng)造的o

78、verlayWhen那里的一運輸層地址,Socket與叫的一套configu口糧參數(shù)一起成形把歸于。應用程序能從一件配置文件獲得屬性或者它從一臺服務器上下載屬性。 配置</p><p>  Socket交換二類消息,消息和消息applica - tion 協(xié)議。協(xié)議消息面向網(wǎng)絡上協(xié)議主要tain被涂上的拓撲學的消息。應用消息包含是在一個面向網(wǎng)絡上的報文首部里的encap-sulated的應用數(shù)據(jù)。一條應用消息使用

79、在集箱里的邏輯地址鑒定來源和為單路傳送,消息的目的地。面向網(wǎng)絡Socket上得到它的一個鄰居的消息應用在方面過于放網(wǎng)絡,確定消息一定提供另一個涂上Socket如果,消息需要被傳給地方應用。目前被面向網(wǎng)絡支持上的Socket的這種傳輸方式是單路傳送和多路傳送。在多路傳送過程中,在覆蓋網(wǎng)絡里的全部成員都是接收者。不是度過數(shù)據(jù)在被嵌入在被涂上的拓撲學內(nèi)的生成樹的是。 例如,多路傳送消息傳送順流有多路傳送消息的發(fā)送人的一生成樹根(看見圖2(A)

80、)當時。當一個面向網(wǎng)絡上的Socket得到一條多路傳送消息時,它把消息傳到它所有下游的鄰近的物(孩子),和對當?shù)貞贸绦蛲ㄟ^單路傳送消息傳送向上游一樹與消息的接收者一起根(看見圖2(b))當時。 得到消息提出隨著鄰居(父母)向上游的消息在有作為根的目的地的樹內(nèi)的單路傳送的一個面向網(wǎng)絡上的Socket。 </p><p>  3.Overlay Socket 的組成</p><p>  一個

81、面向網(wǎng)絡上的Socket由一次在面向網(wǎng)絡上的Socket被建立時,成形的零部件的收集組成,使用被提供的套屬性。這些組成部分包括面向網(wǎng)絡上的協(xié)議,這幫助建造并且保持面向網(wǎng)絡上的網(wǎng)絡拓撲,處理申請數(shù)據(jù)的一個組成部分,并且聯(lián)接于一個運輸層網(wǎng)絡。一個面向網(wǎng)絡上的Socket的主要零部件,如下:面向網(wǎng)絡上的節(jié)點實現(xiàn)建立并且保持面向網(wǎng)絡上的網(wǎng)絡拓撲的一份面向網(wǎng)絡上的協(xié)議。面向網(wǎng)絡上的節(jié)點送并且得到面向網(wǎng)絡上的協(xié)議消息,并且保養(yǎng)一套定時器。面向網(wǎng)絡上

82、的節(jié)點是知道面向網(wǎng)絡上的拓撲學的一個面向網(wǎng)絡上的Socket的唯一的零部件。</p><p><b>  應用程序接口 </b></p><p>  Statistics Interface </p><p>  Protocol Messages </p><p>  Application </p>&

83、lt;p><b>  Receive </b></p><p><b>  Buffer </b></p><p>  Application </p><p><b>  Transmit </b></p><p>  Buffer Overlay Node </

84、p><p>  O verlay Node </p><p>  Interfac e </p><p>  Node Adapter </p><p>  Adapter Interface </p><p>  Socket Adapter </p><p>  A dapter Interfa

85、ce </p><p>  Application Messages </p><p>  Application Program </p><p>  Transport-layer Network </p><p>  Application Messages </p><p>  forwarding engin

86、e執(zhí)行應用層路由器的功能,發(fā)送、接收,并且在覆蓋網(wǎng)絡里格式化的應用層消息。 </p><p>  每一個面向網(wǎng)絡Socket上例如TCP或者UDP有每一個提供給傳送層協(xié)議的一接口的網(wǎng)絡轉(zhuǎn)接器。節(jié)點改編者作為送并且得到的在terface涂上協(xié)議消息,接合器作為給應用消息的接口,就因特網(wǎng)而論,由IP 地址和一UDP或者TCP港口數(shù)目組成。目前,有3類不同的改編者,是 TCP,UDP和UDP多路傳送。在保持面向網(wǎng)絡上的

87、協(xié)議和運輸應用數(shù)據(jù)的消息時使用改編者完全分開消息的方式 。 </p><p>  應用得到緩沖器和應用傳送緩沖器能分別臨時儲存消息,已經(jīng)被Socket收到但不是應用發(fā)送的,或者那已經(jīng)被應用程序發(fā)布,但不是被Socket傳送了。 </p><p>  面向網(wǎng)絡Socket上的每一個有兩個外部接口。從覆蓋網(wǎng)絡寄給覆蓋網(wǎng)絡的其他成員和再接收的數(shù)據(jù)。面向網(wǎng)絡上的Socket的接口提供進入面向網(wǎng)絡上

88、的Socket信息的途徑,并且用于一個面向網(wǎng)絡上的Socket的監(jiān)控和管理。面向網(wǎng)絡上的Socket的一些零部件也有接口,訪問面向網(wǎng)絡上的Socket的其他零部件。 </p><p>  覆蓋管理程序是在面向網(wǎng)絡以外上的Socket一個零部件。 當Socket被建立時,使一個面向網(wǎng)絡上的Socket成形是負責的。 </p><p>  4、面向網(wǎng)絡的程序設(shè)計</p><

89、p>  一個程序開發(fā)員不需要如以前的部分描寫熟悉一個面向網(wǎng)絡上的Socket的零部件的細節(jié)。開發(fā)者只暴露面向網(wǎng)絡上的Socket的API 和對一個文件用構(gòu)造參數(shù)。 配置文件是全部屬性需要一個面向網(wǎng)絡上的Socket成形的一個文本文件。每當一種變化被需要到傳送協(xié)議,面向網(wǎng)絡上的協(xié)議或者面向網(wǎng)絡上的Socket的一些其他參數(shù)的時候,配置文件被修改。在如下內(nèi)容里,我們只總結(jié)API的主要特征,我們稱針對在面向網(wǎng)絡上的Socket上的詳細資

90、料。 </p><p>  4.1 基于Socket的API </p><p>  從面向網(wǎng)絡上的拓撲學起和提出的數(shù)據(jù)應用層的給那些應用程序,那些API透明適合面向網(wǎng)絡上網(wǎng)絡程序設(shè)計可能被做簡單。應用需要能建立一個新覆蓋網(wǎng)絡, 參加并且離開現(xiàn)有覆蓋網(wǎng)絡,寄給數(shù)據(jù)隨著并且得到面向網(wǎng)絡上其他成員的數(shù)據(jù)。 </p><p>  面向網(wǎng)絡上的Socket的API基于消息,

91、并且接近于熟悉的伯克利SocketAPI 故</p><p>  意停留[3].從空間起考慮不允許充分的API的描述,我們借助于一個簡化的例子素描API。圖4顯示使用一個面向網(wǎng)絡上的Socket的一個java計劃的碎片。一個應用程序借助于覆蓋管理程序成形并且建立一個面向網(wǎng)絡上的Socket。覆蓋管理程序從一個configu口糧文件(hypercast.prop)適合面向網(wǎng)絡讀構(gòu)造參數(shù)上的Socket,這能類似如圖

92、5中所示看起來。applica - tion程序用來自文件的命om.getDefault</p><p>  Property(“OverlayID”)讀面向網(wǎng)絡上的ID,并且為一個面向網(wǎng)絡建立一個構(gòu)造(配置)上的Socket 。 </p><p>  // 產(chǎn)生構(gòu)造物體 </p><p>  OverlayManager om = new OverlayMana

93、ger("hypercast.prop"); </p><p>  String MyOverlay = om.getDefaultProperty("OverlayID"); </p><p>  OverlaySocketConfig config =new om.getOverlaySocketConfig(MyOverlay); </p

94、><p>  // create an overlay socket </p><p>  OL Socket socket =config.createOverlaySocket(callback); </p><p>  // Join an overlay </p><p>  socket.joinGroup(); </p>

95、<p>  // Create a message </p><p>  OL Message msg = socket.createMessage(byte[] data, int length); </p><p>  // Send the message to all members in overlay network </p><p>  s

96、ocket.sendToAll(msg); </p><p>  // Receive a message from the socket </p><p>  OL Message msg = socket.receive(); </p><p>  Fig. 4. Program with overlay sockets. </p><p&

97、gt;  # OVERLAY Server: </p><p>  # OVERLAY ID: </p><p>  OverlayID = 1234 </p><p>  KeyAttributes= Socket,Node,SocketAdapter </p><p>  # SOCKET: </p><p>  

98、Socket = HCast2-0 </p><p>  HCAST2-0.TTL = 255 </p><p>  HCAST2-0.ReceiveBufferSize = 200 </p><p>  # SOCKET ADAPTER: </p><p>  SocketAdapter = TCP </p><p>

99、;  SocketAdapter.TCP.MaximumPacketLength = 16384 </p><p><b>  # NODE: </b></p><p>  Node = DT2-0 </p><p>  DT2-0.SleepTime = 400 </p><p>  # NODE ADAPTER: &

100、lt;/p><p>  NodeAdapter = NodeAdptUDPServer </p><p>  NodeAdapter.UDP.MaximumPacketLength = 8192 </p><p>  NodeAdapter.UDPServer.UdpServer0 = </p><p>  128.143.71.50:8081

101、</p><p>  4.2 面向網(wǎng)絡的協(xié)議管理 </p><p>  顯然,一個面向網(wǎng)絡上的Socket的性質(zhì)成形歸于在確定時在一件配置文件內(nèi)。 在一個應用進程里的覆蓋管理程序使用屬性建立一個面向網(wǎng)絡上的Socket。通過在配置文件里修改屬性,一個申請程序員能使被面向網(wǎng)絡使用上的Socket的面向網(wǎng)絡上的協(xié)議或者傳送協(xié)議成形。換乘文件一定做在Socket被創(chuàng)造之前。配置文件的每條線把價值

102、歸因于一個屬性。屬性和范圍的完整的目錄被用文獻證明在[12]里。其中有,對‘1234’的面向網(wǎng)絡上的ID,面向網(wǎng)絡協(xié)議(‘= DT2.0節(jié)點’)上的那樣選擇DT 協(xié)議的第2.0版本,并且它把接口的傳送協(xié)議確定成TCP(‘Socket-Adapter= </p><p>  TCP’) 。每個覆蓋網(wǎng)絡與表現(xiàn)參加覆蓋網(wǎng)絡的面向網(wǎng)絡上的Socket的性質(zhì)的特性的一套屬性有關(guān)。如前所說,最重要的屬性是面向網(wǎng)絡上的ID,并

103、且能被用作一把訪問一個覆蓋網(wǎng)絡的全部其他屬性的鑰匙。面向網(wǎng)絡上的ID 應該是一個全球獨特的標識符。 </p><p>  一個新覆蓋網(wǎng)絡被創(chuàng)造,在產(chǎn)生新面向網(wǎng)絡上ID并且聯(lián)系指定面向網(wǎng)絡上的Socket在覆蓋網(wǎng)絡內(nèi)的性質(zhì)的一套屬性時。為了加入一個覆蓋網(wǎng)絡,一個面向網(wǎng)絡上的Socket必須知道面向網(wǎng)絡上的ID和這個面向網(wǎng)絡的ID上的各種屬性。 </p><p>  全部屬性有一個名稱。例如,

104、一個面向網(wǎng)絡上的Socket的面向網(wǎng)絡上的協(xié)議能通過名字節(jié)點對一個屬性加以測定。如果屬性調(diào)整到DT2-0節(jié)點,然后在面向網(wǎng)絡上的Socket里的面向網(wǎng)絡上的節(jié)點運轉(zhuǎn)DT(第2版本)。那些面向網(wǎng)絡上的Socket區(qū)分在之間屬性有二類:關(guān)鍵屬性和configurable 屬性。 </p><p><b>  5、 結(jié)論 </b></p><p>  我們討論試圖簡化面向網(wǎng)

105、絡上網(wǎng)絡程序設(shè)計任務的一個面向網(wǎng)絡上的Socket的設(shè)計。面向網(wǎng)絡上的Socket在覆蓋網(wǎng)絡里作為一個交互的終點。面向網(wǎng)絡上Socket</p><p>  可能用于各種各樣的面向網(wǎng)絡上的拓撲學并且支持不同的傳送協(xié)議。面向網(wǎng)絡上的Socket為參加和留下一個覆蓋網(wǎng)絡支持sim-ple API,并且為送和得到來自在覆蓋網(wǎng)絡里的其他Socket的數(shù)據(jù)。面向網(wǎng)絡覆蓋網(wǎng)絡的構(gòu)造上的Socket的主要優(yōu)勢是它相對易于轉(zhuǎn)換。

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論