30.04.2013 Aufrufe

Folien zur Vorlesung 2

Folien zur Vorlesung 2

Folien zur Vorlesung 2

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

90-classical-some.fm<br />

“CLASSICAL” C/S APPLICATIONS<br />

5. SOME STANDARD<br />

APPLICATIONS<br />

1. Terminal Emulation<br />

2. rlogin<br />

3. telnet<br />

4. File Transfer<br />

5. Trivial File Transfer Protocol (TFTP)<br />

6. File Transfer Protocol (FTP)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel


Recommended reading<br />

[1] J. Postel, J.K. Reynolds:<br />

Telnet Protocol Specification.<br />

RFC-0854, May 1983<br />

[2] J. Postel, J. Reynolds:<br />

File Transfer Protocol.<br />

RFC-0959, October 1985<br />

5-2


Terminal Emulation (1)<br />

Ein Rechner fungiert in einem Netzwerk als („dummes“) Terminal<br />

an einem oder mehreren anderen Rechnern.<br />

Netzwerk<br />

— Zugriff auf Anwendungen, die auf fremden Rechnern laufen<br />

— Zugriff von einer Maschine auf mehrere andere Maschinen<br />

— Emulation von Terminals mit unterschiedlicher Technik<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-3


5-4


Terminal Emulation (2)<br />

Terminal-Typen<br />

— Character-mode Terminals: UNIX, DOS, ...<br />

anwendungsspezifische<br />

Reaktion<br />

darstellbare Zeichen,<br />

Steuerzeichen<br />

Charakteristikum:<br />

zeichenweiser Verkehr zwischen Rechner u. Terminal<br />

entweder Wiedergabe des an der Tastatur eingegebenen Zeichens<br />

auf dem Bildschirm: „Echo“<br />

oder Auslösung einer komplexen Reaktion: nach Steuerzeichen,<br />

nach letztem Zeichen in einem Feld usw.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-5


5-6


Terminal Emulation (3)<br />

Terminal-Typen (Forts.)<br />

— Full-screen Terminals: IBM 3270, 5250 (AS/400), Siemens 9750, ...<br />

Chrakteristikum: seitenweiser Verkehr zum Rechner<br />

Eine Bildschirmseite wird lokal aufgebaut und mit Drücken der<br />

„DÜ-Taste“ ganz oder teilweise zum Rechner übertragen.<br />

Pro Bildschirmseite können bis zu 2000 Zeichen (incl. Farb-, Feldinformationen)<br />

übertragen werden.<br />

— Graphik-Terminals (Bit-mapped Terminals): X-11, Windows, ...<br />

Austausch komplexer Graphikinformation<br />

neben Tastatur die Maus als Eingabegerät<br />

Zeichen, Schriften, Koordinaten, Farben, Vektoren, ...<br />

Graphical User Interfaces (GUIs) auf der Basis von HTML/XML<br />

— Text, Formatierungsanweisungen, Bilder, Formulare, Buttons, …<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-7


5-8


Terminal Emulation (4)<br />

Problemstellungen<br />

— Unterscheidung von drei Datenströmen:<br />

1. zwischen Benutzer und Anwendung (inkl. Steuerzeichen)<br />

2. zwischen Benutzer und Client (z.B. Abbruch der Session)<br />

3. zwischen Client und Server (z.B. Aushandlung von Optionen)<br />

— Terminal-Fähigkeiten: Zeichenvorrat, Größe (Zeilen × Spalten), ...<br />

— Einbettung in die Zielsysteme: Schnittstellen für Client und Server<br />

— Performance<br />

— Sicherheitsaspekte (Authentifizierung, Password-Übertragung, ...)<br />

1<br />

Client Netzwerk<br />

2 3<br />

Anwendung<br />

Server<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-9


5-10


login (1)<br />

Terminal Emulation zwischen UNIX-Maschinen<br />

— Protokoll-Beschreibung in RFC-1282 (Kantor 1991)<br />

— „kleine“ Implementierung:<br />

Client und Server je ca. 1500 lines of code (LOC)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-11


5-12


login (2)<br />

Datenströme<br />

— Benutzer an Anwendung<br />

8-bit Zeichen, zeichenweiser Verkehr mit remote echo<br />

— Benutzer an Client<br />

Einleitung mit Escape-Zeichen ~ (Tilde),<br />

z.B. für Abbruch<br />

— Client/Server-Interaktion im TCP urgent mode („out-of-band“)<br />

Flußkontrolle<br />

Server sendet 0x10: Anwendung interpretiert Ctl-S, Ctl-Q<br />

Server sendet 0x20: Client soll Ctl-S, Ctl-Q interpretieren<br />

Terminalgröße (Window size)<br />

Server fordert „Zeilen × Spalten“ an: 0x80<br />

Client („in-band“): „0xff 0xff s s “<br />

(xp, yp: Zeichengröße in [pixel])<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-13


5-14


login (3)<br />

Einbettung<br />

UNIX-Kern<br />

Terminal-<br />

-Treiber<br />

User<br />

rlogin<br />

Client<br />

TCP/IP<br />

TCP/IP<br />

TCP-Verbindung (port 513)<br />

rlogin<br />

Server<br />

Pseudoterminal<br />

Anwendg.<br />

— Pseudoterminal („pty“) erscheint für login-Prozeß und die nachfolgenden<br />

Anwendungsprozesse wie ein „reales“ Terminal.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-15


5-16


login (4)<br />

Sicherheit<br />

Client Server<br />

<br />

<br />

<br />

<br />

<br />

[Password:]<br />

[]<br />

— Server überprüft,<br />

ob im Home-Verzeichnis der eine Datei .rhosts ist<br />

ob darin ein Eintrag , ist<br />

( ermittelt aus der IP-Adresse des Absenders)<br />

Übertragung des Paßworts kann vermieden werden!<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-17


5-18


telnet (1)<br />

Terminal Emulation zwischen „beliebigen Maschinen“<br />

— Protokoll-Beschreibung in RFC-854 (Postel, Reynolds 1983)<br />

— „große“ Implementierung: Client und Server je ca. 8000 lines of code<br />

— Einbettung (genauso wie rlogin):<br />

UNIX-Kern<br />

Terminal-<br />

-Treiber<br />

User<br />

telnet<br />

Client<br />

TCP/IP<br />

TCP/IP<br />

TCP-Verbindung (port 23)<br />

telnet<br />

Server<br />

Pseudoterminal<br />

Anwendg.<br />

— Pseudoterminal („pty“) erscheint für login-Prozeß und die nachfolgenden<br />

Anwendungsprozesse wie ein „reales“ Terminal.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-19


5-20


telnet (2)<br />

Datenstrom: Network Virtual Terminal (NVT)<br />

— Mit telnet ist ein „Standard-Terminaldatenstrom“ (NVT-ASCII) definiert, auf dessen<br />

Eigenschaften Client und Server „ihren“ lokalen Datenstrom abbilden müssen.<br />

lokaler<br />

Datenstrom<br />

— Definition NVT-ASCII:<br />

NVT<br />

7-bit US-ASCII, gesendet als 8-bit Byte, MSB=0<br />

Zeilenende dargestellt durch ,<br />

Wagenrücklauf durch <br />

Client Server Anwendung<br />

NVT-Datenstrom<br />

lokaler<br />

Datenstrom<br />

Kommandos zwischen Benutzer u. Server, Client u. Server:<br />

eingeleitet durch IAC (0xff) : „Interpret As Command“<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-21


5-22


telnet (3)<br />

Benutzer-Kommandos an den Server<br />

lokaler<br />

Datenstrom<br />

Name Code Beschreibung<br />

— Auslösung dieser Zeichen: „local matter“<br />

Client Server Anwendung<br />

NVT<br />

IP 244 Interrupt Process: Erzeuge das lokale Signal, um den Anwendungsprozeß<br />

abzubrechen.<br />

AO 245 Abort Output: Fordere den Anwendungsprozeß auf, seine laufende<br />

Ausgabe abzubrechen.<br />

AYT 246 Are You There: Server, lebst Du noch?<br />

EC 247 Erase Character: Lösche das letzte eingegebene Zeichen.<br />

EL 248 Erase Line: Lösche die letzte eingegebene Zeile.<br />

lokaler<br />

Datenstrom<br />

— IP, AO, AYT werden typischerweise im TCP Urgent Mode gesendet.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-23


5-24


telnet (4)<br />

Optionen: zwei Beispiele<br />

— „Paketierung“ character-at-a-time oder linemode<br />

— Echo durch Client (local echo) oder Server (remote echo)<br />

lokaler<br />

Datenstrom<br />

local echo remote echo<br />

Client Server Anwendung<br />

NVT<br />

— Drei Szenarien mit unterschiedlichen Anforderungen:<br />

lokaler<br />

Datenstrom<br />

1. Password-Eingabe: linemode, remote echo<br />

Lokales Echo würde Password auf dem Bildschirm sichtbar machen.<br />

2. Interaktive Kommandobearbeitung: linemode, local echo<br />

