1Spring 2003, COM1337/3501 Lecture 5: End-to-End Protocols Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie, Morgan Kaufmann Chapter.

Slides:



Advertisements
Similar presentations
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 5 End-to-End Protocols Copyright © 2010, Elsevier Inc. All rights.
Advertisements

Spring 2002CS 4611 Remote Procedure Call Outline Protocol Stack Presentation Formatting.
Spring Remote Procedure Call (5.3) Outline Protocol Stack Presentation Formatting.
Slide Set 13: TCP. In this set.... TCP Connection Termination TCP State Transition Diagram Flow Control How does TCP control its sliding window ?
CS 6401 Transport Control Protocol Outline TCP objectives revisited TCP basics New algorithms for RTO calculation.
Computer Networks Chapter 5: End-to-End Protocols
1 Chapter 5 End-to-End Protocols Outline 5.1 UDP 5.2 TCP 5.3 Remote Procedure Call.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 5 End-to-End Protocols Copyright © 2010, Elsevier Inc. All rights.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
8. Transport Protocol and UDP 8.1 Transport protocol : End-to-end protocol –IP: Host to host packet delivery –Transport: Process to process communication.
CSS432: End-to-End Protocols 1 CSS432 End-to-End Protocols Textbook Ch5.1 – 5.2 Professor: Munehiro Fukuda.
Reliable Byte-Stream (TCP)
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
End-to-End Protocols Outline Reliable Byte-Stream Simple Demultiplexer
6-May-154/598N: Computer Networks End-to-End Protocols Underlying best-effort network –drop messages –re-orders messages –delivers duplicate copies of.
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
CSE Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 14 – February 23, 2010.
TCP 4/15/2017.
1 Remote Procedure Call Outline Protocol Stack Presentation Formatting.
Fundamentals of Computer Networks ECE 478/578 Lecture #21: TCP Window Mechanism Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
TDC561 Network Programming Camelia Zlatea, PhD Week 10: Performance Aspects of End-to-End (Transport)
End-to-End Data Outline Presentation Formatting Data Compression.
Spring 2003CS 4611 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Spring 2002CS 4611 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Gursharan Singh Tatla Transport Layer 16-May
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
1 Internet Engineering University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
SMUCSE 4344 transport layer. SMUCSE 4344 transport layer end-to-end protocols –transport code runs only on endpoint hosts encapsulates network communications.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
1 Introduction to Computer Networks University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
Chapter 5 : End-to-End (Transport) Protocols Summary of underlying best-effort network capabilities (host-host) –drops packets or datagrams –re-orders.
CSE Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 14 – February 23, 2010.
Spring 2006CS 3321 Remote Procedure Call Outline Protocol Stack Presentation Formatting.
CSE 331: Introduction to Networks and Security Fall 2000 Instructor: Carl A. Gunter Slide Set 5.
Introduction to Computer Networks
Spring 2010CS 3321 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
CSE Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 22 – April 1, 2010.
Spring 2008CPE Computer Networks1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control.
1 End-to-End Protocols User Datagram Protocol (UDP) Transmission Control Protocol(TCP)
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Ilam University Dr. Mozafar Bag-Mohammadi 1 Transport Layer.
Spring 2000CS 4611 Remote Procedure Call Outline Protocol Stack Presentation Formatting.
1 End-to-End Protocols UDP TCP –Connection Establishment/Termination –Sliding Window Revisited –Flow Control –Congestion Control –Adaptive Timeout.
11 CS716 Advanced Computer Networks By Dr. Amir Qayyum.
1 Transmission Control Protocol (TCP) RFC: Introduction The TCP is intended to provide a reliable process-to-process communication service in a.
3. END-TO-END PROTOCOLS (PART 1) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE.
Advanced Computer Networks
Transport Control Protocol
5. End-to-end protocols (part 1)
Internet routing Problem: Route from any node to any other node
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
TCP Overview Connection-oriented Byte-stream Full duplex
Transport Control Protocol
Advanced Computer Networks
Advanced Computer Networks
University of Houston Remote Procedure Call Datacom II Lecture 6
Reliable Byte-Stream (TCP)
Ilam University Dr. Mozafar Bag-Mohammadi
State Transition Diagram
Advanced Computer Networks
The University of Adelaide, School of Computer Science
Transport Protocols: TCP Segments, Flow control and Connection Setup
Introduction to Computer Networks
Introduction to Computer Networks
Introduction to Computer Networks
Transport Protocols: TCP Segments, Flow control and Connection Setup
Presentation transcript:

