Welcome to CS 3516: Computer Networks Prof. Yanhua Li Time: 9:00am 9:50am, T, R, and F Location: AK219 Fall 2018 A-term 1 Some slides are originally from the course materials of the textbook Computer Networking: A Top Down Approach, 7th edition, by Jim Kurose, Keith Ross, Addison-Wesley arch 2016. Copyright 1996-2017 J.F Kurose and K.W. Ross, All Rights Resered.
Lab 2 due today. Grading by next Thu! Quiz 4: Graded! Proj 1: Grading by next Tue! Quiz 5: Grading By next Wed! Application Layer 2-2
segment datagram frame bits message H l H t H n H t H n H t source Encapsulation switch H l H n H n H t H t H t destination H l H n H n H t H t H n H t router Introduction 1-3
Chapter 3: Transport Layer our goals: understand principles behind layer serices: multiplexing, demultiplexing reliable data transfer learn about Internet layer protocols: UDP: connectionless TCP: connection-oriented reliable Transport Layer 3-4
Chapter 3 outline 3.1 -layer serices 3.2 multiplexing and demultiplexing 3.3 connectionless : UDP Transport Layer 3-5
Transport serices and protocols proide logical communication between app processes running on different hosts protocols run in end systems send side: breaks app messages into segments, passes to layer rc side: reassembles segments into messages, passes to app layer more than one protocol aailable to apps Internet: TCP and UDP data logical end-end data Transport Layer 3-6
Transport s. layer layer: logical communication between hosts layer: logical communication between processes relies on, enhances, layer serices 12 kids in Ann s house sending letters to 12 kids in Bill s house: hosts = houses processes = kids app messages = letters in household analogy: enelopes protocol = Ann and Bill who demux to inhouse siblings -layer protocol = postal serice Transport Layer 3-7
Internet -layer protocols reliable, in-order deliery (TCP) retransmission congestion control flow control connection setup unreliable, unordered deliery: UDP no-frills extension of best-effort IP message segment datagrams data data data logical end-end data data data data data data Transport Layer 3-8
Chapter 3 outline 3.1 -layer serices 3.2 multiplexing and demultiplexing 3.3 connectionless : UDP Transport Layer 3-9
ultiplexing/demultiplexing multiplexing at sender: handle data from multiple sockets, add header (later used for demultiplexing) demultiplexing at receier: use header info to delier receied segments to correct socket P3 P1 P2 P4 socket process Transport Layer 3-10
Connectionless demultiplexing when host receies UDP segment: checks destination port # in segment directs UDP segment to socket with that port # IP datagrams with same dest. port #, but different source IP addresses and/or source port numbers will be directed to same socket at dest Transport Layer 3-11
Connectionless demux: example DatagramSocket mysocket2 = new DatagramSocket (9157); P3 DatagramSocket serersocket = new DatagramSocket (6428); P1 DatagramSocket mysocket1 = new DatagramSocket (5775); P4 source port: 6428 dest port: 9157 source port:? dest port:? source port: 9157 dest port: 6428 source port:? dest port:? Transport Layer 3-12
Connection-oriented demux TCP socket identified by 4-tuple: source IP address source port number dest IP address dest port number demux: receier uses all four alues to direct segment to appropriate socket serer host may support many simultaneous TCP sockets: each socket identified by its own 4-tuple Transport Layer 3-13
Connection-oriented demux: example 80 9157 5775 9157 P3 P4 P5 P6 serer: IP address B P2 P3 host: IP address A source IP,port: B,80 dest IP,port: A,9157 source IP,port: A,9157 dest IP, port: B,80 three segments, all destined to IP address: B, dest port: 80 are demultiplexed to different sockets source IP,port: C,5775 dest IP,port: B,80 source IP,port: C,9157 dest IP,port: B,80 host: IP address C Transport Layer 3-14
Chapter 3 outline 3.1 -layer serices 3.2 multiplexing and demultiplexing 3.3 connectionless : UDP Transport Layer 3-15
UDP: User Datagram Protocol [RFC 768] best effort serice, UDP segments may be: lost deliered out-of-order to app connectionless: no handshaking between UDP sender, receier each UDP segment handled independently of others UDP use: streaming multimedia apps (loss tolerant, rate sensitie) DNS reliable transfer oer UDP: add reliability at layer -specific error recoery! Transport Layer 3-16
UDP: segment header (8 bytes header) 32 bits source port # dest port # length data (payload) checksum UDP segment format length, in bytes of UDP segment, including header why is there a UDP? no connection establishment (which can add delay) simple: no connection state at sender, receier small header size no congestion control: UDP can blast away as fast as desired Transport Layer 3-17
UDP checksum Goal: detect errors (e.g., flipped bits) in transmitted segment sender: treat segment contents, including header fields, as sequence of 16-bit integers checksum: addition (one s complement sum) of segment contents sender puts checksum alue into UDP checksum field receier: compute checksum of receied segment check if computed checksum equals checksum field alue: NO - error detected YES - no error detected. But maybe errors nonetheless? ore later. Transport Layer 3-18
Internet checksum: example example: add 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 sum checksum 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 Note: when adding numbers, a carryout from the most significant bit needs to be added to the result Transport Layer 3-19
Questions? Application Layer 2-20