• Tidak ada hasil yang ditemukan

Distributed Systems: Concepts and Design - Books Drive

N/A
N/A
Nguyễn Gia Hào

Academic year: 2023

Membagikan "Distributed Systems: Concepts and Design - Books Drive"

Copied!
1067
0
0

Teks penuh

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed in initial capitals or capital letters.

16 TRANSACTIONS AND CONCURRENCY CONTROL 675

17 DISTRIBUTED TRANSACTIONS 727

19 MOBILE AND UBIQUITOUS COMPUTING 817

20 DISTRIBUTED MULTIMEDIA SYSTEMS 881

21 DESIGNING DISTRIBUTED SYSTEMS

GOOGLE CASE STUDY 915

PREFACE

New to the fifth edition

In addition, we recognized the growing diversity of distributed systems, particularly in terms of the range of architectural approaches available to distributed systems developers today. Some of the book's chapters, such as the new chapter on indirect communication (Chapter 6), cover a lot of material.

PREFACE XV

Client-server communication moved to Chapter 5 New Section 4.5: Network Virtualization (includes Skype case study). New Section 4.6: Case Study on MPI Case Study on IPC on UNIX Removed 5 Remote Calls Significant refactoring of material.

CHARACTERIZATION OF DISTRIBUTED SYSTEMS

Introduction

Examples of distributed systems 1.3 Trends in distributed systems

Case study: The World Wide Web 1.7 Summary

The consequences of this characteristic of distributed systems will be a recurring theme throughout the book. The primary motivation for constructing and using distributed systems stems from a desire to share resources.

EXAMPLES OF DISTRIBUTED SYSTEMS 3 extends from hardware components such as disks and printers to software-defined

  • Examples of distributed systems
    • Web search

Finance and Commerce The growth of e-commerce, as exemplified by companies such as Amazon and eBay, and core payment technologies such as PayPal; the related emergence of online banking and trading as well as complex information dissemination systems for financial markets. Education The emergence of e-learning through, for example, online tools such as virtual learning environments; connected distance learning support; support for collaborative or community learning.

EXAMPLES OF DISTRIBUTED SYSTEMS 5 addresses. Given that most search engines analyze the entire web content and then carry

  • Massively multiplayer online games (MMOGs)
  • Financial trading

The financial industry has long been at the forefront of distributed systems technology with its need, in particular, for real-time access to a wide variety of information sources (for example, current stock prices and trends, economic and political developments). Examples of such events include a drop in a share price, the release of the latest unemployment figures, and so on.

EXAMPLES OF DISTRIBUTED SYSTEMS 7

  • Trends in distributed systems
    • Pervasive networking and the modern Internet

The modern Internet is an extensive interconnected collection of computer networks of many different types, with the range of types increasing all the time and now including, for example, a wide range of wireless communication technologies such as WiFi, WiMAX, Bluetooth (see Chapter 3 ) and third-generation mobile phone networks . The design and construction of the Internet communication mechanisms (the Internet Protocols) is a major technical feat that enables a program running anywhere to address messages to programs elsewhere and abstract over the myriad of technologies mentioned above.

TRENDS IN DISTRIBUTED SYSTEMS 9

  • Mobile and ubiquitous computing

Mobile computing is the performance of computing tasks while the user is on the move, or visiting places other than their usual environment. The figure shows the user's home intranet and the host intranet at the site the user is visiting.

TRENDS IN DISTRIBUTED SYSTEMS 11

  • Distributed multimedia systems

Multimedia support can usefully be defined as the ability to support a variety of media types in an integrated manner. A distributed system can be expected to support the storage, transmission, and presentation of what are often referred to as discrete media types, such as photos or text messages.

TRENDS IN DISTRIBUTED SYSTEMS 13

  • Distributed computing as a utility
  • Focus on resource sharing

Other elements, such as power, cooling, persistent storage (disks), networking, and displays, are provided either by enclosure or through virtualized solutions (discussed in Chapter 7). We routinely share hardware resources such as printers, data resources such as files, and resources with more specific functions such as search engines.

Figure 1.5 Cloud computing
Figure 1.5 Cloud computing

FOCUS ON RESOURCE SHARING 15 Looked at from the point of view of hardware provision, we share equipment such

  • Challenges
    • Heterogeneity

Although the Internet consists of many different types of networks (illustrated in Figure 1.3), their differences are masked by the fact that all computers attached to them use Internet protocols to communicate with each other. For example, a computer attached to an Ethernet has an implementation of Internet Protocol over Ethernet, while a computer on another type of network will need an implementation of Internet Protocol for that network.

CHALLENGES 17 Different programming languages use different representations for characters and

  • Openness
  • Security

This practice has continued and forms the basis of the Internet's technical documentation. Many information resources available and maintained in distributed systems have high intrinsic value for their users.

CHALLENGES 19 location, security risks are associated with allowing free access to all of the resources in

  • Scalability

Performance loss control: Consider managing a set of data whose size is proportional to the number of users or resources on the system - for example, the table with the correspondence between the domain names of computers and their Internet addresses held from the Domain Name System, which is primarily used to look up DNS names such as www.amazon.com. For this reason, a new version of the protocol with 128-bit Internet addresses is being adopted, and this will require modifications to many software components.

Figure 1.6 Growth of the Internet (computers and web servers)
Figure 1.6 Growth of the Internet (computers and web servers)

CHALLENGES 21 to the early designers of the Internet, there is no correct solution to this problem. It is

  • Failure handling
  • Concurrency

There must always be at least two different paths between any two routers on the Internet. In the Domain Name System, each name table is replicated to at least two different servers.

CHALLENGES 23 access a shared resource at the same time. For example, a data structure that records bids

  • Transparency

As an example of a lack of access transparency, consider a distributed system that does not allow you to access files on a remote computer unless you use an ftp program to do so. To illustrate the presence of network transparency, consider using an email address such as [email protected].

CHALLENGES 25 from one environment (cell) to another. We regard the caller’s phone as the client and

  • Quality of service
  • Case study: The World Wide Web

The structure of links can be arbitrarily complex and the set of resources that can be added is limitless – the 'web' of links is indeed worldwide. HTML • The HyperText Markup Language [www.w3.org II] is used to specify the text and images that make up the content of a web page, and to specify how it is laid out and formatted for presentation to the user.

Figure 1.7 Web servers and web browsers
Figure 1.7 Web servers and web browsers

CASE STUDY: THE WORLD WIDE WEB 29 In general, HTTP URLs are of the following form

HTTP • The HyperText Transfer Protocol [www.w3.org IV] defines the ways in which browsers and other types of clients interact with Web servers. The client sends a request message to the server containing the URL of the requested resource.

CASE STUDY: THE WORLD WIDE WEB 31 page containing instructions for the user and input widgets such as text fields and check

  • Summary

Discussion of the Web • The Web's phenomenal success rests on the relative ease with which many individual and organizational sources can publish resources, the suitability of its hypertext structure for organizing many types of information, and the openness of its system architecture. Openness: Distributed systems must be extensible – the first step is to publish the interfaces of the components, but the integration of components written by different programmers is a real challenge.

EXERCISES

State all the issues involved to ensure that only the named users can use a protected operation. Discuss an approach to mapping resource names that achieves minimal performance loss as the number of resources in service increases.

SYSTEM MODELS

Introduction 2.2 Physical models

Introduction

PHYSICAL MODELS 39

  • Physical models
  • Architectural models

Distributed Systems of Systems • A recent report discusses the emergence of ultra-large scale (ULS) distributed systems [www.sei.cmu.edu]. Summary • The entire historical development covered in this section is summarized in Figure 2.1, with the table highlighting the significant challenges associated with modern distributed systems in terms of managing the level of heterogeneity and ensuring key features such as openness and quality of service.

ARCHITECTURAL MODELS 41

  • Architectural elements

Objects: Objects were introduced to enable and encourage the use of object-oriented approaches in distributed systems (including both object-oriented design and object-oriented programming languages). Components resemble objects in that they provide problem-oriented abstractions for building distributed systems and are also accessed through interfaces.

ARCHITECTURAL MODELS 43 enables third-party development of components and also promotes a purer

Remote Method Invocation: Remote method invocation (RMI) strongly resembles remote procedure calls, but in a world of distributed objects. Receivers are also generally aware of the identity of senders, and in most cases both parties must exist at the same time.

ARCHITECTURAL MODELS 45 Recipients elect to receive messages sent to a group by joining the group. Senders

