1 / 56

CSCI 6433 Internet Protocols Class 5

CSCI 6433 Internet Protocols Class 5. David C. Roberts. Agenda. Network Address Translation (NAT) User Datagram Protocol (UDP) Reliable Stream Transfer Service (TCP). NAT. Developed in order to extend life of IP address pool Used these characteristics of Internet connections:

marinel
Télécharger la présentation

CSCI 6433 Internet Protocols Class 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCI 6433Internet ProtocolsClass 5 David C. Roberts

  2. Agenda • Network Address Translation (NAT) • User Datagram Protocol (UDP) • Reliable Stream Transfer Service (TCP)

  3. NAT • Developed in order to extend life of IP address pool • Used these characteristics of Internet connections: • Most hosts are clients that don’t need to be publicly accessible • Few hosts access the Internet at the same time • Internet connections are routed

  4. Analogy • Think of a NAT router as a company’s telephone operator • Connects outside callers to local extensions • Connects local extensions to the outside network

  5. How It Works

  6. Limitation • Traditional NAT is said to be “unidirectional”, allows only for transactions originated inside the network • No allowance for a server inside the network • Domain Naming Services (DNS) can be used to make a name visible outside the local network (to be discussed)

  7. NAT • Extends the pool of addresses • Creates a form of two-level addressing • Could be used even more widely to extend the pool of IPv4 addresses • Does not allow for a server inside the NAT network to hosts outside • Can be port-based or not

  8. On to udp and tcp!

  9. What Does IP Do? • Addressing • Data encapsulation • Fragmentation and reassembly • Routing/indirect delivery

  10. UDP and TCP

  11. Ports • Destination of a datagram is a program • Selection is by protocol port number • Messages carry source and destination port numbers • UDP and TCP provide protocol ports, provide ability to distinguish among destinations within a given host

  12. UDP and TCP in Operation

  13. UDP--User Datagram Protocol • UDP provides unreliable, best-effort, connectionless datagram delivery services to multiple destinations within a single host computer, using IP to carry messages

  14. UDP Message Format

  15. UDP Message Format • Question: How many different UDP ports are there on a PC?

  16. UDP Layering Application programs access UDP, and UDP uses IP to send and receive datagrams UDP message is encapsulated in an IP datagram

  17. UDP Demultiplexing

  18. Well-Known Port Assignments

  19. Summary • UDP is a “thin” protocol • Unreliable • Best-effort • Distinguishes between applications • 16-bit port number is used • UDP lies in the transport layer

  20. On to tcp!

  21. What TCP Does • Addressing and multiplexing • Connection establishment, management and termination • Data handling and packaging • Provides reliability and transmission quality services • Provides flow control and congestion avoidance features

  22. How TCP Does Its Job • Connection-oriented • Bidirectional • Multiply-connected • Reliable • Acknowledged • Stream-oriented • Data-unstructured • Data flow managed

  23. Why Stream Delivery? • Using stream delivery protocol frees the application from any concern about network delivery of data • Packets may arrive out of order • Packet data may contain errors • Application program doesn’t want to know optimal packet size

  24. TCP—Reliable Stream Transport Service • Stream orientation—receiver gets the same sequence of octets sent by the sender • Unstructured stream—no way to mark boundaries, applications must use a stream • Virtual circuit connection—source and destination operate at the same time, interact during the transfer • Buffered transfer—large blocks can be transferred, fed to receiver as needed • Full duplex connection—communication can take place in both directions

  25. Reliable Delivery, Unreliable Transport • Ethernet is unreliable • IP is unreliable • But TCP, that runs over IP, is reliable • How?

  26. Unreliable Transport

  27. Positive Acknowledgement with Retransmission • Sender starts a timer when sending, saves data • Receiver sends acknowledgement (ACK) when data arrives successfully • When ACK arrives, sender cancels timer, deletes data • If timer expires, sender retransmits data, starts another timer

  28. Reliable Transport

  29. Delays A positive acknowledgement protocol introduces a number of delays because it delays sending a new packet until it receives an acknowledgement for the previous packet.

  30. Sliding Windows To solve the problem, we use the sliding window approach to decouple transmissions from reception of acknowledgements. The sender transmits multiple packets before waiting for an acknowledgement. The number of packets is said to be the window size.

  31. Sliding Window Approach

  32. Sliding Window Example

  33. Enhanced Positive Acknowledgement

  34. Sliding Window Approach Question: Suppose the IP link travels over a very high-capacity satellite connection that has ¼ second latency in each direction. What is the effect on throughput if the window size is set to 1? What if it is set to, say, 1,000?

  35. TCP Protocol Enhancements • There are a number of protocol extensions and hardware products designed to speed up TCP in the presence of delays • Generally they involve some form of providing ACKs to the sender before the receiver has received the packet • The extension then has to provide some form of retransmission itself, since TCP counts success when it receives an ACK

  36. TCP and UDP Layering

  37. Ports and Connections • UDP uses the port as a queue to process incoming data • TCP uses port numbers, but the port number is part of identifying a connection • A connection is identified as a pair of pairs in the form <host, port> • Question: can two programs both use the same TCP port on the same machine at once?

  38. TCP Segments and Streams Data stream divided into segments. Window used to send multiple segments before acknowledgement arrives. Allows receiver to restrict transmission until it has buffer space.

  39. Flow Control • Each ack includes a window advertisement, giving the number of additional octets the receiver is willing to accept • Sender increases or decreases its window size based on the window advertisement • The sliding window provides end-to-end flow control • Congestion, that can occur at intermediate points, is dealt with by congestion control mechanisms

  40. MSS • MSS—maximum segment size is negotiated • MSS may be the MTU of a single connecting network, if both ends are on the same network • MSS may be the MTU of path if sender and receiver are on different networks • Risk of poor performance if MSS is too large or too small

  41. Problems with Wrong MSS • If too large: segments will be fragmented, requiring extra network messages and routing • If too small: fixed size of TCP header, IP header, Ethernet header all are still required for a small amount of data Question: what’s the right size for a TCP segment?

  42. TCP Segment Format

  43. Code Bits Code bits determine purpose, contents of the segment

  44. Urgent TCP Data • Programs may need to send “out of band” data • That is, data is treated as being sent through another connection • In TCP, this can be done by setting the urgent flag • Receiving program processes urgent data ahead of the rest of the data stream

  45. TCP Acknowledgements • TCP acknowledgements can’t refer to datagram or segment numbers, since retransmission can change message size • TCP ack specifies sequence number of the next octet the receiver expects to receive • Called a cumulative acknowledgement • Both efficient and inefficient

  46. Timeout, Retransmission • Great variation in transit times, from local net to distant network • Adaptive retransmission algorithm—monitors the performance of each connection, deduces reasonable timeout value • Stores round trip time, uses new RTT to change stored RTT slowly • Timeout is some constant times RTT • Note that acknowledgements are ambiguous in case of retransmissions

  47. Karn’s Algorithm • Timer backoff strategy • Compute an initial timeout • If retransmission, then increase timeout • Often, double the timeout • Timeout increases have an upper limit • Karn uses only unambiguous acknowledgements to compute RTT new_timeout = γ * old_timeout

  48. Response to Congestion • No way for TCP to directly know about congestion, which causes retransmission, increasing congestion even further • Multiplicative decrease congestion avoidance—when segment is lost, sender congestion window is reduced by half (starts same as receiver advertisement), ack timer is increased • Allowed window=min(receiver_advertisement, congestion_window) • Slow-start recovery—start congestion window at single segment size, increase by one for each ack

  49. Explicit And Explicit Notification • Most versions of TCP use implicit feedback mechanisms—using timeout and multiple ACKs to detect loss and congestion • Some versions of explicit feedback have been developed for TCP/IP • Selective acknowledgement—receiver identifies left edge, right edge of received segments • Explicit congestion notification—routers add notification to TCP header, then receiver notifies sender in next ACK

  50. Global Synchronization • When router is congested, early routers used tail-drop strategy • Tail-drop—drop most recent datagram • Causes drops from many TCP sources, leads to global synchronization • Random Early Discard (RED)—uses min and max. If fewer than min datagrams in queue, add it. If more than min, randomly discard one datagram. More than max, then drop new datagram.

More Related