So how do the layers actually interact with each other? We have Layers 1 to 7. How do they connect to each other? Well the way it works is that each layer will provide some kind of service to the layer above and in order to deliver that service it will make use of the services of the layer below and in terms of what that looks like in the traffic that goes over your network you'll see that the data from one layer is encapsulated inside frames of the layer below so here is an example of what a frame might look like on the wire you've got some application data let's say it's http it's part of a web page that application data is carried inside a Layer 4 segment so that's a tcp segment for http that Layer 4 segment is included inside a Layer 3 header which would be an ip datagram with its own header with the ip address where you want to go that ip datagram then might be delivered across an ethernet so the ethernet has to have a layer 2 header put around that and then you will get the start and end of the frame marked with layer two and then that entire layer two frame will be sent across your layer one network which might be your cat5 cable or your fiber optic cable or whatever now this is all very very real you can see all of these parts in the packet if you use a tool like wireshark to decode your packets then you will see each of these fields and wireshark can decode them for you these are all things that actually happen on the wire let's uh take a few other examples about these layers so what about equipment that works at layer four we already talked about equipment that works at layer one two and three if you're looking at equipment that works at layer 4 what does that mean well it means it will inspect the layer 4 header the udp or tcp header which means that it's going to be looking at the port numbers so if you think about a network device which makes a decision based on what port numbers are in your packets then you're thinking about something like a firewall the firewall will have rules that say allow from this address to this address on this port but block if it's on a different port and that device that does network address translation is also something that works at Layer 4 because it has to manipulate the ip address and the port number in each of the packets to make the job work. Those are examples of Layer 4. What about Layer 7? Could you have a device that works completely at Layer 7? Well, yes, you can so you need to think of an example of a networking device which actually looks at the packet right the way into the application layer protocol as well and so one example of that would be a firewall that does deep packet inspection or an intrusion detection system so those kinds of device are actually looking right inside Layer 7 information you might also think about things like a web proxy so web proxy will take the entire http request analyze it decide whether that request can be answered from its local cache and then send a response back or whether it needs to contact another http server on the internet so that's an example another one will be a mail relay so mail relay will receive an entire email message look at the headers look at the envelope decide where to send it next and then forward out a whole new email message using smtp those would be layer 7 devices for networking so another question here is what layer does a wireless access point work at well wireless access points in general are carrying ethernet frames ethernet frames encapsulated over the wireless so a true wireless access point is a Layer 2 device you can plug it in and your devices will join a Layer 2 network and they will be peers with your other Layer 2 devices your wired ethernet devices and your wireless ethernet devices can see each other on the same subnet it's the same broadcast domain however if you buy a wireless access point off the shelf you may find that it also acts at Layer 3. it may have routing and that functionality built in and so the kind of consumer access points you often buy will have five ethernet ports on them there will be four marked lan and one marked when on the one side they will pick up an ip address using DHCP so an ip address for the device itself and then they will route at layer 3 and then the four lan ports will be on a different subnet and there will be nat going on so it really depends how your access point is configured and where you plug it into your into your network and which port you use on on that device as to whether it's a Layer 2 or a Layer 3 device in a campus environment really you want it to work at Layer 2 so you should either turn off the Layer 3 functionality plug directly into the Layer 2 ports and if your access point has a built-in dhcp server then turn that off as well because that's a layer 3 function and just have it working at layer 2. that's the best way to operate it because it gives you the most seamless ability to join the network and to roam between access points without having to change subnets okay so here's another question what is a Layer 3 switch now that doesn't seem to make any sense because a switch by definition is a Layer 2 device and a Layer 3 device is a router it's not a switch so what a Layer 3 switch is is a device that can be a router or a switch one box depending on how you configure it can either switch or it can route so normally when you buy a Layer 3 switch and you take it out of the box the default factory configuration will be as a switch it will be a flat Layer 2 network there'll be a single VLAN all the ports will be in there and if you just plug it in it'll run as a switch but if you log in and change the configuration then you can turn on routing functionality so that it will inspect the Layer 3 headers look at the destination ip address you can build forwarding tables you can turn on routing protocols, all of these things can be turned on and so it can be a router as well as being a switch.
© Produced by Philip Smith and the Network Startup Resource Center, through the University of Oregon.
Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
This is a human-readable summary of (and not a substitute for) the license. Disclaimer. You are free to: Share — copy and redistribute the material in any medium or format Adapt — remix, transform, and build upon the material The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms: Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. NonCommercial — You may not use the material for commercial purposes. No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.