Erzeugt am wenigsten Verkehr.<br />

3. Textbearbeitung mit einem Editor: character-at-a-time, remote echo<br />

Nur Anwendung kann „darstellbare Zeichen“ und „Steuerzeichen“ unterscheiden.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-25


5-26


telnet (5)<br />

Optionen (Forts.)<br />

— Aushandlung über Kommandos<br />

WILL, WONT, DO, DONT (251 - 254)<br />

Client und Server können als Sender und als Empfänger auftreten.<br />

Sender Empfäng. Beschreibung<br />

1. WILL → ← DO<br />

2. WILL → ← DONT<br />

3. DO → ← WILL<br />

4. DO → ← WONT<br />

5. WONT → ← DONT<br />

6. DONT → ← WONT<br />

Sender will Option aktivieren;<br />

Empfänger ist einverstanden.<br />

Sender will Option aktivieren;<br />

Empfänger ist nicht einverstanden.<br />

Sender will, daß Empfänger Option aktiviert;<br />

Empfänger ist einverstanden.<br />

Sender will, daß Empfänger Option aktiviert;<br />

Empfänger ist nicht einverstanden.<br />

Sender will Option deaktivieren;<br />

Empfänger muß zustimmen.<br />

Sender will, daß Empfänger Option deaktiviert;<br />

Empfänger muß zustimmen.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-27


5-28


File Transfer (1)<br />

Erzeugen einer Dateikopie<br />

— lokale Kopie einer entfernten Datei<br />

— entfernte Kopie einer lokalen Datei<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-29


5-30


File Transfer (2)<br />

Vier Szenarien<br />

1. Urladen (bootstrapping) von diskless workstations<br />

Maschinen verfügen nicht über eine eigene Platte; der Betriebssystem-Code muß<br />

über das Netz in den Hauptspeicher geladen werden; nur lesender Zugriff.<br />

2. Dokumenten-Archive<br />

Zentrale Aufbewahrung von Dokumenten; nur lesender Zugriff.<br />

3. Back-up<br />

Sicherung des eigenen Datenbestandes über das Netz auf dem Plattenspeicher eines<br />

anderen Rechners. Keine konkurrierenden Schreib-/Leseoperationen.<br />

4. Austausch von Arbeitsergebnissen in einer Arbeitsgruppe<br />

Konkurrierender Zugriff wird über check-in/check-out-Prozeduren ausgeschlossen<br />

(z.B. Source Code Control System).<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-31


5-32


File Transfer (3)<br />

Problemstellungen<br />

— Zugriffsrechte<br />

Authentifizierung und Autorisierung des Benutzers<br />

Verzeichnis- und Datei-Attribute<br />

— Dateinamenskonventionen, z.B.<br />

DOS: c:\vorlesg\ks2\ftp.mkr<br />

UNIX: /home/lu/vorlesungen/ks2/filetransfer.maker<br />

— unterschiedliche Datenformate<br />

ASCII, EBCDIC, binär, ...<br />

satzstrukturierte Dateien, unstrukturierte Dateien, ...<br />

— …<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-33


5-34


Trivial File Transfer Protocol (TFTP) (1)<br />

Ziel der Entwicklung: ein einfaches Protokoll, das in den<br />

ROM-Speicher von diskless workstations paßt.<br />

— benutzt z.B. für das Urladen von diskless workstations<br />

— TFTP Server Port: 69/udp<br />

TFTP<br />

UDP<br />

IP<br />

Protokoll-Stack<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-35


5-36


File Transfer Protocol (FTP) (1)<br />

Ziel der ftp-Entwicklung: ein Protokoll, das auch in heterogenen Umgebungen<br />

angewendet werden kann<br />

— für allgemeine, meist interaktive Anwendungen<br />

— eigene Security-Funktionen<br />

— FTP Server Ports: 21/tcp control connection<br />

20/tcp data transfer connection<br />

FTP<br />

TCP<br />

IP<br />

Protokoll-Stack<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-37


5-38


File Transfer Protocol (FTP) (2)<br />

Ports und Connections<br />

user<br />

file<br />

system<br />

user<br />

interface<br />

protocol<br />

interpreter<br />

data<br />

transfer<br />

Client<br />

control<br />

data<br />

protocol<br />

interpreter<br />

data<br />

transfer<br />

Server<br />

file<br />

system<br />

— ftp-Session startet mit Aufbau einer control connection: port 21/tcp: Austausch von<br />

Authentifizierungsinformation und ftp commands/replies<br />

— je Übertragung (Datei-Inhalt, Verzeichnisse, …) eine neue TCP-Verbindung:<br />

Server: Port 20, Client: Port-Nummer wird dem Server über die control connection<br />

dynamisch mitgeteilt (ftp command „port“)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-39


5-40


File Transfer Protocol (FTP) (3)<br />

FTP Commands (C → S) (Auswahl)<br />

— Authentifizierung<br />

USER user-id des Benutzers (auf dem Server)<br />

PASS password des Benutzers (auf dem Server)<br />

— Kontrolle<br />

PORT Client Port-Nummer für nachfolgenden Transfer<br />

TYPE Datenformat (A: ASCII, I: binär („image“))<br />

QUIT Ende der ftp-Session<br />

— Datentransfer<br />

RETR Transfer S → C<br />

STOR Transfer C → S<br />

LIST Holen eines Verzeichnisses<br />

— Kommandos werden in NVT-ASCII übertragen<br />

3 - 4 Großbuchstaben, Leerzeichen, Parameter, <br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 5-41


5-42


91-classical-dns.fm<br />

CLASSICAL C/S APPLICATIONS<br />

6. DIRECTORY SERVICES<br />

(1)<br />

1. Einführung<br />

2. Anforderungen an eine Architektur<br />

3. DNS-Komponenten<br />

4. Domain Names<br />

5. Namensauflösung<br />

6. DNS-Protokolle und -dienste<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel


Recommended reading<br />

[1] P. Mockapetris:<br />

Domain names - implementation and specification.<br />

RFC 1035, 11/01/1987, Internet Std. 13.<br />

[2] P. Mockapetris<br />

Domain names - concepts and facilities.<br />

RFC 1034, 11/01/1987, Internet Std. 13.<br />

[3] M. Lottor<br />

Domain administrators operations guide.<br />

RFC 1033, 11/01/1987.<br />

[4] P. Vixie<br />

A Mechanism for Prompt Notification of Zone Changes (DNS NOTIFY).<br />

RFC 1996, 08/28/1996, Updates RFC1035.<br />

[5] M. Ohta<br />

Incremental Zone Transfer in DNS.<br />

RFC 1995, 08/28/1996, Updates RFC1035.<br />

6-2


Einführung (1)<br />

Verzeichnisdienste …<br />

1. <strong>zur</strong> Auflösung eines symbolischen Namens für ein Rechensystem<br />

in eine Netzwerkadresse, z.B.<br />

Name<br />

?<br />

IP-Adresse<br />

im Internet das Domain Name System (DNS)<br />

2. <strong>zur</strong> Auflösung eines Personennamens in eine „User-Id“<br />

oder eine Mail-Adresse<br />

X.500 oder das Lightweight Directory Access Protocol (LDAP)<br />

— hier zunächst: Einführung in das DNS<br />

vom Benutzer verwendete<br />

Hostbezeichnung<br />

von IP verlangte<br />

numerische Net-/Host-Id<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-3


6-4


Anforderungen an eine Architektur (2)<br />

logische Namen ohne Bezug zu<br />

physischen Netzen, Rechnern etc.<br />

für alle verfügbaren<br />

Dienste und Adreßformate<br />

verteilte Datenhaltung<br />

lokale Pufferspeicher (Cache)<br />

Namen beziehen sich auf<br />

Organisation und ihre Gliederungen.<br />

universelle Mechanismen für<br />

die Namensauflösung und die<br />

zugehörige Datenhaltung<br />

Jede Organisation ist für „ihren“ Teil<br />

des Namensraums verantwortlich:<br />

Zonen-Konzept.<br />

<strong>zur</strong> Steigerung der Performance;<br />

weitestgehende Datenkonsistenz<br />

durch Angabe von Refreshzyklen<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-5


6-6


DNS-Komponenten (1)<br />

Definition eines Namensraums<br />

Verfahren für die Namensauflösung<br />

Datenhaltung für Namensauflösung<br />

Protokolle und Dienste<br />

Domain Name Service<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-7


6-8


Domain Names (1)<br />

Das Internet benutzt einen hierarchischen Namensraum:<br />

Domain Name Space<br />

1<br />

2<br />

3<br />

unnamed root<br />

edu com gov mil ... de uk<br />

ibm<br />

Baumstruktur:<br />

informatik<br />

uni-kiel<br />

— jedem Knoten außer dem Wurzelknoten ist ein „label“ zugeordnet:<br />

Länge: 1 − 63 byte<br />

— Der Wurzelknoten ist ausgezeichnet: label hat die Länge 0.<br />

