Network layer services and protocols
Network layer services and protocols are focused on these two tasks:
- Forwarding
- moves packets from a routher’s input link to appropriate router output link.
- Routing Algorithm
- determines route for packets from source to destination.
Network Layer Service Model

Network layer is a best-effort model so it has no guarantees on:
- successful datagram delivery to destination.
- timing or order of delivery.
- bandwidth available through end-to-end flow.
- Upper layer protocols (e.g. TCP) provide reliable data transfer instead.
Best effort model is adopted because:
- Simplicity of machanism allows Internet to be widely deployed and adopted.
- Sufficient provisioning of bandwidth allows performance of real-time applications to be “good enough” for “most of the time”.
- Application layer provides replicated and distributed services (e.g. Datacenter or CDN), placing copies of services closer to clients.
- 05-TCP Congestion Control adapts sending rates to current network conditions.
Data plane and Control plane
Data Plane
- is local and per-rounter function.
- determines how datagram arriving from router input port is forwared to a router output port.
- essentially handles forwarding.
Control plane
- is network-wide logic.
- has two approaches:
- traditional distributed routing algorithms are implemented in a set of routers.
- SDN (Software-defined networking) is implemented in remote servers as a centralized service.
- essentially handles routing.
Router Architecture Overview

- Router Input and output ports are composed of 3 layers:
- Physical layer (green)
- recieves electrical, or wireless signals and convert them into bits.
- sends signals converted from bits.
- Link-layer (blue)
- processes Ethernet frame.
- Network layer (red) provides lookup and forwarding:
- examines header field values and forward packets to appropriate output ports using forwarding table stored in each input port’s memory (decentralized).
- entails queueing when arrival of packets is faster than transmission of packets.
- Physical layer (green)
- Switching fabric
- is the internal and high-speed architecture within a switch or router that connects input ports to output ports, facilitating data packet forwarding.
- Routing processor
- is the core control plane components in network routers, responsible for
- running routing protocls (like BGP, OSPF).
- providing forwarding tables.
- managing system functions.
- is the core control plane components in network routers, responsible for
Buffer Management
Packets can be dropped when buffers are full. Therefore, a careful buffer management is required for efficiency:
- drop or add: which packet to drop or add.
- priority: which packet is to be privilieged.
- packet scheduling:
- FCFS
- Priority Scheduling
- Round Robin Scheduling
- Weighted Fair Queueing
IP Address
- IP address
- 32-bit identifer associated with each host or router interface.
- Interface
- Connection between host/router and phsycal link (interface is covered in link layer)
IP Datagram Structure

Subnet
- A subnet is a logical subdivision of networks by dividing IP addresses.
- The practice of dividing a network into two or more networks is called subnetting.
- The higher significant octet in IP address is subnetted, the higher hierarchy (larger regions) the network spans.
For example, a network can be divided into two networks (192.168.1.0/25 and 192.168.1.128/25):

Subnet Mask
Subnet mask splits an IP address into two parts:
- Network portion which identifies a network.
- indicated by a sequence of 1s.
- Host portion which identifies a specific interface (device) within that network.
- indicated by a sequence of 0s.
For example, the following subnet mask reveals which octet belongs to the network and the host portion:

CIDR (Classless Inter-Domain Routing)
CIDR facilitates the notation of an IP address with the subnet mask:

Host portion conventional interpretation:
- Network address:
192.168.100.0- is usually assigned to the router itself.
- Ordinary host range:
192.168.100.1–192.168.100.254 - Broadcast address:
192.168.100.255- is used to broadcast packets to local hosts simultanesouly (e.g., to find DHCP server).
How Forwarding Works?
Match and Forward based on Longest-prefix Matching
When deciding which output port a packet should be forwarded, compare the packet’s destination IP address with forwarding table entries, then find longest address prefix.
Given a forwarding table as below:

Two packets arrived with destination IP addresses as shown above, then:
- First packet is forwarded to interface 2.
- Second packet is forwarded to interface 1.
This fast match and forward is enabled by TCAM (ternary content-addressable memory)
- TCAM compares an arriving address against many table entries in parallel, allowing an extermely quick match.