Computers do a lot of stuff to exchange data. If a programmer would try to write everything up to the “voltage in a wire” level, they would get stuck in all the details. So, there are several levels of protocols: standards for these operation. Each protocol has libraries that let you implement specific stuff in an easy way, and you don’t have to think about specifics: TCP connection over wifi and over fiber optics cable will look the same for you even though your computer does very different things in these two cases.
Library of each protocol uses lower level protocols. It looks kinda like that:
HTTP: “I need that web page, TCP, connect me to the server.”
TCP: “Okay, establishing connection. IP, send these messages at this address and hand me the responses, I’ll check if the server is available.”
IP: “This address… My network map says that it’s this way. MAC, send this message to that router nearby, it will pass it further.”
MAC: “Sending message… the router is connected via this cable. Ethernet, do your electric stuff with this port, here’s the packet.”
Ethernet: “10001010111101010010110101101011”
Latest Answers