§ — — Data Communications and Networking
The network layer allows devices on different networks to communicate. It provides logical addressing and routing so packets can move from a source host to a destination host across one or more networks.
The main protocol at this layer is IP. IP has three important characteristics:
| Characteristic | Meaning |
|---|---|
| Connectionless | IP does not establish a session before sending packets. |
| Best effort | IP does not guarantee delivery by itself. |
| Media independent | IP can work over different network media such as copper, fiber, or wireless. |
Reliability, if needed, is handled by upper-layer protocols such as TCP.
The network layer encapsulates a transport layer segment into an IP packet. The packet includes source and destination IP addresses. These IP addresses normally remain the same from source to destination, even as the packet passes through routers.
At each hop, the data link frame changes because the local MAC addresses change. The IP packet remains focused on end-to-end delivery.
An IPv4 packet header contains information used to deliver and handle the packet. Important fields include:
The TTL value is reduced by routers. If it reaches zero, the packet is discarded to prevent endless looping.
IPv6 uses a simpler fixed-size base header compared with IPv4. Important fields include:
The Hop Limit field in IPv6 performs a similar role to TTL in IPv4.
When a host sends data, it decides whether the destination is local or remote.
If the destination is on the same network, the host sends the frame directly to the destination MAC address. If the destination is on a different network, the host sends the frame to the default gateway's MAC address. The default gateway is usually a router interface.
Routers connect different networks and forward packets based on destination IP addresses. A router uses its routing table to choose the best path.
A routing table may include:
A static route is manually configured. It is useful for small networks, simple paths, backup routes, or default routes. However, static routes do not automatically adapt when the network changes.
A typical IPv4 static route format is:
ip route destination-network subnet-mask next-hop-or-exit-interface
ProReviewer — locked
Drills, code labs, and full solutions.
ProReviewer — locked
Drills, code labs, and full solutions.
ProReviewer — locked
Drills, code labs, and full solutions.
Done with this module? Track it — your progress shows on the subject list.
Up next
Address Resolution Protocol→←Previous: Ethernet Switching