1Spring 2003, COM1337/3501 Lecture 5: End-to-End Protocols Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie, Morgan Kaufmann Chapter 5.

2Spring 2003, COM1337/3501 Lecture Outline –Connection –Establishment/Termination –Sliding Window Revisited –Flow Control –Adaptive Timeout –Overview of Remote Procedure Call

3Spring 2003, COM1337/3501 End-to-End Protocols Goal: turn host-to-host packet delivery into process-to-process communication channel Underlying best-effort network –drop messages –re-orders messages –delivers duplicate copies of a given message –limits messages to some finite size –delivers messages after an arbitrarily long delay Common end-to-end services –guarantee message delivery –deliver messages in the same order they are sent –deliver at most one copy of each message –support arbitrarily large messages –support synchronization –allow the receiver to flow control the sender –support multiple application processes on each host

4Spring 2003, COM1337/3501 Types of End-to-End Protocols Simple asynchronous demultiplexing service (e.g., UDP) Reliable byte-stream service (e.g., TCP) Request reply service (e.g., RPC)

5Spring 2003, COM1337/3501 Simple Demultiplexor (UDP) Unreliable and unordered datagram service Adds multiplexing No flow control Endpoints identified by ports –servers have well-known ports (e.g., DNS: port 53, talk: 517) –see /etc/services on Unix Header format Optional checksum –pseudo header + UDP header + data –Pseudo header = protocol number, source IP addr, dest IP addr, UDP length SrcPortDstPort ChecksumLength Data 01631

6Spring 2003, COM1337/3501 TCP Overview Reliable Connection-oriented Byte-stream –app writes bytes –TCP sends segments –app reads bytes Application process Write bytes TCP Send buffer Segment Transmit segments Application process Read bytes TCP Receive buffer … …… Full duplex Flow control: keep sender from overrunning receiver Congestion control: keep sender from overrunning network

7Spring 2003, COM1337/3501 Data Link Versus Transport Potentially connects many different hosts –need explicit connection establishment and termination Potentially different RTT –need adaptive timeout mechanism Potentially long delay in network –need to be prepared for arrival of very old packets Potentially different capacity at destination –need to accommodate different node capacity Potentially different network capacity –need to be prepared for network congestion

8Spring 2003, COM1337/3501 End-to-End Argument A function should not be provided in the lower levels of the system unless it can be completely and correctly implemented Exception: optimization –Example: CRC at layer 2 + checksum at layer 4 The end-to-end argument has to be revisited for wireless networks

9Spring 2003, COM1337/3501 Segment Format

10Spring 2003, COM1337/3501 Segment Format (cont) Each connection identified with 4-tuple: –(SrcPort, SrcIPAddr, DsrPort, DstIPAddr) Sliding window + flow control –acknowledgment, SequenceNum, AdvertisedWindow Flags –SYN, FIN, RESET, PUSH, URG, ACK Checksum –pseudo header + TCP header + data Sender Data(SequenceNum) Acknowledgment + AdvertisedWindow Receiver

11Spring 2003, COM1337/3501 Segments Transmission Transmission of segments can be triggered by: –When the data to be sent reaches: Maximum Segment Size (MSS). MSS is usually equal to the longest segment that won’t result in local IP fragmentation –Request from the application: Push operation (e.g., Telnet) –Periodic timer

12Spring 2003, COM1337/3501 Connection Establishment and Termination Active participant (client) Passive participant (server) SYN, SequenceNum = x SYN + ACK, SequenceNum = y, ACK, Acknowledgment = y + 1 Acknowledgment = x + 1

