How Networking Works
At a job interview, an interviewer asked me to explain networking hardware and protocols. I learned the OSI reference model and TCP/IP briefly. I had not studied deeply, and I did not remember that well... I could not explain it during the interview.
Since time/life is limited, I thought a brief understanding was good enough. (Now, I know I did not even briefly understand it. All I understood was I knew it existed.)
I have to admit that I had some justification for not understanding that. Here are justifications I had in the past.
Do people need to write the code of middleware unless specific requirements or serious bugs?
Do we buy hardware when we need it? It will take so much time to do everything alone from scratch.
As web application programmers, main business logic, readability, and design seemed much more important to me. Although I was into hardware performance, I was not interested in how hardware works. I felt ashamed for not understanding it. I decided to look into how it works.
The Youtube video was extremely helpful for me to understand how it works.
Networking tutorial: Ben Eater 13 videos
I leave some notes here.
Ethernet Cable
Copper Cable
A 10BASE-T transmitter sends two differential voltages, +2.5 V or −2.5 V.
Manchester encoding is used for 10BASE-T to combine clock and data into one signal,
Manchester Code | Wikipedia
A 100BASE-TX transmitter sends three differential voltages, +1 V, 0 V, or −1 V.
4B/5B encoding and MLT-3 encoding are used for the 100BASE-TX.
Manchester encoding can consume up to approximately twice the bandwidth of the original signal.
4B/5B encoding takes five-fourths (1.25 times) of the bandwidth of the original signal.
A 100 MHz data stream that uses a 4B/5B encoding results in a 125 MHz signal whereas Manchester encoding results in 200 MHz.
4b/5b Clock Encoding
MLT-3 encoding is used to reduce the bandwidth by one-fourth. 125 * 1/4 =31.2 MHz
MLT-3 Line Encoding
Optical Fiber (Fiber Optics)
Optical Fibers conduct infrared light from laser diodes as transmitters to photodiodes as receivers.
On-off keying (OOK) modulation was used in the early types.
Quadrature amplitude modulation (QAM) is used in the latest types.
World's First Successful Transmission of 1 Petabit per Second in a Standard Cladding Diameter Multi-core Fiber
Radio Waves
The Ethernet was inspired by ALOHAnet which used radio waves to send data.
Mobile telecommunications technology such as 4G, 5G, and Wi-Fi use radio waves to send data.
Mobile Communication: From 1G to 4G
Ethernet Frame
An Ethernet packet starts with 56 bits preamble and 8 bits start frame delimiter (SFD).Preamble: 10101010 10101010 10101010 10101010 10101010 10101010 10101010
SFD: 10101011
Preamble/SFD (8 bytes) | Destination Address (6 bytes) | Source Address (6 bytes) | Ether Type (2 Byte) | Payload (46 - 1500 bytes) | Frame check sequence (4 bytes)
In TCP/IP case,
Ether Type: 0800 = IP Protocol
Payload: The IP Header and TCP Header are included in the payload
Ethernet frame | Wikipedia
TCP: Transmission control protocol | Networking tutorial (12 of 13)
Point-to-Point Protocol (PPP) Frame
Flag | Address (1 byte) | Control (1 byte) | Protocol (2 bytes) | Payload | FCS (40 - 1500 bytes)Flag: 0111110
Address: ff is usually assigned.
Control: 03 is usually assigned.
Frame formats | Networking tutorial (6 of 13)