Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT 740 Class Location:

Similar presentations


Presentation on theme: "CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT 740 Class Location:"— Presentation transcript:

1 CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT 740 Email: carey@cpsc.ucalgary.cacarey@cpsc.ucalgary.ca Class Location: ICT 122 Lectures: MWF 12:00 – 12:50 Notes derived from “ Computer Networking: A Top Down Approach”, by Jim Kurose and Keith Ross, Addison-Wesley. Slides are adapted from the book’s companion Web site, with changes by Anirban Mahanti and Carey Williamson.

2 CPSC 441: Intro, UDP2 Chapter 3: Transport Layer Our goals: r understand principles behind transport layer services: m multiplexing and demultiplexing m reliable data transfer m flow control m congestion control r learn about transport layer protocols in the Internet: m UDP: connectionless transport m TCP: connection-oriented transport m TCP congestion control

3 CPSC 441: Intro, UDP3 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end systems m send side: breaks app messages into segments, passes to network layer m rcv side: reassembles segments into messages, passes to app layer r more than one transport protocol available to apps m Internet: TCP and UDP application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport

4 CPSC 441: Intro, UDP4 Transport vs. Network Layer r transport layer: logical communication between processes m relies on, enhances, network layer services m PDU: Segment m extends “host-to-host” communication to “process-to-process” communication r network layer: logical communication between hosts m PDU: Datagram m Datagrams may be lost, duplicated, reordered in the Internet – “best effort” service

5 CPSC 441: Intro, UDP5 TCP/IP Transport Layer Protocols r reliable, in-order delivery (TCP) m connection setup m flow control m congestion control r unreliable, unordered delivery: UDP m no-frills extension of “best-effort” IP m What does UDP provide in addition to IP? r services not provided by IP (network layer): m delay guarantees m bandwidth guarantees

6 CPSC 441: Intro, UDP6 Multiplexing/Demultiplexing r Use same communication channel between hosts for several logical communication processes r How does Mux/DeMux work? m Sockets: doors between process & host m UDP socket: (dest. IP, dest. Port) m TCP socket: (src. IP, src. port, dest. IP, dest. Port) Transport Layer Network Layer Transport Layer Network Layer HTTP FTP Telnet

7 CPSC 441: Intro, UDP7 Connectionless demux r UDP socket identified by two-tuple: m ( dest IP address, dest port number) r When host receives UDP segment: m checks destination port number in segment m directs UDP segment to socket with that port number r IP datagrams with different source IP addresses and/or source port numbers directed to same socket

8 CPSC 441: Intro, UDP8 Connection-oriented demux r TCP socket identified by 4-tuple: m source IP address m source port number m dest IP address m dest port number r recv host uses all four values to direct segment to appropriate socket r Server host may support many simultaneous TCP sockets: m each socket identified by its own 4-tuple r Web servers have different sockets for each connecting client m non-persistent HTTP will have different socket for each request

9 CPSC 441: Intro, UDP9 UDP: User Datagram Protocol [RFC 768] r “no frills,” “bare bones” Internet transport protocol r “best effort” service, UDP segments may be: m lost m delivered out of order to app r Why use UDP? m No connection establishment cost (critical for some applications, e.g., DNS) m No connection state m Small segment headers (only 8 bytes) m Finer application control over data transmission

10 CPSC 441: Intro, UDP10 UDP Segment Structure r often used for streaming multimedia apps m loss tolerant m rate sensitive r other UDP uses m DNS m SNMP r reliable transfer over UDP: add reliability at application layer m application-specific error recovery! source port #dest port # 32 bits Application data (message) UDP segment format length checksum Length, in bytes of UDP segment, including header

11 CPSC 441: Intro, UDP11 UDP checksum Sender: r treat segment contents as sequence of 16-bit integers r checksum: addition (1’s complement sum) of segment contents r sender puts checksum value into UDP checksum field Receiver: r compute checksum of received segment r check if computed checksum equals checksum field value: m NO - error detected m YES - no error detected. But maybe errors nonetheless? More later …. Goal: detect “errors” (e.g., flipped bits) in transmitted segment

12 CPSC 441: Intro, UDP12 Internet Checksum Example r Note: When adding numbers, a carryout from the most significant bit needs to be added to the result r Example: add two 16-bit integers r Weak error protection? Why is it useful? 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 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 wraparound sum checksum


Download ppt "CPSC 441: Intro, UDP1 Transport Layer Instructor: Carey Williamson Office: ICT 740 Class Location:"

Similar presentations


Ads by Google