— Knoten mit einem gemeinsamen unmittelbaren Vorgänger dürfen<br />

nicht denselben label haben!<br />

— Groß- und Kleinschreibung wird nicht ausgewertet.<br />

top-level<br />

domains<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-9<br />

...


Domain Names<br />

Board approves 7 new Internet suffixes – .biz, .info, others to join the mix (November 17, 2000)<br />

MARINA DEL REY, California. A new wave of domain names should spring up on the Internet early next year, giving relief to the dot-com<br />

name crunch. The governing body for Internet names approved seven additional online suffixes, the first such address expansion in more<br />

than a decade. The new Web address suffixes authorized by the Internet Corporation for Assigned Names (ICANN) are as follows .info for<br />

general information, .biz for businesses, .name for individuals, .pro for professionals, .museum for museums, .coop for business cooperatives<br />

and .aero for the aviation industry.<br />

They will join .com, .net and .org as generic suffixes available worldwide. The action drew cheers from industries seeking the expansion<br />

and jeers from critics who said ICANN unfairly favors large corporate interests over individual Internet users.<br />

'Time to refill the tank'<br />

"Dot-com is almost out of gas," said Ken Hansen of NeuStar Inc., which joined in the winning bid for .biz. "It's time to refill the tank so<br />

good names are available for users and businesses." Thursday's decision capped a half-decade of discussion about how to relieve<br />

demand for addresses ending in .com. With some 20 million .com names registered worldwide, easy-to-remember addresses have been<br />

all but used up. ICANN must now negotiate contracts with companies or groups that made the winning proposals. That should occur by<br />

year's end, and getting the databases running could take a few more months.<br />

More suffixes are expected, although ICANN skirted such questions as when and how. "We haven't discussed anything," said Vinton<br />

Cerf, who was elected chairman of ICANN after the meeting. "This is unexplored territory." First, Cerf said, the board must be convinced<br />

the new suffixes do not introduce side effects.<br />

The new suffixes could also begin a new Internet land rush, with speculators and trademark holders competing to claim the best names<br />

first. ICANN has been embroiled in controversy since it was created in 1998 by the United States government to oversee the domain name<br />

system. About half of the board members were chosen on ICANN's inception, with the other half chosen by constituencies within ICANN.<br />

6-10


Domain Names (2)<br />

Definitionen<br />

Domain Name<br />

→ ein Pfad im hierachischen Namensraum,<br />

d.h. eine Folge von labels, vom Blatt <strong>zur</strong> Wurzel gelesen.<br />

Domain<br />

→ Unterbaum, der durch den Domain Name seiner Wurzel bezeichnet wird;<br />

umfaßt die Wurzel und alle Knoten darunter<br />

Subdomain<br />

→ Eine Domain ist eine Subdomain, wenn sie in einer anderen Domain enthalten ist.<br />

Beispiel: A.B.C.D ist enthalten in B.C.D, C.D, D und ″ ″<br />

formal:<br />

::= | " "<br />

::= | "." <br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-11


Domain Names (Fortsetzung)<br />

Charges of nepotism<br />

That has led to accusations of nepotism, and over-representation by corporate and big business interests instead of regular Internet<br />

users, especially outside of the United States, and calls for ICANN's abolishment. To assuage critics, ICANN earlier this year held a direct<br />

election via the Internet for five new board members, who did not start their terms until after the board meeting.<br />

But it is also considering limiting further direct elections of board members, which prompted some ICANN attendees to wear buttons<br />

saying "Help Stamp Out ICANN Board Squatting". In choosing new domains to add and the companies to run them, the board said it was<br />

looking for diversity in company size, and region, strength of their business plan, and their technical proficiency to handle this. "Competing<br />

with .com requires technical ability. You need to emphasize this, or competition can't exist," said Jun Murai, a member of ICANN's board.<br />

But some complained that with the emphasis on the financial fitness of the applicants, ICANN was looking more like a venture capitalist<br />

rather than a nonprofit corporation.<br />

"ICANN has become a large gatekeeper deciding who has the right to print money on the Internet," said Karl Auerbach, a long-time critic<br />

of ICANN who favors adding up to 10,000 new domain name suffixes per year. Auerbach is an incoming ICANN board member who did<br />

not participate in the selection process. New suffix bids cost $50,000 For this week's meeting, companies or groups proposing new suffixes<br />

paid a nonrefundable $50,000 fee for the chance to become record keepers for the new names.<br />

As registry operators, they would be able to charge a few dollars per name registered, an amount that could add up to millions of dollars<br />

for the most popular suffixes. Desiring to steer clear of content regulation, the board rejected .kids for children, .xxx for adults and .health<br />

for prescreened health sites. They also dismissed .tel for telephone numbers and .yp for yellow page directories.<br />

An unexpected omission from the board's group was the .geo domain name, which would've created a huge Web-accessible database<br />

of businesses and monuments based on location. In all, there were 47 applications for new suffixes.<br />

6-12


Domain Names (3)<br />

Schreibweise für Domain Names:<br />

. ... ..<br />

Labels werden durch einen Punkt voneinander getrennt.<br />

Beispiel: informatik.uni-kiel.de<br />

Anmerkung: Bei E-mail: Vor den Domain Name steht noch<br />

ein sog. local part, der den Empfänger bezeichnet;<br />

local part durch @ vom Domain Name getrennt; Beispiel: nl@informatik.uni-kiel.de<br />

Absolute/Relative Domain Names<br />

absoluter Domain Name = vollständiger Domain Name<br />

auch: fully qualified domain name<br />

Schreibweise (Beispiel): ftp.Germany.EU.net.<br />

relativer Domain Name = nur die ersten labels eines<br />

absoluten Domain Name;<br />

muß lokal zu einem absoluten Domain Name ergänzt werden.<br />

Schreibweise: ohne abschließenden Punkt<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-13


6-14


Namensauflösung (1)<br />

Konzept<br />

1. Aufteilung des gesamten Namensraums in sog. Zonen:<br />

„a particular ’pruned’ subtree of the domain space“ (RFC-1035)<br />

2. Je Zone mindestens zwei sog. Name Server:<br />

stellen Informationen <strong>zur</strong> Namensauflösung <strong>zur</strong> Verfügung<br />

„autoritative Daten“ für die eigene Zone<br />

„glue data“ für den Übergang zu anderen Name Servers<br />

3. Format für die Daten <strong>zur</strong> Namensauflösung:<br />

sog. Resource Records (RRs)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-15


6-16


Namensauflösung (2)<br />

DNS-Zonen<br />

— Eine Zone ist ein zusammenhängender baumförmiger Teil des<br />

DNS-Namensraums, für den mindestens zwei Name Server<br />

(„primary/secondary“) Informationen (= RRs) bereithalten.<br />

— Eine Zone beginnt bei einem „top node“ (einschließlich) und geht bis zu ihren unteren<br />

Grenzen („cuts“).<br />

— Eine Zone wird identifiziert durch ihren „top node“.<br />

— Die unteren Grenzen werden gebildet<br />

durch Blattknoten des Namensraumes oder<br />

durch Verweise auf die Name Server unterlagerter Zonen:<br />

„delegated subzones“<br />

— Der Begriff Zone bezeichnet nicht das gleiche wie der Begriff Domain:<br />

Der Knoten informatik.uni-kiel.de. ist in der<br />

Domain uni-kiel.de., aber nicht unbedingt<br />

in der Zone uni-kiel.de.!<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-17


6-18


Namensauflösung (3)<br />

Aufteilung des Namensraums in Zonen<br />

Beispiel:<br />

unnamed root<br />

edu com gov mil ... de uk<br />

ibm<br />

heidelbg<br />

vesuv<br />

p-1<br />

pool<br />

…<br />

informatik<br />

…<br />

uni-kiel<br />

Zone „informatik.uni-kiel.de.“<br />

donald<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-19<br />

jura<br />

…<br />

...<br />

med<br />

…<br />

Zone „uni-kiel.de.“


6-20


Namensauflösung (4)<br />

Zordnung von Name Servern zu Zonen<br />

Verweise auf<br />

die Name Server<br />

unterlagerter Zonen<br />

NS<br />

vesuv<br />

NS<br />

p-1<br />

pool<br />

…<br />

NS<br />

informatik<br />

…<br />

Zone „informatik.uni-kiel.de.“<br />

uni-kiel<br />

donald<br />

de<br />

...<br />

Jeder Zone hat einen Name Server mit „Autorität für die Zone“;<br />

verweist auf die Name Server der Subzonen.<br />

NS<br />

root name server<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-21<br />

...<br />

jura<br />

…<br />

med<br />

…<br />

Zone „uni-kiel.de.“


6-22


Namensauflösung (5)<br />

Resource Records<br />

Domain Name<br />

RR<br />

RR<br />

…<br />

RR: ( ,[],[],, )<br />

name: Domain Name<br />

ttl: time to live in [s]<br />

(nach dieser Zeit soll der RR aus dem Cache gelöscht werden)<br />

class: IN Internet<br />

