Introduction to Computer Networks CS640 Efficient Addressing

38
Ming Liu mgliu@cs.wisc.edu Introduction to Computer Networks CS640 https://pages.cs.wisc.edu/~mgliu/CS640/F21/ Efficient Addressing 1

Transcript of Introduction to Computer Networks CS640 Efficient Addressing

Ming Liu [email protected]

Introduction to Computer Networks

CS640 https://pages.cs.wisc.edu/~mgliu/CS640/F21/

Efficient Addressing

1

Today

Last lecture • IP introduction

2

Today • Subnetting/Supernetting

• ARP/DHCP/ICMP

Announcements • Lab2 due on 10/19/2021 at 11:59PM

How to Make Forwarding Scale

Problem #1: inefficient use of hierarchical address space • Class C with 2 hosts (2/255 = 0.78% efficient) • Class B with 256 hosts (256/65535 = 0.39% efficient)

Problem #2: still too many networks • Routing tables do not scale

• Big tables make routers expensive

• Route propagation protocols do not scale

3

Two Approaches

Subnetting — allocate a given set of addresses across many switched networks within an internetwork

CIDR/Supernetting — allocate just the right number of addresses overall to an internet work

4

Subnetting — 1985

Original intent was for network to identify one physical network • Lots of small networks are what we actually have — how do we handle this?

Solution: add another level to address/routing hierarchy — subnet • Allocate address to several physical networks • Routers in other networks (or ASs) route all traffic to network as if it is a single physical network

5

Subnetting — 1985 (cont’d)

Subnet masks define variable partition of host part • 1’s identify subnet, 0’s identify hosts within the subnet • Mechanism for sharing a single network number among multiple networks

Subnets are only visible within a internetwork

Network numberClass B address Host number

11111111 11111111 11111111Subnet mask 255.25.255.0

00000000

Network number Subnet ID Host IDSubnetted address

6

Subnet Example

H1

Subnet mask: 255.255.255.128 Subnet number: 128.96.34.0

128.96.34.15

R1

128.96.34.1

R2H3

128.96.34.130

H2

Subnet mask: 255.255.255.0 Subnet number: 128.96.33.0

Subnet mask: 255.255.255.128 Subnet number: 128.96.34.128

128.96.33.14

128.96.33.1

128.95.34.129

128.95.34.139

7

Subnet Example

H1

Subnet mask: 255.255.255.128 Subnet number: 128.96.34.0

128.96.34.15

R1

128.96.34.1

R2H3

128.96.34.130

H2

Subnet mask: 255.255.255.0 Subnet number: 128.96.33.0

Subnet mask: 255.255.255.128 Subnet number: 128.96.34.128

128.96.33.14

128.96.33.1

128.95.34.129

128.95.34.139

Forwarding table at R1

Subnet Number Subnet Mask Next Hop128.96.34.0 255.255.255.128 Interface 0

128.96.34.128 255.255.255.128 Interface 1

128.96.33.0 255.255.255.0 R2

7

Forwarding Algorithm w/ Subnet

8

Forwarding Algorithm w/ Subnet

8

Forwarding Algorithm w/ Subnet

• Use a default router if nothing matches • Subnets not visible from the rest of the Internet • Hosts on a subnet also have similar forwarding tables, and use a similar look up

algorithm8

Subnets More

Arbitrary bit mask numbers can be used • They make administration more difficult

Thus bit masks are typically a sequence of N 1 bits followed by a sequence of M 0 bits, where N+M=32 • If the subnet number is S, this means that hosts on the subnet S have IP addresses whose first N bits match that of S

9

Is Subnetting Enough?

Problem: • Potential exhaustion of IPv4 address space (due to inefficiency) • Class B network numbers are highly costly (not everyone needs one)

• Lots of class C addresses but no one wants them

• Growth of backbone routing tables • We don’t want lots of small networks since this causes large routing tables • Route calculation and management requires high computation overhead

10

Is Subnetting Enough?

Problem: • Potential exhaustion of IPv4 address space (due to inefficiency) • Class B network numbers are highly costly (not everyone needs one)

• Lots of class C addresses but no one wants them

• Growth of backbone routing tables • We don’t want lots of small networks since this causes large routing tables • Route calculation and management requires high computation overhead

Solution • Allow address assigned to a single entity to span multiple classful network address spaces • Support route aggregation

10

Supernetting

Also called CIDR: Classless Inter-Domain Routing • Breaks rigid boundaries between address classes • If ISP needs 16 class C addresses, make them contiguous • E.g., 192.4.16.xx to 192.4.31.xx enables a 20-bit network number

Assign block of contiguous network numbers to nearby networks

11

Supernetting (cont’d)

All routers must understand CIDR addressing

Key idea: enabling network number to be any length

Collapse multiple addresses assigned to a single internet work to one address

12

CIDR Addresses

Identifying a “CIDR block” requires both an address and a mask • CIDER block is assigned to an internetwork • Slash notation - also called a “prefix” • 128.211.168.0/21 for addresses 128.211.168.0 - 128.211.175.255

• Here the /21 indicates a 32 bit mask • All possible CIDR masks can easily be generated

• /8, /16, /24 correspond to traditional class A, B, C categories

13

CIDR Addresses (cont’d)

