IPv4 Header of Datagram

Notes:

Flag: 1 if there’s a next segment, otherwise 0

Lenght: length of entire IP fragment (header + payload)

Offset: offset from start of original datagram in 8-bytes (sets of 8 bytes)

MTU (Max Transfer Unit): The maximum amount of data (bytes) a link-level frame can carry.

Checksum: same checksum as in transport layer

Why fragment?

Different link layers have different physically determined Maximum Transfer Units (MTUs) – the max amount a link level frame can carry.

From 1 IP header + 1 payload $\rightarrow$ 3 $\times$ (IP header + $\frac{1}{3}$ payload).

Network Address Translation

Public IP addresses are globally unique and routable.

Private IP addresses are routable within an organization/home etc, but not globally.

Serving a packet from a Private IP address to the internet will fail (ISP will never).

All $n$ local area network (LAN) addresses $\rightarrow$ NAT $\rightarrow$ 1 public address to the wide area network (WAN).

Problems:

IPv6

Same as IPv4 in header structure, except source, destination addresses are now 128-bit. Header is 40-byte.

Routing

Routing between Autonomous Systems (ASs) in the internet (network of networks) is done hierarchically.

AS: Mini internet under one organization’s control.

Intra-AS

Inter-AS routing.

Routing algos

Link state algorithms: all routers know the whole network topology (graph) and link cost (edge weight).

Distance vector algorithms:

Bellman-Ford

Let $d_x(y)$ be the least cost path from $x$ to $y$.

Let $c(x,y)$ be the cost of the direct link between nodes $x$ and $y$. $c(x,y) = \infty$ if $x, y$ are not neighbours.

\[d_x(y) = \min_{v \in \text{neighbours}(x)} {c(x,v) + d_v(y)}\]
n = V.length
for i in range(0, n):
  for edge in graph:
    relax(edge)

Key property: If P is the shortest path from S to D, and node X is on P, then P must be the shortest path from S to X $\cup$ shortest path from X to D.

Distributed: Each node receive info from neighbours, recompute and distributes again

Iterative: Continues until two iterations are the same (no more information)

Asynchronous: Nodes do not have to compute in a certain order.

Routing Information Protocol (RIP)

Internet Control Message Protocol (ICMP)

ICMP are carriedin IP datagrams.

Contained after IP header (IP header - ICMP header - data).

Header: Type + Code (for specific status) + Checksum

Examples