ggf. noch weitere<br />

type: A Adresse<br />

CNAME „canonical name“<br />

HINFO Information über den Host<br />

MX Mail Exchange für die Domain<br />

NS der autoritative Name Server<br />

SOA „Start of Zone Authority“<br />

data: Typ- und Klassen-abhängige Daten<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-23


6-24


Namensauflösung (6)<br />

A<br />

CNAME<br />

HINFO<br />

MX<br />

Ein A-RR gibt die Adresse eines Host an.<br />

Beispiel:<br />

donald.informatik.uni-kiel.de. A 134.245.199.10<br />

Ein CNAME-RR übersetzt den „Spitznamen“ eines<br />

Host in den offiziellen Namen.<br />

Beispiel:<br />

super-server CNAME donald.informatik.uni-kiel.de.<br />

Ein HINFO-RR gibt Information über Hardware und<br />

Software eines Host.<br />

Beispiel:<br />

donald HINFO HP9000-725 HP-UX2.1<br />

MX-RRs geben an, wohin Mail für eine Domain<br />

geliefert werden soll. Mit Angabe einer Priorität.<br />

Beispiel:<br />

informatik.uni-kiel.de. MX 10 donald.informatik.uni-kiel.de.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-25


6-26


Namensauflösung (7)<br />

SOA<br />

NS<br />

SOA-RRs definieren den „top node“ einer Zone und<br />

identifzieren damit die Zone. Außerdem enthalten sie<br />

Daten für das Zonen-Management.<br />

NS-RR = Verweis auf einen Name Server<br />

für die eigene Zone<br />

für eine „delegated subzone“.<br />

Beispiel:<br />

informatik.uni-kiel.de. NS donald.informatik.uni-kiel.de.<br />

NS sun1.rz.uni-kiel.de.<br />

Ein Name Server muß nicht in der Zone sein, für die<br />

er „zuständig“ ist.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-27


6-28


Namensauflösung (8)<br />

Systemadminstrator erstellt masterfile named.hosts mit RRs<br />

für die eigene Zone.<br />

primary<br />

zone<br />

transfers<br />

secondary<br />

named.hosts<br />

(in LINUX)<br />

Name<br />

Server<br />

Name<br />

Server<br />

Netzwerk<br />

query/response<br />

transfers<br />

Client<br />

Resolver<br />

local cache<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-29


6-30


Namensauflösung (9)<br />

Aufbau einer Zonenbeschreibung<br />

Start<br />

Name Server<br />

für die eigene Zone<br />

Name Server für<br />

angrenzende Zonen*<br />

Autoritative Daten<br />

für die eigene Zone<br />

Address-RRs für<br />

die Name Server<br />

angrenzender Zonen*<br />

uni-kiel.de. SOA …<br />

NS aix.rz.uni-kiel.de.<br />

NS donald.informatik.uni-kiel.de.<br />

informatik NS donald.informatik.uni-kiel.de.<br />

NS aix.rz.uni-kiel.de.<br />

name-1 A 134.245. …<br />

name-2 …<br />

…<br />

donald.informatik.uni-kiel.de.A 134.245.199.10<br />

*) nicht-autoritative Information („glue records“)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-31


6-32


Namensauflösung (10)<br />

Wie wird der Name pc100.informatik.uni-kiel.de aufgelöst?<br />

resolver<br />

Name<br />

Server<br />

Verweis<br />

Verweis<br />

Verweis<br />

Adresse<br />

Root<br />

Name Server<br />

de<br />

Name Server<br />

uni-kiel.de<br />

Name Server<br />

informatik.uni-kiel.de<br />

Name Server<br />

Resolver fordert rekursive Auflösung an,<br />

Name Server fordert iterative Auflösung an.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-33<br />

de<br />

uni-kiel<br />

informatik


6-34


Namensauflösung (11)<br />

Zonen-Management<br />

— Primary Name Server<br />

bezieht seine Informationen aus dem Master File, der vom<br />

Systemadministrator erstellt wird.<br />

— Secondary Name Server<br />

kopiert in regelmäßigen Abständen die Zonen-Information vom<br />

Primary Name Server: Zonen-Transfer<br />

— Update der NS-RRs und A-RRs der Subzonen<br />

RFC-1033: „The administrators of both zones should insure that<br />

the NS and glue RRs which mark both sides of the cut are consistent and remain so.“<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-35


6-36


DNS-Protokolle und -dienste (1)<br />

DNS-Protokoll<br />

— benutzt UDP oder TCP, Port 53<br />

— Query/Answer-Protokoll<br />

Resolver<br />

query<br />

answer<br />

Name<br />

Server<br />

request for<br />

zone transfer<br />

Name<br />

Server<br />

primary<br />

zone<br />

transfer<br />

secondary<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-37


6-38


DNS-Protokolle und -dienste (2)<br />

DNS-Protokoll: PDU-Format<br />

id flags<br />

# of questions # of answer RRs<br />

# of authority RRs # of additional RRs<br />

queries<br />

(name, qtype, qclass)*<br />

answer RRs<br />

authority RRs<br />

additional RRs<br />

*) qtype = 252 fordert Transfer einer kompletten Zone an.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-39


6-40


DNS-Protokolle und -dienste (3)<br />

Dienstschnittstelle für die Namensauflösung<br />

— Funktionen der sog. Resolver Lib<br />

— programmiert: gethostbyname(…);<br />

— Kommando: nslookup<br />

mit Subkommandos zum Setzen von Anfrageparametern, z.B.:<br />

set norecurse<br />

set type = ns<br />

usw.<br />

ftp,<br />

E-mail,<br />

…<br />

domain name<br />

Resolver<br />

Lib<br />

IP address<br />

Datenbasis<br />

des<br />

Domain Name<br />

Service<br />

(Name Server)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 6-41


6-42


71-webApp-N-Tier.fm<br />

WEB APPLICATIONS<br />

7. N-TIER ARCHITECTURE<br />

1. Development of the N-Tier Architecture<br />

2. Serverseitige Schnittstellen<br />

3. CGI-Programmierung<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel


Recommended reading<br />

[1] Eberhart, A., Fischer, St.:<br />

Java-Bausteine für E-Commerce-Anwendungen.<br />

München, Wien (Hanser) 2000<br />

7-2


Development of the N-Tier Architecture (1)<br />

Wikipedia definition:<br />

In software engineering, multi-tier architecture (often referred to as<br />

n-tier architecture) is a client-server architecture in which an<br />

application is executed by more than one distinct software agent.<br />

For example, an application that uses middleware to service data<br />

requests between a user and a database employs multi-tier<br />

architecture. The most widespread use of „multi-tier architecture“<br />

refers to three-tier architecture.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-3


7-4


Development of the N-Tier Architecture (2)<br />

WWW: a platform for distributed applications<br />

— decoupling of<br />

user interface:<br />

data presentation to the user via a Graphical User Interface (GUI),<br />

possibly for devices with different capabilities<br />

(memory, processing power, display size, …)<br />

business logic:<br />

translating client calls into database queries and other actions,<br />

and translating data from the database into client data in return.<br />

data storage and access:<br />

database management system, dedicated services<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-5


7-6


Development of the N-Tier Architecture (3)<br />

C/S configuration as 2-tier architecture<br />

Client/<br />

Browser<br />

presentation<br />

Internet/<br />

Intranet<br />

HTTP/HTML<br />

Server<br />

Presentation Business<br />

Logic<br />

generate<br />

HTML page<br />

process user<br />

request<br />

Resources<br />

database or<br />

other services<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-7


7-8


Development of the N-Tier Architecture (4)<br />

from 2-tier to 3-tier<br />

“Three-tier websites evolved from earlier two-tier websites which initially<br />

used webservers with both static and dynamic content, often Common<br />

Gateway Interface or CGI scripts, and a database back end. Separating<br />

out the static and dynamic page generation, and using software platforms<br />

with more programming features and structure, made website creation<br />

and management easier.”<br />

Wikipedia<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-9


7-10


Development of the N-Tier Architecture (5)<br />

Two different kinds of requests<br />

HTTP<br />

Client<br />

— formally equal:<br />

HTTP Req.<br />

HTTP Reply<br />

request for a static HTML page:<br />

URL<br />

Tier 2<br />

Web<br />

Server<br />

request for an application server:<br />

URL + possibly additional parameters<br />

Appl. Req.<br />

configuration of the tier-2 server decides on URL interpretation<br />

static HTML<br />

pages<br />

Application<br />

Server<br />

(Tier 3)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-11


Development of the N-Tier Architecture<br />

Wenn von einem HTTP-Client ein HTTP-Request eintrifft, dessen URL auf ein CGI-Skript zeigt, liefert der HTTP-Server nicht den Inhalt<br />

dieser Datei an den Client, sondern führt das in einer Datei gespeicherte Skript aus. (Dabei werden – falls vorhanden – Ausführungsparameter<br />

übergeben.) Um eine Unterscheidung zwischen den Inhalten der unterschiedlichen Verzeichnisse treffen zu können, verfügt der<br />

Tier-2-Server über Verzeichnisbeschreibungen in seinen Konfigurationsdateien.<br />

Ein Beispiel: Dem Apache-Web-Server wird durch die folgenden Einträge in die Datei httpd.conf mitgeteilt, daß es sich bei den im<br />

Verzeichnis /usr/local/apache/share/cgi-bin gespeicherten Dateien um sog. CGI-Skripte (s.u.!) handelt:<br />

<br />

…<br />

Options ExecCGI<br />

SetHandler cgi-script<br />

<br />

7-12


Development of the N-Tier Architecture (6)<br />

Transformation into a 3-tier architecture<br />

Presentation<br />

Tier 1<br />

— tier 1: GUI<br />

HTTP request<br />

HTTP reply<br />

HTML page<br />

Tier 2<br />

— tier 2: interface objects, application processing:<br />

CGI, Active Server Pages (ASP), PHP (Personal Home Page),<br />

(Java-) Servlets (mit JDBC), ColdFusion, …<br />

— tier 3: typically a database<br />

Webserver<br />

with interface objects<br />

Servlet,<br />

ASP,<br />

CGI,<br />

…<br />

general resources,<br />

e.g. databases<br />

standard database protocols<br />

(SQL, JDBC, ODBC)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-13<br />

Tier 3


7-14


Development of the N-Tier Architecture (7)<br />

a 4-tier architecture<br />

Presentation<br />

Transformation<br />

Tier 1 Tier 2 Tier 3<br />

Tier 4<br />

— end-system devices with different capabilities:<br />

PC, PDA, mobile phone (WAP), …<br />

Application Storage<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-15


7-16


Development of the N-Tier Architecture (8)<br />

Advantages of the n-tier architecture<br />

— clear system structure:<br />

separation of application/business logic from presentation and storage<br />

(cf. model/view/controller design pattern)<br />

— Thin Clients:<br />

cheap end-user devices with minimal capabilities<br />

— configuration management can be centralized<br />

— security:<br />

global concept for Authentication, Authorisation, Accounting (AAA)<br />

— scalability: system can be upgraded stepwise<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-17


7-18


Serverseitige Schnittstellen (1)<br />

Zwei verschiedene Arten von Requests<br />

HTTP<br />

Client<br />

HTTP Req.<br />

mit URL<br />

Tier 1<br />

Web-<br />

Server<br />

— aus Sicht des Browsers formal gleich<br />

Appl. Req.<br />

Request für eine HTML-Seite:<br />

Bezeichnung durch URL<br />

Request für einen Application Server:<br />

Bezeichnung durch URL + ggf. weitere Parameter<br />

HTML-<br />

Seiten<br />

Application<br />

Server<br />

Konfiguration des Tier-1-Servers entscheidet über Interpretation der URL<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-19


7-20


Serverseitige Schnittstellen (2)<br />

Problemstellungen<br />

— Programmiersprachen, häufig Skript-Sprachen:<br />

interpretative Abarbeitung, schwache Typisierung,<br />

keine komplexen Datenstrukturen, Einbettung von Betriebssystemkommandos,<br />

komfortable String-Operationen, Mitbenutzung externer Programme<br />

— Modellierung der Server-Umgebung<br />

APIs, Objekte, I/O-Schnittstellen, …<br />

— Anbindung an HTML<br />

Abgrenzung von statischen HTML-Anteilen und ausführbarem Programm,<br />

z.B. durch bei Active Server Pages (ASP)<br />

Ausgabe von HTML-Code,<br />

z.B. durch response.write ("Hello World!") in JScript<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-21


7-22


CGI-Programmierung (1)<br />

Common Gateway Interface<br />

Zugriff<br />

auf Dokumente<br />

Request<br />

Response<br />

Tier-1-Server<br />

Weiterleiten von Requests an<br />

aktive Komponenten<br />

HTML<br />

Appl. Server<br />

Common Gateway<br />

Interface (CGI)<br />

— Konfiguration z.B. im Apache-Web-Server:<br />

<br />

…<br />

Options ExecCGI<br />

SetHandler cgi-script<br />

<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-23


7-24


CGI-Programmierung (2)<br />

Beispiel:<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-25


HTML-Code für die Beispiel-Seite<br />

Feedback<br />

<br />

<br />

<br />

Name:<br />

E-Mail-Adresse:<br />

<br />

<br />

<br />

<br />

<br />

verwendeter Browser:<br />

genutzte Internet-Dienste:<br />

<br />

<br />

Netscape<br />

Lynx<br />

Microsoft<br />

Arena<br />

Mosaic<br />

sonstige<br />

<br />

<br />

World Wide Web<br />

Electronic Mail<br />

File Transfer<br />

Remote Login<br />

Newsgroups<br />

sonstige<br />

<br />

Hauptinteressengebiet:<br />

weitere Interessengebiete:<br />

<br />

<br />

<br />

<br />

Software Hardware<br />

Netzwerke Sport<br />

Kultur Tiere<br />

Politik Wirtschaft<br />

Wissenschaft<br />

<br />

<br />

7-26


CGI-Programmierung (3)<br />

CGI: eine Schnittstellendefinition mit …<br />

— zwei Mechanismen <strong>zur</strong> Parameterübergabe vom Browser:<br />

Standardeingabe HTTP-Methode POST<br />

bei Datenmengen > 1024 byte<br />

Umgebungsvariablen HTTP-Methode GET<br />

durch "+" getrennte Parameter in der<br />

Umgebungsvariablen QUERY_STRING<br />

— einem Mechanismus <strong>zur</strong> HTML-Ausgabe:<br />

Standardausgabe<br />

— Umgebungsvariable REQUEST_METHOD zeigt POST oder GET an<br />

ausführendes Programm in beliebiger Programmiersprache<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-27


HTML-Code für die Beispiel-Seite (2)<br />

<br />

<br />

Software Hardware<br />

Netzwerke Sport<br />

Kultur Tiere<br />

Politik Wirtschaft<br />

Wissenschaft<br />

<br />

<br />

<br />

<br />

Kommentar:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

7-28


CGI-Programmierung (4)<br />

hier: <br />

Methode POST, da Eingabedaten groß sein können<br />

Aufruf des CGI-Programms feedback.cgi<br />

gesetzte Umgebungsvariablen:<br />

DOCUMENT_ROOT /www/public<br />

GATEWAY_INTERFACE CGI/1.1<br />

HTTP_USER_AGENT Mozilla/3.01 (X11; I; Linux 2.0.33 i586)<br />

PATH /sbin:/bin:/…<br />

QUERY_STRING<br />

REMOTE_ADDR 141.7.11.12<br />

REMOTE_HOST lemming.stud.uni-kiel.de<br />

REQUEST_METHOD POST<br />

SCRIPT_FILENAME /www/public/CGI/feedback.cgi<br />

CONTENT_LENGTH 3416<br />

CONTENT_TYPE application/x-www-form-urlencode<br />

SERVER_ADMIN admin@trick-17.net<br />

SERVER_NAME www.trick-17.net<br />

SERVER_PORT 80<br />

SERVER_PROTOCOL HTTP/1.0<br />

SERVER_SOFTWARE Apache/1.2.6<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-29


7-30


CGI-Programmierung (5)<br />

Beispielprogramm in tcl<br />

#!/usr/local/bin/tcl<br />

# CGI-Unterprogramme einbinden:<br />

source /www/include/cgi.tcl<br />

# Aufruf von CGI_Parameter leistet folgendes:<br />

# CGI-Parameter einlesen<br />

# Unterprogramm liefert folgende Datenstrukturen <strong>zur</strong>ück:<br />

# CGI: Array mit Parametern als Indizes: liefert Werte<br />

# IST_LISTE: Array mit Parametern als Indizes:<br />

# 0 - Parameter ist keine Liste<br />

# 1 - Parameter ist eine Liste<br />

CGI_Parameter name email browser dienste hauptthema<br />

themen kommentar<br />

# Datei zum Anhängen öffnen:<br />

set LOG [open /www/save/feedback.txt a]<br />

# fremde Schreibzugriffe sperren<br />

flock $LOG<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-31


7-32


CGI-Programmierung (6)<br />

Beispielprogramm (Forts.)<br />

# Datum und Zeit ermitteln:<br />

set datum [clock format [clock seconds]<br />

-format "%d. %m. %Y, %H:%M"]<br />

puts $LOG "--------------------------------------"<br />

puts $LOG ""<br />

puts $LOG $datum<br />

puts $LOG "Name: $CGI(name)"<br />

puts $LOG "EMail: $CGI(email)"<br />

puts $LOG "Browser: $CGI(browser)"<br />

if $IST_LISTE(dienste) {<br />

set i 1<br />

foreach el $CGI(dienste) {<br />

puts $LOG "Dienst$i: $el"<br />

incr i<br />

}<br />

} else {<br />

puts $LOG "Dienst: $CGI(dienste)"<br />

}<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-33


7-34


