Network Layer Overview
The Network Layer is all about networks and routing packets to the correct network, it is the “Layer of The Internet” the layer of the IP protocol. The IP protocol is a connectionless protocol, it doesn’t care about setting up a connection prior to sending like TCP’s three way handshake, it just sends. IP is also a best effort protocol in that it isn’t reliable, it leaves reliability up to TCP with its sequence numbers and syns and acks. IP is only concerned with getting the packets to the right network, i.e the Best Path. The Network Layer header specifies the network addressing i.e. source and destination IP addresses.
Along the packet’s travels across the internet the source and destination ip addresses never change. IP or the Internet Protocol is a special protocol that we call a routed protocol. In other words IP is a protocol that is routable, it gets this from the fact that it uses hierarchical addressing that can be tiered into levels of greater and smaller networks as well as the ability to differentiate between the network portion and the host portion of the address. This last part is crucial, think of another hierarchical addressing scheme for instance, a post office mailing address. When you mail a letter, it is sent to a host or recipient like “John Doe,” but what if you only wrote the person’s name on the letter, like “To: John Doe,” would it get there? No, it wouldn’t, because it wouldn’t contain any routable information like State, City, and street address only the recipient John Doe. We can liken a complete mailing address to an IP address like 192.168.1.108 /24. The routable portion like city, state, and street address is the network portion the 192.168.1 part and the recipient is the host portion or the .108 part. We can easily differentiate the network portion from the host portion by means of the network mask or subnet mask. The network mask has 4 octets just like the IP address. The portions with the 255’s (255.255.255.0) identify the network portion and the portion with the 0’s tells us where the host portion is.
IP Addressing – Example
22.214.171.124 – If this is the ip address
255.255.255.0 – and this is the netmask or subnet mask
192.168.1.111 – then the network is red, and the host is green … why?
255.255.255.0 – the network portion is defined by the red 255s and the host portion is defined by the green 0 portion.
192.168.1.0 – the first address is the network address and cannot be assigned to a host
192.168.1.255 – the last address is the broadcast address and cannot be assigned to a host
192.168.1.1 thru 254 – are available for host addresses
If we convert the 255.255.255.0 netmask from decimal to binary the 1s represent the network portion and the zeros represent the host portion:
11111111.11111111.11111111.00000000 – Binary
255.255.255.0 – Decimal
The above ip address and netmask together can be represented as:
192.168.1.111 /24 – The /24 represents the number of binary 1s in the netmask counted from left to right
11111111.11111111.11111111.00000000 – 24 x1s or /24
The Protocols of the Network Layer
IPv4 – The most widely used network layer protocol, and part of the TCP/IP suite used on the internet. A connectionless, best effort protocol.
IPv6 – The successor to IPv4, with 128 bit addresses instead of 32 bit addresses to solve address space and other issues.
ICMP – Internet Control Message Protocol, part of the TCP/IP suite responsible for error messages when services or destinations are unreachable. ICMP is used directly by the ping and trace route utilities.
IPsec – Internet Protocol Security is a TCP/IP suite protocol that provides authentication and encryption similar to SSH, but at the network level for packets, making any type of TCP/IP communication secure. It has been back-engineered into IPv4, and is required under IPv6 for interoperability.
IPX – Novell Internetwork Packet Exchange, a protocol used by Novell NetWare systems that has become depreciated since the acceptance of TCP/IP
Appletalk – A proprietary Apple protocol, depreciated and no longer supported in the latest releases of Apple’s operating system.
CLNS/DECNet – Connectionless Network Service. A connectionless protocol that is not found on the internet, but still used in many telecommunications networks.
Video Tutorials – Routing Basics