Comments (17)
As a network engineer I appreciate the analogy! Now I know more about computer architecture than I did moments ago.
from blog.
Here is a dramatic conclusion from an excellent recent paper called Array layouts for comparison based searching by @pkhuong and Pat Morin:
Our conclusion is contrary to our expectations and to previous findings and goes
against conventional wisdom, which states that accesses to RAM are slow, and should be
minimized. A more accurate statement, that accounts for our findings, is that accesses to
RAM have high latency and this latency needs to be mitigated.
This makes intuitive sense if you think like a network engineer: your connection to RAM is a "long fat pipe."
from blog.
If you are going to recommend Hennessy and Patterson then you should recommend Computer Organization and Design rather than Computer Architecture. Otherwise that would be like recommending Radia Perlman before TCP/IP Network Administration.
from blog.
Very nice write-up!
AFAIK, branch prediction and parallelism is not what TCP itself can do at protocol level. QUIC (borrowed from http/2?) does have multiple UDP stream underneath a single connection which may provide what you are looking for wrt issuing multiple work requests. But if you are looking for 'single source serving multiple targets', the traditional sockets and way we do 'multiple clients connecting to a single server' may provide that.
(from someone who knows very little about CPUs but does know a little bit about protocols. :-))
from blog.
Nice write-up!
Is there any "thing" like a Re-Order Buffer in TCP? Perhaps TCP sequence numbers?
from blog.
Is there any "thing" like a Re-Order Buffer in TCP?
Yep!
The TCP packet transmission queue seems to be like a Re-Order Buffer. TCP always frees packet buffers in FIFO sequential order, even if the packets may be delivered out of order due to loss/retransmission or reordering along the path. Modern TCPs will track a bunch of state for each packet in the queue e.g. do we believe that it is currently in flight / do we believe it's delivered because we got a preliminary Selective Acknowledgement / do we believe it's lost due to packets later in the sequence being acknowledged first.
(One major theme in TCP is needing to maintain heuristic estimates of which packets are in-flight/delivered/lost to accelerate decisions about when to transmit/retransmit a new packet. Sending too much wastes bandwidth by sending data that does not benefit the recipient e.g. because it is duplicate or because it is dropped at a bottleneck en route. Sending too little data wastes bandwidth due to idleness or causes starvation when competing with more aggressive TCP implementations on other hosts. This requires a bunch of state and clever algorithms that may well have direct parallels deeper in the CPU.)
Have to think about Reservation Station / Re-Order Buffer distinction a bit more carefully.
from blog.
Have to think about Reservation Station / Re-Order Buffer distinction a bit more carefully.
Yes, it's kind of tricky. And besides its re-ordering role, the ROB's capacity is also the factor that limits how far ahead the processor can seek for instructions to fetch.
from blog.
Nice! This is helpful for those more versed in computer architecture than TCP as well.
One nit: Hyperthreading is just Intel marketer speak for SMT (Simultaneous Multithreading), so hardware multithreading would be the actual jargon term you mean.
from blog.
This is also at a higher layer than TCP, but I can see an analogy between branch prediction and HTTP/2 server push. Without branch prediction/server push, the CPU/client has to wait for the first instruction/request to finish before it knows what to execute/request next. With it, the CPU/client already has the next instruction/response when it needs it.
from blog.
Multiple execution engines are somewhat similar to multipath routing or (at a smaller scale) multiple rx/tx queues in network cards?
from blog.
I added hyperthreads which I think is a good fit.
Interesting that people are commenting and also finding analogies to more protocols than just TCP :).
I also reckon there is an analogy between packet size and micro-ops. Some packets are bigger than others (e.g. jumbo frames), and require more time to serialize over the link, while some instructions are also bigger than others (e.g. rep movsb
memory copy), and require more cycles to execute all of their micro-ops.
On execution ports I am tempted to draw an analogy to the TCP congestion window (cwnd). Haswell has eight execution ports, so it can actively compute eight instructions (uops) at the same time, and so we can say it has a hardcoded cwnd=8. However, the original formulation above is a bit lacking by not mentioning the cwnd and making a distinction between packets/instructions that are actively progressing vs ones that are just waiting in the transmit-queue/reservation-station.
Plenty to think about :).
from blog.
@hirenp I wonder if this whole model could be expressed in terms of HTTP instead of TCP too :).
from blog.
@lukego Look at QUIC. It has some really nifty features. That will probably be a better fit but I am not sure as I don't know much about CPUs. :-)
from blog.
From protocol's perspective, I guess you want to compare network protocol with cache coherency protocol, they have many similarity, CPU focus on execution, network focus on transmission, there is no much to compare.
from blog.
great read lets have beer! Its the weekend!
from blog.
Awesome work!
from blog.
Very interesting analogy! Should we expand TCP/CPU to UDP/GPU or the like?
from blog.
Related Issues (20)
- RaptorJIT+Studio: Analyzing the evolving C heap of a JIT compiler HOT 2
- The curse of "high-impact medium-generality" optimizations HOT 8
- Celebrating Intel and Mellanox for their open driver interfaces
- How I started working on network device drivers HOT 7
- How a tracing JIT discovers and uses type information
- Speculative optimization in tracing JIT compilers
- How speculative optimizations work in RaptorJIT HOT 2
- The major speculative optimizations in RaptorJIT
- The unit of compilation in RaptorJIT
- Lua tracing JIT performance: Good news, bad news, and more good news
- Mechanical sympathy between modern CPUs and tracing JITs
- Thought experiment on guard instructions and CPU micro architecture
- Joe the office mate HOT 3
- I love the idea of writing a blog in Github Issues, but... HOT 3
- Tracing JIT and guitar looper pedals HOT 1
- Great Social Media Shakeup of 2022 HOT 17
- Ping, or, Bayesian random bits
- kons-9 for ad-hoc data visualization HOT 1
- Sequential Monte Carlo 3D diagnostic with kons-9
- kons-9 ad-hoc posterior predictive check HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.