CGI-Programmierung (7)<br />

Beispielprogramm (Forts.)<br />

puts $LOG "Hauptthema: $CGI(hauptthema)"<br />

if $IST_LISTE(themen) {<br />

set i 1<br />

foreach el $CGI(themen) {<br />

puts $LOG “Thema$i: $el"<br />

incr i<br />

}<br />

} else {<br />

puts $LOG “Thema: $CGI(themen)”<br />

}<br />

puts $LOG “Kommentar:”<br />

puts $LOG $CGI(kommentar)<br />

flush $LOG<br />

# fremde Schreibzugriffe freigeben (erfordert tclX)<br />

funlock $LOG<br />

# Datei schliessen<br />

close $LOG<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-35


7-36


CGI-Programmierung (8)<br />

Beispielprogramm (Forts.)<br />

# Erfolgsmeldung<br />

HTTP_Header<br />

puts ""<br />

puts ""<br />

puts "Feedback abgeschickt"<br />

puts ""<br />

puts ""<br />

puts ""<br />

puts "Hallo $CGI(name)"<br />

puts "Dein Feedback hat uns erreicht."<br />

puts "Vielen Dank!"<br />

puts ""<br />

puts ""<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 7-37


7-38


70-webApp-HTTP.fm<br />

WEB APPLICATIONS<br />

8. THE HYPERTEXT<br />

TRANSFER PROTOCOL<br />

1. Introduction<br />

2. HTTP Overview<br />

3. HTTP Protocol Headers<br />

4. HTTP Dialogues<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel


Recommended reading<br />

[1] R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, T. Berners-Lee:<br />

Hypertext Transfer Protocol -- HTTP/1.1.<br />

RFC-.2616, June 1999.<br />

8-2


Introduction (1)<br />

WWW Cooperation Paradigm: Client/Server<br />

— Hypertext Transfer Protocol (http): Web’s application layer protocol<br />

client: browser that requests, receives, “displays” Web objects<br />

server: Web server sends objects in response to requests<br />

— Standards<br />

Web-Server<br />

Web-Server<br />

http1.0: RFC 1945<br />

http1.1: RFC 2616<br />

http port 80 (TCP)<br />

Internet<br />

Client<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-3


8-4


Introduction (2)<br />

from the HTTP RFC:<br />

„HTTP is an application-level protocol with the lightness and speed<br />

necessary for distributed, collaborative, hypermedia information systems. It<br />

is a generic, stateless, object-oriented protocol which can be used for many<br />

tasks, such as name servers and distributed object management systems,<br />

through extension of its request methods (commands). A feature of HTTP is<br />

the typing and negotiation of data representation, allowing systems to be<br />

built independently of the data being transferred.“<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-5


8-6


HTTP Overview (1)<br />

Request/repsonse dialogues<br />

Client Server<br />

non-persistent communication (http 1.0):<br />

single request/response pair<br />

server closes connection<br />

TCP connection setup<br />

one request/response pair<br />

per data object<br />

TCP connection closing<br />

Client Server<br />

persistent communication (http 1.1):<br />

multiple request/response pairs<br />

client closes connection<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-7


8-8


HTTP Overview (2)<br />

Request methods<br />

— GET<br />

„The GET method means retrieve whatever information (in the form of an entity)<br />

is identified by the Request-URI. If the Request-URI refers to a data-producing<br />

process, it is the produced data which shall be returned as the entity in the<br />

response und not the source text of the process, unless that text happens to be<br />

the output of the process.“<br />

— HEAD<br />

„The HEAD method is identical to GET except that the server must not return<br />

any Entity-Body in the response. The metainformation contained in the HTTP<br />

headers in response to a HEAD request should be identical to the information<br />

sent in response to a GET request. This method can be used for obtaining<br />

metainformation about the resource identified by the Request-URI without<br />

transferring the Entity-Body itself. This method is often used for testing<br />

hypertext links for validity, accessibility, and recent modification.“<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-9


8-10


HTTP Overview (3)<br />

Request methods (cont’d.)<br />

— POST<br />

„The POST method is used to request that the destination server accept the<br />

entity enclosed in the request as a new subordinate of the resource identified by<br />

the Request-URI in the Request-Line. …<br />

Posting a message to a bulletin board, newsgroup, mailing list, …<br />

Providing a block of data, such as the result of submitting a form to a datahandling<br />

process<br />

Extending a database through an append operation.“<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-11


8-12


HTTP Protocol Headers (1)<br />

Clear-text ASCII protocol headers<br />

— sample GET request:<br />

GET /somedir/page.html HTTP/1.0 request line<br />

User-agent: Mozilla/4.0 header lines<br />

Accept: text/html, image/gif, image/jpeg<br />

Accept-language: de<br />

requesting browser,<br />

acceptable data types,<br />

language version<br />

end of request header<br />

— sample response<br />

HTTP/1.0 200 OK status line<br />

Date: Thu, 06 Aug 1998 12:00:15 GMT header lines<br />

Server: Apache/1.3.0 (Unix)<br />

Last-Modified: Mon, 22 Jun 1998<br />

Content-Length: 6821<br />

Content-Type: text/html<br />

end of response header<br />

data data data data data ...<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-13


8-14


HTTP Protocol Headers (2)<br />

Request header format<br />

method sp url sp http version cr lf Request line<br />

header field name : value cr lf<br />

…<br />

…<br />

header field name<br />

cr lf<br />

: value cr lf<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-15<br />

Header<br />

lines<br />

Entity<br />

body


8-16


HTTP Protocol Headers (3)<br />

Request header format (cont’d.)<br />

— header lines<br />

General header lines, e.g.<br />

Connection (e.g. „close“ for non-persistent connection), Date, MIME-Version,…<br />

Pragma (e.g. „no-cache“), Referer, User-Agent, Cookie, …<br />

Request header lines, e.g.<br />

Authorization ( sent if required for access to requested object),<br />

From, If-Modified-Since, …<br />

Entity header lines, e.g.<br />

Content-Encoding, Content-Length, Content-Type, …<br />

— entity body: request parameters, e.g.<br />

form data<br />

click coordinates<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-17


8-18


HTTP Protocol Headers (4)<br />

Request header format (cont’d.)<br />

— Request encodings<br />

GET<br />

GET /getPhoneNumber?name=Reuter HTTP/1.0<br />

POST<br />

POST /getPhoneNumber HTTP/1.0<br />

Content-Type: www-form-url-encoded<br />

Content-Length: 11<br />

name=Luttenberger<br />

XML<br />

POST /getPhoneNumber HTTP/1.0<br />

Content-Type: text/xml<br />

Content-Length: 19<br />

Luttenberger<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-19


8-20


HTTP Protocol Headers (5)<br />

HTTP Response header format<br />

http version sp status code sp reason cr lf Status line<br />

header field name : value cr lf<br />

…<br />

…<br />

header field name<br />

cr lf<br />

: value cr lf<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-21<br />

Header<br />

lines<br />

Entity<br />

body


8-22


HTTP Protocol Headers (6)<br />

HTTP Response header format (cont’d.)<br />

— Status Line<br />

SP Status-Code 2xx − 5xx<br />

SP Reason-Phrase (human readable explanation)<br />

CRLF<br />

2xx successful<br />

3xx redirection (Der Client muß seinen Request an anderer Stelle vortragen)<br />

4xx client error<br />

5xx server error<br />

— Header lines<br />

General header lines<br />

Response header lines, e.g.<br />

Location (redirection), Server, WWW-Authenticate, Set-Cookie, …<br />

Entity header lines<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-23


8-24


HTTP Dialogues (1)<br />

Authentication<br />

Client Server<br />

http request →<br />

←<br />

http response status 401<br />

WWW authenticate:<br />

http request<br />

Authorization: →<br />

← http response status 200<br />

http request<br />

Authorization: →<br />

← http response status 200<br />

— Authentication goal: control access<br />

to server documents<br />

— stateless: client must present authorization<br />

in each request<br />

— authorization: typically name, password<br />

— authorization: header line in request<br />

— if no authorization presented,<br />

server refuses access,<br />

sends WWW authenticate:<br />

header line in response<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-25


8-26


HTTP Dialogues (2)<br />

Cookies<br />

Client Server<br />

http request →<br />

←<br />

http response status 200<br />

Set-cookie: #<br />

← http response status 200<br />

← http response status 200<br />

http request<br />

Cookie: # →<br />

http request<br />

Cookie: # →<br />

— Cookie purpose: help server to remember<br />

client authentication data, user preferences,<br />

previous choices, …<br />

— server sends “cookie” to client<br />

in response message<br />

Set-cookie: 1678453<br />

— client presents cookie in later requests<br />

Cookie: 1678453<br />

— server matches presented cookie with<br />

server-stored info<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-27


8-28


HTTP Dialogues (3)<br />

Conditional GET request<br />

Client Server<br />

http request<br />

If-modified-since: →<br />

←<br />

←<br />

http response status 304<br />

Not Modified<br />

http request<br />

