148
End-to-End Protocols 5.1 Simple Demultiplexer (UDP) 5.2 Reliable Byte-Stream (TCP) 5.3 Remote Procedure Call (RPC) 5.4 Transport for Real-Time Applications (RTP)

End-to-End Protocols 5.1 Simple Demultiplexer (UDP) 5.2 Reliable Byte-Stream (TCP) 5.3 Remote Procedure Call (RPC) 5.4 Transport for Real-Time Applications

Embed Size (px)

Citation preview

  • Slide 1
  • End-to-End Protocols 5.1 Simple Demultiplexer (UDP) 5.2 Reliable Byte-Stream (TCP) 5.3 Remote Procedure Call (RPC) 5.4 Transport for Real-Time Applications (RTP)
  • Slide 2
  • Underlying best-effort network drop messages reorder messages deliver duplicate copies of a given message limit messages to some finite size deliver messages after an arbitrarily long delay Transport layer protocol support communication between the end application programs also called end-to-end protocol
  • Slide 3
  • Physical Data Link Network Transport Application Signals Physical Data Link Network framing, error detection, reliability control, media-access control Transport Application Src Dst host-to-host packet delivery global addressing routing
  • Slide 4
  • Common properties that a transport protocol should provide 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 between the sender and the receiver allow the receiver to apply flow control to the sender support multiple application processes on each host
  • Slide 5
  • 5.1 Simple Demultiplexer (UDP) Unreliable and unordered datagram service Support multiplexing allows multiple application processes on each host to share the network No flow control
  • Slide 6
  • Endpoints identified by ports servers have well-known ports, examples domain name server (DNS) receives messages at well-known port 53 on each host mail service listens for messages at port 25 the Unix talk program accepts messages at port 517 this mapping is published periodically in an RFC (Request for Comments) and is available on most Unix systems in file /etc/services Internet's User Datagram Protocol (UDP) is an example of such a transport protocol
  • Slide 7
  • The header for an end-to-end protocol that implements this demultiplexing function typically contains an identifier (port) for both the sender (source) and the receiver (destination) of the message For example, the UDP header UDP header format
  • Slide 8
  • UDP header format UDP port field is 16 bits long i.e., up to 64K (=2 16 ) possible ports ports are not interpreted across the entire Internet, but only on a single host a process is identified by a port on some particular host - a (port, host) pair UDP header consists of only 4 fields two of them is optional (Source Port & Checksum)
  • Slide 9
  • Fields Source port identifies the sending port when meaningful and should be assumed to be the port to reply to if needed if not used, then it should be zero Destination port identifies the destination port and is required
  • Slide 10
  • Length (16-bit) specifies the length in bytes of the entire datagram: header and data the minimum length is 8 bytes since that's the length of the header the field size sets a theoretical limit of 65,535 bytes for the data carried by a single UDP datagram the practical limit for the data length which is imposed by the underlying IPv4 protocol is 65,507 bytes Checksum (16-bit) used for error-checking of the header and data
  • Slide 11
  • A port is purely an abstraction exactly how it is implemented differs from system to system, or more precisely, from OS to OS example, the socket API described is an example implementation of ports
  • Slide 12
  • A port is implemented by a message queue when a message arrives, the protocol (e.g., UDP) appends the message to the end of the queue should the queue be full, the message is discarded there is no flow-control mechanism that tells the sender to slow down when an application process wants to receive a message, one is removed from the front of the queue if the queue is empty, the process blocks until a message becomes available
  • Slide 13
  • UDP message queue
  • Slide 14
  • UDP computes its checksum over UDP header the contents of the message body pseudoheader Pseudoheader consists of protocol number source IP address destination IP address UDP length field
  • Slide 15
  • UDP uses the same checksum algorithm as IP (section 2.4.2) Motivation behind the pseudoheader verify this message has been delivered between the correct two endpoints example, if the destination IP address was modified while the packet was in transit, causing the packet to be misdelivered, this fact would be detected by the UDP checksum
  • Slide 16
  • 5.2 Reliable Byte Stream (TCP) In contrast to a simple demultiplexing protocol like UDP, a more sophisticated transport protocol is one that offers a reliable, connection-oriented, byte-stream service it frees the application from having to worry about missing or reordered data Internet's Transmission Control Protocol (TCP) is probably the most widely used protocol of this type
  • Slide 17
  • TCP guarantees reliable, in-order delivery of a stream of bytes a full-duplex protocol each TCP connection supports a pair of byte streams, one flowing in each direction a flow-control mechanism allows the receiver to limit how much data the sender can transmit at a given time keep sender from overrunning receiver
  • Slide 18
  • a demultiplexing mechanism allows multiple application programs on any given host to simultaneously carry on a conversation with their peers a highly-tuned congestion-control mechanism keep sender from overrunning network
  • Slide 19
  • 5.2.2 Segment Format TCP a byte-oriented protocol, which means that the sender writes bytes into a TCP connection and the receiver reads bytes out of the TCP connection "byte stream" describes the service TCP offers to application processes app writes bytes TCP sends segments app reads bytes
  • Slide 20
  • TCP does not itself transmit individual bytes over the Internet TCP on the source host buffers enough bytes from the sending process to fill a reasonably sized packet and then sends this packet to its peer on the destination host TCP on the destination host then empties the contents of the packet into a receive buffer, and the receiving process reads from this buffer at its leisure
  • Slide 21
  • Application process Write bytes TCP Send buffer Segment Transmit segments Application process Read bytes TCP Receive buffer How TCP manages a byte-stream
  • Slide 22
  • The packets exchanged between TCP peers are called segments Each TCP segment contains a header TCP header format
  • Slide 23
  • TCP Segment Format 32 bits Source port TCP HL 12:12:23.323832 IP 202.112.0.89.22 > 59.66.24.130.49893: P 1:41(40) ack 1 win 57920 0x0000: 4500 005c 0700 4000 3606 1f0f ca70 0059 E..\[email protected] 0x0010: 3b42 1882 0016 c2e5 3c1c e61f 7172 3969 ;B......