毕业设计外文资料基于socket的网络编程内容摘要:

ode to query next hop routing information for application messages. The forwarding decision is made usi ng logical addresses of the overlay nodes. Each overlay socket has two work adapters that each provides an interface to transportlayer protocols, such as TCP or UDP. The node adapter serves as the interface for sending and receiving overlay protocol messages, and the socket adapter serves as the interface for application messages. Each adapter has a transport level address, which, in the case of the Inter, consists of an IP address and a UDP or TCP port number. Currently, there are three different types of adapters, for TCP, UDP, and UDP multicast. Using two adapters pletely separates the handling of messages for maintaining the overlay protocol and the messages that transport application data. The application receive buffer and application transmit buffer can temporarily store messages that, respectively, have been received by the socket but not been delivered to the application, or that have been released by the application program, but not been transmitted by the socket. The application transmit buffer can play a role when messages cannot be transmitted due to rate control or congestion control constraints. The application transmit buffer is not implemented in the Hyper Cast software. Each overlay socket has two external interfaces. The application programming interface (API) of the socket offers application programs the ability to join and leave existing overlays, to send data to other members of the overlay work, and receive data from the overlay work. The statistics interface of the overlay socket provides access to status information of ponents of the overlay socket, and is used for monitoring and management of an overlay socket. Note in Figure 3 that some ponents of the overlay socket also have interfaces, which are accessed by other ponents of the overlay socket. The overlay manager is a ponent external to the overlay socket (and not shown in Figure 3). It is responsible for configuring an overlay socket when the socket is created. The overlay manager reads a configuration file that stores the attributes of an overlay socket, and, if it is specified in the configuration file, may access attributes from a server, and then initiates the instantiation of a new overlay socket. 4 Overlay Network Programming An application developer does not need to be familiar with the details of the ponents of an overlay socket as described in the previous section. The developer is 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 is modified whenever a change is needed to the transport protocol, the overlay protocol, or some other parameters of the overlay socket. In the following, we summarize only the main features of the API, and we refer to for detailed information on the overlay socket API. Overlay Socket API Since the overlay topology and the forwarding of applicationlayer data is transparent to the application program, the API for overlay work programming can be made simple. Applications need to be able to create a new overlay work, join and leave an existing overlay work, send data to and receive data from other members in the overlay. The API of the overlay socket is messagebased, and intentionally stays close to the familiar Berkeley socket API. 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 application program configures and creates an overlay socket with the help of an overlay manager. The overlay manager reads configuration parameters for the overlay socket from a configuration file (hyper cast prop), which can look similarly as shown in Figure 5. The application program reads the overlay ID with mand on get Default Property(“OverlayID”) from the file, and creates an configuration object (config) for an overlay socket with the. // generate the configuration object OverlayManager om = new OverlayManager()。 String MyOverlay = (OverlayID)。 OverlaySocketConfig config = new (MyOverlay)。 // create an overlay socket OL Socket socket = (callback)。 // Join an overlay ()。 // Create a message OL Message msg = (byte[] data, int length)。 // Send the message to all members in overlay work (msg)。 // Receive a message from the socket OL Message msg = ()。 Fig. 4. Program with overlay sockets. OVERLAY Server: OverlayServer = OVERLAY ID: OverlayID = 1234 KeyAttributes= Socket,Node,SocketAdapter SOCKET: Socket = HCast20 = 255 = 200 SOCKET ADAPTER: SocketAdapter = TCP = 16384 NODE: Node = DT20 = 400 NODE ADAPTER: NodeAdapter = NodeAdptUDPServer = 8192 = :8081 Fig. 5. Configuration file (simplified) given overlay ID. The configuration object also loads all configuration information from the configuration file, and then creates the overlay socket (config create Overlay Socket). Once the overlay socket is created, the socket joins the overlay work (socket join Group). When a socket wants to multicast a message, it instantiates a new message (socket create Message) and transmits the message using the send to all method. Other transmission options are sendToP。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。