19
1 BEEP – The Blocks Extensible Exchange Protocol Fangming Xu TECHNISCHE UNIVERSITÄT ZU BRAUNSCHWEIG CAROLO-WILHELMINA I nstitut für B etriebssysteme und R echnerverbund http://www.tu-bs.de http://www.ibr.cs.tu-bs.de BEEP The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar Wintersemester 2002/2003 Betreuer: Frank Strauß

The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

1BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

BEEPThe Blocks Extensible Exchange Protocol Core

KM-/VS-SeminarWintersemester 2002/2003

Betreuer: Frank Strauß

Page 2: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

2BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Übersicht

EinleitungKonzepte von BEEP

Nachrichtaustausch

Frames

Sitzungsverwaltung

Abbildung auf TCP

Implementierungsbeispiel: Java BEEPZusammenfassung

Page 3: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

3BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Einleitung

BEEP – Ein Framework für AnwendungsprotokolleProbleme bei Entwürfen neuer Internetanwendungen

RFC 3080 und RFC 3081, IETF

Zielsetzung von BEEPVerbindungsorientierung,

Nachrichtenorientierung und

Asynchronität.

Page 4: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

4BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Konzepte von BEEP

BEEP implementiert Peer-to-Peer-Prinzip.Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder mehr gleichberechtigten Endpunkten.

Funktionalitäten von BEEP:Trennen einer Nachricht von der Nächsten (Framing),

Kodierung der Nachrichten,

Unterstützung mehrfacher logischer Kommunikationskanäle,

Fehlerbehandlung,

Aushandlung von Verschlüsselungsparametern,

Aushandlung von Authentisierungsparametern.

Page 5: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

5BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Nachrichtaustausch

RollenListener – wartet auf eine eingehende Verbindung und

Initiator – will eine Verbindung zum Listener erstellen,

Client – löst Datenaustausch aus (Request) und

Server – reagiert auf Request (Response).

Exchange Stylesmessage/reply,

message/error und

message/answer

Page 6: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

6BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Frames

Beschreibung der Inhaltstypen in der Regel durch MIME-Kopf- „entity-headers“. Defaultwerte:

Content-Type: application/octet-stream

Content-Transfer-Encoding: binary

Beschreibung der Nachrichten in der Regel durch XML.Nachrichteninhalt: XML-Element,

Profile: DTD.

Page 7: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

7BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Frame Syntax

data-frame headermessage data-

frame payload trailer

payload

OCTET

trailerEND CR LF

type = “MSG“ / “RPY“ / “ANS“ / “ERR“ / “NUL“channel = 0..231-1

msgno = 0..231-1

more = “*“ / “.“seqno = 0..232-1

size = 0..231-1

ansno = 0..231-1

ackno = seqnowindow = size

seq-frame

seq-frame

SP channel SP ackno SP window CR LF“SEQ“

typeheader

SP channel SP msgno SP more SP

seqno SP size CR LF

ansno SP

Page 8: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

8BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Frame Semantics

Kanalspezifische Semantik – In der Channel-Profile werden definiet:

Initialisierungsnachricht,Nachricht in der Nutzlast undNachrichtensemantik.

Ein Beispiel:S: MSG 0 1 . 52 720

S: Content-Type: application/beep+xml

S:

S: ...

S: END

0

Page 9: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

9BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Sitzungsverwaltung

session

.

.

.

.

channel 0 (management)

channel 1 (profile A)

channel n (profile P, Q)

Eine Sitzung besteht normalerweise aus mehreren Kanälen.Kanal 0: Verwaltungskanal.Weitere Kanäle spezifiziert durch Profile.

Page 10: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

10BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Sitzungsverwaltung

ProfileEin Profile stellt dar, welche Nachrichten über den Kanal übertragen werden sollen/können.Ein Profile ist durch einen URI identifiziert und regelt die Syntax und Semantik zugelassener Nachrichten.

Vordefinierte Profile für:Channel Management (Kanal 0)TLS – „Transport Layer Security“

uri = http://iana.org/beep/TLS

User Authentification: SASL Familyuri = http://iana.org/beep/SASL/mechanism

Weitere anwendungsspezifische ProfileSOAP, RFC 3288…

Page 11: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

11BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Sitzungsverwaltung

NachrichtenNachrichten werden repräsentiert durch XML-Elemente.Fünf Grundtypen von Nachrichtenelementen für Sitzungsverwaltung.Beziehungen zwischen Rollen, Nachrichtenarten und Nachrichtenelementen:

errorokcloseI oder L

errorprofilestartI oder L

errorgreetingI und L