13Spring 2003, COM1337/3501 State Transition Diagram CLOSED LISTEN SYN_RCVDSYN_SENT ESTABLISHED CLOSE_WAIT LAST_ACKCLOSING TIME_WAIT FIN_WAIT_2 FIN_WAIT_1 Passive openClose Send/SYN SYN/SYN + ACK SYN + ACK/ACK SYN/SYN + ACK ACK Close/FIN FIN/ACKClose/FIN FIN/ACK ACK + FIN/ACK Timeout after two segment lifetimes FIN/ACK ACK Close/FIN Close CLOSED Active open/SYN

14Spring 2003, COM1337/3501 Sliding Window in TCP Purpose: –Guarantees a reliable delivery of data (ARQ) –Ensures that data is delivered in order (SeqNum) –Enforces flow-control between sender and receiver (AdvertisedWindow field)

15Spring 2003, COM1337/3501 Sliding Window Revisited Sending side –LastByteAcked < = LastByteSent –LastByteSent < = LastByteWritten –buffer bytes between LastByteAcked and LastByteWritten Sending application LastByteWritten TCP LastByteSentLastByteAcked Receiving application LastByteRead TCP LastByteRcvdNextByteExpected Receiving side –LastByteRead < NextByteExpected –NextByteExpected < = LastByteRcvd +1 –buffer bytes between NextByteRead and LastByteRcvd

16Spring 2003, COM1337/3501 Flow Control Send buffer size: MaxSendBuffer Receive buffer size: MaxRcvBuffer Receiving side –LastByteRcvd - LastByteRead < = MaxRcvBuffer –AdvertisedWindow = MaxRcvBuffer - ( LastByteRcvd - LastByteRead ) Sending side –LastByteSent - LastByteAcked < = AdvertisedWindow –EffectiveWindow = AdvertisedWindow - ( LastByteSent - LastByteAcked ) –LastByteWritten - LastByteAcked < = MaxSendBuffer –block sender if ( LastByteWritten - LastByteAcked ) + y > MaxSenderBuffer Always send ACK in response to arriving data segment Persist when AdvertisedWindow = 0

17Spring 2003, COM1337/3501 Protection Against Wrap Around 32-bit SequenceNum BandwidthTime Until Wrap Around T1 (1.5 Mbps)6.4 hours Ethernet (10 Mbps)57 minutes T3 (45 Mbps)13 minutes FDDI (100 Mbps)6 minutes STS-3 (155 Mbps)4 minutes STS-12 (622 Mbps)55 seconds STS-24 (1.2 Gbps)28 seconds

18Spring 2003, COM1337/3501 Keeping the Pipe Full 16-bit AdvertisedWindow (assuming an RTT ~100ms) BandwidthDelay x Bandwidth Product T1 (1.5 Mbps)18KB Ethernet (10 Mbps)122KB T3 (45 Mbps)549KB FDDI (100 Mbps)1.2MB STS-3 (155 Mbps)1.8MB STS-12 (622 Mbps)7.4MB STS-24 (1.2 Gbps)14.8MB

19Spring 2003, COM1337/3501 TCP Extensions Implemented as header options: –Why? Store timestamp in outgoing segments Extend sequence space with 32-bit timestamp (PAWS: Protection Against Wrapped Sequences) Shift (scale) advertised window

20Spring 2003, COM1337/3501 Adaptive Retransmission (Original Algorithm) Measure SampleRTT for each segment/ ACK pair Compute weighted average of RTT –EstRTT =  x EstRTT +  x SampleRTT –where  +  = 1  between 0.8 and 0.9  between 0.1 and 0.2 Set timeout based on EstRTT –TimeOut = 2 x EstRTT

21Spring 2003, COM1337/3501 Problem with Original Algorithm ACK indicate receipt of data and not of packet If ACK corresponds to retransmitted packet than estimated RTT would be too large. The reverse is also possible.

