INTRODUCTION TO MIDDLEWARE Web Services, Object Components, and Cloud Computing INTRODUCTION TO MIDDLEWARE Web Services, Object Components, and Cloud Computing Letha Hughes Etzkorn CRCPress Taylor&FrancisGroup 6000BrokenSoundParkwayNW,Suite300 BocaRaton,FL33487-2742 ©2017byTaylor&FrancisGroup,LLC CRCPressisanimprintofTaylor&FrancisGroup,anInformabusiness NoclaimtooriginalU.S.Governmentworks Printedonacid-freepaper InternationalStandardBookNumber-13:978-1-4987-5407-1(Hardback) Thisbookcontainsinformationobtainedfromauthenticandhighlyregardedsources.Reasonableeffortshavebeenmade topublishreliabledataandinformation,buttheauthorandpublishercannotassumeresponsibilityforthevalidityofall materialsortheconsequencesoftheiruse.Theauthorsandpublishershaveattemptedtotracethecopyrightholdersofall materialreproducedinthispublicationandapologizetocopyrightholdersifpermissiontopublishinthisformhasnot beenobtained.Ifanycopyrightmaterialhasnotbeenacknowledgedpleasewriteandletusknowsowemayrectifyinany futurereprint. ExceptaspermittedunderU.S.CopyrightLaw,nopartofthisbookmaybereprinted,reproduced,transmitted,orutilized inanyformbyanyelectronic,mechanical,orothermeans,nowknownorhereafterinvented,includingphotocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. Forpermissiontophotocopyorusematerialelectronicallyfromthiswork,pleaseaccesswww.copyright.com(http:// www.copyright.com/)orcontacttheCopyrightClearanceCenter,Inc.(CCC),222RosewoodDrive,Danvers,MA01923, 978-750-8400.CCCisanot-for-profitorganizationthatprovideslicensesandregistrationforavarietyofusers.For organizationsthathavebeengrantedaphotocopylicensebytheCCC,aseparatesystemofpaymenthasbeenarranged. TrademarkNotice:Productorcorporatenamesmaybetrademarksorregisteredtrademarks,andareusedonlyfor identificationandexplanationwithoutintenttoinfringe. VisittheTaylor&FrancisWebsiteat http://www.taylorandfrancis.com andtheCRCPressWebsiteat http://www.crcpress.com Dedication To my husband and sweetheart, Dave, who always does so much for me (he did most of the review of the proofs for this textbook), to the other centers of my heart: Tricia and Chris, and to the memory of Daddy and Mama. Mama always wanted one of her kids to write a book, although I don't think a textbook was what she had in mind. Contents OnlineResources............................................................................................................................xix Preface.............................................................................................................................................xxi Author............................................................................................................................................xxv SECTION I The Different Paradigms Chapter1 Introduction..................................................................................................................3 1.1 WhatIsMiddleware?........................................................................................4 1.2 TechnologyReview:Sockets............................................................................5 1.2.1 SocketDataStructures.........................................................................5 1.2.2 SocketLibraryCalls ...........................................................................7 1.2.3 NetworkByteOrderandHowItIsUsedwithSockets .....................8 1.2.4 GeneralSocketOperation....................................................................9 1.2.5 SimpleSocketExample.....................................................................10 1.2.6 SendingDataOtherthanCharData—ProblemswithEndianness......17 1.3 BriefIntroductiontoOtherMiddlewares........................................................18 1.3.1 WhatAreRemoteProcedureCalls?—AlsoIntroductionto SynchronousandAsynchronousOperation......................................18 1.3.2 WhatAreDistributedObject-OrientedComponents?.......................20 1.3.3 WhatIsMessage-OrientedMiddleware?..........................................20 1.3.4 WhatAreService-OrientedArchitectures?.......................................21 1.3.5 WhatAreWebServices?...................................................................22 1.3.6 WhatIsCloudComputing?...............................................................23 1.4 EnvironmentalMonitoringProject..................................................................23 1.5 SailboatMarinaManagementProject.............................................................25 Exercises....................................................................................................................26 ConceptualQuestions................................................................................................27 Bibliography...............................................................................................................27 Chapter2 SoftwareArchitecturalStyles/PatternsforMiddleware.............................................31 2.1 JustWhatIsa“SoftwareArchitecture,”Anyway?.........................................31 2.2 ArchitecturalStyles/Patterns...........................................................................33 2.3 ArchitecturalStyles/PatternsforMiddleware.................................................35 2.3.1 Gomaa’sArchitecturalPatterns.........................................................35 2.3.2 Fielding’sArchitecturalStyles..........................................................37 2.3.3 Fielding’sArchitecturalProperties....................................................39 2.4 ArchitecturalStyles/PatternsforDistributedObject-OrientedComponents......43 2.5 ArchitecturalStyles/PatternsforService-OrientedArchitectures...................44 2.6 ArchitecturalStyles/PatternsforWebServices..............................................46 2.7 ArchitecturalStyles/PatternsforCloudComputing........................................46 Exercises....................................................................................................................48 ConceptualQuestions................................................................................................48 Bibliography...............................................................................................................48 vii viii Contents SECTION II Enabling Technologies for Middleware Chapter3 IntroductiontoInternetTechnologies........................................................................55 3.1 JustWhatIstheInternet,Anyway?................................................................55 3.2 BriefIntroductiontoTCP/IPandUDP...........................................................55 3.3 IPAddresses(IPv4andIPv6)andSubnetting................................................57 3.3.1 IPv4Addresses..................................................................................57 3.3.1.1 PrivateIPAddressesandNetworkAddressTranslation.....58 3.3.2 IPv6Addresses..................................................................................58 3.3.3 Subnetting .........................................................................................59 3.4 PortNumbers..................................................................................................60 3.5 OtherImportantNetworkInformation............................................................61 3.5.1 InternetControlMessageProtocol....................................................61 3.5.2 LANProtocols:EthernetandWi-Fi..................................................61 3.5.3 MediaAccessControlAddresses......................................................62 3.5.4 Hubs,Bridges,Switches,andRouters...............................................62 3.5.5 AutoconfigurationforIPv4:DynamicHost ConfigurationProtocol......................................................................63 3.5.6 AutoconfigurationforIPv6................................................................64 3.5.6.1 DHCPforIPv6 ..................................................................65 3.5.7 VirtualLocalAreaNetwork..............................................................65 3.6 UniversallyUniqueIdentifiers........................................................................66 Exercises....................................................................................................................68 ConceptualQuestions................................................................................................68 Bibliography...............................................................................................................69 Chapter4 IntroductiontoWorldWideWebTechnologies........................................................71 4.1 JustWhatIstheWeb,Anyway?.....................................................................71 4.2 HypertextTransferProtocol............................................................................71 4.3 HTML,XML,andHTMLForms...................................................................72 4.4 XMLSchemaBasics.......................................................................................79 4.5 JavaScriptObjectNotation(JSON)................................................................81 4.6 InternetMediaTypes(MIMETypes).............................................................82 4.7 Base64Encoding...........................................................................................82 4.8 URLEncoding(PercentEncoding)andURLBase64Encoding..................85 4.9 DomainNamesandDomainNameServers...................................................85 4.10 DocumentObjectModelandBrowserObjectModel....................................87 4.11 PopularWebServers.......................................................................................88 4.11.1 Web/ApplicationServers:LAMPversusWindows/ASP versusJava.........................................................................................89 4.11.1.1 MySQL—TheMinLAMP................................................89 4.11.1.2 UsingJavaDatabaseConnectivity(JDBC)withMySQL....91 4.11.1.3 UsingMySQLiinPHPwithMySQL................................93 4.11.2 GlassFishApplicationServer............................................................95 4.11.2.1 HowtoStartGlassFishandRunanApplication onGlassFish.......................................................................95 4.12 cURL...............................................................................................................99 Exercises..................................................................................................................101 Contents ix ConceptualQuestions..............................................................................................101 Bibliography.............................................................................................................102 Chapter5 SecurityBasics.........................................................................................................105 5.1 JustWhyShouldAnyoneCareAboutSecurity,Anyway?..........................105 5.2 SymmetricKeyCryptographyandAsymmetricKey/Public KeyCryptography ........................................................................................105 5.3 Hash(MessageDigest)Functions................................................................105 5.4 DigitalSignaturesandMessageAuthenticationCodes................................106 5.5 PublicKeyInfrastructureandCertificateAuthorities...................................107 5.6 TransportLayerSecurityandSecureSocketsLayer....................................108 5.6.1 ButHowDoesTLSWork?.............................................................108 5.7 CryptographicMessageSyntax.....................................................................110 Exercises..................................................................................................................112 ConceptualQuestions..............................................................................................112 Bibliography.............................................................................................................112 Chapter6 MicrosoftTechnologiesBasics................................................................................115 6.1 Microsoft“World”versustheRestoftheWorld.........................................115 6.2 DynamicLinkLibraryFilesandWindowsSidebySide.............................115 6.3 CommonLanguageRuntime(CLR).............................................................116 6.4 GlobalAssembliesCache.............................................................................117 6.5 NamedPipesinWindows.............................................................................118 Exercises..................................................................................................................119 ConceptualQuestions..............................................................................................120 Bibliography.............................................................................................................120 Chapter7 CloudTechnologiesBasics......................................................................................121 7.1 WhatYouNeedtoKnowfortheCloud.......................................................121 7.2 JustWhatAreDiskImagesandVirtualMachineImages,Anyway?...........121 7.2.1 VariousKindsofDiskImagesandVirtualMachineImages..........121 7.3 JustWhatAreHypervisorsandVirtualMachines,Anyway?......................123 7.3.1 SomeExamplesofType2Hypervisors..........................................124 7.3.1.1 SomeVirtualBoxInstallationHints.................................125 7.3.2 SomeExamplesofType1Hypervisors..........................................125 7.3.2.1 libvirt................................................................................126 7.4 Software-DefinedNetworkingandNetworkVirtualization.........................126 7.4.1 OpenvSwitch/OpenFlowandLinuxBridge...................................128 7.4.1.1 OpenFlow.........................................................................129 7.4.1.2 HowOpenvSwitchWorks...............................................130 7.5 VirtualizationSecurity..................................................................................130 7.5.1 HypervisorSecurity.........................................................................131 7.6 CloudSecurity...............................................................................................134 7.6.1 PhysicalDataCenterSecurity.........................................................136 Exercises..................................................................................................................137 ConceptualQuestions..............................................................................................137 Bibliography.............................................................................................................137
Description: