Question? Leave a message!




Transport Layer of Computer Communication Networks (CCN)

Transport Layer of Computer Communication Networks (CCN)
Dr.ShivJindal Profile Pic
Dr.ShivJindal,India,Teacher
Published Date:19-07-2017
Website URL
Comment
Computer Communication Networks (CCN) 1Chapter Goals • Understand principles behind transport layer services: – multiplexing/demultiplexing – reliable data transfer – flow control – congestion control • Instantiation and implementation in the Internet Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 2Chapter Overview • Transport layer services • Multiplexing/demultiplexing • Connectionless transport: UDP • Principles of reliable data transfer • Connection-oriented transport: TCP – reliable transfer – flow control – connection management • Principles of congestion control • TCP congestion control Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 3Transport services and protocols • Provide logical communication between app’ processes running on different hosts • Transport protocols run in end systems • Transport vs. network layer services: – network layer: data transfer between end systems – transport layer: data transfer between processes – Relies on, enhances, network layer services Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 4Transport Services and Protocols application transport network data link network physical data link network physical data link physical network data link physical network data link physical network data link physical application transport network data link physical Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 5Transport-layer protocols Internet transport services: • Reliable, in-order unicast delivery (TCP) – congestion – flow control – connection setup • Unreliable (“best-effort”), unordered unicast or multicast delivery: UDP • Services not available: – real-time – bandwidth guarantees – reliable multicast Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 6Multiplexing / demultiplexing Recall: segment - unit of data Demultiplexing: delivering exchanged between received segments to transport layer entities correct app layer processes – aka TPDU: transport protocol data unit receiver P3 P4 application-layer M M data application segment P1 P2 transport M header M network application application transport segment H M transport t network segment H network n Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 7Multiplexing / demultiplexing Multiplexing: gathering data from multiple 32 bits app processes, enveloping source port dest port data with header (later used for demultiplexing) other header fields multiplexing/demultiplexing: • based on sender, receiver port numbers, IP application addresses data – source, dest port s in (message) each segment – recall: well-known port numbers for specific applications TCP/UDP segment format Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 8Multiplexing/demultiplexing: examples source port: x Web client dest. port: 23 server B host A host C source port:23 dest. port: x Source IP: C Source IP: C Dest IP: B Dest IP: B source port: y source port: x dest. port: 80 dest. port: 80 port use: simple telnet app Source IP: A Web Dest IP: B Web client source port: x server B dest. port: 80 host A port use: Web server Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 9UDP: User Datagram Protocol RFC 768 • “no frills,” “bare bones” Internet transport protocol • “best effort” service, UDP segments may be: – lost – delivered out of order to app • connectionless: – no handshaking between UDP sender, receiver – each UDP segment handled independently of others Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 10UDP: User Datagram Protocol RFC 768 Why is there a UDP? • no connection establishment (which can add delay) • simple: no connection state at sender, receiver • small segment header • no congestion control: UDP can blast away as fast as desired. – May not be a good idea, though Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 11UDP: more • Often used for streaming multimedia apps – loss tolerant – rate sensitive • Other UDP uses (why?): – DNS – SNMP • Reliable transfer over UDP: add reliability at application layer – application-specific error recovery Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 12UDP: more 32 bits source port dest port Length, in bytes of UDP checksum length segment, including header Application data (message) UDP segment format Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 13Error Detection and Correction • Single bit-errors vs Burst Errors 110101  100101 vs 100001 • n-bit codeword = m message bits + r check bits • Hamming Distance = of different bits 1010101 1001010 0011111  Hamming distance = 5 • Distance d code = minimum Hamming distance between any two code words written in the code • To detect d-bit errors, distance d+1 code required • To correct d-bit errors, distance 2d+1 code required Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 14Parity Checks 1 0 1 1 1 0 1 0 1 2 3 4 5 6 7 8 9 Odd Parity 1 0 1 1 1 0 1 0 0 0 0 1 1 1 0 1 0 0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1-bit error 0 0 0 1 0 0 1 0 0 0 0 0 1 1 0 1 0 0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 3-bit error 2-bit error Even Parity 1 0 1 1 1 0 1 1 0 1 2 3 4 5 6 7 8 9 Parity is a distance 2 code = can detect 1-bit errors Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 15UDP checksum Goal: detect “errors” (e.g., flipped bits) in transmitted segment Sender: • treat segment contents as sequence of 16- bit integers • checksum: addition (1’s complement sum) of segment contents • sender puts checksum value into UDP checksum field • In reality some IP header fields are included w/ the UDP segment for checksumming. Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 16UDP checksum Receiver: • compute checksum of received segment • check if computed checksum equals checksum field value: – NO - error detected – YES - no error detected. • But maybe errors nonetheless? • More in chap 5 on stronger error detection methods Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 17UDP Checksum Example • Consider three 16-bit words: 0110011001100110 0101010101010101 0000111100001111 • (1’s complement) sum of first two 16-bit words is: 1011101110111011 • Adding the third word to the above sum gives: 1100101011001010 • 1’s complement of this sum = invert 0’s and 1’s 0011010100110101 (this is the checksum field) • If no errors, sum of all four 16-bit words (incl. Checksum) will be all 1s, I.e., 1111111111111111 Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 18UDP Servers • Most UDP servers are “iterative” = a single server process receives and handles incoming requests on a “well- known” port. • Can filter client requests based on incoming IP/port addresses or wild card filters • Port numbers may be reused, but packet is delivered to at most one end-point. • Queues to hold requests if server busy Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 19Principles of Reliable Data Transfer • Important in app., transport, link layers • top-10 list of important networking topics • Characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt) Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 20