22Spring 2003, COM1337/3501 Karn/Partridge Algorithm Do not sample RTT when retransmitting Double timeout after each retransmission SenderReceiver Original transmission ACK SampleR TT Retransmission SenderReceiver Original transmission ACK SampleR TT Retransmission

23Spring 2003, COM1337/3501 Jacobson/ Karels Algorithm New Calculations for average RTT Diff = SampleRTT - EstRTT EstRTT = EstRTT + (  x Diff) Dev = Dev +  ( |Diff| - Dev) –where  is a factor between 0 and 1 Consider variance when setting timeout value TimeOut =  x EstRTT +  x Dev –where  = 1 and  = 4 Notes –algorithm only as good as granularity of clock (500ms on Unix) –accurate timeout mechanism important to congestion control (later)

24Spring 2003, COM1337/3501 Record Boundaries TCP is a byte-stream protocol How to indicate some structure within the stream? –URG flag + UrgPtr (out-of-band data). Initially designed for urgent data. –PUSH mechanism: Initially and still used by interactive applications Can also be used to break the received stream into records –Application program

25Spring 2003, COM1337/3501 Remote Procedure Calls (RPC) RPC: –Generic mechanism for structuring distributed systems Components: –Protocol: manages the messages sent between the client and the server processes and handles network issues –Programming language and compiler support: Arguments translation from one machine architecture to another…

26Spring 2003, COM1337/3501 RPC Components Protocol Stack –BLAST: fragments and reassembles large messages –CHAN: synchronizes request and reply messages –SELECT: dispatches request to the correct process Stubs Caller (client) Client stub RPC protocol Return value Arguments ReplyRequest Callee (server) Server stub RPC protocol Return value Arguments ReplyRequest

27Spring 2003, COM1337/3501 Bulk Transfer (BLAST) Unlike AAL and IP, tries to recover from lost fragments Strategy –selective retransmission –partial acknowledgements SenderReceiver Fragment 1 Fragment 2 Fragment 3 Fragment 5 Fragment 4 Fragment 6 Fragment 3 Fragment 5 SRR

28Spring 2003, COM1337/3501 BLAST Details Sender: –after sending all fragments, set timer DONE –if receive SRR, send missing fragments and reset DONE –if timer DONE expires, free fragments

29Spring 2003, COM1337/3501 BLAST Details (cont) Receiver: –when first fragments arrives, set timer LAST_FRAG –when all fragments present, reassemble and pass up –four exceptional conditions: if last fragment arrives but message not complete –send SRR and set timer RETRY if timer LAST_FRAG expires –send SRR and set timer RETRY if timer RETRY expires for first or second time –send SRR and set timer RETRY if timer RETRY expires a third time –give up and free partial message

30Spring 2003, COM1337/3501 BLAST Header Format MID must protect against wrap around TYPE = DATA or SRR NumFrags indicates number of fragments FragMask distinguishes among fragments –if Type=DATA, identifies this fragment –if Type=SRR, identifies missing fragments

31Spring 2003, COM1337/3501 Request/Reply (CHAN) Guarantees message delivery Synchronizes client with server Supports at-most-once semantics Simple case Implicit Acks ClientServer Request ACK Reply ACK ClientServer Request 1 Request 2 Reply 2 Reply 1 …

32Spring 2003, COM1337/3501 CHAN Details Lost message (request, reply, or ACK) –set RETRANSMIT timer –use message id (MID) field to distinguish Slow (long running) server –client periodically sends “are you alive” probe, or –server periodically sends “I’m alive” notice Want to support multiple outstanding calls –use channel id (CID) field to distinguish Machines crash and reboot –use boot id (BID) field to distinguish

33Spring 2003, COM1337/3501 Synchronous vs Asynchronous Protocols Asynchronous interface xPush(Sessn s, Msg *msg) xPop(Sessn s, Msg *msg, void *hdr) xDemux(Protl hlp, Sessn s, Msg *msg) Synchronous interface xCall(Sessn s, Msg *req, Msg *rep) xCallPop(Sessn s, Msg *req, Msg *rep, void *hdr) xCallDemux(Protl hlp, Sessn s, Msg *req, Msg *rep) CHAN is a hybrid protocol –synchronous from above: xCall –asynchronous from below: xPop/xDemux

