TechKnowSurge
CompTIA Network+ 1.1 Cisco CCNA 3.1 Cisco CCST Networking 4.4 Cisco CCNA 3.2 Cisco CCST Networking 1.1 CompTIA Network+ 1.6
VideoNetworkFree

Layer 3 Basics

Layer 3 of the OSI model, the Network Layer, governs how data packets are addressed and routed across interconnected networks using protocols such as IPv4, IPv6, and ICMP. It forms the foundation of internet communication, enabling data to travel between geographically distant locations through packet switching and dynamic routing.

Complete this video to capture a CTF flag worth 1 point.

About this video

The Network Layer, Layer 3 of the OSI model, serves as the backbone of internet communication, providing the logical addressing and routing mechanisms that move data from one point to another across globally interconnected networks. Its primary protocol data unit is the packet, which carries a Layer 3 header containing addressing information that remains consistent as data traverses multiple physical segments. Key protocols at this layer include IPv4, IPv6, and ICMP, with IPv4 forming the central focus of most foundational networking study. Each protocol defines both its own addressing space and the structure of its packets, giving network engineers a consistent framework for understanding how data is identified and transported. The internet's approach to data delivery is built on packet switching, a model that replaced the older circuit-switching architecture used by the public telephone system. Circuit switching reserved a dedicated physical path for the duration of each call, which was inherently limited in scalability and vulnerable to congestion. Packet switching solves this by segmenting data into discrete packets that can each take independent routes to the destination and be reassembled on arrival. This dynamic routing capability allows the network to adapt in real time to congestion or link failures, rerouting traffic automatically and making the overall infrastructure far more resilient and scalable. When a packet encounters a network segment with a smaller maximum transmission unit, fragmentation allows it to be broken into smaller pieces, transmitted, and then reassembled at the receiving end. Routers are the devices that carry out Layer 3 operations, and their function is intentionally narrow: examine the destination address of each incoming packet and determine the best next hop toward that destination. This single-minded focus on routing keeps the process efficient and fast. Layer 3 is connectionless and best-effort by design, meaning routers do not track sessions, guarantee delivery, or attempt to retransmit lost packets. Responsibility for reliability and error recovery falls to upper-layer protocols, allowing the Network Layer to remain lean and optimized purely for forwarding decisions across complex, large-scale networks.

What you'll learn

What's covered

OSI Layer 3 Network Layer

Aligned to

CompTIA Network+
1.1 Explain concepts related to the Open Systems Interconnection (OSI) reference model.
1.6 Compare and contrast network topologies, architectures, and types.
Cisco CCNA
3.1 Interpret the components of routing table
3.2 Determine how a router makes a forwarding decision by default
Cisco CCST Networking
4.4 Explain basic routing concepts
1.1 Identify the fundamental conceptual building blocks of networks

Key terms

Network Layer
Layer 3 of the OSI model, responsible for logical addressing and routing data packets between networks.
Open Systems Interconnection Model
OSI
A conceptual framework that standardizes network communication into seven distinct layers.
Packet
A unit of data formatted for transmission over a network, containing a header, payload, and sometimes a trailer.
Internet Protocol
IP
The principal communications protocol for routing packets across network boundaries.
IP Address
A numerical label assigned to each device connected to a network that uses the Internet Protocol.
Router
A network device that forwards data packets between networks based on IP addresses.
Internet Control Message Protocol
ICMP
A network layer protocol used to send error messages and operational information about network conditions.
Circuit Switching
A communication method that establishes a dedicated physical path between two devices for the duration of a connection.
Packet Switching
A communication method that breaks data into packets and sends them independently across a network, potentially via different routes.
Segmentation
The process of dividing a large message or data stream into smaller pieces called segments before transmission across a network, allowing multiple devices to share the medium and enabling parallel transfer. TCP performs segmentation at Layer 4 and numbers the segments so the receiver can reassemble them in the correct order.
Fragmentation
The process of breaking a packet into smaller pieces when its size exceeds the maximum transmission unit of a network link, with reassembly occurring at the destination.
Network Segmentation
The practice of dividing a network into smaller segments to improve performance and limit the spread of security threats.

Transcript

Layer three is really the backbone of the internet. It really is what a lot of our information travels across.

The Network Layer

The network is layer three in the OSI model, so we're going to be talking about layer three, the network layer. Some examples of protocols would be IP version 4, IP version 6, and ICMP. There are a few more and we'll talk about a few more, but really this is the core of what we're going to talk about in this course, and we are going to really hone in on IP version 4 at first.

We call the protocol data unit, or the data type, a packet. The packet is what gets sent across from one location to another, from point A to point B. It remains a packet this whole time as it's traversing across all these different physical layers. All these different layers could be shifting and changing, but layer three largely remains the same as it goes from point A to point B, and then it gets over to its destination. We have to have some information to get to its destination, so we have some sort of addressing, and that goes into the header. We do have a layer three header that goes at the beginning of this with some information.

Layer 3 Protocols

Within that layer three header, there are a lot of different types of layer 3 protocols. To name a few, we have Internet Protocol, or IP. This is probably the one that we're most familiar with, but there is also ICMP, and we will be talking about ICMP later. There is SIP at layer three. SIP is a protocol that operates off of multiple layers, but there's a layer 3 component to that. There's IPX, X.25, and quite a few others as well.

Really, the one that we're going to be mainly concerned with in this course is the Internet Protocol. Internet Protocol has different versions, just like the rest of these. With Internet Protocol, we have version 4 and version six. We're going to be focused right now mostly on version four, but there is a version six that we'll get into, what that looks like and how that is differentiated. And then we have ICMP, and we will get a little bit into ICMP as well.

One thing to realize with these is that for the most part all of these are a separate protocol, but most of them also have a separate addressing space, a different way to address it. So we have IP addresses that are specific to IP, although we actually will use that for ICMP packets as well, and we'll take a look at that. We have these IP addressing ranges, and then we also have IP packets. Realize that the protocol will define the address and it will also define the packets and what the packets look like. There are different components within those, and we'll explore each one of those specifically.

Circuit Switching

When it comes to IP version 4, the internet operates off of something called packet switching, which is pretty cool. But to completely understand packet switching, it's helpful to take a look at our history and see what we used before that, which was circuit switching.

The old phone system, or what we call the POTS system, which would be plain old telephone system, is what we used to use. It was circuit switching. You've probably seen a picture of an operator. You call into the operator and they physically plug you in from one switch to the next to get you to your end location. At some point in time that was replaced by machinery, but the idea behind it is there's all these circuits and you would take up a circuit. That's why it's circuit switching. You would take up a circuit from one location to another.

Here we have different switches. I put just some of the lines in within here, but really there would be a huge amount more lines in here. It would just complicate this drawing and what I had here, so I didn't put all the lines in.

You would dial in, so you would have a connection into a switch. That switch would then, when you press the numbers... before, you would actually dial and it would have pulses that would go across the line, but then that was replaced by dual tone multi-frequency, DTMF. When you press the number it would make a tone, it actually makes two tones, and that would be the signaling that would tell the switch where you wanted to dial into, where you wanted to be able to talk to. That dual tone multi-frequency would come across and it would make these connections, and it would be a physical connection that you would connect, and it would then send you to this location and make this connection to this end phone right here. You would take up all of these lines. Then this circuit right here, you would take that up, and that would be assigned to you. Other people would have their own connections within the system.

Every once in a while, and you may hear this every once in a while even when you're making a phone call, is "all circuits are busy right now." That's because on these switches, all of these connections are all taken up, and then you can't communicate because there is no circuit that's available. Especially when there's emergencies or something that happens and everybody gets on the line and starts calling and says, "Hey, this is what's going on," then all those circuits are filled up.

Packet Switching

This is very limiting, because then you can only have a certain amount of circuits that are available. When they set out to make the internet, they realized we can't just take up a circuit for a single line of communication; that's not scalable. We can't scale that out to the degree that we want it to. What we have to do is rethink how we're doing this and come up with another system. That's where packet switching comes in.

Packet switching is the idea of taking data and, rather than having a specific route that goes from point A to point B, instead we are going to break that up into smaller chunks of data, which is what we'll look at here in a second as segmentation. We'll cut it up into smaller chunks of data and then send it across. When you are sending a message from one point to another, it actually could take many different routes, each one of those pieces of data. So if you've got an email that's being sent, it will probably be broken up into lots of different packets and then sent across, and it will probably take a different path as it gets to its end location.

That is packet switching. It will take it and put it into little packets and then it will send it along its way. What this allows us to do is be very dynamic. If a line goes down, or if there's lots of heavy traffic on a certain line, then it will reroute it, and it can reroute it in another direction. It's very dynamic and things are constantly changing, and it doesn't take up this one circuit from one point to another just to send your data across there.

