If you’ve ever wondered how a packet knows where to go after it leaves your computer, the network layer is where things start getting interesting. This layer mainly deals with logical addressing and routing. In the TCP/IP world, IP is the big one. Almost everything else builds around it.
IP Is the Main Network Layer Protocol
Internet Protocol, or IP, gives devices logical addresses and moves packets between different networks. IPv4 is still everywhere. IPv6 is the newer version, built partly because the supply of IPv4 addresses ran short.
IPv4 and IPv6
• IPv4 is the familiar one, and you’ll still find it on a lot of networks.
• IPv6 has the enormous address space people wanted, though adoption has been much slower than the original excitement suggested.
ICMP Works Alongside IP
Then there’s ICMP, the Internet Control Message Protocol. It doesn’t carry your normal application data. Instead, it reports network conditions and errors.
The classic example is ping. Your computer sends an ICMP Echo Request, and the other device sends an Echo Reply. Traceroute also relies on ICMP in many implementations, although its exact behavior depends on the operating system and method being used.
And ICMP matters more than it gets credit for. If something goes wrong with a packet, these messages can give the network a way to say, in effect, “that didn’t work.”
Routing Protocols Get More Specific
Routing protocols are another part of the picture, although they don’t all fit neatly into the same box. OSPF is designed to exchange routing information inside an autonomous system. RIP also shares routes, but it uses UDP underneath. BGP is different again and is normally treated as an application-layer protocol even though it makes major routing decisions.
• OSPF is a network routing protocol that works directly over IP, which makes it a good example to know for exams.
• RIP is older and simpler. It sends routing information using UDP, so calling it purely a network-layer protocol gets messy.
• BGP sits higher in the protocol stack, despite being responsible for the routing decisions that hold the Internet together.
What About IPsec?
IPsec is another important name. It protects IP traffic by adding authentication and encryption at the IP layer. That makes it especially useful for VPNs, where two networks need to communicate securely across an untrusted network.
The trick is that IPsec isn’t really one single protocol. It is a collection of protocols and mechanisms built around securing IP communication. AH provides authentication features. ESP is the part you’ll encounter more often because it can provide encryption as well.
So Which Ones Should You Remember?
• IP is the core answer. It handles logical addressing and packet delivery between networks.
• ICMP travels with IP for control and error reporting, which is why ping belongs in this conversation.
• OSPF is a routing protocol with a direct relationship to IP. It figures out routes rather than carrying ordinary user data.