Escolar Documentos
Profissional Documentos
Cultura Documentos
[Comer] - ch. 12 & 13 [Stevens] - ch. 11, 17, 18, 19, 20, 21, 22, 23, & 24
UDP Datagram Format UDP Ports UDP Datagram Size Limits UDP Datagram Truncation TCP Protocol Overview TCP Communication Model TCP Reliable Stream Delivery
Adrian Popescu, 2003, 2004
1/38
2/38
TCP Segment Format TCP Operation Connection Establishment & Termination Maximum Segment Size Data Transfer Implementation Options Flow Control Retransmission Timer Management Window Management Silly Window Syndrome New Developments
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 7 3/38
Introduction
Network Layer
NL protocols are fundamentally datagram-oriented and unreliable
4/38
Introduction (cont.)
Major alternatives today for host-to-host protocols
User Datagram Protocol (UDP) Provides almost no functionality over IP Performs fast, unreliable datagram delivery Transmission Control Protocol (TCP) Provides reliable, stream-oriented delivery One of the most important protocols, but also one of the most complex Remote Procedure Call (RPC) Application transport protocol (client-server model) Designed for programs to make subrutine calls on other systems Request-reply protocol, mostly limited to LAN Uses UDP datagrams, adding own facilities for insuring data transfer Real-Time Transport Protocol (RTP) Used to transmit digitized audio or video signals over an IP internet Used together with RTP Control Protocol (RTCP) Does not provide timely delivery but mechanisms to control playback Uses UDP datagrams
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 7 5/38
6/38
UDP Ports
Port assignment
Communicating units must agree on a port number Server opens selected port and waits for incoming messages Client selects local port and sends message to selected port Obs: destination port and source port may be different Ways to assign ports Universal assignment (central authority) Port assignments specied by authority are called well-known port assignments Examples (/etc/services): echo (7/udp); time (37/udp); name (42/udp); domain (53/udp); tftp (69/udp); who (513/udp); etc. Dynamic binding Dynamically assigned port numbers
Data
Source Port (16 bits): optional; species the port address of the source; used to multiplex data from more processes onto the same UDP unit Destination Port (16 bits): species the port address of the destination; used to demultiplex datagrams among the processes waiting for them UDP Datagram Length (16 bits): information (in bytes) about the length of UDP datagram (header and data); minimum value is 8, i.e., header only UDP Checksum (16 bits): optional; covers more information than present in the UDP datagram alone, i.e., UDP Pseudo-Header (12 bytes) & UDP Header (8 bytes) & Data & Pad Byte; Obs: Pseudo-Header and Pad Byte are NOT transmitted with the UDP datagram, but used only for checksum computation (to check right destination, i.e., right port number at the right IP address)
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 7 7/38
8/38
Another limit
Hosts are required to handle datagrams with a minimum of 576 bytes Consequence: many application protocols limit themselves to 512 bytes or less of data (e.g., DNS, TFTP, BOOTP, SNMP, etc.)
9/38
10/38
11/38
12/38
Application process
Application process
Answer
Write bytes Read bytes It depends!
Transmit TCP segments (TPDUs) Connection-Oriented Full duplex Byte-stream: sending process writes in some number of bytes into the TCP send buffer; TCP breaks into segments (TPDUs) & sends via IP; receiving process reads some number of bytes from the TCP receive buffer
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 7 13/38
14/38
Data
16/38
Urgent Pointer (16 bits): this can only be interpreted in segments with the URG control bit set; it points to the sequence number of the octet following the urgent data; this allows the receiver to know how much urgent data are coming Options (variable): at present, only one option is practically dened, which species the maximum segment size (MSS) that will be accepted at the receive side; this is communicated to the TCP that sends the segment; if this option is not used, then any segment size is allowed Padding (variable): used to ensure that the header ends and the data begins on a 32 bit boundary; the padding is composed of zeros
18/38
TCP Operation
Purpose of TCP
To provide reliable, securable logical connection between pairs of processes on top of a less reliable internet communication system
Reliability
TCP must recover from data that is corrupted, lost, duplicated or delivered out of order This is done by assigning a sequence number to each octet transmitted, and requiring a positive ACK from the receiver If ACK is not received within a timeout interval, then data is retransmitted At the receiver, the sequence numbers are used to correctly order segments that may be received out of order and to eliminate duplicates Damage is handled by adding a checksum to each segment transmitted, checking it at the receiver, and discarding damaged segments
19/38
20/38
Multiplexing
Allows more processes on same host to use TCP facilities simultaneously Implemented by using ports Ports concatenated with the network & host addresses form together a socket; a pair of sockets uniquely identies each connection A socket may be simultaneously used in multiple connections The binding of ports to processes is handled independently by each host Frequently used processes can be attached to xed sockets that are publicly known Establishing & learning the port addresses may also involve dynamic mechanisms
Dept of Telecommunications & Signal Processing
Internetworking with TCP/IP - ETC003 - Lecture 7 21/38
22/38
24/38
Data Transfer
Main characteristics for TCP data transfer
Stream of octets Error control by Go-Back-N Flow control by credits Data buffered by the transport entity on both transmission & reception Choice for urgent transmission
Implementation Options
RFC793 provides a precise specication of TCP However, several aspects of the protocol admit different possible implementation options, with performance implications
Send policy (sender) Wait until full transmit buffer or not Depends on performance considerations Risk for silly window syndrome when frequent & small transmissions Deliver policy (receiver) Similarly, wait in receive buffer or not before delivering to application Data can be delivered as each in-order segment is received or data from more segments are delivered together (so, waiting in receive buffer for more segments before delivering) Accept policy (receiver) TCP has two choices for out of order segments In-order: accept only segments arriving in order & discard out of order segments In-window: accept all segments that are within the receive window
TCP has the choice of diverse implementation options, based on performance considerations
25/38
26/38
27/38
28/38
Flow Control
Flow control service & congestion control
TCP provides a ow control service to applications to eliminate the possibility of the sender overowing the receivers buffer Flow control is thus a speed matching machine: matching the rate at which the sender is sending to the rate at which the receiving application is reading BIG PROBLEM: TCP sender can also be throttled due to congestion within the IP network Consequence: congestion control (window management) to control the senders rate & keep it from overrunning the network
30/38
RTT estimates
There are different methods for RTT estimation, with different advantages & drawbacks: Simple average Exponential average RTT variance estimation (Jacobsons algorithm) Exponential RTO backoff (RTO: retransmission timeout time) Karns algorithm ....
32/38
Window Management
TCP congestion control
Problem: the size of TCP send window may have a critical effect on whether TCP can be used efciently without causing congestion TCP standard recommends two techniques to avoid congestion in the network, namely Slow Start (SS) Congestion Avoidance (CA) Obs: CA is also known as Dynamic Window Sizing on Congestion (DWSC) Because of using both SS & CA, TCP is referred to as an algorithm of type Additive-Increase, Multiplicative-Decrease (AIMD) Also known as Tahoe algorithm
33/38
34/38
35/38
36/38
New Developments
TCP problems with congestion control
Problems with Tahoe algorithm related to the need to wait long time periods for the timeout Other solution: Reno, which is implemented by most operating systems; Reno includes fast retransmission mechanism (retransmitting the missing segment before the segments timer expires), and also fast recovery mechanism (to cancel SS after a fast retransmission) Even better solution: Vegas, which attempts to avoid congestion while maintaing good throughput; basic idea is to detect congestion in routers before packets are lost
37/38
38/38