Your SlideShare is downloading. ×
[16] Nu P 09 1
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

[16] Nu P 09 1

242

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
242
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Protokolle der OSI-Schicht 4 Transportschicht Kapitel 9.1 Netze und Protokolle Dr.-Ing. Jan Steuer Institut für Kommunikationstechnik www.ikt.uni-hannover.de © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 2. Example: Transport Layer in the Internet (TCP, UDP) Telnet FTP SMTP DNS NFS ApplicationLayer TCP UDP TransportLayer IP, ICMP, GGP NetworkLayer LLC (802.2) LinkLayer SLIP PPP X.25 CSMA/CD (802.3) Token-Ring (802.5) (3) 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 4 TCP 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) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 3. Example: Transport Layer in the WAP environment Wireless Session Protocol (WSP) Wireless Transport Layer Security (WTLS) Wireless Transaction Protocol (WTP) Wireless Datagram Protocol (WDP) Transport Layer: Wireless Datagram Protocol (WDP) WAP Wireless Application Protocol (4) 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 quot;thinquot; 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 quot;browsing.quot; 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 as datagram 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. © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 4. Example: Adaptation Layer, AAL x as Transportlayer in ATM Plane Management Layer Management User Plane Control Plane Higher Layers Higher Layers ATM AdaptationLayer ATM Layer Physical Layer extra layers necessary for switched services protocoll layers involved for initial development (PVC, permanent virtual circuit) (5) 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 AAL The 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. © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 5. Arguments for a Transport Layer Applications Transportation Requirements Abilities vs. Requirements Transport Layer Transport Layer Transportation abilities Networks (6) If the transportation requirements of the applications differ from the transportation abilities of the network a adaptation is required © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 6. Example: TCP The applications require from the network: Guaranteed transmission of info packets Transmission in sequence Support of indefinite message length Synchronization support between transmitter and Application Application receiver Flow control from the transmitter Support for several transceiving processes ??? ??? IP IP The network is able to create: Lost messages Messages out of sequence Layer 2 Layer 2 Replication of messages Limitations in size of messages Varying latencies (delays) Layer 1 Layer 1 A single connection between two terminals Transportsystem (7) 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 © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 7. 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 flows Security (ciphering) Priority handling (8) 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) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 8. Data transfer using TCP TCP allows a continous Application Application datastream from the application layer to the TCP layer TCP layer decides on the transport mechanism TCP TCP The application can push the IP IP user data to the TCP layer e.g.IEEE e.g.IEEE 802.3 802.3 Transmissionsystem, e.g. Ethernet Cable (9) 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. © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 9. Communication of TCP and examples for services Telnet FTP SMTP DNS NFS Port, See: SAP TCP UDP asynchronous IP,ICMP,GGP Data transfer LLC (802.2) using buffers SLIP PPP X.25 802.3 802.5 and addresses CSMA/CD Token-Ring (10) 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. © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 10. Transport unit of TCP Application delivers bytes to TCP Application Application Collection of bytes is called segment TCP collects bytes to send until: Max segment size is reached Segments TCP TCP Application pushes TCP to send (e.g. TELNET) IP IP Timer forces TCP to deliver all collected octets e.g.IEEE e.g.IEEE 802.3 802.3 Transmissionsystem, e.g. Ethernet Cable (11) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 11. Multiplexing A single computer is able to access TCP and thus an existing Appl.n Appl.1 Appl.1 Appl.n connection at „the same time“ from several application processes. The individual processes are addresses by „ports“ TCP TCP Network-, Host- und Port-adress form the socket. Sockets are partly IP IP unique throughout the world. e.g.IEEE e.g.IEEE Frequently used processes are addressed by fixed ports. 802.3 802.3 (addressing from everywhere, without knowing something of the installed processes). Those ports Transmissionsystem are specified in RFC790. (12) der RFC 790 gibt assigned numbers im Internet wieder, also auch standardisierte ports © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 12. Sliding Window Mechanismn In principle the same as on the link layer, but: the link is a point to point permanent connection, between two adjacent network elements In contrast TCP is operating end-to-end with the following consequences: Connection control (setup, control, release) required before sliding window mechanism can start Round trip time (RTT) can vary significantly, timers and window size need to be adaptive, Sequence of packets could be disturbed dramatically Terminals are not known and thus receiving buffers might vary in size, buffer size need to capture all packets until acknowledgement Transmission bottlenecks might not be visible directly to the transmitting stack because several transmission links are chained up (13) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 13. How to cope with these difficulties for the sliding window mechanismn? Sliding window size is adaptable to the transmission situation (ressources, latency, network behaviour) Window size is advertized by the receiver to the transmitter (both ways) basis: available buffer this prevents the transmitter to overflow the receiver (14) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 14. Buffer control at transmitter and receiver Receiving application Transmitting application Last byte written TCP TCP Last byte read By application By application byte byte Last byte sent Last byte next byte Last byte acknowledged received expected Last byte acknowledged ≤ Last byte sent Last byte read ≤ next byte expected Last byte sent ≤ Last byte written next byte expected ≤ Last byte received+1 Remark: at the receiver segments could be out of sequence Consider that the buffer in both stations is limited to a max size How is the advertized window size calculated at the receiver and how is it used at the transmitter? (15) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 15. 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 ≤ MaxReceiveBuffer The advertized window should be maximal the free space in the buffer: AdvertizWindow = MaxReceiveBuffer - (Last byte received -Last byte read) Window size of the transmitter: Last byte sent - Last byte acknowledged ≤ AdvertizWindow EffectiveWindowTrans=AdvertizWindow–(Lastbytesent-Last byte acknowledged) Consequence: the receiving process controlls the speed of transmission! (16) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 16. Sequence Number The octets are addressed with sequence numbers the sequence number (SN) is used for the flow control: SN in window, but not acknowledged all sent SN acknowledged >> send_buffer empty received SN in window (17) 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. © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 17. Initial Sequence Number (ISN) At start up time an ISN-Generator produces a 32 bit long random figure in order to start with different ISN in case start ups follow each other quickly This figure is incremented every 4 µsek the cycle time is about 4.55 hours Question: Which condition must be met to prevent repeted SN´s? (18) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 18. Influence of transmission speed on Sequence Number Transmission Speed Estimation of Cycle time of SN T1 (1.5Mbit/s) 6.4 hours Ethernet (10Mbit/s) 57 minutes T3 (45 Mbit/s) 13 minutes Fast Ethernet 6 minutes (100Mbit/s) STM1 (155Mbit/s) 4 minutes TTL<120sec! STM4 (622Mbit/s) 55 seconds ! Too small The SN needs to STM16 (2.5Gbit/s) 14 seconds! Too small be extended! (19) 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! © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 19. 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 00000000 Protocol TCP Length (20) http://www.rvs.uni-bielefeld.de/~heiko/tcpip/kap_2_4.html © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 20. Transmission Control Block TCB Der TCB enthält alle Variablen einer Verbindung: local und remote sockets Verschlüsselungs- und Vorrang-Daten Zeiger auf die Sende- und Empfangspuffer Zeiger auf die Wiederholungswarteschlange Zeiger auf das aktuelle Segment Variablen zu den Sende-/Empfangs-Sequenznummern (21) 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 window SND:WL1 segment sequence number used for last window update SND.WL1 segment acknoledgement number used fpr last window update ISS initial send sequence number Receive Sequence Variables RCV.NXT nächste erwartete Sequenznummer RCV.WND empfangenes Fenster RCV.UP urgent pointer IRS initial receive sequence number © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 21. Connection control handled by 3 - State - acknowledge Station 1 Station 2 1.sende Nachricht 1 2. quittiere Nachricht 1 und füge eigene Nachricht 2 an 3.quittiere Nachricht 2 (22) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 22. Verbindungsaufbau angeforderte Station | Verbindung | anfordernde Station closed erzeuge TCB passive open aktives open Close sende SYN erzeuge TCB lösche TCB listen empf. SYN send send SYN,ACK SYN Vereinbarung SYN SYN Sequenznummer received sent empfangen SYN, send ACK,SYN empfangen empfangen SYN, ACK; ACKvon SYN send ACK established 1.Die Verbindung ist abgebaut, closed (23) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 23. Verbindungsaufbau angeforderte Station | Verbindung | anfordernde Station closed erzeuge TCB passive open aktives open Close sende SYN erzeuge TCB lösche TCB listen empf. SYN send send SYN,ACK SYN Vereinbarung SYN SYN Sequenznummer empfangen SYN, send ACK,SYN received sent empfangen empfangen SYN, ACK; ACKvon SYN send ACK established 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) (24) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 24. Verbindungsaufbau angeforderte Station | Verbindung | anfordernde Station closed erzeuge TCB passive open aktives open Close sende SYN erzeuge TCB lösche TCB listen empf. SYN send send SYN,ACK SYN Vereinbarung SYN SYN Sequenznummer empfangen SYN, send ACK,SYN received sent empfangen empfangen SYN, ACK; ACKvon SYN send ACK established 3. Die Gegenstelle empfängt die Sequenznummer (SYN), bestätigt diese (ACK) und sendet gleichzeitig seine eigene Sequenznummer (SYN) (25) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 25. Verbindungsaufbau angeforderte Station | Verbindung | anfordernde Station closed erzeuge TCB passive open aktives open Close sende SYN erzeuge TCB lösche TCB listen empf. SYN send send SYN,ACK SYN Vereinbarung SYN SYN Sequenznummer empfangen SYN, send ACK,SYN received sent empfangen empfangen SYN, ACK; ACKvon SYN send ACK established 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. (26) SN = Sequenznummer © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 26. Verbindungsaufbau angeforderte Station | Verbindung | anfordernde Station closed erzeuge TCB passive open aktives open Close sende SYN erzeuge TCB lösche TCB listen empf. SYN send send SYN,ACK SYN Vereinbarung SYN SYN Sequenznummer empfangen SYN, send ACK,SYN received sent empfangen empfangen SYN ,ACK; ACKvon SYN send ACK established 4. Die angeforderte Instanz empfängt die Bestätigung für ihre SN und geht auch in den Zustand established (27) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 27. 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-Handshake Verfahren durchgeführt (28) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 28. TCP - Rahmen 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 Ursprungs-Port Ziel-Port Sequence Number Acknowledgement Number Flags Reserviert Fenster Offset Dringlichkeitszeiger Prüfsumme Padding Options DATA DATA (29) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik
  • 29. Initial Sequence Number (ISN) At start up time an ISN-Generator produces a 32 bit long random figure in order to start with different ISN in case start ups follow each other quickly This figure is incremented every 4 µsek the cycle time is about 4.55 hours Question: Which condition must be met to prevent repeted SN‘s? The retention period (Verweildauer) of the message in the TCP- system needs to be shorter than 4.55 hours (31) © UNI Hannover, Institut für Allgemeine Nachrichtentechnik

×