1 / 59

History and Internals of TCP/IP

History and Internals of TCP/IP. Andrew Tucker February 15, 2000. What We’ll Cover . Big picture of network protocols Where TCP/IP lives in the network layer model Protocols that utilize TCP/IP Under the hood of IP Addressing and Routing Under the hood of TCP (and UDP)

camdyn
Download Presentation

History and Internals of TCP/IP

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. History and Internals of TCP/IP Andrew Tucker February 15, 2000

  2. What We’ll Cover • Big picture of network protocols • Where TCP/IP lives in the network layer model • Protocols that utilize TCP/IP • Under the hood of IP • Addressing and Routing • Under the hood of TCP (and UDP) • Ensuring reliable delivery • Weaknesses of TCP/IP • Resources for more info

  3. What We’ll Cover • All topics should be considered overviews • References for more depth on each subject will be given at the end • Programming with sockets will be covered in next session • Feel free to interrupt with questions at any time

  4. TCP/IP in the Big Picture

  5. What is TCP/IP? • Set of protocols that are used for communication across a network • TCP/IP = Transmission Control Protocol / Internet Protocol • UDP = User Datagram Protocol • Standard method for transferring data and information on the Internet

  6. What is a protocol? • Definition: A set of rules that regulate the way data is transmitted between computers. • An infinite amount of ways to realize this abstract notion - so why did the Internet standardize on TCP/IP?

  7. Why TCP/IP? • ‘cuz Uncle Sam said so! • Originally a set of conventions developed by the DOD and DARPA in 1969, formalized into TCP/IP in 1980s • Original ideas attributed to Vinton Cerf and Robert Kahn • Gained popularity in the user community because of inclusion in v4.2 of BSD UNIX

  8. Why TCP/IP? • DARPA network was the early precursor of the Internet • If you wanted to talk on the DARPANET you needed to speak TCP/IP • TCP/IP was designed well enough to scale to the Internet* * - until recently...

  9. Why TCP/IP? • Three Main Goals: • Interoperability - communicate between heterogeneous hardware and OS • Robustness - reliability and performance • Ease of Reconfiguration - add and remove computers without disruption

  10. ISO OSI 7-layer model • ISO developed the 7-layer Open Systems Interconnect (OSI) model independent of TCP/IP in the 1970s • Allows each layer of a protocol to be changed without affecting layers above or below

  11. Layer 7: interfaces with end user Layer 6: data format conversion Layer 5: establishes node connection Layer 4: ensures delivery and correctness Layer 3: routing and addressing Layer 2: interface for physical line (NIC) Layer 1: actual transmission line or “bit pipe” ISO OSI 7-layer model

  12. Modified Conceptual 5 Layer Model • Top three layers ISO OSI model don’t relate well to Internet protocols using TCP/IP • Conceptually it helps to think about a 5 layer model for the Internet and TCP/IP

  13. Modified 5 Layer Conceptual Model

  14. TCP/IP In the 5 Layer Model • TCP handles the transport layer and guarantees data delivery and correctness • UDP is a TCP replacement that doesn’t guarantee delivery • IP lives in the network layer and handles routing and addressing

  15. TCP/IP In the 5 Layer Model Stream Connection ConnectionlessDatagram Sockets API

  16. Protocols Built on TCP/IP FTP HTTP NNTP TFTP DNS Telnet SMTP TCP UDP IP

  17. TCP/IP Internals

  18. IP Internals • Current version in widespread use is IPv4 • Each node in an internet has a 32-bit IP address such as 10.0.3.172 IP knows nothing of text names like www.bsquare.com - they are translated to the numeric form by DNS

  19. IP Internals • IP addresses are split into two parts: • network - same for all hosts on the same network • host - identifies a specific host within a network • The number of bits that represent the network and host vary by the address “class”

  20. IP Internals 7 24 Class A 0 Network Host 14 16 Class B 1 0 Network Host 21 8 Class C 1 1 0 Network Host

  21. IP Internals • Original idea was to have a small number of WANs (class A), modest number of campus size networks (class B) and a large number of LANs (class C) • Explosion of the Internet has changed this - many clever interpretations of IP addresses have been invented to stretch the limit

  22. IP Internals • IP routes information across a network via “packet switching” (as opposed to circuit switching) • Each packet is transmitted as a separate entity • Different packets can take different routes and can arrive in different order than they were sent

  23. IP Internals • Packets are sent as datagrams, so delivery isn’t guaranteed • Each packet has an IP header that contains source and destination address, data and header length, etc • Packets are routed based on the network specified in the destination address

  24. IP Internals • If the source and destination address are on the same network life is simple (e.g. Ethernet uses ARP to get the MAC address) • If the source and destination address are on different networks it is more complicated...

  25. IP Internals • Special nodes called “gateways” connect networks • Gateways have tables that map network numbers to gateway addresses • Datagrams are forwarded to the gateway corresponding to their destination network number • What if there is no gateway available?

  26. IP Internals • Default gateways are used if no mapping is present • Once a mapping is found the sender is notified of the correct gateway mapping (via ICMP) • Over time, routers build up a mapping table based on ICMP notifications

  27. IP Internals • A simple routing example via TraceRoute: 1 www.worldaccessnet.com (206.190.139.3) 2 worldaccessnet-2t1-ltipdxbackbone.ltinet.net (206.190.136.117) 3 pdx2lc.worldaccessnet.com (206.190.136.6) 4 seattle-portland-ds3.sea.above.net (209.133.31.50) 5 POS1-0-0.GW2.SEA4.ALTER.NET (157.130.177.121) 6 112.ATM3-0.XR2.SEA4.ALTER.NET (146.188.200.174) 7 292.ATM3-0.XR2.SEA1.ALTER.NET (146.188.200.157) 8 194.ATM9-0-0.GW1.SEA1.ALTER.NET (146.188.200.45) 9 63.76.82.94 (63.76.82.94) 10 www.bsquare.com (63.76.82.70)

  28. IP Internals • TTL (Time To Live) field in IP header eliminates endless routing loops by limiting hop count • 127.0.0.1 is a special loopback address

  29. UDP Internals • Ensures data correctness, but not reliable delivery • Adds a “port” number to IP • Think of a port as channels for a single machine - more on this in the discussion of sockets

  30. UDP Internals • Sends entire chuck of data in one packet • Sends datagrams in one direction

  31. TCP Internals • Lots of versions floating around: • Tahoe - released with BSD NR 1.0 • Reno - released with BSD NR 2.0 • New TCP Reno • TCP Vegas • Versions are guaranteed to interoperate but not with optimal performance

  32. TCP Internals • Guarantees data correctness and delivery • Uses ports identical to UDP • Breaks data into individual packets • Full duplex two-way stream • Complete implementation is complicated with lots of intricate details - we’ll touch on interesting highlights

  33. TCP Internals • Operates on two basic principles: flow control and congestion control • Flow control involves preventing senders from overrunning the capacity of receivers • Congestion control involves preventing too much data from being injected into the network, causing links and switches to become overloaded

  34. TCP Internals • Follows a basic protocol design rule called “smart sender, dumb receiver” • Flow control done via “sliding window” • For window size n, only n bytes can be sent without receiving an acknowledgement • When data is acknowledged, the window slides forward

  35. TCP Internals • TCP packet header advertises a window size indicating the number of bytes the receiver is willing to get • Initial window size established in TCP connection setup

  36. TCP Internals • Packet header includes the last byte acknowledged and the packet sequence number • Sequence numbers are used to reassemble packets in the order they were sent

  37. TCP Internals offered window (advertised by receiver) usable window 1 2 3 4 5 6 7 8 9 10 11 12 sent and acknowledged can send ASAP can’t send until window moves sent, not ACKed Left side of window advances when data is acknowledged Right side controlled by size of window advertisement

  38. TCP periodically sends a 1-byte “probe” packet which fails but has a new advertised window size EffectiveWindow = AdvertisedWindow - (LastByteSent - LastByteAcked) TCP Internals • What if receiver’s buffer fills up and results in an advertised window size of 0?

  39. TCP Internals • Acks indicate last consecutive packet received • Packets are retransmitted if an ACK is not received after a certain time period • Timeout value varies depending on previous packets average round trip time (RTT)

  40. TCP Internals • Congestion control is built on top of sliding window flow control • Consists of three intertwined mechanisms: • Additive Increase / Multiplicative Decrease • Slow Start • Fast Retransmit

  41. TCP Internals • An additional window size is maintained in each packet header called the congestion window • Similar to advertised window, but not directly controlled by sender or receiver

  42. TCP Internals • Effective window size calculation changes: MaxWindow = MIN(CongestionWindow,AdvertisedWindow) EffectiveWindow = MaxWindow - (LastByteSent - LastByteAcked) • How is congestion window size calculated?

  43. TCP Internals • Initially it is set to the Maximum Segment Size (MSS) • Whenever a congestion window size is successfully transmitted, the size is incremented by MSS - hence the term “additive increase”

  44. TCP Internals • If a packet is dropped (e.g an ACK times out), it is assumed to be due to network congestion • When a packet is dropped, the congestion window size is cut in half - hence the term “multiplicative decrease”

  45. TCP Internals • Result is that the window size is eased up until a packet is dropped and then it is throttled back • Works OK during the middle of a connection, but takes too long to ramp up when starting from scratch...

  46. TCP Internals • Slow Start addresses initial connection issue and temporarily discards additive increase • Congestion window size starts at 1 packet and is doubled every time a full window is successfully transmitted • Eventually a packet is dropped and additive increase is resumed

  47. TCP Internals • Why is it called Slow Start if it changes from linear to exponential growth of congestion window size? • Refers to difference when compared to original TCP strategy of always starting with full advertised window size

  48. TCP Internals • Fast retransmit was not part of original TCP spec • Added by TCP Reno circa 1990 to deal with performance problems

  49. TCP Internals • Fast Retransmit means that if the sender sees a number of duplicate ACKs it retransmits first packet after ACK • Assumes that a number of duplicate ACKs imply a dropped packet

  50. TCP Internals Fast Retransmit in action! Packet 1 Packet 2 Packet 3 ACK 1 Packet 4 ACK 1 Packet 5 ACK 1 Packet 2 ACK 5

More Related