Thus, the search engine is both a server and a client: it responds to queries from browser clients and runs web crawlers that act as clients of other web servers. In fact, a typical search engine would typically involve many concurrent threads of execution, some serving their clients and others running web crawlers.

Figure 2.2 Communicating entities and communication paradigms
Figure 2.2 Communicating entities and communication paradigms

ARCHITECTURAL MODELS 47

Applications are composed of a large number of peer processes running on separate computers, and the communication pattern between them depends entirely on the application requirements. Location • The final issue to consider is how entities such as objects or services map onto the underlying physically distributed infrastructure, which will consist of a potentially large number of machines connected by a network of arbitrary complexity.

Figure 2.4a illustrates the form of a peer-to-peer application. Applications are  composed of large numbers of peer processes running on separate computers and the  pattern of communication between them depends entirely on application requirements
Figure 2.4a illustrates the form of a peer-to-peer application. Applications are composed of large numbers of peer processes running on separate computers and the pattern of communication between them depends entirely on application requirements

ARCHITECTURAL MODELS 49

Applets are a well-known and widely used example of mobile code: the user using a browser selects a link to an applet whose code is stored on a web server; the code is downloaded to the browser and executed there, as shown in Figure 2.6. Some services are probably so standardized that we can access them with an existing and well-known application. The web is the most common example of this, but even there some websites use features not found in standard browsers and require additional code to be downloaded.

ARCHITECTURAL MODELS 51 example, accessing individual database entries. If we compare this architecture with a

  • Architectural patterns

In a two-tier solution, the three aspects mentioned above must be divided into two processes, the client and the server. This is most often done by splitting the application logic, with some on the client and the rest on the server (although other solutions are possible).

Figure 2.7 introduces the important terms platform and middleware, which we  define as follows:
Figure 2.7 introduces the important terms platform and middleware, which we define as follows:

ARCHITECTURAL MODELS 55

The Ajax.Request object then returns control and allows the browser to continue responding to other user actions in the same window or windows. Thin clients • The trend in distributed computing is to shift complexity from the end-user device to services on the Internet.

Figure 2.10 Thin clients and computer servers
Figure 2.10 Thin clients and computer servers

ARCHITECTURAL MODELS 57 and other resource-constrained devices) can be significantly enhanced with a plethora of

  • Associated middleware solutions

Middleware has already been introduced in Chapter 1 and reviewed in the discussion of layering in Section 2.3.2 above. Middleware solutions are based on the architectural models introduced in section 2.3.1 and also support more complex architectures.

Figure 2.11 The web service architectural pattern
Figure 2.11 The web service architectural pattern

ARCHITECTURAL MODELS 59

It is therefore not always wise to offer that function as a feature of the communication system itself. Although an incomplete version of the communication system function can sometimes be useful as a performance improvement).

FUNDAMENTAL MODELS 61 It can be seen that their argument runs counter to the view that all communication

  • Fundamental models
    • Interaction model

In the analysis and design of distributed systems, we are mainly concerned with these interactions. Our security model defines and classifies the forms such attacks can take, providing a basis for analyzing threats to a system and designing systems capable of resisting them.

FUNDAMENTAL MODELS 63 controlled by algorithms in which the steps are strictly sequential. The behaviour of the

Computer Clocks and Timing Events • Each computer in a distributed system has its own internal clock that can be used by local processes to obtain the current time value. Two versions of the interaction model • In a distributed system, it is difficult to place limits on the time that can be spent executing a process, delivering a message, or moving a clock.

FUNDAMENTAL MODELS 65 Asynchronous distributed systems: Many distributed systems, such as the Internet,

Even in an asynchronous Pepperland, it is possible to agree on who should lead the charge. If the division to lead the charge sends a message 'Charge!', it waits for minutes; then it charges.

Figure 2.13 Real-time ordering of events
Figure 2.13 Real-time ordering of events

FUNDAMENTAL MODELS 67 If the clocks on X’s, Y’s and Z’s computers could be synchronized, then each message

  • Failure model

Arbitrary failures • The term arbitrary or Byzantine failure is used to describe the worst possible failure semantics, in which any type of error can occur. We will assume that it is impossible for the Blue Meanies to brainwash the messengers into giving the wrong message - the Meanies are unaware of their treacherous Byzantine forerunners.).

FUNDAMENTAL MODELS 69

In an asynchronous system, neither division can tell if the other has been defeated, or the time it takes messengers to cross the intervening valley is simply too long. Release channel A message inserted into an outgoing message buffer never reaches the other end's incoming message buffer.