ERRRPYMEGRolle

Page 12: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

12BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

SitzungsverwaltungGreeting-NachrichtenL: RPY 0 0 . 0 98L: Content-Type: application/beep+xmlL: <greeting>L: <profile uri=’http://iana.org/beep/TLS’ />L: </greeting>L: ENDI: RPY 0 0 . 0 47I: Content-Type: application/beep+xmlI: <greeting />I: END

Start-NachrichtenC: RPY 0 1 . 30 169C: Content-Type: application/beep+xmlC:C: <start number=’1’>C: <profile uri=’http://iana.org/beep/SASL/OTP’ />C: <profile uri=’http://ibr.cs.tu-bs.de/fangming/MYCONTACT’ />C: </start>C: END

Page 13: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

13BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Sitzungsverwaltung

C: RPY 0 2 . 390 66C: Content-Type: application/beep+xmlC: <close number=’1’ code=’200’ />C: ENDS:S: RPY 0 2 . 210 75S: Content-Type: application/beep+xmlS: <error code=’550’>still working</error>S: END

S: RPY 0 2 . 211 42S: Content-Type: application/beep+xmlS:S: <ok />S: END

Close-, Error-/OK-Nachrichten

Page 14: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

14BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Abbildung auf TCP

TCP A TCP BCLOSEDCLOSED

OPEN-Active OPEN-PassiveSYN, …

SYN+ACK, …OPEN-Success

ESTABLISHED OPEN-Success

ESTABLISHED

ACK, …

.

.

.

…, <close number=’1’>

BEEP Peer A BEEP Peer BInitiator Listener

RECEIVE (<close>)

SEND (<ok>)

SEND (<close>)

RECEIVE (<ok>)

CLOSE

…, <ok>

FIN, … CLOSING

CLOSEACK, …

FIN, …TERMINATETERMINATEACK, …CLOSED

CLOSED

Page 15: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

15BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Abbildung auf TCP

TCP A TCP B

ESTABLISHED ESTABLISHED

SEND (<profile>)

SEND (<start>)

RECEIVE (<profile>) …, <profile url=’…’>

.

.

.

BEEP Peer A BEEP Peer BClient Server

…, <start number=’1’> RECEIVE (<start>)

.

.

.

initial channel 1successful

SEND (<error>)

SEND (<start>)

RECEIVE (<error>) …, <error code=’550’>

…, <start number=’2’> RECEIVE (<start>)

initial channel 2unsuccessful

SEND (<greeting>)

SEND (<greeting>)

RECEIVE (<greeting>) …, <greeting>

…, <greeting> RECEIVE (<greeting>)

SEND (<query>)

…, <query uid=’fm007’> RECEIVE (<query>)

search person RECEIVE (<person>) …, <person tel#=’…’>

.

.

.

Page 16: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

16BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Implementierungsbeispiel: Java BEEP

Session Channel...sendMSG()getProfile()getSession()...

1..*

1

Message...getChannel()getMsgno()getAnsno()sendMSG()sendRPY()sendANS()sendERR()sendNUL() ...

1

Reply...getNextReply()hasNext()receiveRPY()receiveERR()receiveANS()receiveNUL()

TLSProfile...init()...

Profile<<interface>>

init()

1..*

...firedChannelClose()firedChannelStarted()getProfileRegistry()startChannel() sendProfile()...

SASLProfile...init()...

implem

ents

1..*

implements

Page 17: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

17BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Implementierungsbeispiel: Java BEEP

Client

Page 18: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

18BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Implementierungsbeispiel: Java BEEP

Server

Page 19: The Blocks Extensible Exchange Protocol Core KM-/VS-Seminar · Konzepte von BEEP BEEP implementiert Peer-to-Peer-Prinzip. Peer-to-Peer: bilaterale Kommunikation zwischen zwei oder

19BEEP – The Blocks Extensible Exchange ProtocolFangming Xu

TECHNISCHE UNIVERSITÄT

ZU BRAUNSCHWEIGCAROLO-WILHELMINA

Institut für Betriebssysteme und Rechnerverbundhttp://www.tu-bs.de http://www.ibr.cs.tu-bs.de

Zusammenfassung

BEEP ist ein Framework für Anwendungsprotokoll.Asynchronität,

XML Nachrichtenformate,

Unterstützt Peer-toPeer-, Client/Server- und Server-to-Server-Kommunikation,

Profile für standardisierte und spezifische Anwendungen.

Der „Missbrauch“ von HTTP für Anwendungsprotokolle kann durch BEEP elegant abgelöst werden. BEEP Home - http://www.beepcore.org