Top Banner
© UNI Hannover, Institut für Allgemeine Nachrichtentechnik Institut für Kommunikationstechnik www.ikt.uni-hannover.de Protokolle der OSI-Schicht 4 Transportschicht Kapitel 9.1 Netze und Protokolle Dr.-Ing. Jan Steuer
29
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

Institut für Kommunikationstechnikwww.ikt.uni-hannover.de

Protokolle der OSI-Schicht 4Transportschicht

Kapitel 9.1

Netze und ProtokolleDr.-Ing. Jan Steuer

Page 2: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(3)

LLC (802.2)CSMA/CD (802.3) Token-Ring (802.5)

SLIP PPP X.25

IP, ICMP, GGPTCP UDP

Telnet FTP SMTP DNS NFS

TransportLayer

NetworkLayer

LinkLayer

ApplicationLayer

Example: Transport Layer in the Internet (TCP, UDP)

TCP (Transport Control Protocol) and UDP (User Datagram Protocol) are typical representatives for the transport layer. Neither in the narrow band ISDN nor in the broad band ISDN (ATM) we find a transport protocol. The transport protocol is the first layer for the communication control of the user or terminal. The public network operators did not intend to interfere with the communication of the user.The transport layer of the OSI model is the layer 4TCP is connection oriented and thus operates with acknowledgements, while UDP operates connection less and thus operates without flow control. If the subscriber needs flow control with UDP, he has to solve that an the application layer or above.UDP is often used to transport isochronous data. These data anyhow do not allow repetitions and unlimited jitter (delay variance) Other examples for the transport layer could be found in the WAP-stack (Wireless Application Protocol, Internet access for GSM-terminals)

Page 3: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(4)

Transport Layer: Wireless Datagram Protocol (WDP)WAP Wireless Application Protocol

Wireless Session Protocol (WSP)Wireless Transaction Protocol (WTP)

Wireless Transport Layer Security (WTLS)Wireless Datagram Protocol (WDP)

Example: Transport Layer in the WAP environment

Wireless Session Protocol (WSP): WSP provides HTTP/1.1 functionality and incorporates new features, such as long-lived sessions and session suspend/resume. WSP provides the upper-level application layer of WAP with a consistent interface for two session services. The first is a connection-mode service that operates above the transaction layer protocol, and the second is a connectionless service that operates above a secure or non-secure datagram transport service.Wireless Transaction Protocol (WTP): WTP has been defined as a light weight transaction oriented protocol that is suitable for implementation in "thin" clients (mobile stations) and operates efficiently over wireless datagram networks. The benefits of using WTP include:Improved reliability over datagram services. WTP relieves the upper layer from re-transmissions and acknowledgements that are necessary when datagram services are used.Improved efficiency over connection oriented services. WTP has no explicit connection set up or tear down phases.Advantage of using a message oriented protocol, designed for services oriented towards transactions, such as "browsing."Wireless Transport Layer Security (WTLS): The WTLS layer is designed to provide privacy, data

integrity and authentication between two communicating applications. It provides the upper-level layer of WAP with a secure transport service interface that preserves the transport service interface below it. In addition, WTLS provides an interface for managing (e.g., creating and terminating) secure connections. It provides a functionality similar to TLS 1.0 and incorporates additional features such asdatagram support, optimised handshake and dynamic key refreshing.Wireless Datagram Protocol (WDP): WDP is a general datagram service, offering a consistent service to the upper layer protocols and communicating transparently over one of the available underlying bearer services. This consistency is provided by a set of adaptations to specific features of these bearers. This thus provides a common interface to the upper layers that are then able to function independently of the services of the wireless network.

Page 4: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(5)

ATM LayerPhysical Layer

Higher Layers

Control Plane User Plane

Layer Management

Plane Management

protocoll layers involved for initial development(PVC, permanent virtual circuit)

extra layers necessary for switched services

Example: Adaptation Layer,AAL x as Transportlayer in ATM

Higher Layers

ATM AdaptationLayer