Segmentation

We're capable of doing packet switching because we break things into packets, or we segment the data into packets. We're going to talk about segmentation in a couple different lights here. We're going to talk about it from a data perspective, but we're also going to talk about it from a network perspective.

First of all, let's just talk about it from a data perspective. We take the data and we break it up into smaller components, so that when it's sent from one point to another and it gets over to the next location, then it needs to be reassembled. But we do that so that it can take different routes. As data is being sent across here, we could be sending across this fast path right here, but then something happens like this line goes down. If we segment the data, then this could heal and take a different route. Or maybe the line doesn't go down. Maybe the line just gets congested and there's a lot of traffic on that, and so this network is able to adjust for that and be able to send it a different route. So your message, not only will it break it down into different packets and segment it into different data as it sends it across, it could actually take a different route to get from point A to point B, and probably will if it's big enough data that you're trying to send across. It probably will take a lot of different routes. It's pretty amazing how we can take this data, chop it into smaller segments, and then send it across. That's data segmentation.

But the other thing that happens at this layer 3 is network segmentation. Network segmentation is the idea that we break up our communication into lots of segments. So we have a segment here, we have a segment here. We have these different segments, and as data is being transferred each one could have its different technologies and its different protocols. So this is network segmentation, once again for the same reasons. It allows us to dynamically adjust as lines get congested or lines go down. It allows us to adjust and resend that information, or send that information in a different route, so it can get to its end destination, allowing for things to self-heal and making things much more scalable.

Fragmentation

Now, what can happen when we segment data is we break it down into specific chunks of sizes as we're sending across this network. But something could happen along the way where maybe it gets to a certain technology that's not able to have the same size of data that goes across it. This is why we have like the MTU, or maximum transmission unit, to avoid that from happening. But it still can happen, where it gets to a certain location where the data that's trying to be sent across there is too large. And so we need to do something with that data. What we can do is break that down into a fragment.

One thing that happens at a layer 3 is we're able to take a packet and take the data from it and break it apart and make some adjustments to it to get it across the certain connection, and then get it reassembled on the other side to send it along its way. That's what we call fragmentation. Fragmentation is when a packet size is too big and we need to break it into a couple smaller components and then get it reassembled on the other side. That would be fragmentation, when packets are fragmented into smaller components to get it across one of these links, or maybe certain networks.

Routing

Now, layer 3 deals with a lot of data and it's got to be very fast. It does this by really just focusing on routing. That's its job, routing. As it comes into this machine right here, it doesn't do too much with that packet. It tries to do the least amount of steps with that packet, so its sole focus is on getting it to its destination.

Whenever a packet comes to a router, its primary job is to route that information to the proper location. It takes a look at that destination address and just makes a decision: I need to send it this way, or I need to send it this way. That's this router's sole purpose, which direction do I send it? I have three networks that are attached to this router right here. I have three networks, and so which direction does it need to go? That is routing.

When it gets to this router right here, it makes the same decision. Where does it need to go? I need to send it this way. When it gets to this destination, this router right here decides where does it need to go? It needs to go right here. So that's routing. Routing is just, where is the next best place I can send this? Every router makes that decision. Where's the next best hop? We call it a hop. What's the next best hop that it needs to go to? Every single router does just that one function, which is where do I route this information to.

Layer 3 Characteristics

Layer three is connectionless and it's best effort. What that means is, as this computer is communicating to this server, this router is just concerned with the destination. Which way do I send this? What is my next hop? What route do I send this to? It is connectionless. It doesn't care what business this computer has with the server right here. It's not going to realize that this is going to be sending this amount of packets, or that it's going to be establishing a connection to the server to be able to send multiple pieces of data.

And it's just best effort. If it discovers an error, if it discovers that the connection is broke, if it discovers anything that's wrong with this, it's not going to try to fix anything. It's not going to try to retransmit anything. It's not going to make any effort to try to fix the connection or fix the messages that are coming across here. It's just going to take the message in, figure out where it's supposed to go, and route it, and it wants to do that really efficiently.

So what happens is, let's say we're sending multiple packets over to this server right here. It's expecting four packets and something gets dropped. We need to resend that packet, we need to retransmit that packet. It's not the job of the routers to get that resent or retransmitted or fixed. It is the job of other protocols, upper layer protocols, to realize the data didn't get across here, and so I need to resend this, up to different layers. Layer 3 does not handle that. So layer 3 is best effort and connectionless. All it's concerned with is routing information.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →