Transport Layer Chapter 6

Transport Layer Chapter 6

Transport Layer Chapter 6 • Transport Service • Elements of Transport Protocols • Congestion Control • Internet Protocols – UDP • Internet Protocols – TCP • Performance Issues • Delay-Tolerant Networking Revised: August 2011 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 The Transport Layer Responsible for delivering data across networks with the desired Application reliability or quality Transport Network Link Physical CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Transport Service Data transport from a process on the source machine to a process on the destination machine with a desired level of reliability that is independent of the physical networks actually being used. − Transport entity process can be physically located in the operating system kernel, in a NIC card, in a library package bound into the network applications or else in a separate user process. − Transport code runs entirely on end user’s computers in direct contrast to the network layer, which runs mostly on routers. • Services Provided to the Upper Layer » • Transport Service Primitives » • Berkeley Sockets » • Socket Example: Internet File Server » CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Services Provided to the Upper Layers (1) Transport layer adds reliability to the network layer • Offers connectionless (e.g., UDP) and connection- oriented (e.g, TCP) service to applications CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Services Provided to the Upper Layers (2) New term: “segments” – transport layer “packets” Transport layer sends segments in packets (in frames) Segment Segment Transport Layer Protocols in the Internet Protocol Suite: 1. UDP – connectionless 2. TCP – connection-oriented reliable service 3. SCTP (Stream Control Transmission Protocol) – Emerging; tailored for multimedia and wireless environments 4. SST (Structured Stream Transport) – experimental; finer grained TCP-like streams 5. DCCP (Datagram Congestion Controlled Protocol) – UDP with congestion control CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Transport Service Primitives (1) Service Primitives for TCP. • Transport layer makes it possible for the (TCP) transport service to be more reliable than the underlying network. − TCP hides the imperfections of the network layer − Transport Layer provides services to the application layer • Greater reliability is accomplished entirely without any dependence (or reliance) upon underlying network primitives. TCP’s primitives that applications might call to transport data for a simple connection-oriented service: • Client calls CONNECT, SEND, RECEIVE, DISCONNECT • Server calls LISTEN, RECEIVE, SEND, DISCONNECT Segment CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Transport Service Primitives (2) State diagram for a simple connection-oriented service Solid lines (right) show client state sequence Dashed lines (left) show server state sequence Transitions in italics are due to segment arrivals. CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Berkeley Sockets Very widely used primitives started with TCP on UNIX • Notion of “sockets” as transport endpoints • Like simple set plus SOCKET, BIND, and ACCEPT CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Socket Example – Internet File Server (1) Client code See code on page 504 . Get server’s IP address Make a socket Try to connect . 9 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Socket Example – Internet File Server (2) Client code (cont.) . Write data (equivalent to send) Loop reading (equivalent to receive) until no more data; exit implicitly calls close 10 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Socket Example – Internet File Server (3) Server code See code on page 505 . Make a socket Assign address Prepare for incoming connections . 11 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Socket Example – Internet File Server (4) Server code (continued) . Block waiting for the next connection Read (receive) request and treat as file name Write (send) all file data Done, so close this connection 12 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Elements of Transport Protocols • Addressing » • Connection establishment » • Connection release » • Error control and flow control » • Multiplexing » • Crash recovery » CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Addressing • Transport layer adds TSAPs • Multiple clients and servers can run on a host with a single network (IP) address • TSAPs are ports for TCP/UDP This slide explains how the OSI protocols “address” services on adjacent layers of the OSI reference model. CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Instructor’s Slide Addition: Addressing • Textbook describes Internet Port Addresses in terms of OSI’s “TSAP” concept • Your Instructor believes that this is confusing for those not familiar with OSI, even though these OSI concepts are helpful for a formal orientation. • This instructor-inserted slide seeks to summarize pgs 509-512 and 554 of the textbook in purely Internet terms, which he believes is much simpler. • OSI’s TSAPs and Internet’s Ports both provide addresses for application-layer applications so that the transport layer can forward packets to the appropriate application layer processing entity (e.g., a process server local within that device such as Unix’s inetd). • https://www.ietf.org/assignments/service-names-port-numbers/service-names- port-numbers.xml Security firewalls also extensively • Three types of Ports use port references and definitions 1. Well-known Ports: ports 0 – 1023 to identify specific applications. 2. Registered Ports: ports 1024 – 49151 » Ports 0 through 49151 are formally registered worldwide through IANA (see above URL for current registration results) 3. Dynamic Ports: Ports 49152 – 65535 » These ports are not registered thru IANA but rather use a locally scoped port ID system such as portmapper (see textbook page 510) . Example is Sun Microsystems’ ONC RPC protocol system, which is a popular approach for remote procedure calls (see pages 543-546) Another Instructor Slide Insertion • Tannenbaum is a European and therefore apparently thinks that connection- oriented systems are “normal” and connectionless systems “abnormal” or “unusual” or “bad” – they didn’t exist within OSI. Regardless, he introduces and describes Transport layer concepts solely in terms of the connection-oriented variant. • The next 11 slides are true for the Internet’s TCP. • They are NOT true for the Internet’s UDP, which provides a connectionless service to the application layer. • Textbook doesn’t really explain this distinction until UDP and TCP are subsequently introduced late in the chapter circa page 541 • This reflects the textbook’s origins: earlier editions were written in a time of protocol diversity and discussed data communications in terms of the OSI Reference Model and OSI Protocols. These foundational concepts still remain important to understand for protocol development and research. Connection Establishment (1) TCP is a connection-oriented protocol. It therefore provides services common to other connection-oriented approaches (e.g., circuit switching) Key problem is to ensure reliability even though packets may be lost, corrupted, delayed, and duplicated • Don’t treat an old or duplicate packet as new • (Use ARQ and checksums for loss/corruption) Approach: • Don’t reuse sequence numbers within twice the MSL (Maximum Segment Lifetime) of 2T=240 secs • Three-way handshake for establishing connection CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Connection Establishment (2) Requirement: need a practical and foolproof way to reject delayed duplicate segments to ensure that no session confusion can happen. Use a sequence number space large enough that it will not wrap, even when sending at full rate • Clock (high bits) advances & keeps state over crash Need seq. number not to Need seq. number not to wrap within T seconds climb too slowly for too long CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Connection Establishment (3) Three-way handshake provides a foolproof way to ensure that an initial CONNECTION_REQUEST sequence number is not a duplicate of a recent connection (since seq numbers are not remembered across different connections at a destination). Three-way handshake used for initial packet • Since no state from previous connection • Both hosts contribute fresh seq. numbers • CR = Connection Request CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Connection Establishment (4) Three-way handshake protects against odd cases: a) a) Duplicate CR. Spurious ACK does not connect X b) Duplicate CR and DATA. Same plus DATA will be rejected (wrong ACK). b) X X CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Connection Release (1) Key problem is to ensure reliability while releasing Asymmetric release (when one side breaks connection) is abrupt and may lose data X CN5E by Tanenbaum & Wetherall,

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    67 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us