The ATM adaptation layer (AAL) enhances the services provided by the ATM layer to support the functions required by the next higher layer. The AAL performs functions required by the user, control and management planes and supports the mapping between the ATM layer and the next higher layer. The functions performed in the AAL depend upon the higher layer requirements. The AAL supports multiple protocols to fit the needs of the different AAL service users. The AAL is therefore service-dependent.Architecturally, the AAL is a layer between the ATM layer and the next higher layer in each of the user plane, the control plane and the management plane. Examples of services provided by the AAL include:– handling of transmission errors; – handling quantization effect due to cell information field size;– handling of the lost and misinserted cell condition;– flow control and timing control.Basic principles of the AALThe AAL isolates the higher layers from the specific characteristics of the ATM layer by mapping the higher layer protocol data units (PDUs) into the information field of the ATM cell and vice-versa. The AAL entities exchange information with the peer AAL entities to support the AAL functions.

Page 5: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(6)

Abilities vs. Requirements

Applications

TransportationRequirements

Networks

Transportationabilities

Transport LayerTransport Layer

Arguments for aTransport Layer

If the transportation requirements of the applications differ from the transportation abilities of the network a adaptation is required

Page 6: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(7)

Example: TCP

The applications require from the network:Guaranteed transmission of info packetsTransmission in sequenceSupport of indefinite message lengthSynchronization support between transmitter and receiverFlow control from the transmitterSupport for several transceiving processes

Application

IP

Layer 2

Layer 1

Application

IP

Layer 2

Layer 1

Transportsystem

??? ???

The network is able to create:Lost messagesMessages out of sequenceReplication of messagesLimitations in size of messagesVarying latencies (delays)A single connection between two terminals

Lost messages are generated from buffer or queue overflow

Messages out of sequence might happen if the underlying transport system is not a simple link but a network with alternative paths, e.g. a X.25 network or an ATM-network

Replication of messages might occur, when timers generate a repitition of messages because of missing acknowledgements. The timers might be activated, because messages are kept too long in buffers or queues. In such cases the original message occurs with a certain delay at the receiver followed by the repeated message.

The IP-Packet (version 4) is just specified with the max. length of 64K octets

Varying latencies are meant between two connections at different times. They are caused just because of the different distances (e.g. Hannover-Munich or Hannover New York) between two terminals or because of different transmission paths (e.g. terrestrial optical link versus satellite link)

The IP address is unique for a terminal. Thus an IP packet can only support one connection between two terminals

Page 7: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(8)

Functions of TCP

Connection control (set up, control, release)Reliable Datatransfer (without care for the structure of IP packets)Error Control (CRC and pseudo header)Flow control (sliding window mechanism)Multiplexing of several data flowsSecurity (ciphering)Priority handling

Verbindungssteuerung (Aufbau, Überwachung, Abbau)Datentransfer (ohne Rücksicht auf die Datagramstruktur des IP)Datensicherung (CRC-Information)Flow Control (Fenster-Mechanismen)Multiplexing (Mehrfachnutzung einer bestehenden Verbindung)Vorrang (Priorität in der Übermittlung)Sicherheit (Verschlüsselung)

Page 8: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(9)

Data transfer using TCP

TCP allows a continousdatastream from the applicationlayer to the TCP layer

TCP layer decides on thetransport mechanism

The application can push theuser data to the TCP layer

Application

TCP

IP

e.g.IEEE

802.3

Transmissionsystem, e.g. Ethernet Cable

Application

TCP

IP

e.g.IEEE

802.3

Im Netz werden die Informationen in Datagrammen (Paketen) übertragen. Die Datagram-Bildung wird in der TCP-Schicht vorbereitet, die Anlieferung der Daten aus der Anwendung kann kontinuierlich erfolgen. Kontinuierlich wird zwar im Standard gebraucht, ist aber irreführend, tatsächlich werden Buffer von der Anwendung mit Daten gefüllt. Wenn die Anwendung diese Daten übertragen will, werden die Zeiger der Buffer an TCP übergeben.

Page 9: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(10)

LLC (802.2)802.3

CSMA/CD802.5

Token-RingSLIP PPP X.25

IP,ICMP,GGPTCP UDP

Telnet FTP SMTP DNS NFSPort,

See: SAP

asynchronousData transferusing buffers

and addresses

