Application Level Protocol DesignApplication Layer Protocol DesignTrivial FTP (TFTP)Services & PDU designPDU structure and encodingTFTP ProtcolSorcerer’s apprentice syndromeCorrectionImplementation IssuesImplementation cont’dHTTP 1.0HTTP 1.0 cont’dHTTP 1.1Application-level ProtocolsPresentation LayerCORBA CDR for constructed typesCORBA CDR messageIndication of Java serialized formMIME1CS 475 1Application Level Protocol DesignConcurrent & Distributed Software SystemsCS 475 2Application Layer Protocol DesignSteps in design ServicesProtocol Data Unit (PDU) structure and encodingProtocolClient, Server, interaction with environment (DNS, NFS, etc.)2CS 475 3Trivial FTP (TFTP)RFC 1350a simple file transfer protocol, often used for booting from a remote file systemno access control, directory manipulation, etc.UDP transportfiles are netascii or binaryCS 475 4Services & PDU designServicesRead, write a filePDUsRRQ, read request: read a fileWRQ, write request: write a fileDATAACKERROR3CS 475 50(1)Errcode (2)Block # (2)Block # (2)PDU structure and encodingRRQWRQDATAACKERROROpcode String EOS01 (2) Filename (n) 0(1) Mode (n) 0(1)0(1)Mode (n)0(1)Filename (n)02 (2)03 (2)04 (2)05 (2)String EOSData (0-512)Errstring (n)String EOSCS 475 6TFTP ProtcolClient ServerWRQACK, block # 0Data, block #1ACK, block #1Data, block #2Writing a fileClient ServerRRQData, block #1ACK, block #1Data, block #2ACK, block #2Reading a file4CS 475 7Sorcerer’s apprentice syndromeSend DATA (n)Recv DATA (n)Send ACK (n)(time out)Retransmit Data (n)Recv DATA(n) DuplicateSend ACK (n) DuplicateRecv ACK(n)Send DATA(n+1)Recv DATA(n+1)Send ACK(n+1)Recv DATA(n+1) DuplicateSend ACK (n+1) DuplicateRecv ACK(n+1)Send DATA(n+2)Recv ACK (n)Send DATA(n+1)DuplicateDuplicateRecv ACK (n+1)Send DATA(n+2)DuplicateDuplicateRecv DATA(n+2)Send ACK(n+2)CS 475 8CorrectionSend DATA (n)Recv DATA (n)Send ACK (n)(time out)Retransmit Data (n)Recv DATA(n) DuplicateSend ACK (n) DuplicateRecv ACK(n)Send DATA(n+1)Recv DATA(n+1)Send ACK(n+1)Recv ACK(n+1)Send DATA(n+2)Recv ACK (n)don’t send anythingDuplicateRecv DATA(n+2)Send ACK(n+2)5CS 475 9Implementation IssuesHow does server keep track of client address?New socket created by child process on server sideChild process binds socket to a local addressAll subsequent messages from client sent to new address CS 475 10Implementation cont’dData formatsnetascii -responsibility of the client & server to convert from netascii to local representation (and vice versa)Protocol processingFinite state machineSecurity6CS 475 11HTTP 1.0Servicesread web pages, append to web pages, write pages, etc.GET, HEAD, POST, PUT, DELETE, etc.PDU design and encodingASCII request followed by MIME-like responseformat specified in BNFCS 475 12HTTP 1.0 cont’dProtocolTCP used as transportnew connection for every file retrieved⌧poor performanceOther issuesactive content, caching, proxy servers, security7CS 475 13CS 475 14HTTP 1.1Several changes Persistent connections - default behaviorHost header field in requestConnection headerSee also link on class web page for a more detailed discussionAssignment GETLIST method (not part of HTTP 1.1) ⌧server can supply a list of embedded files as an optional header in the response to a GET request⌧you have to design the request/response formats8CS 475 15CS 475 16Application-level ProtocolsSession-layercommunication between processes (as opposed to hosts)Example:⌧ error-recovery and check-pointing for long-lived connections⌧ creation and management of synchronized streams for audio and video9CS 475 17Presentation LayerHandle issues related to different data representations on communicating hostsbig endian vs little endian, 32 bit vs 64 bit, different formats for characters, etc. Usually handled in one of two ways⌧Canonical representation of data• XDR, ASN.1, netascii (TFTP), CORBA CDR• ASCII (HTTP)• Java object serialization⌧“receiver makes right”Also handles encryption and decryptionCS 475 18CORBA CDR for constructed typesType Representationsequence length (unsigned long) followed by elements in orderstring length (unsigned long) followed by characters in order (can alsocan have wide characters)array array elements in order (no length specified because it is fixed)struct in the order of declaration of the componentsenumerated unsigned long (the values are specified by the order declared)union type tag followed by the selected member10CS 475 19CORBA CDR messageThe flattened form represents a Person struct with value: {‘Smith’, ‘London’, 1934}0–34–78–1112–1516–1920-2324–275" S mit""h___"6"Lond""on__"1934index in sequence of bytes 4 bytesnotes on representationlength of string‘Smith’length of string‘London’unsigned longCS 475 20Indication of Java serialized formThe true serialized form contains additional type markers; h0 and h1 are handlesSerialized valuesPerson319348-byte version numberint year5 Smithjava.lang.Stringname:6 Londonh0java.lang.Stringplace:h1Explanationclass name, version numbernumber, type and name of instance variables values of instance variables11CS 475 21MIMEInternet email standard (RFC 822) specifies ASCII message formatMultipurpose Internet Mail Extensionscontinue to use the RFC 822 format but allow non-ASCII messagesNew message headers binary messages encoded using base64 encoding or quoted-printable
View Full Document