I have spent the weekend banging my head against the 7 layer model. Slowly I’m beginning to understand it. But by beginning I mean I grasp about 10% of it. I’ve been to a dozen websites that try to explain it. Some use grand metaphors but don’t adequately relate them back to the real world applications of the layers. Others give short couple sentence paragraphs that are overloaded with jargon and require you to have a back ground knowledge of dozens of protocols.
Stuff like this is making me say OMG Head Explode.
Network:
This layer converts the segments from the Transport layer into packets (or datagrams) and is responsible for path determination, routing, and the delivery of these individual packets across multiple networks without guaranteed delivery. The network layer treats these packets independently, without recognizing any relationship between those packets, it relies on upper layers for reliable delivery and sequencing.
Also this layer is responsible for logical addressing (also known as network addressing or Layer 3 addressing) for example IP addresses
Examples of protocols defined at this layer: IP, IPX, AppleTalk, ICMP, RIP, OSPF, BGP, IGRP, EIGRP, NLSP, ARP, RARP, X.25
Devices that operate on this layer: Routers, Layer 3 Switches.
I know what all those words mean, but the sentences leave me baffled. What is the difference between a segment and a packet? if this layer does routing what the fuck is the transport layer for?
I would love to see a more detailed explanation of the 7 layers. Written in less dense language, and including real world examples of what happens at each step. When I send an email what does the application layer do to prepare the data for the presentation layer? And all the way down the stack. When the email is received what does the presentation layer do to prepare it for the application layer? And all the preceding layers climbing up the stack. What do each of the layers do differently when I pull up a web page? What do they do the same?
Ok, first of all remember that the OSI model predates the internet and so doesn't truly have a relevant mapping in "real life". It has some application to networking theory in that it covers most of the stuff you have to think about, but each of the OSI layers can be smooshed into a single level of real-world protocols, or you may have several protocol layers in one OSI layer. Don't tell the teacher though, and you'll pass.
For email:
Application Layer: SMTP. For some reason, most texts just stop with SMTP and don't include POP3, IMAP, WebMail or anything else because it just blows their layering model to pieces (mainly because it's a whole new protocol transaction). So, they stick with mail server to mail server comms because you can shove it into the OSI model a little better.
Presentation Layer: Doesn't really exist, or it's just absorbed into the Application Layer. Some people would put MIME or TLS in here but it doesn't neatly fit because you make an SMTP handshake before you invoke these, which really breaks the whole layering model. Just answer whatever your teacher is trying to get you to answer and you'll be fine.
Session Layer: Again, absorbed into the app layer. Things that people tend to stick into here are things like RPC handshakes or NetBIOS weirdness. In any modern system, this layer is pretty much ignored (as is anything above layer 4).
Transport: TCP. This layer provides reliable connectivity between the two hosts, retransmitting any IP packets that are lost and discarding any duplicates that may arrive (it does happen sometimes). It's not really "separate" from the network layer (IP) because there's ugly bits that really drop down into layer 3 (ICMP) and ugly bits from layer 3 that are kinda layer 4-ish (routing protocols) which all have interplay in how the packets get from one spot to another. Your teacher/textbook will just simplify all this into TCP sitting in Layer 4 though.
Network: IP. Nice little packets. All ready to stick on some sort of data link layer (or so the texts would make you believe). Has all sorts of side-baggage like ARP that sits between layers 2 and 3 though which just bastardize the entire model.
Data Link: Ethernet (802.3), WiFi (802.11), PPP, etc. Anything that defines how things get broken apart into neat chunks of data on a wire, and how to tell those chunks apart. A lot of the protocols here are intimately tied to something in layer 1 (ethernet mostly to twisted pair, wifi to wifi, PPP to some sort of serial line etc.)
Physical: The wire and the electrical signal that goes down it, or the fiber and the light beam that goes down it. Essentially what makes something a "1" and what makes something a "0".
Ok - answering your specific questions on the differences between the Transport and Network layer, it's all about the guarantees you can provide from your communications:
The transport layer can provide connections with guaranteed data delivery, including the detection of duplicate packets and so on. If you stick an arbitrary message in one end then you can expect the exact same message at the other end or some sort of error. Your text is referring to pieces of this message as "segments" that are then given to the network layer for sending onwards. This layer handles the reordering and retransmission requests from the mess made by the network layer.
The network layer provides the ability to shoot data blindly at a target that can be indirectly connected. It may get there, it may not. Stuff in between may make indiscriminate copies of your chunks of data and send it down all sorts of different routes. They may shuffle the chunks of data (ie the packets) as much as they feel like, and lose a few of them for good measure. They only have to make a best effort to get the data to the other end. This layer does what it can to move stuff between pairs of physically connected machines to make an actual network.
The data link layer only has the ability to talk between physically connected devices. It tends to be ordered, but may be lossy (think wifi). It doesn't know anything about machines not directly connected to the current machine, so doesn't have the ability to retransmit things to get beyond the wire/antenna range/piece of fiber in question.
If you want real-world examples of layering, get Wireshark and capture a trace of sending an email. You'll see how it breaks apart the packets into their different components. Make sure you filter somewhere on only port 25 though or you'll tend to get a mess of other crud.
Does that mean that TCP operates on the transport layer and UDP on the network layer?
"A few months ago, I told the American people I did not trade arms for hostages. My heart and best intentions still tell me that's true, but the facts and evidence tell me it is not." - Ronald Reagan 1987
Klast Brell wrote:Does that mean that TCP operates on the transport layer and UDP on the network layer?
Most texts count UDP as a transport layer, primarily because it still sits on top of IP which is in the network layer. If it depends on the network layer then it must be transport, right?
Again, it's a breakdown in the mapping of the OSI model to what actually happens. UDP, while being counted as a transport layer entity, doesn't actually provide any of the features of the transport layer - it can lose packets, turn up multiple times, turn up out of order, all the fun network layer stuff.
I'm slowly slowly starting to absorb it through repeated exposure to different short descriptions.
I understand that it's the central model by which all other models are measured and interpreted. But it galls me that hardly anything maps directly to a single layer. Almost everything straddles a few layers.
If this is the mechanism by which all other models and protocols are understood, then the class needs to devote many more hours to making sure we know it backwards and forwards.
"A few months ago, I told the American people I did not trade arms for hostages. My heart and best intentions still tell me that's true, but the facts and evidence tell me it is not." - Ronald Reagan 1987