If-modified-since: →<br />

http response status 200<br />

datadatadataS<br />

— Goal: don’t send object if client has<br />

up-to-date stored (cached) version<br />

— client: specify date of cached copy in http<br />

request: If-modified-since: <br />

— server: response contains no object if<br />

cached copy up-to-date:<br />

HTTP/1.0 304 Not Modified<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 8-29


8-30


80-webServ-XML.fm<br />

WEB SERVICES<br />

9. EXTENSIBLE MARKUP<br />

LANGUAGE (XML)<br />

1. Einführung/Problemstellung<br />

2. XML — die wichtigsten Konzepte<br />

3. Dokumentenmodell<br />

4. Exkurs: URI<br />

5. Syntax<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel


Recommended reading<br />

[1] Holzner, St.:<br />

Inside XML.<br />

Indianapolis (New Riders) 2001, ISBN 0-7357-1020-1.<br />

[2] Eberhart, A., Fischer, St.:<br />

Java-Bausteine für e-Commerce-Anwendungen.<br />

München, Wien (Hanser) 2000, ISBN 3-446-21372-4.<br />

[3] Abiteboul, S., Buneman, P., Suciu, D.:<br />

Data on the Web.<br />

San Francisco (Morgan Kaufmann) 2000, ISBN 1-55860-622-X.<br />

[4] Tolksdorf, R.:<br />

XML und darauf basierende Standards: Die neuen Auszeichnungssprachen des Web.<br />

Informatik Spektrum, vol. 22 (1999), pp. 407–421.<br />

[5] W3C (Ed.):<br />

Extensible Markup Language (XML) 1.0 (Second Edition), W3C Recommendation 6 October 2000.<br />

http://www.w3c.org/XML/<br />

9-2


Einführung/Problemstellung (1)<br />

der Umgang mit „Information“ in der „Informationsgesellschaft“<br />

— Generierung neuer Information: ≈ 20% des Bruttosozialprodukts<br />

— ca. 90% der Information: in Dokumenten (nicht in Datenbanken)<br />

— Aufwandsanteile bei der Dokumentenerstellung<br />

ca. 30%: Informationssammlung<br />

ca. 40%: Aufbereitung des Inhalts<br />

ca. 30%: Formatierung für den Ausdruck auf Papier<br />

— Papierdokumente: eine Sackgasse!<br />

— Herausforderungen für die Zukunft<br />

durchgängige elektronische Dokumentenverteilung<br />

formatunabhängige Dokumentenverteilung u. -speicherung<br />

dauerhafte Dokumentenspeicherung<br />

(aus einem WWW-Dokument der Arbortext Inc. zu SGML)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-3


9-4


Einführung/Problemstellung (2)<br />

Definition eines einheitlichen Formats für die<br />

— Übertragung<br />

— Verarbeitung von Dokumenten<br />

— Speicherung<br />

— Präsentation (nach entsprechender Transformation)<br />

aufbauend auf der Trennung von<br />

— Inhalt<br />

— Struktur von Dokumenten<br />

— Layout<br />

erforderlich: flexibles Markup-Konzept<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-5


9-6


Einführung/Problemstellung (3)<br />

Probleme von HTML<br />

— keine inhaltsorientierte Auszeichnung<br />

z.B. HTML hat inhaltsorientierte und layoutorientierte Tags:<br />

↔ <br />

layoutorientierte Tags ungeeignet für Extraktion von Daten aus Dokumenten<br />

— fixer Vorrat an Tags<br />

keine wählbare „Granularität“ der Beschreibung, z.B.<br />

Norbert Luttenberger<br />

oder<br />

Norbert<br />

Luttenberger<br />

— unterschiedliche Interpretationen durch Browser<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-7


9-8


XML — die wichtigsten Konzepte (1)<br />

Hintergrund der XML-Entwicklung<br />

— Standard Generalized Markup Language (SGML)<br />

ISO 8879, entwickelt 1986<br />

komplex, schwierig zu beherrschen, Spezifikation umfaßt 155 Seiten<br />

bislang kein umfassender Erfolg, nur wenige Tools (z.B. FrameMaker)<br />

— HyperText Markup Language (HTML)<br />

eine Anwendung von SGML<br />

kann als „Standard“ für GUIs gesehen werden<br />

viele Tools<br />

— EXtensible Markup Language (XML)<br />

World Wide Web Consortium (W3C), Spez. Version 1.0, 1998<br />

eine Untermenge von SGML<br />

Spezifikation mit 45 Seiten<br />

Basis für zahlreiche Innovationen, u.a. Web Services Middleware<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-9


Hintergrund der XML-Entwicklung<br />

„There is a real relationship between HTML and XML; both are based on Standard Generalized Markup Language (SGML). As its name<br />

implies, SGML is a very general markup language, with enormous capabilities. Because of the large number of things you can do with<br />

SGML, however, it can be very difficult to learn, and it hasn’t caught on in general use. XML is actually an easier-to-use subset of SGML<br />

(and technically speaking, HTML is called an application of SGML). You can read more about the relationship between SGML and XML at<br />

www.w3c.org/TR/NOTE-sgml-xml.“ (Holzner, S. 2)<br />

9-10


XML — die wichtigsten Konzepte (2)<br />

Was XML nicht ist …<br />

— XML ist keine Auszeichnungssprache für das WWW.<br />

stattdessen: XML definiert ein baumförmiges Dokumentenmodell und<br />

eine Notation für Markup-Sprachen.<br />

— XML ist keine Datenbeschreibungssprache.<br />

aber: XML-basierte Sprachen <strong>zur</strong> Beschreibung der Grammatik<br />

von Dokumenten, z.B. die W3C XML Schema Definition Language<br />

— XML ist keine neue Abfragesprache für Datenbanken.<br />

aber: XML-basierte Query Languages, z.B. XQuery<br />

— XML ist kein neues Datenformat für Textsysteme.<br />

aber: XML-basierte Sprachen <strong>zur</strong> Dokumententransformation, z.B. XSL(T);<br />

Anwendung unter Einschluß von Style Sheets z.B. in Open Office<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-11


Was XML nicht ist …<br />

„Mit diesem Begriff fängt gleichzeitig die Begriffsverwirrung an: XML ist keine erweiterbare Auszeichnungssprache – sie ist eine standardisierte<br />

Sprache, in der sich die Syntax von Auszeichnungssprachen notieren lässt. Formaler ausgedrückt ist XML eine Metagrammatik für<br />

kontextfreie Grammatiken – also die Grammatik einer Sprache mit der sich die Regeln von Grammatiken notieren lassen. … Diese Grammatikdefinition<br />

wird im XML-Umfeld DTD („Document Type Definition“) genannt.“ (Tolksdorf, S. 408)<br />

9-12


XML — die wichtigsten Konzepte (3)<br />

vier elementare Konzepte<br />

1. logische Strukturierung von Daten<br />

anwendungsspezifische, inhaltsorientierte Auszeichnung von Dokumenten<br />

2. selbstbeschreibende Strukturierung<br />

eine vollgeklammerte Sprache:<br />

Alle Elemente eines Dokuments sind in Klammern (engl. tags) eingeschlossen,<br />

die Metainformation <strong>zur</strong> Dokumentenverarbeitung liefern.<br />

3. Semistrukturiertheit<br />

Variationen der Struktur von Elementen eines Dokuments sind zulässig.<br />

Bsp.: In einer Struktur Adresse können<br />

0 … n Elemente Telefonnummer auftauchen<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-13


9-14


XML — die wichtigsten Konzepte (4)<br />

vier elementare Konzepte (Forts.)<br />

4. (optionale) Angabe einer kontextfreien Baumgrammatik („Schema“) für das Dokument<br />

oder<br />

in einer Document Type Definition (DTD)<br />

im Dokument enthalten oder extern (ganz oder teilweise),<br />

formuliert als Document Type Declaration:


9-16


XML — die wichtigsten Konzepte (5)<br />

Verarbeitung von XML-Dokumenten<br />

Dokument<br />

Parser<br />

syntakt. Korrektheit:<br />

well-formed XML doc.<br />

XSL(T)-<br />

Prozessor<br />

Schema<br />

Style Sheet<br />

validierender<br />

Parser<br />

grammat. Korrektheit:<br />

valid XML doc.<br />

Ausgabe<br />

auf Endgerät<br />

XSL(T)-<br />

Prozessor<br />

Extensible<br />

Style Sheet Lang.<br />

(Transformations)<br />

transformiertes<br />

Dokument<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-17


9-18


Dokumentenmodell (1)<br />

vorab: ein einfaches Beispieldokument<br />

<br />

<br />

<br />

<br />

Norbert Luttenberger<br />

<br />

Universit&#228;t Kiel<br />

Luttenberger<br />

Norbert<br />

Prof. Dr.-Ing.<br />

<br />

Christian-Albrechts-Platz 4<br />

24098<br />

Kiel<br />

<br />

0431-880-7291<br />

0173-2036632<br />

nl@informatik.uni-kiel.de<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-19


