Concepts with Symbian OS (779878), страница 48
Текст из файла (страница 48)
The socket may implement translationof data, without each side knowing. The translation is implemented bythe operating system and occurs as the data is transferred between theendpoints.The socket, then, provides an abstract extension to I/O by implementing a generic I/O device. Specific implementations demonstratethis. A network socket, for example, is used for many different protocols.
One can open a TCP layer socket that exchanges data with aweb server or a UDP socket that communicates with an NTP server.Both TCP and UDP layers are handled automatically and the network properties are preserved in the implementation. Bluetooth socketswork in the same way; Bluetooth sockets can implement connectionsthat look like serial cable connections or some generic data transferconnection.10.3Connectivity in Symbian OSLike many other general-purpose operating systems, Symbian OS embraces networks and allows implementations that use networking toexpand its core functionality.
Symbian OS supports many kinds ofcommunication. Since it is a smartphone operating system, it naturallysupports telephony. It also supports many other communication technologies, including Bluetooth, wireless networking, Ethernet, infrared,and messaging protocols. In addition, it allows for the implementation ofnew technologies that might be added in the future.Distributed computing is supported by Symbian OS in the sense thatthe operating system supports general user applications.
There is no realdistributed computing built into Symbian OS, but the operating system canexecute any type of general application, including those that implementclustering or other forms of distribution. In fact, Beowulf clusters havebeen implemented using Symbian OS phones using Ethernet protocolsover GPRS networks.EXERCISES227Symbian OS does not specifically support shared memory models andis unlikely to do so any time soon. Symbian OS is targeted to smartphoneswhich are designed to work in isolation.When it comes to file systems, Symbian OS has some unique featuresthat allow the expansion of file-system implementation.
The file serverthat Symbian OS implements to protect file resources utilizes a plugin architecture to recognize file systems. Since Symbian OS has a widevariety of communications choices, implementing a distributed file systemis a matter of writing the proper plug-in for the file server and allowingSymbian OS to recognize it.
Many experiments have been performed onfile systems for Symbian OS; NFS is among the implementations that havebeen used for the operating system.Symbian OS has a rich set of implementations for network-based I/O.One of its basic communication structures is the socket, which is implemented for each of the communication possibilities it supports. Throughthe use of sockets, Symbian OS supports many protocols, includingTCP/IP, Bluetooth, WAP, HTTP and many others.10.4SummaryThis chapter has discussed the ways that network communication canbe used to extend the functionality of operating systems. We introducedthe facilities important to a closed computer system and discussed hownetworking could extend a closed system. Specifically, we discussed fourareas of extension: CPU processing, memory sharing, file service, andI/O.
We concluded the chapter by briefly looking at the extensions thatnetworks can provide to Symbian OS.Exercises1.List at least five different aspects of operating systems that accessnetworks. Include the functionality of the operating system featurethat is extended by network access.2.Consider the network topologies in Figure 10.1.
Which topologieswould you judge to be the most reliable? Justify your statements.3.List at least three different communication media that computersaround you use. For each one, consider how it fulfils the criteria228NETWORKSfrom Section 10.2 (connections, installation, communication costand availability).4.For each communication medium listed in exercise 3, characterizethe connection strength between the nodes on the network.5.Give examples of each of the distributed-system models.6.Can handheld computers or smartphones be considered ‘storagefree’? While most do not have hard disk drives, most use storage.
Dothey use network storage as well? Find examples of some that do.7.Why is caching such an important aspect of distributed file systems?11Modeling CommunicationsThe game of ‘telephone’ (sometimes called ‘Chinese Whispers’) is aninteresting children’s game. This game is played by telling a child asentence and allowing that child to tell the sentence to another child,who tells it to another child, and so forth. After a number of messagetransfers, the final message is revealed.
This final message is almost alwaysan unrecognizable version of the first message.In Chapter 9, we took a generic look at I/O modeling and implementations in operating systems. In this book, we are considering smartphoneoperating systems and therefore we should focus the generic discussion ofI/O on communications. This chapter considers generic communicationsmodels and specific implementations in various operating systems.The model of communications resembles the ‘telephone’ game. Apopular, effective way to model communications streams is to break thecommunications implementation into stages where each stage implements a specific kind of functionality. As a message passes through thesestages, various levels of functionality are added until the final messagebears only a small resemblance to the original.
However, in this case,this is a good thing. It allows the message to be passed correctly fromcomputer to computer. We examine how this happens in this chapter.We should point out that communications are not solely the property of smartphones and operating systems such as Symbian OS. Linuxhas been used to implement communications facilities; wired networkcommunications saw its beginning on Unix and Linux platforms. Allmodern operating systems today implement some kind of model for the230MODELING COMMUNICATIONScommunications they support – from serial communications to Bluetoothto wireless networking.We begin with an overview of general communications models – fromthe general-purpose operating systems model to more focused modelsused in handheld platforms. Then we look specifically at the communications model used in Symbian OS.
We expand on this and finish thechapter by showing how the Symbian OS model works on other computerplatforms.11.1Communications ModelsIn order to discuss how operating systems approach communications, weneed to apply the I/O concepts from Chapter 9 to communications. Oncewe understand how general I/O fits with communications, we can thenexamine how communications is tailored to various needs.It is important to keep in mind the obvious point that communications involves more than one computer.
While we can look at the processmodel of running programs on a computer as a contained environment ona single computer, developing a communications model means addressing how multiple computers interact. This complicates things becausewe cannot accurately predict how all components of communicationswork together. This is especially true when dealing with computers ina heterogeneous environment. For example, Symbian OS might have aprecise model for getting web pages, but it will fail if a Windows-basedserver sends pages in a way that Symbian OS is not expecting. This meansthat models must expect errors and prepare for flexibility. It also meansthat models must embrace standards; adhering to standards is the bestway to work with other devices.General Communications ConceptsA general communications model, one that addresses all facets of communications, is an expression of design goals and criteria.• A communications model must support all communications applications of which the computer is capable.
This criterion is perhapsobvious, but it should be stated. Users of communications devicesexpect a level of functionality from their devices. The communications model must support this functionality and be able to address thefuture gracefully.COMMUNICATIONS MODELS231• Communications model components must be exceptionally flexibleto cope with the variety of devices that are possible for each platform.Users of computers demand a mix of connectivity methods andcommunications platforms. The communications architecture musteasily adapt itself to the changing requirements of configuration andconnectivity.
Even on-the-fly reconfiguration, for example, from a dialup connection to a wireless network, must be easy and straightforward.• Communications components must be organized to accommodatethe constant restructuring and rebuilding of communications technology. The communications architecture must be built in a modularfashion so that pieces can be replaced as technology evolves withoutupsetting the entire structure. In fact, the structure should be able toaccommodate the coexistence of old and new pieces.• The communications components must adapt to the RAM and CPUconstraints of their intended target platforms.
While they must doa great amount of work, the components of the communicationsarchitecture must not consume a burdensome amount of resources.The resources of a communications device are to be targeted at anapplication, not consumed by communications methods.This is a difficult job: support all functionality possible in a flexible,modular fashion in what can be a limited computing environment!Clients and ServersThe way computers interact – especially in a network environment – isoften characterized as a client–server type of relationship. The client isthe computer taking advantage of a service; the server is the computerproviding that service.
The client typically utilizes the service by sending requests to the server; the server provides the service, typically byresponding to those requests. The requests and responses take the formof messages sent back and forth between client and server.We have seen this relationship in many places already. The client–server model describes a relationship like that on which a system calldepends, where the ‘client’ is a user-level application and the ‘server’ isthe kernel, providing a set of services for the kernel-level request. Theclient–server model adequately describes the server approach taken bythe design of microkernels, where taking advantage of a service meansconnecting to a server and making a request.232MODELING COMMUNICATIONSRequestEncoded RequestClientGateway ServerWAPMicrobrowserEncoding anddecoding serviceEncoded ResponseFigure 11.1HTTP ServerResponseHTML pagesCGI scripts,etc.A client–server relationshipA good communications example is a micro-browser in a WAPenabled mobile phone.
Figure 11.1 shows how this works. The phonecalls up a WML page for viewing by sending an encoded request to acomputer at the company that provides the service. This computer iscalled a gateway server, because it provides a gateway to the Internetfor the mobile phone. This server, in turn, becomes a client by passingthe request from the mobile phone on to the actual Internet server thathouses the WAP page in question.
This server happens to be providinga HTTP service and answers the request by sending a web page to thegateway server. The gateway server then translates the HTML page intoWML and encodes the response using the encryption scheme the mobilephone expects. Finally, the gateway server sends the response to themobile phone and the micro-browser displays the WML page on thephone’s display.Note that in the example, there were two clients and two servers. Thegateway server was a server to the mobile phone and a client to the HTTPserver.