1 / 85

Kapitel 22: UDP och TCP. (Kapitel 23: Congestion control and QoS översiktligt.)

Kapitel 22: UDP och TCP. (Kapitel 23: Congestion control and QoS översiktligt.). PART V. Transport Layer. Position of transport layer. Transport layer duties. Chapters. Chapter 22 Process-to-Process Delivery. Chapter 23 Congestion Control and QoS. Chapter 22.

bezanson
Télécharger la présentation

Kapitel 22: UDP och TCP. (Kapitel 23: Congestion control and QoS översiktligt.)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Kapitel 22: UDP och TCP. (Kapitel 23: Congestion control and QoS översiktligt.)

  2. PART V Transport Layer

  3. Position of transport layer

  4. Transport layer duties

  5. Chapters Chapter 22 Process-to-Process Delivery Chapter 23 Congestion Control and QoS

  6. Chapter 22 Process-to-ProcessDelivery:UDP and TCP

  7. Note: The transport layer is responsible for process-to-process delivery.

  8. Figure 22.1Types of data deliveries

  9. Application Application TCP, UDP TCP, UDP IP IP Physical Physical IP IP Physical Physical Virtual Connection at the Transport Layer Router Server Host Router Client Host Protocol stack in the host Protocol stack in the host Protocol stack in the router

  10. Client-Server Paradigm • Used most often in Internet process-to-process communication, for example, email, web, file transfer, etc. • The client process initiates the communication. • The server process waits for the client to initiate communication, and responds by sending the information required. Example: Web server, email server, ftp server, etc. • A firewall often stops external clients from accessing internal servers, except certain web • Opposite: Peer-to-peer communication, where a program can act both as client (taking initiative) and server (responding to other).

  11. Multiplexing and Demultiplexing Receiver processes Sender processes Web Email MP3 Web Email MP3 TCP UDP TCP UDP IP IP IP datagrams IP datagrams

  12. 22.2 UDP Port Numbers User Datagram Applications

  13. Note: UDP is a connectionless, unreliable protocol that has no flow and error control. It uses port numbers to multiplex data from the application layer.

  14. Table 22.1 Well-known ports used by UDP

  15. Figure 22.10User datagram format

  16. Note: The calculation of checksum and its inclusion in the user datagram are optional.

  17. Note: UDP is a convenient transport-layer protocol for applications that provide flow and error control. It is also used by multimedia applications.

  18. 22.3 TCP Port Numbers Services Sequence Numbers Segments Connection Transition Diagram Flow and Error Control Silly Window Syndrome

  19. Table 22.2 Well-known ports used by TCP

  20. Figure 22.7Connection establishment

  21. Figure 22.8Connection termination

  22. Connection-oriented vs. Conectionless • A connection-oriented service requires both sender and receiver to create a connection before any data is transferred • TCP provides connection oriented service to the applications, allowing a byte stream to be delivered in order, allthough IP is a connectionless service. • A connectionless service does not create a connection first but simply sends the data • UDP provides connectionless service to the applications. UDP packets are called datagrams.

  23. Figure 22.11Stream delivery

  24. Figure 22.12Sending and receiving buffers

  25. Figure 22.13TCP segments

  26. Example: Connection-oriented Service • An analogy to the connection-oriented service is telephone conversation

  27. Example: Connectionless Service • An analogy to connectionless service is the delivery of the mail

  28. Data-link vs. Transport Layer • Data link layer • Responsibile for reliability between two directly connected points • Transport layer • Resposibe for reliability over the internetwork Duties of the data-link layer Network 1 Network 3 Network 2 Internetwork Duties of the data-link layer Duties of the data-link layer Duties of the transport layer

  29. Reliable vs. Unreliable • Transport layer can offer • Unreliable service (UDP) • No guarantee that the packet will be delivered to the destination • Useful especially for transmitting audio and video files where waiting for acknowledgement can be annoying for the user • Reliable service (TCP) • Connection establishment • Connection maintenance • Connection termination

  30. User Datagram Protocol (UDP) • No reliability or connection management! • Serves solely as a labeling mechanism for demultiplexing at the receiver end • Use predominantly by protocols that do no require the strict service guarantees offered by TCP (e.g. real-time multimedia protocols) • Additional intelligence built at the application layer if needed

  31. Transmission Control protocol (TCP) • Provides a connection-oriented end-to-end (user-to-user) reliable byte stream service in both directions (full duplex) • Divides a byte stream into a sequence of segments and sends them to the destination via IP • Uses the destination port, source port to identify the application to which the segment is sent (multiplexing the sessions) • Uses sliding window like scheme for flow control and congestion control

  32. B A Connection Management • Two way handshake protocol is not enough because of potential delays in either A’s request or B’s responce, as shown below. Possibility of confusion exists. A sends a connection request t1 A sends connection request again B receives connection request B establishes a connection and sends an acknowledgement t2 t3 A receives the acknowledgement and establishes a connection t4 A and B exchange data and eventually disconnect B receives connection request B establishes a connection and sends an acknowledgement t5 time time

  33. B A Three-way Handshake Protocol for Connection Establishment A sends a connection request with seq. no. x t1 t2 A sends connection request again with seq. no. y B sends acknowledgement y+1 and seq. no. z t3 A receives the acknowledgement y+1 and sends acknowledgement z+1 t4 The connection is established B sends acknowledgement x+1 and seq. no. w t5 A does not send an acknowledgement and no connection is established t6 time time

  34. Server does passive open Accept connection request Send acceptance Start connection SYN Active open Send connection request SYN+ACK ACK DATA Connection Establishment and Termination • 3-way handshake used for connection establishment • Randomly chosen sequence number is conveyed to the other end • Similar FIN, FIN+ACK exchange used for connection termination The three-way handshake TCP segments are labeled with SYN. The length of data in the first two is 0

  35. TCP’s Segments • TCP treats data as a sequence of bytes to be divided and sent in segments. • The size of the segment depends on the underlying physical network and on the number of bytes the sender is allowed to send (window size) • Rather than numbering each segment, TCP stores the sequence number of the data byte in the segment • The source and the destination each have separate sequence numbers • The acknowledgement numbers are equal to the next expected sequence number

  36. Window Management in TCP • Sliding window scheme is used with variable window • The window can change depending on the traffic in the network (TCP provides congestion control) • The size of the window is expressed in bytes instead of packets • The window size depends on the receiver’s capabilites and the congestion in the network

  37. TCP Sliding Window

  38. Example 1 Imagine a TCP connection is transferring a file of 6000 bytes. The first byte is numbered 10010. What are the sequence numbers for each segment if data are sent in five segments with the first four segments carrying 1000 bytes and the last segment carrying 2000 bytes? Solution The following shows the sequence number for each segment: Segment 1==> sequence number: 10,010 (range: 10,010 to 11,009) Segment 2 ==> sequence number: 11,010 (range: 11,010 to 12,009) Segment 3==> sequence number: 12,010 (range: 12,010 to 13,009) Segment 4 ==> sequence number: 13,010 (range: 13,010 to 14,009) Segment 5 ==> sequence number: 14,010 (range: 14,010 to 16,009)

  39. Note: The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number.

  40. Note: The value of the sequence number field in a segment defines the number of the first data byte contained in that segment.

  41. Note: The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. The acknowledgment number is cumulative.

  42. Figure 22.14TCP segment format

  43. Figure 22.15Control field

  44. Table 22.3 Description of flags in the control field

  45. Figure 22.16Three-step connection establishment

  46. Figure 22.17Four-step connection termination

  47. Table 22.4 States for TCP

  48. Figure 22.18State transition diagram

  49. Note: A sliding window is used to make transmission more efficient as well as to control the flow of data so that the destination does not become overwhelmed with data. TCP’s sliding windows are byte-oriented.

  50. Figure 22.19Sender buffer

More Related