220 likes | 363 Views
Net-Centric Computing Content Formats. 2110472 Computer Networks Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University. “ Garbage In, Garbage Out .”. Outline. Content Formats Overview. MIME – email contents. EDI – business document contents.
E N D
Net-Centric ComputingContent Formats 2110472 Computer Networks Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University
“Garbage In, Garbage Out.” Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
Outline • Content Formats Overview. • MIME – email contents. • EDI – business document contents. • XML – generic contents. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
Overview • Net-Centric Applications require • Networks: a road, an express way • Internet, Intranet, proprietary networks, … • Delivery protocols: a mail man, a messager • HTTP, SMTP, TCP/IP, … • Content formats: a message • HTML, MIME, EDI, XML, … Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
Standard Email Contents • RFC 822 – ASCII only Header From:Natawut.N@chula.ac.th To:nc@cp.eng.chula.ac.th Subject: MIME demo. This email is to inform you that … One blank line Body (ASCII only) Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
MIME • Multipurpose Internet Mail Extension • RFC 2045 / 2046. • Allow non-ASCII data in email contents. • “Attachments”. • Three important features • Identify type of content. • Encode binary-format data into ASCII-format. • Multiple attachments. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
MIME – Identify Content Type • “Content-Type:” header Content-Type: type/subtype; parameters • Types • Text: text/plain. • Image: image/jpeg, image/gif. • Audio: audio/basic. • Video: video/mpeg, video/quicktime. • Application: application/zip. • Multiple parts: multipart/mixed. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
MIME – Content Encoding • “Content-Transfer-Encoding:” header Content-Transfer-Encoding: encoding_scheme • Base64 • Use ASCII characters to represent binary data. • Group data into 6-bit. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
MIME – Example From:Natawut.N@chula.ac.th To:nc@cp.eng.chula.ac.th Subject: class photo MIME-Version: 1.0 Content-Type: multipart/mixed; Boundary=ABCDEF12345 --ABCDEF12345 Dear class, Here are the photos … --ABCDEF12345 Content-Transfer-Encoding: base64 Content-Type:image/gif Base64 encoded data ...... . . . . . . . . . . Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
EDI • How companies exchange documents • Normal mail (snail mail). • Fax. • Email. • Example: • ABC department store sends an order form to XYZ cloth manufacture via fax. • Problems ? Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
EDI: Electronic Data Interchange “Intercompanycomputer-to-computer communication of standard business transactions in a standard format.” Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
EDI • Standards • ANSI X12. • UN/EDIFACT. • Who use it ? • Import/Export: Thai Customs. • Supply Chain: retail stores and suppliers. • Shipping and Freight: shipping company and shipyards. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
EDI – How it works Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
EDI – Sample EDI File ISA*00* *00* *08*61112500TST *01*DEMO WU000003 *970911*1039*U00302000009561*0*P? GS*PO*611125001I*WU000003 *970911*1039*9784*X*003020 ST*850*397822 BEG*00*RE*194743**970911 REF*AH*M109 REF*DP*641 REF*IA*000100685 DTM*010*970918 N1*BY*92*1287 Nl*ST*92*87447 N1*ZZ*992*1287 PO1*1*1*EA*13.33**CB*80211*IZ*364*UP*71837927164l PO1*1*2*EA*13.33**CB*80211*IZ*382*UP*718379271573 PO1*1*3*EA*13.33**CB*80213*IZ*320*UP*718379271497 PO1*1*4*EA*13.33**CB*80215*IZ*360*UP*718379271848 PO1*1*5*EA*13.33**CB*80215*IZ*364*UP*718379271005 CTT*25 SE*36*397822 GE*1*9784 IEA*1*000009561 Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
Extensible Markup Language • We will use slides “Introduction to XML” by Hall and Brown. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
Sample PO in EDI Format ISA*00* *00* *08*61112500TST *01*DEMO WU000003 *970911*1039*U00302000009561*0*P? GS*PO*611125001I*WU000003 *970911*1039*9784*X*003020 ST*850*397822 BEG*00*RE*194743**970911 REF*AH*M109 REF*DP*641 REF*IA*000100685 DTM*010*970918 N1*BY*92*1287 Nl*ST*92*87447 N1*ZZ*992*1287 PO1*1*1*EA*13.33**CB*80211*IZ*364*UP*71837927164l PO1*1*2*EA*13.33**CB*80211*IZ*382*UP*718379271573 PO1*1*3*EA*13.33**CB*80213*IZ*320*UP*718379271497 PO1*1*4*EA*13.33**CB*80215*IZ*360*UP*718379271848 PO1*1*5*EA*13.33**CB*80215*IZ*364*UP*718379271005 CTT*25 SE*36*397822 GE*1*9784 IEA*1*000009561 Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
Sample PO in XML Format <?xml version = "1.0"?> <purchase-order> <header> <po-number>1234</po-number> <date>l999-02-08</date><time>14:05</time> </header> <billing> <company>XMLSolutions</company> <address> <street>601 Pennsylvania Ave. NW</street> ... </address> </billing> <order items="1" > <item> <reference>097251</reference> <description>Widgets</description> <quantity>4</quantity> <unit-price>11.99</unit-price> <price>47.96</price> </item> ... </order> ... </purchase-order> Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
Summary • Content formats are very important for Net-Centric Applications. • XML is a very important standard • Flexible and extensible. • Both human and machine readable. • Lots of tools. • Being used in many areas • Data formats. • Programming interface description. • RPC protocol formats. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
Summary • Other data formats • CSV. • Fixed-column format. • Application-dependent formats. • XML-based formats: ebXML. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
References • Kurose and Ross, Computer Networking: A Top-Down Approach Featuring the Internet, Addison Wesley Longman, 2001. • R. Morin, “Howto Base64”, http://www.kbcafe.com/articles/base64.html. • P. Sokol, From EDI to Electronic Commerce: A Business Initiative, McGraw-Hill, 1995. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.
References • M. Johnson, “XML for the absolute beginner ”, Javaworld, April 1999, http://www.javaworld.com/javaworld/jw-04-1999/jw-04-xml.html. • W3C, “XML Tutorial”, http://www.w3schools.com/xml/default.asp. • M. Hall and L. Brown, “Introduction to XML”, 2001, http://www.corewebprogramming.com. Net-Centric Computing: Data Formats Natawut Nupairoj, Ph.D.