WEEK 8 Networks and Operating Systems - Network layer II
CS2005 Networks and Operating Systems
Course: CS2005
Focus: Networks and Operating Systems, Network Layer II
Authors: J.F Kurose and K.W. Ross ©1996-2016
Session Objectives
Understanding Internet Protocol (IPv4)
IPv4 datagram format
IPv4 datagram fragmentation
IPv4 addressing
Understanding Internet Protocol (IPv6)
Overview of IPv6
Network Layer Overview
Network layer protocol enables logical communication between hosts.
Decomposed into:
Data Plane
Handles per-router functions for datagram forwarding.
Control Plane
Manages network-wide logic to route datagrams from source to destination using routing algorithms.
Traditional implementation often combines data and control planes within a router.
Software-Defined Networking (SDN) separates these planes:
Control plane functions are implemented as a separate service, e.g. in a remote "controller."
Functions of the Network Layer
Sending Side
Encapsulates transport layer segments into datagrams.
Routes datagrams to nearby routers.
Receiving Side
Receives datagrams from routers.
Extracts transport layer segments and delivers them to the transport layer.
IPv4 Datagram Format
Two Protocol Versions: IPv4 and IPv6.
Key fields in the IPv4 datagram include:
Version Number: 4-bit number indicating IP protocol version.
Header Length: 4-bits to determine where the payload begins (typical 20 bytes).
Type of Service (TOS): 8-bit number to define datagram types (e.g., real-time vs. non-real-time).
Datagram Length: Total length and maximum of 65,535 bytes; actual often ~1500 bytes.
Flags and Fragmentation Offset: Information for IP fragmentation.
Time-to-live (TTL): Prevents infinite datagram circulation; decremented by each router.
Continued - IPv4 Datagram Format
Protocol Identifier: Indicates transport-layer protocol at the destination (e.g., TCP, UDP).
Header Checksum: Detects bit errors; recomputed at each router.
Source and Destination IP Addresses: Identifiers for origination and destination of the datagram.
Options: Allow header extensions that complicate processing.
Data (Payload): Typically contains transport-layer segments (TCP/UDP) or other data types (e.g., ICMP).
IPv4 Datagram Fragmentation
Encapsulation within link layer frames for transport.
Maximum Transmission Unit (MTU): Limits the size of individual packets based on link layer protocol.
Fragmentation occurs when datagrams exceed MTU:
IP fragments the payload into smaller datagrams.
Each fragment retains the original datagram identification for reassembly.
IPv4 Datagram Reassembly
Fragments are identified by their shared identification number.
Reliability issues include potential loss or out-of-order arrival of fragments.
The last fragment has its flag bit set to 0.
Offset field specifies the position of each fragment within the original datagram.
Example Fragmentation
A 4000-byte datagram needing fragmentation for a link with MTU of 1500 bytes:
Results in 3 fragments (2 with 1480 bytes of payload + 20 bytes header, 1 with 1020 bytes of payload + 20 bytes header).
Offset values calculated in 8-byte blocks.
IPv4 Addressing
Each host typically has one link; routers have multiple links.
Each interface (host/router link) must have its own IP address (32-bit long).
IP Addressing Notation: Dotted-decimal representation; example: 193.32.216.9.
Continued - IPv4 Addressing
IP addresses must follow subnet rules based on interface connectivity.
Example subnet: 223.1.1.0/24, where /24 indicates the subnet mask.
Host addresses in the subnet must follow the defined prefix (e.g., 223.1.1.xxx).
Network Classes and CIDR
Classes:
Class A: /8
Class B: /16
Class C: /24
Classless Interdomain Routing (CIDR) introduced to allocate contiguous IP address blocks with common prefixes.
Format: a.b.c.d/x, where x is the number of bits in the network portion.
Subnetting
Definition: Network segments where devices can reach each other directly without routers.
Example: Isolated networks are referred to as subnets.
Overview of IPv6
IPv6 was motivated by the depletion of IPv4 addresses.
Key improvements:
Expanded Addressing: 128-bit addresses ensure ample supply.
New Address Types: Anycast addresses deliver datagrams to any one of a group of hosts.
Fixed Header: 40-byte for faster router processing.
Session Objectives Review
Review of key concepts discussed:
IPv4 and IPv6 Addressing
IPv4 Datagram Format, Fragmentation, and IPv4 Addressing
Overview of IPv6.