The OSI Model of Networking
There are easily hundreds of ways to try and explain the OSI Model of Networking to an audience. A quick Google search will net some of the best, but in general, what's important to understand about the Open Standard Interconnect model is that it breaks down host to host transmission into seven layers, listed above. The highest layer is the Application layer, where information is presented to the user. The lowest layer is the Physical layer, where the electrical/radio/light signals are transmitted along whatever medium exists between the hosts. The actual units of data are referred to by different terms beyond the Session layer, as you can see.
Note: The analogy presented below was not taken from a book, it is my own attempt to explain.
Application LayerThis layer deals with the protocols/services used by the actual applications used, which they will employ to transmit network information.
Pretend for a moment that we are in the Wild West. Sally Packett has just written a thrilling, loin-warming romance novel, and wants to send the manuscript to her publisher. At this layer of the OSI model, Sally Packett simply makes the decision to use Western Union Courier Services to get her important package to the publisher, who is anxiously awaiting the finished copy.
Presentation LayerThis layer defines how the information is to be presented to the user, file formats work at this layer, such as JPG, BMP, TXT, AVI, and so on.
Sally Packett needs to be sure that her manuscript will be readable, so she makes sure that she wrote the whole novel in English (she had a few glasses of wine for inspiration some nights). After that, she makes sure her grammar is correct and picks up her telephone.
Session LayerThis layer initiates the setup and teardown of connections, and differentiates between multiple network connections. This layer deals with hello packets, notifications, timeouts, the logistics of how data will be delivered.
Sally has a long talk with a very helpful gentleman from Western Union on the telephone, who assures her that they do deliver to the publisher's address. Sally schedules the pickup of her manuscript as soon as possible. The Western Union clerk has Sally verify how many pages there are in her book and other details about the package, as well as determining how soon it needs to get there and, depending on how much Sally wants to pay, may or may not offer a tracking number/receipt.
Transport LayerThis layer deals with the mechanics of setting up, maintaining, and tearing down connections. Transmission Control Protocol (TCP, of the famous TCP/IP suite) operates at this layer. User Datagram Protocol (UDP) also operates at this layer. The largest difference between TCP and UDP is that TCP is connection-oriented, meaning it keeps track of the data delivery attempt and will attempt to recover if it is having trouble (missed packets, corrupt data, packets arriving out of sequence). UDP is not connection-oriented. If TCP were a delivery driver, it would be the one that won't leave a package without a signature. If UDP were a delivery driver, the truck might slow down as the package was thrown at your house.
In our Wild West example, Sally Packett has elected to go with a more expensive option (after all, this romance novel will make her rich when it sells!). She receives a tracking receipt and soon afterward her manuscript is picked up by the Western Union courier. The courier goes back to the central office and informs the management that he's starting his trip to the publisher's address. The central office issues the courier the correct horse, a rifle and rations for the trip. The courier is ready to go, he has all the details of the delivery, except he doesn't know how to get there yet.
Network LayerThis layer provides the logical topology of the network, makes routing decisions to determine the best path to logical destinations, and allows logical addressing instead of otherwise obtuse physical addressing. IP addresses operate at the Network layer, saving us all from having to memorize hardware MAC addresses of source/destinations (At least for now - I'm looking at you, IPv6).
The Western Union courier (Let's call him Jim. It's easier that way) consults the map of the western territories to figure out his route. Unfortunately, the central office where he works only has a route to the next way station in line, not the entire map. He knows that the name of the way station is Tuscaloosa Valley Station, and how to get there. Jim knows what to expect, and he has all the proper tools for the journey. He leaves the office and takes the western road. Come hell or high latency, he's going to see that package delivered.
Data Link LayerThis layer uses physical hardware addressing, and defines how devices should communicate within a given physical media type. It also defines how a device accesses the network, the media's framing method and the transmission method on that media. This is the layer that uses MAC addressing to determine source/destination. This one is tough to understand, just remember that at this layer, there are no fancy IPs that are easy to read, just ugly MAC addresses.
Jim has just started his journey. Up ahead, he sees signs on the road, telling him that slower horses should stay to the right, and that stagecoaches have right of way. Jim isn't looking to run afoul of the Marshals, so he aims to pay attention to the rules of the road. He looks for a sign pointing him in the direction of the Tuscaloosa Valley Station, but he just sees signs for Alabama. Luckily, he knows from the office map that Tuscaloosa is in Alabama, and he is headed the right way.
Physical LayerThis layer deals with the physical properties of the network media. This includes connectors, multiplexers, adapters, lines, radio, light, and electrical signals. At this layer, it's raw signal, binary ones and zeroes moving across the medium. The Data link layer will determine who those signals are for and how they should be interpreted, the Physical layer's only concern is how to convey that signal.
It's been a long, hard road. Jim is parched, hungry, and has dodged his share of bullets from unfriendly natives and bandits alike. Only his wits and the speed of his horse saved him, as well as the fine condition of the road.
Now What?Jim has arrived in Alabama alive and with Sally Packett's manuscript intact. Once in town, he gets directions from a friendly local to the Tuscaloosa Valley Station. At the station, two possibilities exist for Sally's package.
- If Tuscaloosa is indeed the final destination, Jim will turn over the package to the publisher, who will open it and verify everything arrived in order, then format it and prepare it for sale, moving up from the Network layer to the Application layer in sequence.
- If there are further legs of the journey, his trip will begin again, picking up from the Network layer back down to the Physical in a process called encapsulation/de-encapsulation until the final destination is reached.