Week 05 Lecture - Network Fundamentals PDF

Summary

This document contains lecture notes on Network Fundamentals, specifically focusing on the Transport Layer. The notes discuss transport protocols, services, and demultiplexing/multiplexing.

Full Transcript

Network Fundamentals Lecture 5 Transport Laye...

Network Fundamentals Lecture 5 Transport Layer INSEARCH CRICOS provider code: 00859D I UTS CRICOS provider code: 00099F Insearch Limited is a controlled entity of the University of Technology Sydney (UTS), and a registered private higher education provider of pathways to UTS. Transport services and protocols application transport  provide logical communication network data link between app processes physical running on different hosts  transport protocols run in end systems send side: breaks app messages into segments, passes to network layer rcv side: reassembles application segments into messages, transport network passes to app layer data link physical  more than one transport protocol available to apps Internet: TCP and UDP Transport Layer 3-2 Transport vs. network layer  network layer: logical household analogy: communication between hosts 12 kids in Ann’s house sending letters to 12 kids in Bill’s  transport layer: house: logical  hosts = houses communication  processes = kids between processes  app messages = letters in envelopes relies on, enhances,  transport protocol = Ann network layer and Bill who demux to in- services house siblings  network-layer protocol = IP address – identifies the host postal service Port no. – identifies the process Transport Layer 3-3 Internet transport-layer protocols application  reliable, in-order transport network delivery : TCP data link physical network congestion control network data link data link physical physical flow control network data link connection setup physical network  unreliable, unordered data link physical delivery: UDP network data link physical no-frills extension of network data link application “best-effort” IP physical network data link transport network data link  Transport services not physical physical available: delay guarantees bandwidth guarantees Transport Layer 3-4 Multiplexing/demultiplexing multiplexing at sender: handle data from multiple demultiplexing at receiver: sockets, add transport header use header info to deliver (later used for demultiplexing) received segments to correct socket application application P1 P2 application socket P3 transport P4 process transport network transport network link network link physical link physical physical Transport Layer 3-5 Multiplexing/demultiplexing Transport Layer 3-6 How demultiplexing works  host receives IP datagrams 32 bits each datagram has source IP source port # dest port # address, destination IP address other header fields each datagram carries one transport-layer segment each segment has source, application destination port number data  host uses IP addresses & (payload) port numbers to direct segment to appropriate TCP/UDP segment format socket Transport Layer 3-7 Connectionless demultiplexing(UDP)  recall: created socket has host-  recall: when creating local port #: datagram to send into UDP servSoc=socket(AF…) servSock.bind((‘’,serverPort); socket, must specify destination IP address destination port #  when host receives UDP UDP segments with same segment: destination IP address checks destination port # destination port number in segment will be directed to same destination process via directs UDP segment to the same destination socket with that port # socket Transport Layer 3-8 Connectionless(UDP) demux: example serverSocket=socket mySocket2=socket (AF_INET,SOCKET_DGRAM) mySocket1=socket (AF_INET,SOCKET_DGRAM) serverSocket.bind((‘’, (AF_INET,SOCKET_DGRAM mySocket.bind((‘’,9157 6428)); mySocket.bind((‘’,5775) )); ); application application application P1 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: ? Transport Layer 3-9 Connection-oriented demux  TCP socket identified  server host may support by 4-tuple: many simultaneous TCP source IP address sockets: source port number each socket identified by dest IP address its own 4-tuple dest port number  web servers have  demux: receiver uses all different sockets for four values to direct each connecting client segment to appropriate non-persistent HTTP will socket have different socket for each request Transport Layer 3-10 Connection-oriented demux: example application application P4 P5 P6 application P1 P2 P3 transport transport transport network network link network link physical link physical server: IP physical address B Host A source IP,port: B,80 Host C initiates dest IP,port: A,9157 source IP,port: C,5775 initiates one dest IP,port: B,80 two HTTP source IP,port: A,9157 HTTP session dest IP, port: B,80 sessions 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 Transport Layer 3-11 Connection-oriented demux: example threaded server application application application P4 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 Transport Layer 3-12 UDP: User Datagram Protocol [RFC 768]  “no frills,” “bare bones”  UDP use: Internet transport  streaming multimedia protocol apps (loss tolerant, rate  “best effort” service, UDP sensitive) segments may be:  DNS lost  SNMP delivered out-of-order  reliable transfer over to app UDP:  connectionless:  add reliability at no handshaking application layer between UDP sender, receiver  application-specific error recovery! each UDP segment handled independently of others Transport Layer 3-13 UDP: segment header 32 bits source port # dest port # header length length checksum = 8 bytes why is there a UDP?  no connection application establishment (which can data add delay) (payload)  simple: no connection state at sender, receiver  small header size UDP segment format  no congestion control: UDP can blast away as fast as desired Transport Layer 3-14 Internet apps and transport protocols Transport Layer 3-15 UDP: segment header 32 bits source port # dest port # header length length checksum = 8 bytes UDP header – 4 fields  Source and destination port application numbers(2bytes each field) data  Length field –the number of (payload) bytes in the UDP segment (header plus data) (2 bytes)  Checksum –receiving host check whether errors have UDP segment format been introduced into the segment(2bytes Transport Layer 3-16 UDP checksum Goal: detect “errors” (e.g., flipped bits) in transmitted segment sender: receiver:  treat segment contents,  compute checksum of including header fields, received segment as sequence of 16-bit  check if computed checksum integers equals checksum field value:  checksum: addition (one’s complement sum) NO - error detected of segment contents YES - no error detected.  sender puts checksum But maybe errors value into UDP checksum nonetheless? More later field …. Transport Layer 3-17 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 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 Binary addition – can you remember? 0+0 = 0 0+1 = 1 1+0 = 1 1+1 = 10 > write 0 carry 1 1+1+1 = 11 > write 1 carry 1 Transport Layer 3-18 UDP checksum - summary Receiver checks if computed checksum equals checksum field value: YES match –no error detected NO match –error is detected Why UDP provides a checksum? Error Detection: Error recovery: (or not)  Links between source and  Although UDP provides destination may not provide error checking, it does not do error checking anything to recover from am  Even if segments are error… correctly sent across a link,  UDP simply discard the it’s possible that bit errors damaged segment could occur when a  UDP is not reliable segment is stored in a router’s memory Transport Layer 3-19

Use Quizgecko on...
Browser
Browser