Understanding Computer Networks: From ISPs to IP Routing
Class 1: Introduction to Internet Service Providers (ISPs) and Network Technologies
Autonomous Systems (AS) and Internet Exchange Points (IXPs)
Each ISP consists of one or more Autonomous Systems (AS). An AS is a group of routers under the control of a single ISP. Each AS is assigned a unique AS Number (ASN) by the Internet Assigned Numbers Authority (IANA). ISPs can connect their networks through Internet Exchange Points (IXPs), which are physical locations where networks can exchange traffic.
Standard Organization: Internet Engineering Task Force (IETF)
The Internet Engineering Task Force (IETF) is the main standards organization for the internet.
WAN Switching Technologies
- X.25: Utilizes virtual switching.
- Frame Relay: Utilizes virtual circuit switching and Quality of Service (QoS).
- ATM: Utilizes virtual circuit switching, QoS, and fixed small cell size.
Connecting Devices
- Repeaters: Layer 1 devices that extend the reach of a network.
- Hubs: Multi-port repeaters that operate in a single collision domain.
- Bridges: Layer 2 devices that filter traffic based on MAC addresses.
- Switches: Layer 2 devices that forward traffic based on MAC addresses.
- Routers: Layer 3 devices that forward traffic based on IP addresses.
LAN Segments, Repeaters, and Hubs
A LAN Segment is a portion of a LAN used to extend its length or reach. LAN Repeaters connect LAN segments. A Hub is a multi-port repeater that operates in a single collision domain. All devices connected to a hub are in the same collision domain, meaning their frames could collide.
Bridges and Switching
A Bridge is a repeater with a Layer 2 filter. This filter reads MAC addresses and decides whether to forward or drop a frame based on its MAC Forwarding Table. This table associates port interfaces with host MAC addresses. Modern bridges function transparently, meaning they don’t require manual configuration by a network administrator.
Bridging (also known as switching) performs the following functions:
- Forwards frames based on the MAC forwarding table.
- Updates the MAC forwarding table through learning.
- Prevents switch loops.
MAC forwarding table entries are learned by monitoring source MAC addresses received at ingress ports. These entries are removed (aged out) if frames from a source MAC address haven’t been received within a certain time (typically 5 minutes).
When a switch receives a frame with an unknown destination MAC address, it uses Flooding. This process broadcasts the frame to all ports in the Broadcast Domain, which is equivalent to the IP subnet.
Required Addresses for Hosts
For Direct Delivery within a subnet, a host needs:
- MAC address
- Host IP address
- Subnet mask
For Indirect Delivery outside of the subnet, a host also needs:
- Default router IP address (also known as the Default Gateway IP address)
- DNS server IP address
- DHCP server IP address
Class 2: IP Addressing and Subnetting
IPv4 Address Exhaustion and Solutions
The Internet Assigned Numbers Authority (IANA) assigns IPv4 /8 address blocks to Regional Internet Registries (RIRs). Due to the increasing number of internet-connected devices, IPv4 addresses are becoming scarce. Mitigation and solutions include:
- Classless Addressing: Allows for more efficient allocation of IP addresses.
- Private IP Addresses with NAT: Conserves public IP addresses by using private addresses internally and translating them to public addresses using Network Address Translation (NAT).
- Reclaiming Unused IPv4 Address Blocks: Recovering unused address blocks from organizations that no longer need them.
- Long-Term Solution: Migration to IPv6: IPv6 offers a much larger address space.
Network Addresses and Limited Broadcast Address
The Network Address (Net ID) is a portion of the IP address that identifies the network. The Limited Broadcast Address (255.255.255.255) is used to send a message to all devices on the local network. The This Host address (0.0.0.0) is used when a host doesn’t know its own IP address. The Loopback Address (127.0.0.1) is used for testing and communication within the same host.
Private IP Addresses and NAT
Private IP Addresses are not globally recognized and are used within private networks. Network Address Translation (NAT) allows devices with private IP addresses to communicate with the internet by translating their private addresses to public addresses.
Subnetting
Subnetting divides a network into smaller subnetworks. It adds a third level of hierarchy to IP addresses. The Subnet Mask is used to determine which bits of the IP address belong to the network and subnet portions and which bits belong to the host portion.
Classful vs. Classless Addressing
Classful Addressing uses fixed-size address blocks for each class (A, B, C). Classless Addressing allows for variable-length address blocks, making IP address allocation more efficient.
Network Address Translation (NAT)
Network Address Translation (NAT) allows a site to use private IP addresses internally and public IP addresses externally. It helps conserve public IP addresses and provides some security benefits. However, it can also introduce complexities and break certain applications that rely on direct IP communication.
Class 3: Routing and Switching
Connection-Oriented vs. Connectionless Service
Connection-Oriented Service (like virtual circuit switching) establishes a connection before transferring data and then terminates the connection. Connectionless Service (like datagram switching) doesn’t establish a connection before transferring data. Each packet is treated independently.
Virtual Circuit Switching
Most virtual switches use Virtual Connection IDs (VCIs) to forward frames. The VCI Forwarding Table tells the switch how to forward frames based on their VCIs. This table is updated using call control signaling protocols.
IP Routing
IP Routing is connectionless. IP packet delivery can be Direct (within the same network) or Indirect (to a different network).
General Forwarding Techniques
- Source Forwarding: The routing table stores the entire path to the destination.
- Next-Hop Forwarding: The routing table stores only the address of the next router.
- Network-Specific Forwarding: One routing table entry for each network or subnet address.
- Host-Specific Forwarding: One routing table entry for each host address.
- Default Forwarding: Specifies where to send packets that don’t match other entries in the routing table.
IP Routing and Forwarding Tables
IP hosts typically use default routing. IP routers generally use network-specific or host-specific forwarding and next-hop forwarding. The Routing Table is used for routing decisions (slow path), while the Forwarding Table is used for packet forwarding (fast path).
Types of Routers
- Core Routers: Used by ISPs for high-speed backbone connections.
- Edge Routers: Connect different networks, often used by carriers.
- Enterprise Routers: Used within companies to connect different departments or branches.
- Access Routers: Used in homes and small offices to connect to the internet.
Longest Prefix Matching and Address Aggregation
Longest Prefix Matching (also known as Longest Mask Matching) is used to select the most specific routing table entry for a given destination address. Address Aggregation combines multiple network addresses into a single entry in the routing table, reducing its size.
Hierarchical Routing
Hierarchical Routing further reduces the size of routing tables by organizing networks into a hierarchy. This enables address aggregation and simplifies routing decisions.
Class 4: IP and ICMP
IPv4 and Datagrams
IPv4 provides a connectionless, best-effort service. Packets at the IP layer are called Datagrams.
IP Header Fields
- IP Header Length (HLEN): Specifies the length of the IP header in 32-bit words.
- Total Length Field: Specifies the total length of the IP packet in bytes.
- Protocol Field: Identifies the encapsulated protocol (e.g., TCP, UDP, ICMP).
IP Options
- Record Route: Adds router addresses to the header.
- Strict Source: Specifies the exact path the datagram must take.
- Loose Source: Specifies a list of routers the datagram must traverse, but allows for other routers as well.
- Timestamp: Adds timestamps and router addresses to the header.
Source Routing
Source Routing allows the sender to specify the path a datagram should take. Strict Source Routing requires the datagram to follow the exact path specified. Loose Source Routing allows the datagram to deviate from the specified path.
ARP and ICMP
Address Resolution Protocol (ARP) is used to find the MAC address associated with an IP address. Internet Control Message Protocol (ICMP) is used for error reporting and network diagnostics.
Ping and Traceroute
Ping is used to test the reachability of a host. Traceroute is used to trace the path a packet takes to reach a destination.
Dynamic Host Configuration Protocol (DHCP)
Dynamic Host Configuration Protocol (DHCP) automatically assigns IP addresses and other network configuration parameters to devices on a network.
Abbreviations
- AS: Autonomous System
- ISP: Internet Service Provider
- IXP: Internet Exchange Point
- ASN: AS Number
- QoS: Quality of Service
- DA: Destination Address
- IANA: Internet Assigned Numbers Authority
- RIR: Regional Internet Registry
- ICANN: Internet Corporation for Assigned Names and Numbers
- NAT: Network Address Translation
- ARP: Address Resolution Protocol
- HLEN: IP Header Length
- COS: Class of Service
- PHB: Per-Hop Behavior
- MTU: Maximum Transmission Unit
- ICMP: Internet Control Message Protocol
- DHCP: Dynamic Host Configuration Protocol