Chapter 4: Network Layer
4.1: Introduction
- Network layer = IP layer
- Transport segments from sending to receiving host
- On the sending side, segments are encapsulated into datagrams
- On the receiving side, segments are delivered to transport layer
- Network layer protocols in every host and router
- Router examines header fields in all IP datagrams passing through it
Key Network-Layer functions
- Routing: determine the path taken by packets from source to dest
- Build a minimum-cost table at each router
- Table has next-hop neighbor for each possible destination
- Goal: send packet along the least-expensive path
- Forwarding: move packets from a router’s input port to the router’s output port (physical interface (NIC) inside router, not a TCP/UDP port!)
- Table lookup
- Port-to-port transfer
- Goal: efficiency
- Note this is within a single router!

- Connection setup in certain network architectures, e.g. ATM (Asynchronous Transfer Mode):
- Before datagrams flow in such networks, two hosts and intermediate routers establish virtual circuit (VC). Routers get involved to set up a path
4.2: Virtual Circuit and Datagram Networks
Virtual Circuits
- VCs may create a path that behaves much like a telephone circuit (no congestion, low delay, no loss)
- Call setup for each connection before data can flow
- Each packet carries a VC tag instead of the 5-tuple <src addr, dest addr, src port, dest port, proto>
- Every router on source-dest path maintains “state” for each passing connection
- Mapping from tags to next-hop router
- Fraction of router resources (bandwidth, buffers) are allocated to each VC

If this was a forwarding table for a datagram network, then the 2 columns would be destination address and outgoing interface.

Datagram Networks
- No call setup at network layer