Network Layer

Forwarding: moving data from router A’s output to next router B’s input.

Routing: determining entire route of routers from source to destination.

Local forwarding table: Key = Destination address in header; Value = Output link. (Generated by routing algorithm)

Planes

Data plane: Local, per router logic, forwarding function

Control plane: network-wide logic, routing algorithms

Protocols

Routing: Path selection (RIP, OSPF, BGP)

IP Protocol: Addressing conventions, datagram format, packet handling

ICMP Protocol: Error reporting, Router “signalling”

IP Addresses

An interface = connection between host/router and a physical link.

Typically a router has multiple interfaces (despite being only 1 device).

An interface can have more than one IP address associated with it (that’s why network layer connections don’t use MAC addresses!)

Subnet

Group of “directly” interconnected hosts: can reach each other without crossing a router.

Same network prefix within a subnet.

CIDR (Classless InterDomain Routing): IP address format in 32-bit (4x 8-bit) a.b.c.d/x [x = the number of bits in subnet]

Subnet mask: set all first x bits to 1, last 32-x bits to 0. Bitwise AND of the mask with an IP gives us which subnet.

Getting IP address:

  1. Buy block from ICANN/IANA
  2. Buy block from ISP
  3. DHCP

After obtaining a larger block from ISP, can split into contiguous blocks of $2^k$ addresses for integer $k$.

Route/Address aggregation

Hierarchical addressing: longest prefix matching

If organization is transferred from one ISP to another, its block is transferred to the new ISP.

Packets are matched with the longest prefix.

DHCP

Dynamic Host Configuration Protocol: dynamically obtains an IP address from server.

DHCP runs over UDP