
Chapter 3 Transport Layer A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides Computer Networking: (including this one) and slide content to suit your needs. They obviously A Top Down Approach represent a lot of work on our part. In return for use, we only ask the following: Featuring the Internet, q If you use these slides (e.g., in a class) in substantially unaltered form, 3rd edition. that you mention their source (after all, we’d like people to use our book!) q If you post any slides in substantially unaltered form on a www site, that Jim Kurose, Keith Ross you note that they are adapted from (or perhaps identical to) our slides, and Addison-Wesley, July note our copyright of this material. 2004. Thanks and enjoy! JFK/KWR All material copyright 1996-2005 J.F Kurose and K.W. Ross, All Rights Reserved Transport Layer 3-1 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services r learn about transport layer protocols in the Internet Transport Layer 3-2 Chapter 3 outline r 3.1 Transport-layer r 3.5 Connection-oriented services transport: TCP r 3.2 Multiplexing and m segment structure demultiplexing m reliable data transfer r 3.3 Connectionless m flow control transport: UDP m connection management r r 3.4 Principles of 3.6 Principles of reliable data transfer congestion control r 3.7 TCP congestion control Transport Layer 3-3 Transport services and protocols r provide logical communication application transport between app processes network data link network running on different hosts physical logical end data link network physical r transport protocols run in data link physical end systems network - data link end transport m physical network send side: breaks app data link messages into segments, physical network passes to network layer data link physical m rcv side: reassembles segments into messages, application transport passes to app layer network data link r more than one transport physical protocol available to apps Transport Layer 3-4 Transport vs. network layer r network layer: logical communication between hosts r transport layer: logical communication between processes m relies on, enhances, network layer services Transport Layer 3-5 Common Transport Layer Functions r Demux to upper layer r Delivery semantics m Delivering data to correct m Reliable or unreliable application process m Ordered or unordered r Quality of service m Unicast, multicast, m Providing service anycast guarantees in processing (buffers, process r Flow control scheduling) m Prevent overflow of r Security receiver buffers m Authenticity, Privacy, r Congestion control Integrity for connection m Prevent overflow of r Connection setup network buffers m Providing a connection m Avoid packet loss and abstraction over a connectionless substrate packet delay Transport Layer 3-6 UDP and Transport Layer Functions r Demux to upper layer m UDP port field r Quality of service m none r Security m None r Connection setup m none r Delivery semantics m Unordered, unicast or multicast m Unreliable, but data integrity provided by checksum r Flow control m none r Congestion control m none Transport Layer 3-7 TCP and Transport Layer Functions r Demux to upper layer m TCP port field r Quality of service m none r Security m None, rely on TLS (SSL) r Connection setup m 3-way handshake r Delivery semantics m In-order, unicast m Data integrity provided via 32-bit checksum r Flow control m Receiver advertised window r Congestion control m Window-based Transport Layer 3-8 SCTP and Transport Layer Functions r Demux to upper layer m SCTP port field r Quality of service m none r Security m Limited DoS protection via signed state cookie (SYN cookies) m Rely on TLS (SSL) r Connection setup m 4-way handshake r Delivery semantics m Optional ordering, unicast m Optional reliability, but data integrity provided via 32-bit CRC r Flow control m Receiver advertised window r Congestion control m Window-based Transport Layer 3-9 Chapter 3 outline r 3.1 Transport-layer r 3.5 Connection-oriented services transport: TCP r 3.2 Multiplexing and m segment structure demultiplexing m reliable data transfer r 3.3 Connectionless m flow control transport: UDP m connection management r r 3.4 Principles of 3.6 Principles of reliable data transfer congestion control r 3.7 TCP congestion control Transport Layer 3-10 Multiplexing/demultiplexing Demultiplexing at rcv host: Multiplexing at send host: gathering data from multiple delivering received segments sockets, enveloping data with to correct socket header (later used for demultiplexing) = socket = process application P3 P1P1 application P2 P4 application transport transport transport network network network link link link physical physical physical host 3 host 1 host 2 Transport Layer 3-11 How demultiplexing works r host receives IP datagrams m each datagram has source IP address, destination IP 32 bits address source port # dest port # m each datagram carries 1 transport-layer segment m each segment has source, other header fields destination port number r host uses IP addresses & port numbers to direct segment to appropriate socket application m source, dest port #s in each segment data m recall: well-known port numbers for specific applications (message) m Servers wait on well known ports (/etc/services) TCP/UDP segment format Transport Layer 3-12 Connectionless demultiplexing r When host receives UDP r Create sockets with port numbers: segment: DatagramSocket mySocket1 = new m checks destination port DatagramSocket(99111); number in segment DatagramSocket mySocket2 = new m directs UDP segment to DatagramSocket(99222); socket with that port number r UDP socket identified by two-tuple: r IP datagrams with different source IP (dest IP address, dest port number) addresses and/or source port numbers directed to same socket Transport Layer 3-13 Connectionless demux (cont) DatagramSocket serverSocket = new DatagramSocket(6428); P1 P2 P3 P1 SP: 6428 SP: 6428 DP: 9157 DP: 5775 SP: 9157 SP: 5775 client DP: 6428 server DP: 6428 Client IP: A IP: C IP:B SP provides “return address” Transport Layer 3-14 Connection-oriented demux r TCP socket identified r Server host may support by 4-tuple: many simultaneous TCP m source IP address sockets: m source port number m each socket identified by m dest IP address its own 4-tuple m dest port number r Web servers have r recv host uses all four different sockets for values to direct each connecting client segment to appropriate m non-persistent HTTP will socket have different socket for each request Transport Layer 3-15 Connection-oriented demux (cont) P1 P4 P5 P6 P2 P1P3 SP: 5775 DP: 80 S-IP: B D-IP:C SP: 9157 SP: 9157 client DP: 80 server DP: 80 Client IP: A S-IP: A IP: C S-IP: B IP:B D-IP:C D-IP:C Transport Layer 3-16 Connection-oriented demux: Threaded Web Server P1 P4 P2 P1P3 SP: 5775 DP: 80 S-IP: B D-IP:C SP: 9157 SP: 9157 client DP: 80 server DP: 80 Client IP: A S-IP: A IP: C S-IP: B IP:B D-IP:C D-IP:C Transport Layer 3-17 Chapter 3 outline r 3.1 Transport-layer r 3.5 Connection-oriented services transport: TCP r 3.2 Multiplexing and m segment structure demultiplexing m reliable data transfer r 3.3 Connectionless m flow control transport: UDP m connection management r r 3.4 Principles of 3.6 Principles of reliable data transfer congestion control r 3.7 TCP congestion control Transport Layer 3-18 UDP: User Datagram Protocol [RFC 768] r “no frills,” “bare bones” Internet transport Why is there a UDP? protocol r no connection r “best effort” service, UDP establishment (which can segments may be: add delay) m lost r simple: no connection state m delivered out of order at sender, receiver to app r small segment header r connectionless: r no congestion control: UDP m no handshaking between can blast away as fast as UDP sender, receiver desired m each UDP segment handled independently of others Transport Layer 3-19 UDP: more r often used for streaming 32 bits multimedia apps m loss tolerant Length, in source port # dest port # m rate sensitive bytes of UDP length checksum r other UDP uses segment, m DNS including header m SNMP r reliable transfer over UDP m add reliability at Application application layer data m application-specific error (message) recovery! m Many applications re- implement reliability over UDP segment format UDP to bypass TCP m New transport protocols? Transport Layer 3-20 UDP checksum Goal: detect “errors” (e.g., flipped bits) in transmitted segment Sender: Receiver: r treat segment contents r compute checksum of as sequence of 16-bit received segment integers r check if computed checksum r checksum: addition (1’s equals checksum field value: complement sum) of m NO - error detected segment contents m YES - no error detected. r sender puts checksum But maybe errors value into UDP checksum nonetheless? More later field …. Transport Layer 3-21 Internet Checksum Example r Note m When adding numbers, a carryout from the most significant bit needs to be added to the result m 1s complement => convert 0 to 1 and 1 to 0 r Example: checksum for two 16-bit integers 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 Transport Layer 3-22 Internet Checksum Example r Verification at receiver m Add all 16-bit words and checksum together m If no errors, sum will be all 1s 1 1 1 1 0 0 1 1 0 0 1 1 0
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages304 Page
-
File Size-