Kommunikationssysteme Teil 2.2 – Aufbau und Entwurf von P rotokollen

40
Informatik Master, PM2100.1, 2013 Kommunikationssysteme, Teil 2.2, S. Rupp Kommunikationssysteme Teil 2.2 – Aufbau und Entwurf von Protokollen Stephan Rupp Informatik Masterstudium www.dhbw-stuttgart.de

description

Kommunikationssysteme Teil 2.2 – Aufbau und Entwurf von P rotokollen. Stephan Rupp Informatik Masterstudium. www.dhbw-stuttgart.de . Inhalt. Aufbau und Entwurf von P rotokollen Protokolle Entwicklung und Test Protokollanalysator. Protokollschichten. - PowerPoint PPT Presentation

Transcript of Kommunikationssysteme Teil 2.2 – Aufbau und Entwurf von P rotokollen

Page 1: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp

KommunikationssystemeTeil 2.2 – Aufbau und Entwurf von ProtokollenStephan RuppInformatik Masterstudium

www.dhbw-stuttgart.de

Page 2: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 2

Inhalt

Aufbau und Entwurf von Protokollen

• Protokolle

• Entwicklung und Test

• Protokollanalysator

Page 3: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 3

Protokollschichten

Prinzip: Schichtung von Diensten

Schicht N + 1nutzt …

… Dienst derSchicht N

Page 4: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 4

Referenzmodell der ISO-OSI

Endsysteme und Übertragungssysteme

Page 5: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 5

ISO-OSI Referenzmodell

Funktionen der Protokollschichten

Page 6: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 6

OSI – Modell für Systeme

Anw

endu

ngen

Net

zwer

k

Page 7: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 7

Ebenen om OSI Referenzmodell

Management Plane:

Systemadministration

(OSS/NMS)

Control Plane: Steuerung

User Plane: Daten

OSS: Operation Support System, Betriebsführungssystem NMS: Network Management System, Leitsystem

Page 8: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 8

Anfragen auf Dienstebene

Dienstanbieter (Service Provider) leitet Anfragen weiter

Page 9: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 9

Innerhalb der Anwendungsknoten

SDU: Service Date Unit

PDU: Protocol Data Unit

Page 10: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 10

Hierarchie der Nachrichten

Protocol Data Units als komplette Nachricht der Schicht

• (N) PDU = (N) SDU + (N) PCI

• (N) SDU = (N+1) PDU

SDU: Service Date Unit

PDU: Protocol Data Unit

PCI: Protocol Control Information

Page 11: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 11

Kommunikationsprozess

Nachrichten und Zustandsänderungen

PaketkopfPaketinhaltQuelle: Gerd Siegmund

Prozess: Zustandsautomat(Finite State Machine)

PDU

Page 12: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 12

Beispiel: Client - Server Kommunikation

Client und Server als ZustandsautomatenZustände (States):0: Disconnected (DISC)1: Waiting (WAIT)2: Connected (CONN)

Zustandsübergänge (Transitions):+/-1: send/receive Connect

Request (Creq)+/-2: send/receive Connect

Acknowledge (Cack)+/-3: send/receive Disconnect

Request (Dreq)

Page 13: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 13

Zustandsdiagramm

Nachrichten lösen Zustandsänderungen aus

• Gleiches Konzept wie bei UML Zustandsdiagrammen (State Diagram)

Page 14: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 14

Beispiel: Client-Server in SDL Notation

SDL: Service Description Language (vergleichbar mit Aktivitätsdiagramm bei UML)

Zustand

Nachricht empfangenNachricht

senden

Nachricht empfangen(warten auf Benutzer)

Zustand

Page 15: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 15

Beispiel: Sequenzdiagramm

Message Sequence Diagram entspricht Sequenzdiagramm bei UML (Nachricht senden = Methode aufrufen)

Page 16: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 16

Formale Validierung

Formale Validierung

ist in sehr einfachen

Fällen durch

Berücksichtigung

globaler Zustände

möglich.

Page 17: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 17

Beispiel: Client-Server Kommunikation

Kriterien zur Validierung:• gegenseitige Blockierung

(Deadlock): Pfade ohne Ausgang

• unspezifizierte Signale (ohne Empfang)

• Nicht auführbare Zustände (Zustand ist nicht erreichbar)

• Mehrdeutige Zustände (Zustand wird durch unterschiedliche Ereignisse erreicht)

Page 18: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 18

Inhalt

Aufbau und Entwurf von Protokollen

• Protokolle

• Entwicklung und Test

• Protokollanalysator

Page 19: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 19

Planen und Bauen

Top-Down Prozess

Bottom-UpProzess

Modell

Code

Planung und Design: Transformationen eines Modells

