home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.lbl.gov / 2014.05.ftp.ee.lbl.gov.tar / ftp.ee.lbl.gov / email / vanj.88mar10.txt < prev    next >
Internet Message Format  |  1995-11-26  |  7KB

  1. Date: 10 Mar 88 03:45:47 GMT
  2. From: van@LBL-CSAM.ARPA (Van Jacobson)
  3. Subject: Re: maximum Ethernet throughput
  4. Article: 167 of comp.protocols.tcp-ip
  5. Newsgroups: comp.protocols.tcp-ip
  6. Sender: usenet@ucbvax.BERKELEY.EDU
  7.  
  8. I don't know what would constitute an "official" confirmation
  9. but maybe I can put some rumors to bed.  We have done a TCP that
  10. gets 8Mbps between Sun 3/50s (the lowest we've seen is 7Mbps,
  11. the highest 9Mbps -- when using 100% of the wire bandwidth, the
  12. ethernet exponential backoff makes throughput very sensitive to the
  13. competing traffic distribution.)  The throughput limit seemed to
  14. be the Lance chip on the Sun -- the CPU was showing 10-15% idle
  15. time.  I don't believe the idle time number (I want to really
  16. measure the idle time with a uprocessor analyzer) but the
  17. interactive response on the machines was pretty good even while
  18. they were shoving 1MB/s at each other so I know there was some
  19. CPU left over.
  20.  
  21. Yes, I did crash most of our VMS vaxen while running throughput
  22. tests and no, this has nothing to do with Sun violating
  23. protocols -- the problem was that the DECNET designers failed to
  24. use common sense.  I fired off a 1GB transfer to see if it would
  25. really finish in 20 minutes (it took 18 minutes) and halfway
  26. through I noticed that our VMS 780 was rebooting.  When I later
  27. looked at the crash dump I found that it had run out of non-paged
  28. pool because the DEUNA queue was full of packets.  It seems that
  29. whoever did the protocols used a *linear* backoff on the
  30. retransmit timer.  With 20 DECNET routers trying to babble the
  31. state of the universe every couple of minutes, and my Suns
  32. keeping the wire warm in the interim, any attempt to access the
  33. ether was going to put a host into serious exponential backoff.
  34. Under these circumstances, a linear transport timer just doesn't
  35. cut it.  So I found 25 retransmissions in the outbound queue for
  36. every active DECNET connection.  I know as little about VMS as
  37. possible so I didn't investigate why the machine had crashed
  38. rather than terminating the connections gracefully.  I should
  39. also note that NFS on our other Sun workstations wasn't all that
  40. happy about waiting for the wire:  As I walked around the building,
  41. every Sun screen was filled with "server not responding" messages.
  42. (But no Sun crashed -- I later shut most of them down to keep ND
  43. traffic off the wire while I was looking for the upper bound on
  44. xfer rate.)
  45.  
  46. I did run two simultaneous 100MB transfers between 4 3/50s and
  47. verified that they were gracious about sharing the wire.  The
  48. total throughput was 7Mbps split roughly 60/40.  The tcpdump
  49. trace of the two conversations has some holes in it (tcpdump
  50. can't quite hack a packet/millisecond, steady state) but the
  51. trace doesn't show anything weird happening.
  52.  
  53. Quite a bit of the speedup comes from an algorithm that we (`we'
  54. refers to collaborator Mike Karels and myself) are calling
  55. "header prediction".  The idea is that if you're in the middle
  56. of a bulk data transfer and have just seen a packet, you know
  57. what the next packet is going to look like:  It will look just
  58. like the current packet with either the sequence number or ack
  59. number updated (depending on whether you're the sender or
  60. receiver).  Combining this with the "Use hints" epigram from
  61. Butler Lampson's classic "Epigrams for System Designers", you
  62. start to think of the tcp state (rcv.nxt, snd.una, etc.) as
  63. "hints" about what the next packet should look like.
  64.  
  65. If you arrange those "hints" so they match the layout of a tcp
  66. packet header, it takes a single 14-byte compare to see if your
  67. prediction is correct (3 longword compares to pick up the send &
  68. ack sequence numbers, header length, flags and window, plus a
  69. short compare on the length).  If the prediction is correct,
  70. there's a single test on the length to see if you're the sender
  71. or receiver followed by the appropriate processing.  E.g., if
  72. the length is non-zero (you're the receiver), checksum and
  73. append the data to the socket buffer then wake any process
  74. that's sleeping on the buffer.  Update rcv.nxt by the length of
  75. this packet (this updates your "prediction" of the next packet).
  76. Check if you can handle another packet the same size as the
  77. current one.  If not, set one of the unused flag bits in your
  78. header prediction to guarantee that the prediction will fail on
  79. the next packet and force you to go through full protocol
  80. processing.  Otherwise, you're done with this packet.  So, the
  81. *total* tcp protocol processing, exclusive of checksumming, is
  82. on the order of 6 compares and an add.  The checksumming goes
  83. at whatever the memory bandwidth is so, as long as the effective
  84. memory bandwidth at least 4 times the ethernet bandwidth, the
  85. cpu isn't a bottleneck.  (Let me make that clearer: we got 8Mbps
  86. with checksumming on).
  87.  
  88. You can apply the same idea to outgoing tcp packets and most
  89. everywhere else in the protocol stack.  I.e., if you're going
  90. fast, it's real likely this packet comes from the same place
  91. the last packet came from so 1-behind caches of pcb's and arp
  92. entries are a big win if you're right and a negligible loss if
  93. you're wrong.
  94.  
  95. In addition to the header prediction, I put some horrible kluges
  96. in the mbuf handling to get the allocation/deallocations down to
  97. 1 per packet.  Mike Karels has been working in the same area and
  98. his clean code is faster than my kluges.  As soon as this
  99. semester is over, I plan to merge Mike's and my versions then
  100. the two of us will probably make a pass at knocking off the
  101. biggest of the rough edges.  Sometime in late spring or early
  102. summer we should be passing this code out to hardy souls for
  103. beta-testing (but ask yourself: do you really want workstations
  104. that routinely use 100% of the ethernet bandwidth?  I'm pretty
  105. sure we don't and we're not running this tcp on any of our
  106. workstations.)
  107.  
  108. Some of the impetus for this work came from Greg Chesson's
  109. statement at the Phoenix USENIX that `the way TCP and IP are
  110. designed, it's impossible to make them go fast'.  On hearing
  111. this, I lept to my feet to protest but decided that saying "I
  112. think you're wrong" wasn't going to change anybody's mind about
  113. anything.  Now I can say that I'm pretty sure he was wrong about
  114. TCP (but that's *not* a comment on the excellent work he's doing
  115. and has done on the XTP and the Protocol Engine).
  116.  
  117. The header prediction algorithm evolved during attempts to make
  118. my 2400-baud SLIP dial-up send 4 bytes when I typed a character
  119. rather than 44.  After staring at packet streams for a while, it
  120. was pretty obvious that the receiver could predict everything
  121. about the next packet on a TCP data stream except for the data
  122. bytes.  Thus all the sender had to ship in the usual case was
  123. one bit that said "yes, your prediction is right" plus the data.
  124. I mention this because funding agents looking for high speed,
  125. next-generation networks may forget that research to make slow
  126. things go fast sometimes makes fast things go faster.
  127.  
  128.  - Van
  129.