Exploring the OSI model
The OSI model is such an important concept in networking, but it often is difficult for people to learn. Instead of memorizing acronyms, let's explore each layer through something completely unrelated-- a cake shop, and some hungry clients that want to purchase the cake.
5/8/20245 min read


Layer 1: Physical
Layer 2: Data Link
Layer 3: Network
Layer 5: Session
Layer 6: Presentation
Layer 7: Application
Imagine there is a cake shop, and a humble cake shop manager. He makes the best cakes in his shop, and people can't get enough of it! So many cafes and clients order directly from him, so he must have a system in place to get those delicious slices to her hungry customers. That's where his system, pulled directly from his days as a network engineer comes in. He uses the OSI model (cake edition)!
Parked in the back of the shop, warming up for the journey there was a big, strong delivery truck. It wasn’t glamorous, but it was essential to the operation. Every cake started with this truck, just like data in a network starts its journey from the physical medium.
“Without the truck,” Chef Hubert explained to his apprentice, “we couldn’t get our cakes to the customers. It’s just like how data can’t move without a physical connection—whether it’s a cable or wireless signal."
The truck transported all bits that allow the bakery able to bake: the ingredients, mixing tools, and final cakes to their destination. It's not concerned with the details of the cake—it just makes sure everything gets where it needs to go, just like the physical layer of the OSI model.
Once the cakes are made, they were carefully placed into boxes for delivery. These boxes were labeled with the customer's address and the bakery's return address. They frame the delivery and address it through the address of the customer, while also providing a return address so they can communicate back to the bakery.
“This is like the data link layer," Chef Hubert said. "The packaging keeps everything safe and ensures that the cake doesn’t get mixed up. The customer's address is like the MAC address on a host! In networking, the data link layer is responsible for ensuring that packets aren't corrupted during transmission, and provides error checking--just like our delivery drivers. ”
Each cake was sealed and carefully packaged into the truck to ensure everything arrived safely and intact. The driver got into the seat, and his journey began!
When the cakes left the shop, they were guided by a mapping system-- a logical addressing system. This system knew exactly which street, which house, and which apartment to send each cake to. The truck knew which way to go based on the directions on the map. If there was a traffic jam, it knew some reliable alternate routes!
Chef Hubert explained, “This system is responsible for determining the best route for our cakes to get to the right address. Just like the network layer of the OSI model decides how data will travel across a network, using IP addresses to find the best path. The network layer routes packets with an IP address so the data knows the next hop to take.”
For the bakery, knowing the route and the destination ensured that no cake got lost, and all his customers were satisfied. This layer was key to ensuring every delivery reached the right place.
Layer 4: Transport
With the cakes were on their way, our dependable driver made sure each cake arrived on time. If the delivery service was overloaded or made a mistake, the cake wouldn’t be delivered properly. It needs to be segmented to ensure reliable deliveries. If there were lots orders, or if one customer ordered lots of cakes, they could use multiple drivers to split the deliveries to make sure everything was received correctly.
"The transport layer is like our delivery service, in networking it's responsible for end-to-end connections! It ensures that the entire order gets to the customer, and if something goes wrong, it can request a re-delivery. Or, they can choose to receive the order as-is, even if it's missing a little bit of the icing. Just like the TCP/UDP protocols, making sure that communication is successful."
Whether the cake was sent by one driver or multiple drivers, communication was handled efficiently.
Before the cake was even made, customers would call in and place orders! Hubert already had an explanation ready for this as well: The session layer handled this part of the process.
“The session layer maintains the connection," he said. "For us, our communication system is where we start and end a conversation with the customer, our drivers, and our bakers! It's a dialogue. We make sure that each order is tracked and that we don’t confuse one order with another. It'd be embarrassing if we delivered the wrong cakes! We also keep track of when our cakes are delivered, so we don't accidentally send even more to our clients. This is what the session layer is responsible for: it's the icing that holds all the layers together, making sure information can be exchanged efficiently.”
Chef Hubert beamed, any excuse he could to put in a baking reference, he would.
Once the cake was baked and packaged, it was time for the final touch—decoration This seems to be out of order, but one of the things that makes Chef Hubert's cakes so special isn't just that they arrive on time-- it's that they look beautiful. To make sure everything was presented perfectly, and left the customer smiling from ear-to-ear, all of Chef Hubert's drivers were specially trained to assemble and decorate the cake. After all, what if something got smashed in transit!? All the special decorations, glitter, and visual aspects that gave his cakes that special "wow" factor were added on-site.
Hubert took a lot of pride in the presentation of his cakes. He explained to his apprentice, “The presentation layer is like this. Just like we take a cake and make it stunning, the presentation layer translates data into a format that the receiver can understand-- otherwise it'd be just 0's and 1's!”
This layer was all about ensuring that the final product was ready for the customer to enjoy.
At the venue, the customer was delighted-- not only was the cake everything she asked for, it was delicious! As always, it arrived on time and was perfect!
"The application layer was all about the end user," Chef Hubert explained. “This is the most important layer! The customer gets to enjoy the cake, just like when a user interacts with all the precious data that worked so hard to get to them. The application layer is what the user sees and can interact with. For us, we measure our customers' happiness with the cake is the final result all our hard work. It's all the 'cake' layers working together.”
For the network, the application layer makes sure that the data gets to the end user in a way that they can use it. For the bakery, it's that beautiful slice ready to be eaten.