9-20


Dokumentenmodell (2)<br />

Beispieldokument (Forts.)<br />

<br />

<br />

Luttenberger<br />

Norbert<br />

<br />

<br />

203040<br />

24105<br />

Kiel<br />

<br />

0431-8888235<br />

0173-2036632<br />

<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-21


9-22


Dokumentenmodell (3)<br />

Baumstruktur<br />

eigner<br />

adressbuch<br />

eintrag<br />

+<br />

?<br />

?<br />

*<br />

firma name portrait adresse kontakt<br />

seq. nachname<br />

choice<br />

vorname<br />

titel<br />

?<br />

?<br />

Kardinalität (→ Semistrukturiertheit):<br />

+ ein oder mehrere Elemente<br />

? null oder ein Element<br />

* null oder mehrere Elemente<br />

strasse |<br />

postfach<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-23<br />

plz<br />

?<br />

?<br />

stadt<br />

tel<br />

?<br />

?<br />

email<br />

fax<br />

?<br />

?<br />

?


9-24


Dokumentenmodell (4)<br />

Dokumentenbaum mit unterschiedlichen Arten von Knoten; die wichtigsten:<br />

— element:<br />

Each XML document contains one or more elements, the boundaries of which are either<br />

delimited by start-tags and end-tags, or, for empty elements, by an empty-element tag.<br />

Each element has a type, identified by name, sometimes called its "generic identifier"<br />

(GI), and may have a set of attribute specifications. An element type declaration constrains<br />

the element’s content. Element type declarations often constrain which element<br />

types can appear as children of the element.<br />

Beispiele: Luttenberger<br />

Norbert<br />

Luttenberger<br />

ist gleichbedeutend mit <br />

— document element:<br />

There is exactly one element, called the root, or document element, no part of which<br />

appears in the content of any other element. For all other elements, if the start-tag is in the<br />

content of another element, the end-tag is in the content of the same element. More simply<br />

stated, the elements, delimited by start- and end-tags, nest properly within each other.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-25


9-26


Dokumentenmodell (5)<br />

die wichtigsten Arten von Knoten im XML-Dokumentenbaum (Forts.)<br />

— content:<br />

The text between the start-tag and end-tag is called the element’s content.<br />

simple content: parsed character data<br />

unparsed character data („CDATA section“)<br />

complex content: element content with different content models:<br />

sequence, choice, union, all<br />

mixed content<br />

An element type has element content when elements of that type must contain only child<br />

elements (no character data), optionally separated by white space. In this case, the constraint<br />

includes a content model, a simple grammar governing the allowed types of the<br />

child elements and the order in which they are allowed to appear. The grammar is built on<br />

content particles, which consist of names, choice lists of content particles, or sequence<br />

lists of content particles. (Further content models defined in W3C XML Schema.)<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-27


9-28


Dokumentenmodell (6)<br />

die wichtigsten Arten von Knoten im XML-Dokumentenbaum (Forts.)<br />

— attribute:<br />

Attributes are used to associate name-value pairs with elements. Attribute specifications<br />

may appear only within start-tags and empty-element tags. Note that the order of attribute<br />

specifications in a start-tag or empty-element tag is not significant. No attribute name may<br />

appear more than once in the same start-tag or empty-element tag. XML attribute types<br />

are of three kinds: a string type, a set of tokenized types, and enumerated types. The<br />

string type may take any literal string as a value; the tokenized types have varying lexical<br />

and semantic constraints. Enumerated attributes can take one of a list of values provided<br />

in the declaration.<br />

Beispiel: <br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-29


9-30


Dokumentenmodell (7)<br />

die wichtigsten Arten von Knoten im XML-Dokumentenbaum (Forts.)<br />

— comment:<br />

Comments may appear anywhere in a document outside other markup. They are not part<br />

of the document’s character data; an XML processor may, but need not, make it possible<br />

for an application to retrieve the text of comments. For compatibility, the string "--"<br />

(double-hyphen) must not occur within comments.<br />

— processing instructions:<br />

Processing instructions (PIs) allow documents to contain instructions for applications. PIs<br />

are not part of the document’s character data, but must be passed through to the application.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-31


9-32


Dokumentenmodell (8)<br />

die wichtigsten Arten von Knoten im XML-Dokumentenbaum (Forts.)<br />

— namespace:<br />

Zur Unterscheidung gleicher Namen können Namen mit einem sog. name space prefix<br />

versehen werden. Dieser Präfix steht als „Abkürzung“ für einen Universal Resource Identifier<br />

(URI). Schreibweise: prefix:name<br />

Bindung des prefix an einen URI über ein spezielles Attribut: das xmlns-Attribut, z.B.<br />

<br />

<br />

<br />

<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-33


9-34


Exkurs: URI (1)<br />

— RFC-2396:<br />

„A Uniform Resource Identifier (URI) is a compact string of characters for identifying an<br />

abstract or physical resource. A resource can be anything that has identity. Familiar<br />

examples include an electronic document, an image, a service (e.g., "today's weather<br />

report for Los Angeles"), and a collection of other resources. … The resource is the conceptual<br />

mapping to an entity or set of entities, not necessarily the entity which corresponds<br />

to that mapping at any particular instance in time. Thus, a resource can remain<br />

constant even when its content – the entities to which it currently corresponds – changes<br />

over time, provided that the conceptual mapping is not changed in the process.<br />

An identifier is an object that can act as a reference to something that has identity. In the<br />

case of URI, the [identifier] is a sequence of characters with a restricted syntax. Having<br />

identified a resource, a system may perform a variety of operations on the resource, as<br />

might be characterized by such words as ’access', ’update', ’replace', or ’find attributes'.<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-35


9-36


Exkurs: URI (2)<br />

— RFC-2396 (Forts.):<br />

A URI can be further classified as a locator, a name, or both.<br />

The term "Uniform Resource Locator" (URL) refers to the subset of URI that identify<br />

resources via a representation of their primary access mechanism (e.g., their network<br />

"location"), rather than identifying the resource by name or by some other attribute(s) of<br />

that resource.<br />

The term "Uniform Resource Name" (URN) refers to the subset of URI that are required to<br />

remain globally unique and persistent even when the resource ceases to exist or becomes<br />

unavailable.“<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-37


9-38


Dokumentenmodell (3)<br />

zusammenfassende Übersicht<br />

document<br />

element<br />

element<br />

namespace<br />

comment<br />

attribute<br />

processing<br />

instruction<br />

content<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-39


9-40


Syntax (1)<br />

nur einige wichtige Regeln<br />

— Groß- und Kleinbuchstaben werden unterschieden: case-sensitive<br />

— Wert eines Attributs muß in Anführungszeichen gesetzt werden.<br />

— Bildung von Namen:<br />

Name ::= (Letter | ':' | '_' )(NameChar)*<br />

Letter ::= BaseChar | Ideographic<br />

-- "Letters are characters that are used to write words." --<br />

NameChar ::= Letter | Digit | ':' | '_' | '.' | '-'<br />

Digit ::= [0–9]<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-41


9-42


Syntax (2)<br />

wohlgeformte XML-Dokumente<br />

1. Das Dokument als ganzes genügt der folgenden Produktion:<br />

document ::= prolog element Misc*<br />

Folge von<br />

Prolog (optional): enthält die XML-Deklaration (optional)<br />

und die DTD (bzw. einen Verweis auf eine DTD) (optional)<br />

das Wurzel-Element (kann rekursiv weitere Elemente enthalten)<br />

optionale weitere Angaben, z.B. Kommentare<br />

2. Es werden alle well-formedness constraints (WFCs) berücksichtigt.<br />

Angabe der XML-Grammatik in einer EBNF mit<br />

zusätzlichen Einschränkungen → WFCs (in Klartext formuliert)<br />

3. Alle referenzierten entities sind wohlgeformt.<br />

Entities sind weitere interne/externe/vordefinierte Text-/Datenobjekte:<br />

Einbringen in das jeweilige XML-Dokument per textueller Ersetzung<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-43


9-44


Syntax (3)<br />

Prolog<br />

— xml-Deklaration (optional)<br />

Misc<br />

XMLDecl ::= ’’<br />

VersionInfo gibt die Version der benutzten XML-Spec. an<br />

EncodingDecl gibt den verwendeten Zeichensatz an<br />

SDDecl standalone-Deklaration: ein SD-Dokument enthält unmittelbar<br />

alle erforderlichen Deklarationen<br />

Beispiel: <br />

(UTF-8 ist eine Zeichenkodierung für das Unicode-System; Kodierung mit n × 8 bit mit n=1…4;<br />

Voreinstellung für XML)<br />

— Kommentare, z.B. <br />

— Verarbeitungsanweisung (Processing Instructions, PI):<br />

werden unbearbeitet an die genannte Applikation weitergereicht:<br />

<br />

Communication Systems Research Group Prof. Dr.-Ing. Norbert Luttenberger<br />

Computer Science Dept., CAU Kiel 9-45


9-46

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!