Figure 2.15 Omission and arbitrary failures
Figure 2.15 Omission and arbitrary failures

FUNDAMENTAL MODELS 71

  • Security model

The server performs the operation specified in each call and sends the result to the client. The client can verify the identity of the principal behind the server to ensure that the result is coming from the requested server.

Figure 2.17 Objects and principals
Figure 2.17 Objects and principals

FUNDAMENTAL MODELS 73

Each of the processes reliably knows the identity of the principal on whose behalf the other process is executing. Therefore, if a client and server communicate via a secure channel, the server knows the identity of the principal behind it.

FUNDAMENTAL MODELS 75

  • Summary

The effectiveness and the cost of the necessary security techniques can then be balanced against the threats. In terms of architectural models, the client-server approach is common - the web and other Internet services such as FTP, news and mail as well as web services and the DNS are based on this model, as well as filing and other local services.

EXERCISES 77 computing and support for more problem-oriented abstractions such as objects,

In Service A, messages can be lost, duplicated, or delayed, and checksums only apply to headers. With Service B, messages may be lost, delayed, or delivered too quickly for the recipient to process, but arrive delivered with the correct content.

EXERCISES 79 2.16 Suppose that a basic disk read can sometimes read values that are different from those

NETWORKING AND INTERNETWORKING

Introduction 3.2 Types of network

Introduction

INTRODUCTION 83

  • Networking issues for distributed systems

In Figure 1-6, we have shown the growth in the number of host computers and Web servers connected to the Internet over a 12-year period ending in 2005. The potential future size of the Internet is proportional to the population of the planet.

INTRODUCTION 85 Security • Chapter 11 sets out the requirements and techniques for achieving security

  • Types of network

Here we introduce the main types of networks used to support distributed systems: personal area networks, local area networks, wide area networks, metropolitan area networks and their wireless variants. The Internet is the prototypical Internet job; it consists of millions of local, metropolitan and wide area networks.

Figure 3.1 Network performance
Figure 3.1 Network performance

TYPES OF NETWORK 87 coaxial cable or optical fibre. A segment is a section of cable that serves a department or

  • Network principles
    • Packet transmission
    • Data streaming

Wireless metropolitan area networks (WMANs) • The IEEE 802.16 WiMAX standard targets this class of network. Communication subsystems that provide quality of service guarantees require facilities for preallocating network resources and enforcing the allocations.

NETWORK PRINCIPLES 91 requirements in each packet. The availability of effective implementations of these

  • Switching schemes
  • Protocols

A process that wants to send a message to another process calls the transport protocol module and passes it the message in a specified format. The appropriate transport protocol module in the receiving computer receives the packet through the network layer protocol module and.

Figure 3.2 Conceptual layering of protocol software
Figure 3.2 Conceptual layering of protocol software

NETWORK PRINCIPLES 93

Protocol packages that conform to the OSI model must include at least one specific protocol at each of the seven levels that the model defines. First, the application, presentation, and session layers are not clearly distinguished in the Internet protocol suite.

Figure 3.4 Protocol layers in the ISO Open Systems Interconnection (OSI) protocol model
Figure 3.4 Protocol layers in the ISO Open Systems Interconnection (OSI) protocol model

NETWORK PRINCIPLES 95

Addressing • The transport layer is responsible for delivering messages to destinations with transport addresses composed of the network address of a host computer and a port number. A network address is a numerical identifier that uniquely identifies a host computer and enables it to be located by nodes responsible for sending data to it.

Figure 3.6 Internetwork layers
Figure 3.6 Internetwork layers

NETWORK PRINCIPLES 97 can be used for private purposes, but computers using them for private purposes cannot

  • Routing

We describe these in Section 3.4.6 in the context of the Internet transport protocols UDP (connectionless) and TCP (connection-oriented). Determining the routes for transmitting packets to their destinations is the responsibility of a routing algorithm implemented by a program at the network layer at each node.

Figure 3.7 Routing in a wide area network
Figure 3.7 Routing in a wide area network

NETWORK PRINCIPLES 99

The resulting entry in the routing table identifies the outgoing link that should be used to route the packet forward to its destination. The packet arrives at B and the same procedure is followed using the routing table at B, which shows that the route to C is through the link named 2.