Bauen: Transformationen eines Codes

(OpenSource: Code als Modell)

Page 20: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 20

Implementierung und Tests

System-anforderungen

FunktionaleAnforderungen

DesignAnforderungen

Implementierungder Module

Implementierung der Units

white box

black box

Software-Entwickler

Unit- Tests

Modul- tests

Integrations- tests

FunktionaleTests

System-tests

Implementierung und Test

V-ModellSpezifikation und Test

Page 21: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 21

Hardware Architektur

Controller (Host)

Schnittstelle(Communication Controller)

Page 22: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 22

Software Architektur

Controller (Host)

Schnittstelle(Communication Controller)

Page 23: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 23

Modell einer Protokollschicht

Schicht N als Dienstleister (Service Provider) für Schicht N+1

Page 24: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 24

Protokolltests

Ereignisse und Statustabellen (Event State Tables)

Page 25: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 25

Protokolltests

Referenz und Prüfling einer Protokollschicht

Referenz Prüfling

Page 26: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 26

Konformitätstests

Mit externem Protokolltester

FSM: Finite State Machine, Zustandsautomat ASP: Abstract Service Primitives

Page 27: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 27

Realer Testaufbau

Protokollschicht Testfälle (Test Cases)

Emulation der unteren Protokoll-

schichten

Prüfling(System under Test)

Testsystem(Protokolltester)

PDU

ASP

PDU: Packet Data Unit ASP: Abstract Service Primitives

Simulator Trace

Full Trace

Page 28: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 28

Anwendungstests

Editor

AnwendungSkript

Testumgebung

Entwicklungs-system & Emulator

Zielsystem

Test Case

Input

record inputs

play backError

situations

Events

Test report

Screen shots

laden

programmieren und testen

Page 29: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 29

Inhalt

Aufbau und Entwurf von Protokollen

• Protokolle

• Entwicklung und Test

• Protokollanalysator

Page 30: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 30

Protokollschichten

Page 31: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 31

Signalisierung und Verbindung

VoIP mit Session Initiation Protokoll (SIP)

Page 32: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 32

Protokollanalysator einsetzen

Übungen mit Wireshark

• Wireshark installieren und eigenen Verkehr mitschneiden

Siehe auch: SIP Labor

Page 33: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 33

Protokollanalysator einsetzen

Aufbau einer SIP-Nachricht – Anfrage (Request)

SP: Leerzeichen (Space)

Page 34: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 34

Protokollanalysator einsetzen

Aufbau einer SIP-Nachricht – Antwort (Response)

Page 35: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 35

Protokollanalysator einsetzen

Ablauf einer SIP-Transaktion

Verbindungsaufbau

Verbindungsabbau

Verbindung

Page 36: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 36

Protokollanalysator einsetzen

Aufzeichnung mit Wireshark (Beispiel)

Page 37: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 37

Protokolle manipulieren

Beispiel: ARP Poisoning

• Sicherheitslücke: zustandsloses Protokoll

• Beschreibung des Szenarios siehe:

http://www.oxid.it/downloads/apr-intro.swf

• Protokollwerkzeug Cain & Abel, siehe:

http://www.oxid.it/downloads/cain20.exe

Page 38: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 38

Protokolle absichern

Fehlerfälle und Sicherheitsmaßnahmen

  Maßnahme      Fehler

Sequenz Nummer

Watchdog Connection ID CRC (Prüfsumme) Berechnung

Unbeabsichtigte Wiederholung x     xVerlust x x   xEingefügte Nachricht x     xInkorrekte Sequenz x     xVerfälschung       xUnakzeptable Verzögerung   x    

Maskerade   x   x

Memory Fehler in Switches x     x

Inkorrekte Weiterleitung zwischen Segmenten     x  

Page 39: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 39

Funktionale Sicherheit (engl. Safety)

• Ziel: Gefahren für Menschen und Umwelt durch Maschinen und Anlagen vermeiden.

• Risiko = Schadenshäufigkeit * Schadensausmaß

• Prinzip: Senkung des Risikos auf ein akzeptables Maß durch Sicherheitsmaßnahmen.

Maschinen und Anlagen sind derart auszulegen, dass Fehler und Defekte keine Gefährdung nach sich ziehen.

Risiko ohne Schutzmaßnahme

< akzeptables RisikoRisiko mit

Schutzmaßnahme

Page 40: Kommunikationssysteme Teil  2.2 –  Aufbau  und  Entwurf  von  P rotokollen

Informatik Master, PM2100.1, 2013Kommunikationssysteme, Teil 2.2, S. Rupp 40

Kommunikationssysteme

ENDE Teil 2.2

Aufbau und Entwurf von Protokollen