34Spring 2003, COM1337/3501 Dispatcher (SELECT) Dispatch to appropriate procedure Synchronous counterpart to UDP Caller SELECT CHAN xCall xDemuxxPush Callee SELECT CHAN xCallDemux xDemuxxPush ServerClient Address Space for Procedures –flat: unique id for each possible procedure –hierarchical: program + procedure number

35Spring 2003, COM1337/3501 Simple RPC Stack BLAST ETH IP SELECT CHAN

36Spring 2003, COM1337/3501 SunRPC IP implements BLAST-equivalent –except no selective retransmit SunRPC implements CHAN-equivalent –except not at-most-once UDP + SunRPC implement SELECT-equivalent –UDP dispatches to program (ports bound to programs) –SunRPC dispatches to procedure within program

37Spring 2003, COM1337/3501 SunRPC Header Format XID (transaction id) is similar to CHAN’s MID Server does not remember last XID it serviced Problem if client retransmits request while reply is in transit Data MsgType = CALL XID RPCVersion = 2 Program Version Procedure Credentials (variable) Verifier (variable) 031 Data MsgType = REPLY XID Status = ACCEPTED 031

38Spring 2003, COM1337/3501 Presentation Formatting Marshalling (encoding) application data into messages Unmarshalling (decoding) messages into application data Data types we consider –integers –floats –strings –arrays –structs Application data Presentation encoding Application data Presentation decoding Message … Types of data we do not consider –images –video –multimedia documents

39Spring 2003, COM1337/3501 Difficulties Representation of base types –floating point: IEEE 754 versus non-standard –integer: big-endian versus little-endian (e.g., 34,677,374) Compiler layout of structures (126)(34)(17)(2) Big-endian Little-endian (2)(17)(34)(126) High address Low address

40Spring 2003, COM1337/3501 Taxonomy Data types –base types (e.g., ints, floats); must convert –flat types (e.g., structures, arrays); must pack –complex types (e.g., pointers); must linearize Conversion Strategy –canonical intermediate form –receiver-makes-right (an N x N solution) Marshaller Application data structure

41Spring 2003, COM1337/3501 Taxonomy (cont) Tagged versus untagged data Stubs –compiled –interpreted type = INT len = 4value = Call P Client stub RPC Arguments Marshalled arguments Interface descriptor for Procedure P Stub compiler Message Specification P Server stub RPC Arguments Marshalled arguments Code

42Spring 2003, COM1337/3501 eXternal Data Representation (XDR) Defined by Sun for use with SunRPC C type system (without function pointers) Canonical intermediate form Untagged (except array length) Compiled stubs

43Spring 2003, COM1337/3501 #define MAXNAME 256; #define MAXLIST 100; struct item { int count; char name[MAXNAME]; int list[MAXLIST]; }; bool_t xdr_item(XDR *xdrs, struct item *ptr) { return(xdr_int(xdrs, &ptr->count) && xdr_string(xdrs, &ptr->name, MAXNAME) && xdr_array(xdrs, &ptr->list, &ptr->count, MAXLIST, sizeof(int), xdr_int)); } CountName JO37HNSON List

44Spring 2003, COM1337/3501 Abstract Syntax Notation One (ASN-1) An ISO standard Essentially the C type system Canonical intermediate form Tagged Compiled or interpreted stubs BER: Basic Encoding Rules (tag, length, value) value type lengthvaluelengthtypevaluelength

45Spring 2003, COM1337/3501 Network Data Representation (NDR) Defined by DCE Essentially the C type system Receiver-makes-right (architecture tag) Individual data items untagged Compiled stubs from IDL 4-byte architecture tag –IntegerRep 0 = big-endian 1 = little-endian –CharRep 0 = ASCII 1 = EBCDIC –FloatRep 0 = IEEE = VAX 2 = Cray 3 = IBM