CCS2201 Introductions to Networks Lecture 6 - Fall 2023-2024 PDF
Document Details
Uploaded by Deleted User
Tags
Summary
These lecture notes cover the transport layer services and protocols, including TCP and UDP. They discuss actions in end systems, such as segmenting and reassembling messages for network communication, as well as multiplexing and demultiplexing. The document includes examples related to network diagrams.
Full Transcript
CCS2201 Introductions to Networks Fall 2023-2024 Lecture #6 Trans Layer Services, UDP 1 Transport services and protocols application transport §...
CCS2201 Introductions to Networks Fall 2023-2024 Lecture #6 Trans Layer Services, UDP 1 Transport services and protocols application transport § provide logical communication network mobile network data link physical between application processes national or global ISP running on different hosts lo g ica l en § transport protocols actions in end d-e systems: nd local or tra sender: breaks application messages regional ISP nsp into segments, passes to network layer ort home network content receiver: reassembles segments into provider network messages, passes to application layer datacenter application transport network network § two transport protocols available to data link physical Internet applications enterprise network TCP, UDP Transport Layer Actions Sender: § is passed an application- layer message application application app. msg § determines segment transport header fields values TThhtransport app. msg network (IP) § creates segment network (IP) link § passes segment to IP link physical physical Transport Layer Actions Receiver: § receives segment from IP § checks header values application application § extracts application-layer app. msg transport message transport network (IP) § demultiplexes message up network (IP) to application via socket link link physical physical Th app. msg Two principal Internet transport protocols application transport § TCP: Transmission Control Protocol mobile network network data link physical reliable, in-order delivery national or global ISP lo g congestion control ica flow control l en d-e connection setup nd local or § UDP: User Datagram Protocol tra regional ISP nsp unreliable, unordered delivery ort home network content provider no-frills extension of “best-effort” IP network datacenter application network § services not available: transport network data link delay guarantees physical bandwidth guarantees enterprise network Transport Layer Transport-layer services Multiplexing and demultiplexing Connectionless transport: UDP Principles of reliable data transfer Connection-oriented transport: TCP Principles of congestion control TCP congestion control Evolution of transport-layer functionality Multiplexing/demultiplexing multiplexing at sender: demultiplexing at receiver: handle data from multiple use header info to deliver sockets, add transport header received segments to correct (later used for demultiplexing) socket application application P1 P2 application socket P3 transport P4 process transport network transport network link network link physical link physical physical How demultiplexing works § host receives IP datagrams 32 bits each datagram has source IP source port # dest port # address, destination IP address each datagram carries one other header fields transport-layer segment each segment has source, application destination port number data § host uses IP addresses & port (payload) numbers to direct segment to appropriate socket TCP/UDP segment format Connectionless demultiplexing: an example of UDP demultiplexing DatagramSocket serverSocket = new DatagramSocket DatagramSocket mySocket2 = new (6428); DatagramSocket mySocket1 = new DatagramSocket DatagramSocket (5775); (9157); application application P1 application P3 P4 transport transport transport network network link network link physical link physical physical source port: 6428 source port: ? dest port: 9157 dest port: ? source port: 9157 source port: ? dest port: 6428 dest port: ? Connection-oriented demultiplexing: TCP demultiplexing § TCP socket identified by § server may support many 4-tuple: simultaneous TCP sockets: source IP address each socket identified by its source port number own 4-tuple dest IP address each socket associated with dest port number a different connecting client § demux: receiver uses all four values (4-tuple) to direct segment to appropriate socket Connection-oriented demultiplexing: example on TCP demultiplexing application application P4 P5 P6 application P3 P2 P3 transport transport transport network network link network link physical link physical server: IP physical address B host: IP source IP,port: B,80 host: IP address A dest IP,port: A,9157 source IP,port: C,5775 address C dest IP,port: B,80 source IP,port: A,9157 dest IP, port: B,80 source IP,port: C,9157 dest IP,port: B,80 Three segments, all destined to IP address: B, dest port: 80 are demultiplexed to different sockets HTTP server client application application transport transport network transport network link network link physical link physical physical HTTP server client application application transport transport network transport network link network link physical link physical physical ? de-multiplexing application ? transport de-multiplexing multiplexing application transport multiplexing Summary of multiplexing and demultiplexing § Multiplexing, demultiplexing: based on segment, datagram header field values § UDP: demultiplexing using destination port number (only) § TCP: demultiplexing using 4-tuple: source and destination IP addresses, and port numbers § Multiplexing/demultiplexing happen at all layers Transport Layer Transport-layer services Multiplexing and demultiplexing Connectionless transport: UDP Principles of reliable data transfer Connection-oriented transport: TCP Principles of congestion control TCP congestion control Evolution of transport-layer functionality UDP: User Datagram Protocol Why is there a UDP? § “no frills,” “bare bones” Internet transport protocol § no connection establishment (which can § “best effort” service, UDP add RTT delay) segments may be: § simple: no connection state lost at sender, receiver delivered out-of-order to app § small header size § connectionless: § no congestion control no handshaking between UDP § UDP can blast away as fast as desired! sender, receiver § can function in the face of each UDP segment handled congestion independently of others UDP: User Datagram Protocol § UDP use: § streaming multimedia apps (loss tolerant, rate sensitive) § DNS § SNMP § HTTP/3 § if reliable transfer needed over UDP (e.g., HTTP/3): § add needed reliability at application layer § acc congestion control at application layer UDP: Transport Layer Actions SNMP client SNMP server application application transport transport (UDP) (UDP) network (IP) network (IP) link link physical physical UDP: Transport Layer Actions SNMP client SNMP server UDP sender actions: application § is passed an application- application SNMP msg layer message transport transport § determines UDP segment UDP UDPhh SNMP msg (UDP) header fields values (UDP) network (IP) § creates UDP segment network (IP) link § passes segment to IP link physical physical UDP: Transport Layer Actions SNMP client SNMP server UDP receiver actions: application § receives segment from IP application § checks UDP checksum transport transport SNMP msg header value (UDP) (UDP) § extracts application-layer network UDPh SNMP(IP) msg message network (IP) § demultiplexes message up link link to application via socket physical physical UDP segment header 32 bits source port # dest port # length checksum application length, in bytes of UDP data segment, including (payload) header data to/from UDP segment format application layer UDP checksum Goal: detect errors (i.e., flipped bits) in transmitted segment sender: receiver: § treat contents of UDP § compute checksum of received segment (including UDP header segment fields and IP addresses) as sequence of 16-bit integers § check if computed checksum equals § checksum: addition (one’s checksum field value: complement sum) of segment Not equal - error detected content Equal - no error detected. But maybe § checksum value put into errors nonetheless? More later …. UDP checksum field Internet checksum: an example example: add two 16-bit integers 1110011001100110 1101010101010101 wraparound 11011101110111011 sum 1011101110111100 checksum 0100010001000011 Note: when adding numbers, a carryout from the most significant bit needs to be added to the result Internet checksum: weak protection! example: add two 16-bit integers 01 1110011001100110 10 1101010101010101 wraparound 11011101110111011 Even though numbers have sum 1011101110111100 changed (bit flips), no change checksum 0100010001000011 in checksum! Summary: UDP § “no frills” protocol: segments may be lost, delivered out of order best effort service: “send and hope for the best” § UDP has its plusses: no setup/handshaking needed (no RTT incurred) can function when network service is compromised helps with reliability (checksum) § build additional functionality on top of UDP in application layer (e.g., HTTP/3)