3 ms·
The data on the wires really varies too much to cover like a nand2tetris where you can walk through one way to do it from the ground up and call it good. Genera
by zamadatix 6y ago
The data on the wires really varies too much to cover like a nand2tetris where you can walk through one way to do it from the ground up and call it good. Generally if there is a way to transmit data it's possible and probably your socket could go over it or some combination. Even taking a narrow scope such as "copper cables carrying ethernet" leads to various collision algorithms, encodings, wire counts, and optional components like PoE to consider and that's not counting "copper cables with something else that can transport encapsulation ethernet data efficiently".
Generally though you really don't care about how the data gets on the wire (I mean it's definitely interesting but it doesn't help you any more at a practical than thinking about what happens at the ethernet frame layer).
Also when it comes down to it not only is the physical encoding wildly different most each step of the way but it's not even ethernet. I.e. the only thing that matters are the guarantees of the socket interface, not the guarantees of what it rides over. The socket may ride over some transport which guarantees in order delivery and no congestion or it may ride over some transport which guarantees nothing, not even in order delivery. What matters is what the socket guarantees, e.g. is it a TCP socket provided by the OS where the OS guarantees it'll reassemble, handle loss, handle out of order, etc for you or is it something like a UDP socket which leaves most of these up to you (or a raw socket where the OS really isn't doing much of anything for you).
That being said if you want to pick a single example just to walk through it bottom to top one time pick 1G RJ45 copper between two PCs which have a TCP session going. There isn't really a need for a book, just the Wikipedia articles on gigabit Ethernet, IPv4, and TCP. It's just that this isn't always the stack so it doesn't really matter what Ethernet/IPv4 happen to give you - all that matters is what the TCP socket says it's going to guarantee.