Communication of TCP and examples for services

Die Kommunikation der TCP-Schicht von und zur Anwendung erfolgt mithilfe von Aufrufen (wie Aufrufe zum Betriebssystem). Die Übergabepunkte für diese calls sind die Ports. Ports werden mit Nummern adressiert. Sie sind vergleichbar mit den Service Access Points (SAP) im ISDN. Die Aufrufe erfolgen asynchron.Die Kommunikation zwischen TCP und IP erfolgt auch asynchron, jedoch nicht mit calls, sondern mit der Übergabe von Bufferinhalten.

Page 10: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(11)

Transport unit of TCP

Application delivers bytes to TCPCollection of bytes is calledsegmentTCP collects bytes to send until:

Max segment size is reachedApplication pushes TCP to send (e.g. TELNET)Timer forces TCP to deliver all collected octets

Segments

Application

TCP

IP

e.g.IEEE

802.3

Transmissionsystem, e.g. Ethernet Cable

Application

TCP

IP

e.g.IEEE

802.3

Page 11: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(12)

Multiplexing

A single computer is able to access TCP and thus an existingconnection at „the same time“ fromseveral application processes.

The individual processes areaddresses by „ports“

Network-, Host- und Port-adressform the socket. Sockets are partlyunique throughout the world.

Frequently used processes areaddressed by fixed ports. (addressing from everywhere, without knowing something of theinstalled processes). Those portsare specified in RFC790.

TCP

IP

e.g.IEEE

802.3

TCP

IP

e.g.IEEE

802.3

Transmissionsystem

Appl.1 Appl.n Appl.1 Appl.n

der RFC 790 gibt assigned numbers im Internet wieder, also auch standardisierte ports

Page 12: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(13)

Sliding Window Mechanismn

In principle the same as on the link layer, but: the link is a point to point permanent connection, between twoadjacent network elementsIn contrast TCP is operating end-to-end with the followingconsequences:

Connection control (setup, control, release) required beforesliding window mechanism can startRound trip time (RTT) can vary significantly, timers and windowsize need to be adaptive, Sequence of packets could be disturbed dramaticallyTerminals are not known and thus receiving buffers might vary in size, buffer size need to capture all packets untilacknowledgementTransmission bottlenecks might not be visible directly to thetransmitting stack because several transmission links are chainedup

Page 13: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(14)

How to cope with these difficulties for the sliding window mechanismn?

Sliding window size is adaptable to the transmissionsituation (ressources, latency, network behaviour)Window size is advertized by the receiver to thetransmitter (both ways)

basis: available bufferthis prevents the transmitter to overflow the receiver

Page 14: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(15)

Buffer control at transmitter and receiver

Remark: at the receiver segments could be out of sequenceConsider that the buffer in both stations is limited to a max sizeHow is the advertized window size calculated at the receiver and how is it used at thetransmitter?

Transmitting application Receiving application

TCP TCP

Last byte acknowledged ≤ Last byte sentLast byte sent ≤ Last byte written

Last byte writtenBy application

Last byte sentLast byte acknowledged

byte

Last byte readBy application

Last bytereceived

next byteexpected

byte

Last byte read ≤ next byte expectednext byte expected ≤ Last byte received+1

Page 15: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(16)

Solution for the last slide:

Window size: number of unacknowledged messages, those need to fit into the receive buffer:

Last byte received - Last byte read ≤ MaxReceiveBufferThe advertized window should be maximal the free space in thebuffer:AdvertizWindow = MaxReceiveBuffer - (Last byte received -Last byte read)

Window size of the transmitter:Last byte sent - Last byte acknowledged ≤ AdvertizWindowEffectiveWindowTrans=AdvertizWindow–(Lastbytesent-Last byteacknowledged)

Consequence: the receiving process controlls the speedof transmission!

Page 16: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(17)

Sequence Number

The octets are addressed with sequence numbersthe sequence number (SN) is used for the flow control:

SN in window, but not acknowledgedall sent SN acknowledged >> send_buffer emptyreceived SN in window

Tatsächlich wird nicht jedes Oktett einzeln numeriert, sondern immer nur das erste und das letzte eines Blockes. Damit ist aber eine implizite Numerierung jedes Oktetts möglich.

