The network layer runs on all internet devices.
- Includes switches, routers, hosts
The network layer takes a segment from the sending host to the receiving host:
- Sender - encapsulates segment into datagram, pass to link layer
- Receiver - deliver segment to transport layer protocol
Function of a router:
- Examine header fields in all IP datagrams passing through it
- Move datagram from input port to output port along end-to-end path
There are 2 key functions of the network layer:
- Routing
- Determine route taken by packets from source to destination
- Involves routing algorithms to determine best path
- Part of control plane
- Forwarding
- Move packet from input to appropriate output link depending on IP header, forwarding table
- Part of data plane
Planes for network layer:
-
Data plane
-
Implemented on switches
-
Has local, per-router functionality
-
Determines how datagram on router is forwarded to router output port

-
Control plane
-
Involves network-wide logic
-
Determines how datagram is routed among routers along end-end path from source to destination host
-
Involves routing algorithms - find best path according to network
-
Traditional routing algorithm - implement in routers
- Need to commit to a single router (i.e. vendor lock-in)
- Per-router control plane ⇒ individual routing algorithm components in every router interact in control plane
- Information is collected via communication with other routers

-
Software-defined networking (SDN) - implement in remote servers
- Can be deployed remotely on proprietary hardware
- Remote controller computes and installs forwarding tables in routers
- Control plane pushes output to data plane
- Data plane uses information to forward packets
- Monitoring information is pushed by routers to control plane

Network Service Model