NETWORK PRINCIPLES 101

  • Congestion control

But if the rate of packet loss and retransmission reaches a significant level, the effect on network throughput can be devastating. This will result in increased delays for packets, but will not significantly degrade the overall throughput of the network.

NETWORK PRINCIPLES 103

  • Internetworking

In an internetwork, the routers can be connected by direct connections, as shown in Figure 3.7, or they can be connected via subnets, as shown for cream in Figure 3.10. In either case, the routers are responsible for forwarding the Internet packets arriving on any link to the correct outgoing link, as explained above.

Figure 3.10 Simplified view of part of a university campus network
Figure 3.10 Simplified view of part of a university campus network

NETWORK PRINCIPLES 105

  • Internet protocols

The Internet emerged from two decades of research and development work on wide area networking in the United States, starting in the early 1970s with ARPANET – the first large-scale computer network development [Leiner et al. An important part of this research was the development of the TCP/IP protocol suite.

Figure 3.12 TCP/IP layers
Figure 3.12 TCP/IP layers

INTERNET PROTOCOLS 107

  • IP addressing

But the rapid growth of Internet use has led to the publication of a new version specification (IPv6) to overcome the addressing limitations of IPv4 and add features to support some of the new requirements. It must be efficient in its use of address space - it is impossible to predict the final size of the Internet and the number of network and host addresses that will likely be needed.

Figure 3.14 The programmer
Figure 3.14 The programmer's conceptual view of a TCP/IP Internet

INTERNET PROTOCOLS 109

Network identifiers are assigned by the Internet Assigned Numbers Authority (IANA) to organizations with networks connected to the Internet. Host identifiers for the computers on each network connected to the Internet are assigned by the managers of the relevant networks.

Figure 3.16 Decimal representation of Internet addresses
Figure 3.16 Decimal representation of Internet addresses

INTERNET PROTOCOLS 111

  • The IP protocol

Each of the computers on the local Ethernet receives the ARP request packet and checks the IP address in it to see if it matches its own IP address. IP Spoofing • We have seen that IP packets contain a source address – the IP address of the sending computer.

INTERNET PROTOCOLS 113 therefore all directed to the target, whose input buffers were overwhelmed, preventing

  • IP routing

Another solution to the routing table size explosion issue is simpler and very effective. The default entry specifies the route used for all IP packets whose destinations are not included in the routing table.

INTERNET PROTOCOLS 115 Thus node C is ignorant of nodes A and D. It will route all packets addressed to them

Unregistered Addresses and Network Address Translation (NAT) • Not all computers and devices accessing the Internet need to be assigned globally unique IP addresses. Computers that are attached to a local network and access the Internet through a NAT-enabled router can rely on the router to redirect incoming UDP and TCP packets for them.

WiFi base station/

INTERNET PROTOCOLS 117 Host Configuration Protocol (DHCP) service running on the router. In our illustration

  • IP version 6

As early as 1990, the IETF noticed the potential problems arising from IPv4's 32-bit addresses and started a project to develop a new version of the IP protocol. Tanenbaum calculates that this is enough to provide 7u1023 IP addresses per square meter over the entire surface of the Earth.

Figure 3.19 IPv6 header layout
Figure 3.19 IPv6 header layout

INTERNET PROTOCOLS 119 alternative strategies for aggregating addresses for routing purposes – it remains to

  • MobileIP

Migration from IPv4 • The consequences for the existing Internet infrastructure of a change to the basic protocol are far-reaching. All of these devices are likely to be internet-enabled in the near future and they cannot be easily hidden behind NAT routers.

INTERNET PROTOCOLS 121 Dynamic Host Configuration Protocol (DHCP), which enables a newly connected

  • TCP and UDP

TCP and UDP provide the communication capabilities of the Internet in a form that is usable by application programs. TCP and UDP can be viewed as a faithful reflection of the communication capabilities offered by IPv4 at the application programming level.

Figure 3.20 The MobileIP routing mechanism
Figure 3.20 The MobileIP routing mechanism

INTERNET PROTOCOLS 123 destination port numbers (the corresponding host addresses are present in the IP header),

  • Domain names

With this simple scheme, a segment is sent to the receiver when data has been waiting in the output buffer for T seconds, or the contents of the buffer reach the MTU limit. This is one of the reasons for adopting another transport mechanism in the WAP family of protocols for wide area mobile communications.

INTERNET PROTOCOLS 125 intended to reflect their organizational structure. The naming hierarchy is entirely

  • Firewalls

Indeed, this particular example would be difficult to implement without impeding ordinary users' use of the Internet. That is the purpose of the virtual private network technology described in the next subsection.

Figure 3.21 Firewall configurations
Figure 3.21 Firewall configurations

INTERNET PROTOCOLS 127 IP packet filtering: This is a filter process examining individual IP packets. It may

  • Case studies: Ethernet, WiFi and Bluetooth
    • Ethernet

The IEEE 802.3 Ethernet standard has largely won the battle for the wired LAN market and we describe it in section 3.5.1 as our representative wired LAN technology. The IEEE 802.4 Token Bus standard was developed for industrial applications with real-time requirements and is used in that domain.

Figure 3.22 IEEE 802 network standards
Figure 3.22 IEEE 802 network standards

CASE STUDIES: ETHERNET, WIFI AND BLUETOOTH 131 bridges operate at the level of Ethernet frames, forwarding them to adjacent Ethernets

  • IEEE 802.11 (WiFi) wireless LAN

Using all of these techniques, Ethernet-connected stations can manage their use of the medium without centralized control or synchronization. Ethernet Efficiency • Ethernet efficiency is the ratio of the number of successfully transmitted packets to the proportion of the theoretical maximum number that could be transmitted without collisions.

Figure 3.23 Ethernet ranges and speeds
Figure 3.23 Ethernet ranges and speeds

CASE STUDIES: ETHERNET, WIFI AND BLUETOOTH 137 Fading: Due to the inverse square law of electromagnetic wave propagation, the

  • IEEE 802.15.1 Bluetooth wireless PAN

All Bluetooth nodes are also equipped with a globally unique 48-bit MAC address (see Section 3.5.1), although only the master's MAC address is used in the protocol. In addition to the seven active slaves, a Piconet can contain up to 255 parked nodes in low power mode awaiting an activation signal from the master.

Figure 3.25 Bluetooth frame structure
Figure 3.25 Bluetooth frame structure

SUMMARY 141 manufactured by different vendors will interwork. Thirteen application profiles are

  • Summary

How does the Internet Routing Scheme handle this problem? pages What is the job of an Ethernet switch. Telnet is the need to transmit extraordinary events such as 'kill signals' from the 'terminal'. to the host prior to previously transmitted data.

INTERPROCESS COMMUNICATION

Introduction

The API for the Internet protocols

External data representation and marshalling 4.4 Multicast communication

Network virtualization: Overlay networks 4.6 Case study: MPI

Summary

The application program interface in UDP provides a message passing abstraction - the simplest form of interprocess communication. The producer must wait if the storage space used to hold the data items in the queue is exhausted.

Figure 4.1  Middleware layers
Figure 4.1 Middleware layers

THE API FOR THE INTERNET PROTOCOLS 147 Section 4.4 discusses multicast communication: a form of interprocess

  • The characteristics of interprocess communication

In a synchronous form of communication, the process of sending and receiving is synchronized with each message. In contrast, a point-to-point messaging service can be described as unreliable if messages are not guaranteed to be delivered despite a single packet being dropped or lost.

THE API FOR THE INTERNET PROTOCOLS 149

  • Sockets
  • UDP datagram communication

On arrival, the message is queued for the socket bound to the destination port. The receive method returns the sender's Internet address and local port, so that the recipient can verify where the message came from.

THE API FOR THE INTERNET PROTOCOLS 151 Failure model for UDP datagrams • Chapter 2 presents a failure model for

It also provides a no-argument constructor that allows the system to choose a free local port. The argument of receive is an empty DatagramPacket in which to place the message, its length and its origin.

THE API FOR THE INTERNET PROTOCOLS 153

  • TCP stream communication

The streaming API assumes that when a pair of processes establish a connection, one of them plays the role of client and the other plays the role of server, and then they can be peers. All data in the output buffer is sent to the other end of the stream and queued on the destination socket, indicating that the stream is broken.

THE API FOR THE INTERNET PROTOCOLS 155 Blocking: The data written to a stream is kept in a queue at the destination socket

The client uses a constructor to create a socket, specifying a server's DNS hostname and port. The server program in Figure 4-6 opens a server socket on its server port (7896) and listens for connection requests.

THE API FOR THE INTERNET PROTOCOLS 157

  • External data representation and marshalling

Thus, marshaling consists of translating structured data elements and primitive values ​​into an external data representation. Similarly, unmarshalling consists of generating primitive values ​​from their external data representation and reconstructing data structures.

EXTERNAL DATA REPRESENTATION AND MARSHALLING 159

  • CORBA’s Common Data Representation (CDR)

Each argument or result in a remote call is represented by a sequence of bytes in the call or result message. Each primitive value is placed at an index in the byte sequence according to its size.

EXTERNAL DATA REPRESENTATION AND MARSHALLING 161

  • Java object serialization

The process that deserializes an object can check that it has the correct version of the class. This recursive procedure continues until the class information and types and names of the instance variables of all the necessary classes.

EXTERNAL DATA REPRESENTATION AND MARSHALLING 163

  • Extensible Markup Language (XML)

The labels are used to describe the logical structure of the data and to associate attribute-value pairs with logical structures. However, if an XML document is intended to be used by more than one application, the names of the tags must be agreed upon between them.

EXTERNAL DATA REPRESENTATION AND MARSHALLING 165

Parsing and well-formed documents • An XML document must be well-formed – that is, it must conform to the rules for its structure. Finally, each XML document must have a single root element that includes all other elements.

EXTERNAL DATA REPRESENTATION AND MARSHALLING 167

  • Remote object references

A remote object reference is passed in the call message to indicate which object to call. In such cases, the remote object reference can be used as the address of the remote object.

MULTICAST COMMUNICATION 169

  • Multicast communication
    • IP multicast – An implementation of multicast communication

In this section, we introduce IP multicast and then review the needs of the above uses of group communication to see which of them can be satisfied by IP multicast. Local multicasts use the multicast capability of the local network, for example of an Ethernet.

MULTICAST COMMUNICATION 171 Multicast address allocation: As discussed in Chapter 3, Class D addresses (that is,

A process can join a multicast group with a given multicast address by calling the joinGroup method on its multicast socket. After joining this multicast group, the process creates an instance of the DatagramPacket containing the message and sends it through its multicast socket to the multicast group address at port 6789.

MULTICAST COMMUNICATION 173 peers via its socket, which also belongs to the group on the same port. When several

  • Reliability and ordering of multicast
  • Network virtualization: Overlay networks

The strength of the Internet communication protocols is that through their API (Section 4.2) they provide a very effective set of building blocks for the construction of distributed software. This suggests an answer to the dilemma of Salzer's end-to-end argument (see section 2.3.3): an application-specific virtual network can be built on top of an existing network and optimized for that specific application, without changing the characteristics of the network. modify. underlying network.

NETWORK VIRTUALIZATION: OVERLAY NETWORKS 175

  • Overlay networks

Distributed Hash Tables One of the most prominent classes of overlay networks that provide a service that manages a mapping from keys to values ​​across a potentially large number of nodes in a complete. Multicast One of the earliest uses of overlay networks on the Internet, providing access to multicast services where multicast routers are not available.

Figure 4.15 Types of overlay
Figure 4.15 Types of overlay

NETWORK VIRTUALIZATION: OVERLAY NETWORKS 177

  • Skype: An example of an overlay network
  • Case study: MPI

Super nodes are selected on demand based on a range of criteria, including available bandwidth, reachability (the machine must have a global IP address and not be hidden behind a NAT-enabled router, for example) and availability (based on the length of time Skype runs continuously on that node). The search is orchestrated by the client's chosen supernode and involves an extensive search of other supernodes until the specified user is found.

CASE STUDY: MPI 179

MPI_Bsend buffer: The sender explicitly allocates an MPI buffer library (using a separate . MPI_Buffer_attach call) and the call returns when data has been successfully copied to this buffer. MPI_Ibsend: As with MPI_Isend, but with MPI_Wait and MPI_Test to indicate whether the message has been copied to the sender's MPI buffer and is therefore in transit.

SUMMARY 181

Gambar

Figure 1.2 An example financial trading system
Figure 1.3 A typical portion of the Internet
Figure 1.4 Portable and handheld devices in a distributed system
Figure 1.5 Cloud computing
+7

Referensi

Dokumen terkait

This study aims to improve students' reading comprehension skills and their participation in learning activities, the authors apply STT which allows students to work in groups by