Page 17: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(18)

Initial Sequence Number (ISN)

At start up time an ISN-Generator produces a 32 bit longrandom figure in order to start with different ISN in casestart ups follow each other quicklyThis figure is incremented every 4 µsekthe cycle time is about 4.55 hours

Question: Which condition must be met to prevent repetedSN´s?

Page 18: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(19)

14 seconds! Too smallSTM16 (2.5Gbit/s)

55 seconds ! Too smallSTM4 (622Mbit/s)

4 minutesSTM1 (155Mbit/s)

6 minutesFast Ethernet (100Mbit/s)

13 minutesT3 (45 Mbit/s)

57 minutesEthernet (10Mbit/s)

6.4 hoursT1 (1.5Mbit/s)

Estimation of Cycletime of SN

Transmission Speed

TTL<120sec!

The SN needs to be extended!

Influence of transmission speed on Sequence Number

It need to be prevented that a sequence number (byte number) is twice in the system! The sequence number is 32 bits long. 2 power 32 octetts can be transmitted, before the numbers start again (one cycle) via the transmission speed you can estimate the time you need to transmit 2 power 32 bits. This is an estimation, because all the transmission systems have their own overhead! The TTL in the Internet is designed to be smaller than 120 seconds. Thus the cycle time should be longer than 120 seconds!

Page 19: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(20)

Pseudo-Header

Bei der Berechnung der Prüfsumme stellt TCP einen Pseudoheader vor den eigentlichen Header. Dieser Pseudoheader wird nicht mit übertragen, sondern beim Empfänger erst wieder aus dem IP-Header erzeugt und in die Prüfung der Checksum mit einbezogen. Zweck dieses Verfahrens ist, fehlgeleitete Datagramme zu erkennen und nicht der Anwendung zuzustellen. Fehlgeleitete Diagramme können beispielsweise auftreten, wenn Bitfehler in den Adressen von der Schicht 3 nicht erkannt werden und damit auf IP-Ebene die Pakete falsch zugestellt werden. Mit dem Pseudo-Header wird auf der Schicht vier die Adresse aus Schicht 3 ein zweites mal geprüft und damit die Sicherheit gegen Adressverfälschungen höher.

Source Address

Destination Address

TCP LengthProtocol0 0 0 0 0 0 0 0

http://www.rvs.uni-bielefeld.de/~heiko/tcpip/kap_2_4.html

Page 20: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(21)

Transmission Control Block TCB

Der TCB enthält alle Variablen einer Verbindung:local und remote socketsVerschlüsselungs- und Vorrang-DatenZeiger auf die Sende- und EmpfangspufferZeiger auf die WiederholungswarteschlangeZeiger auf das aktuelle SegmentVariablen zu den Sende-/Empfangs-Sequenznummern

Der lokale Socket ist der eigene, während der remote socket der ferne an der Verbindung beteiligte Socket ist.Im Zusammenhang mit dem Fenstermechanismus der Flußkontrolle muß eine Warteschlange vorgehalten werden, in der alle noch nicht betätigten Segmente für eine eventuelle Wiederholung gespeichert werden.Die Variablen im Zusammenhang mit den Sende-/Empfangssequenznummern sind:

Send Sequenz Variables:SND.UNA unacknowledged (älteste nicht bestätigte Sequenznr.)SND.NXT next (nächste zu sendende Sequenznummer)SND.WND windowSND:WL1 segment sequence number used for last window updateSND.WL1 segment acknoledgement number used fpr last window updateISS initial send sequence numberReceive Sequence VariablesRCV.NXT nächste erwartete SequenznummerRCV.WND empfangenes FensterRCV.UP urgent pointerIRS initial receive sequence number

Page 21: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(22)

Station 1 Station 2

1.sende Nachricht 1

2. quittiere Nachricht 1 und fügeeigene Nachricht 2 an

3.quittiere Nachricht 2

Connection control handled by 3 - State -acknowledge

Page 22: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(23)

closed

listen

passive openerzeuge TCB

Closelösche TCB

SYNsent

aktiv

es o

pen

erze

uge

TCB

send

e SY

N

SYNreceived

established

empfangen SYN, send ACK,SYN

empfangen ACKvon SYN

empfangen SYN, ACK;send ACK

VereinbarungSequenznummer

sendSYN

empf. SYNsend SYN,ACK

1.Die Verbindung ist abgebaut, closed

angeforderte Station | Verbindung | anfordernde Station

Verbindungsaufbau

Page 23: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(24)

closed

listen

passive openerzeuge TCB

Closelösche TCB

SYNsent

aktiv

es o

pen

erze

uge

TCB

send

e SY

N

SYNreceived

established

empfangen SYN, send ACK,SYN

empfangen ACKvon SYN

empfangen SYN, ACK;send ACK

VereinbarungSequenznummer

sendSYN

empf. SYNsend SYN,ACK

2. Die Verbindung wird aktiv eröffnet. Dazu wird ein TCB erzeugt, und von der öff-nenden Instanz eine Sequenznummer zur Gegenstelle gesandt (sende SYN)

angeforderte Station | Verbindung | anfordernde Station

Verbindungsaufbau

Page 24: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(25)

closed

listen

passive openerzeuge TCB

Closelösche TCB

SYNsent

aktiv

es o

pen

erze

uge

TCB

send

e SY

N

SYNreceived

established

empfangen SYN, send ACK,SYN

empfangen ACKvon SYN

empfangen SYN, ACK;send ACK

VereinbarungSequenznummer

sendSYN

empf. SYNsend SYN,ACK

3. Die Gegenstelle empfängt die Sequenznummer (SYN), bestätigt diese (ACK) und sendet gleichzeitig seine eigene Sequenznummer (SYN)

angeforderte Station | Verbindung | anfordernde Station

Verbindungsaufbau

Page 25: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(26)

closed

listen

passive openerzeuge TCB

Closelösche TCB

SYNsent

aktiv

es o

pen

erze

uge

TCB

send

e SY

N

SYNreceived

established

empfangen SYN, send ACK,SYN

empfangen ACKvon SYN

empfangen SYN, ACK;send ACK

VereinbarungSequenznummer

sendSYN

empf. SYNsend SYN,ACK

4. Die die Verbindung aufbauende Instanz empfängt die SN der Gegenstelle und das ACK für die eigene SN, bestätigt die empfangene SN.

angeforderte Station | Verbindung | anfordernde Station

Verbindungsaufbau

SN = Sequenznummer

Page 26: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(27)

closed

listen

passive openerzeuge TCB

Closelösche TCB

SYNsent

aktiv

es o

pen

erze

uge

TCB

send

e SY

N

SYNreceived

established

empfangen SYN, send ACK,SYN

empfangen ACKvon SYN

empfangen SYN ,ACK;send ACK

VereinbarungSequenznummer

sendSYN

empf. SYNsend SYN,ACK

4. Die angeforderte Instanz empfängt die Bestätigung für ihre SN und geht auch in den Zustand established

angeforderte Station | Verbindung | anfordernde Station

Verbindungsaufbau

Page 27: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(28)

Verbindungsabbau

Erfolgt auf Anforderung der Anwendung durch TCP nach Erhalt aller Quittungen oder mit Verlust noch nicht quittierter Meldungen.

Die Auslösung wird wieder mit dem drei-Wege-HandshakeVerfahren durchgeführt

Page 28: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(29)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

FensterPrüfsumme

Options Padding

DATA

Sequence NumberZiel-PortUrsprungs-Port

Acknowledgement Number

FlagsReserviertOffsetDringlichkeitszeiger

DATA

TCP - Rahmen

Page 29: [16] Nu P 09 1

© UNI Hannover, Institut für Allgemeine Nachrichtentechnik

(31)

Initial Sequence Number (ISN)

At start up time an ISN-Generator produces a 32 bit longrandom figure in order to start with different ISN in casestart ups follow each other quicklyThis figure is incremented every 4 µsekthe cycle time is about 4.55 hours

Question: Which condition must be met to prevent repetedSN‘s?

The retention period (Verweildauer) of the message in the TCP-system needs to be shorter than 4.55 hours