Each prefix has a single routing table entry

Raises interesting questions about lookups • Routers cannot determine the division between prefix and suffix just by looking at the

address • Hashing does not work well • Interesting lookup algorithms have been developed and analyzed

14

CIDR Address Assignment

15

Route Aggregation

Multiple networks can map to a single routing table entry

16

IP Forwarding Revisited

IP forwarding mechanism assumes that it can find the network number in a packet and then look up that number in the forwarding table

We need to change this assumption in case of CIDR

CIDR means that prefixes may be of any length, from 2 to 32 bits

17

IP Forwarding Revisited (cont’d)

It is also possible to have prefixes in the forwarding tables that overlap • Some addresses may match more than one prefix

For example, we might find both 171.69 (a 16 bit prefix) and 171.69.10 (a 24 bit prefix) in the forwarding table of a single router

18

IP Forwarding Revisited (cont’d)

It is also possible to have prefixes in the forwarding tables that overlap • Some addresses may match more than one prefix

For example, we might find both 171.69 (a 16 bit prefix) and 171.69.10 (a 24 bit prefix) in the forwarding table of a single router

• A packet destined to 171.69.20.5 would match 171.69, not 171.69.10

• A packet destined to 171.69.10.5 clearly matches both prefixes • The rule is based on the principle of “longest match”

• 171.69.10 in this case

18

Address Translation Problem

Map IP addresses into physical addresses • destination host • next hop router

Preamble8B

Dest Source Type Data CRCPad6B 6B 2B 4B

Ethernet frame

19

Address Translation Problem

Map IP addresses into physical addresses • destination host • next hop router

Possible mapping techniques • Encode physical address in host part of IP address • Make physical address the same as the host portion of IP address • Obviously not possible using IPv4 and Ethernet

• Build a table of IP/MAC pairs • How is it maintained

19

Address Resolution Protocol (ARP)

ARP is part of the TCP/IP specification

ARP key idea: broadcast request if unknown • Populates table of IP to physical address bindings • Broadcast request if IP address not in table — supported by link level topology • Target Machine responds with its physical address • Table entries are discarded if not refreshed

Enable each host to build table of IP to physical address bindings • Dynamic binding protocol — no static entries in table

• Allows new nodes to be easily added to broadcast network

20

ARP Packet Format

• HardwareType: type of physical network (e.g., Ethernet) • ProtocolType: type of higher layer protocol (e.g., IP)

• HLEN&PLEN: length of physical and protocol addresses • Operation: request or response

• Source/Target Physical/Protocol addresses 21

ARP Implementation

Notes • Table entries timeout in about 10 minutes (caching is important) • Update table with source when you are the target • Update table even if there is already an entry • Do not refresh table entries upon reference

• IP addresses are assigned independently of a system HW address

22

How to Determine an IP Address

Ethernet addresses are configured into network by manufacturer and they are unique

IP addresses must be unique on a given internetwork but also must reflect the structure of the internetwork

23

Manual Configuration

Most host operating systems provide a way to manual configure the IP information for the host

Drawbacks of manual configuration • A lot of work to configure all the hosts in a large network • Configuration process is error-prune

24

Manual Configuration

Most host operating systems provide a way to manual configure the IP information for the host

Drawbacks of manual configuration • A lot of work to configure all the hosts in a large network • Configuration process is error-prune

Automated configuration process is required!

24

Dynamic Host Configuration Protocol (DHCP)

DHCP server is responsible for providing configuration information to hosts

There is at least one DHCP server for an administrative domain

DHCP server maintains a pool of available address • Each address, when assigned, comes with a lease. Lease has to periodically refreshed.

Otherwise, address is reassigned

25

DHCP implementation

Newly booted or attached host sends DHCPDISCOVER message to a special IP address (255.255.255.255)

DHCP relay agent unicast the message to DHCP server and waits for the response

It then forwards response to host. Response has assigned IP address, default router, DNS local name server (discussed later)

26

DHCP implementation

Newly booted or attached host sends DHCPDISCOVER message to a special IP address (255.255.255.255)

DHCP relay agent unicast the message to DHCP server and waits for the response

It then forwards response to host. Response has assigned IP address, default router, DNS local name server (discussed later)

26

Defines a collection of error messages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully. Examples include: • Destination host unreachable due to link/node failure

• Reassembly process failed

• TTL had reached 0 (so datagrams don’t cycle forever) • IP header checksum failed

Internet Control Message Protocol (ICMP)

27

Defines a collection of error messages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully. Examples include: • Destination host unreachable due to link/node failure

• Reassembly process failed

• TTL had reached 0 (so datagrams don’t cycle forever) • IP header checksum failed

Internet Control Message Protocol (ICMP)

Error code carried in the ICMP response message indicate which of the above issues were faced 27

Defines a collection of error messages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully. Examples include: • Destination host unreachable due to link/node failure

• Reassembly process failed

• TTL had reached 0 (so datagrams don’t cycle forever) • IP header checksum failed

Internet Control Message Protocol (ICMP)

Error code carried in the ICMP response message indicate which of the above issues were faced

ICMP-Redirect • From router to a source host • With a better route information

27

Summary

Today • Subnetting/Supernetting

• ARP/DHCP/ICMP

Next lecture • Intra-domain Routing

28