14 Ip Addresses and Ipv4
14 Ip Addresses and Ipv4
CS455/CS555/EE407/EE507
Fall 2024
Pat Wilbur
[email protected]
IP addresses & interfaces
IP address: identifier for an interface on a host/router
Network interface: connection between host and physical link
Routers must have multiple interfaces, as routers forward packets from one
network or subnet to another network or subnet
Host may have one interface or multiple interfaces
IP addresses associated with interfaces, not hosts/routers
*
IP Version 4 (IPv4) addresses
IPv4 address: 32 bits
Two parts (essentially a prefix/suffix) of variable length (partition between
two parts is identified by what is known as the subnet mask):
➢ Network part (high-order bits), known as the subnet number (subnet ID)
➢ Host part (low-order bits)
IP address subsets (known as subnets) can be identified/named by:
➢ Class of IP address, or
➢ Subnet number & subnet mask
*
Subnets & routers
Host 1 (H1) is connected to one network consisting of one subnet, H2 is connected to a second network and subnet, and H3 is
connected to a third network and subnet. Routers R1 and R2 each have two interfaces, where each interface is connected to a
different network and subnet. Each of R1 and R2 forward packets from one subnet to another, and vice-versa.
Source
IP address classes
Original/early idea for IP address allocation on the Internet: different classes
of IP addresses depending upon order of magnitude of number of IP
addresses an organization or network administrator needed
➢ Class A has ~224 hosts (16,777,216 hosts)
➢ Class B has ~216 hosts (65,536 hosts)
➢ Class C has ~28 hosts (256 hosts)
Suppose you are a company/university: Do you expect to need 16,777,216
hosts? Do you expect to need more than 256? What about future-proofing
your network?
Which class do you think everyone wants?
*
Address classes, network #, host ID
Class A: ~27 networks max. & ~224
hosts max. (16,777,216 hosts),
The partition between network part and host part are different for IP addresses of classes Class A (a), Class B (b),
and Class C (c), due to different numbers of distinct hosts in each class; thus, there can be many more networks with
IP addresses allocated in Class C than Class A, but there can be many more hosts in Class A than Class C.
Source
Classful subnet mask (bit mask)
In this example of a Class B IPv4 address, the subnet mask of
255.255.255.0 (224 in binary) represents how many bits to first
skip/seek before then extracting the remaining bits in the IP address
(the host part) for representing a particular host.
Note that what we often call the “subnet” consists of both the network
number + subnet ID concatenated; so, with an example Class B IP
address allocation and an example subnet mask of 255.255.255.0 (224
in binary) it means skipping 24 bits (16 bits for a Class B network
number, and (24-16) additional bits for the subnet ID), which leaves 8
bits remainder to be used as the host number in this example.
Why are there only 8 bits remaining for host ID (28 hosts max.) in this
example Class B network? Remember that a Class B network has a
maximum of 216 hosts, but, since the Class B network owner can
subdivide it into sub-allocations (sub-networks, a.k.a. subnets) if
desired, the subnet mask of the subnet is what indicates/determines
how many additional bits are reseved for the subnet ID (and,
consequently, the subnet mask is also what determines the max.
number of hosts per subnet on any given network and subnet).
Source
Subnets & routers
Host 1 (H1) is connected to one network consisting of one subnet, H2 is connected to a second network and subnet, and H3 is
connected to a third network and subnet. Routers R1 and R2 each have two interfaces, where each interface is connected to a
different network and subnet. Each of R1 and R2 forward packets from one subnet to another, and vice-versa.
Source
How to get an IP address?
Normally:
➢ Get an IP address from your upstream provider (ISP)
➢ This is essential to maintain efficient routing!
Or:
➢ If you need lots of IP addresses then you can acquire your own block of
them
➢ IP address space is a scarce resource: you must prove you have fully
utilized a small block before can ask for a larger one and pay $$$
*
How to get many IP addresses?
RIPE NCC (Riseaux IP Europiens Network Coordination Centre) for Europe,
Middle-East)
APNIC (Asia Pacific Network Information Centre ) for Asia and Pacific
ARIN (American Registry for Internet Numbers) for the Americas, the
Caribbean, sub-saharan Africa
LACNIC (Latin America and the Caribbean)
AFRINIC (Africa)
Note: Regional distribution is important for efficient routing!
Can also get Autonomous System Numbers (ASNs) from these registries,
which are used to represent distinct (ISP/large) networks on the Internet
*
Early address allocations interesting
Interesting to examine IPv4 address space allocation...
Who has Class A IP addresses?
➢ Computer companies around during initial allocation (IBM, Apple)
➢ Universities (Stanford, MIT)
*
IP addressing: CIDR
Class-full addressing:
➢ Inefficient use of address space, address space exhaustion
➢ For example: Class B net allocated enough addresses for 65k hosts,
even if only 2k hosts in that network
CIDR: Classless InterDomain Routing
➢ Network portion of address is of arbitrary length (more granular)
➢ Address format: a.b.c.d/x, where x is # bits in net/subnet part of address
subnet part (network number + subnet ID) host part
11001000 00010111 00010000 00000000
200.23.16.0/23
*
Getting IP addresses from an ISP
ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20
*
Hierarchical address aggregation
Organization 0:
200.23.16.0/23
Organization 1:
200.23.18.0/23 “Send me anything with
Organization 2: addresses beginning
200.23.20.0/23 200.23.16.0/20”
Fly-By-Night-ISP
..
.. Internet
Organization 7:
200.23.30.0/23
“Send me anything with
ISPs-R-Us
addresses beginning
199.31.0.0/16”
*
IP address allocation
CIDR is great but must work around existing allocations of IP address space
and other real-world cases:
➢ Company 1 has /20 allocation, has given subset of it to other companies
➢ University has a full Class B allocation
➢ Company 2 has a /23 allocation from some other Class B
➢ If all use the same upstream ISP, that ISP must advertise routes to all
these blocks, which can’t be described with simple CIDR network/mask!
Estimated reduction in routing table size with CIDR: If IP addresses
reallocated and CIDR used most efficiently based on geographic and ISP
divisions, routing tables with 10000+ entries could be reduced to 200 entries
[Ford, Rekhter and Brown 1993]
*
Unicast vs. broadcast & multicast
Unicast IP addresses
➢ IP packet destined for single host, type of address you normally think of
➢ Class A-C & some special IP addresses
Broadcast
➢ IP packet sent to all hosts on a subnet, part of reserved “Class E” range
➢ Part unicast network ID + part special (reserved) host ID
Multicast
➢ IP packet sent to a set of hosts subscribing to a “multicast” group
➢ Part of reserved “Class D” range
*
Broadcast
Net-directed Broadcast
➢ netid.*
➢ All bits in host portion 1’s
➢ 128.1.2.255 is a subnet-directed broadcast with subnet mask
255.255.255.0 but not with 255.255.254.0
Limited Broadcast
➢ 255.255.255.255
➢ Not forwarded!
*
Broadcast & multicast note
Broadcast and multicast make sense for UDP, but not for TCP
For example: telnet 255.255.255.255 doesn’t make sense
*
Network Byte Order
Big Endian byte ordering: for 4 bytes in each 32-bit value, bytes are
transmitted in order (0-7 first, 8-15 second, etc.)
That might seem to only make sense but some machines are Little Endian
Little Endian machines must convert (even if two Little Endian machines are
communicating)
*
History of IPv6
IETF began thinking about the problem of running out of IPv4 addresses in
1991
Requires changing IP packet format, which is a big deal
“NGTrans” (IPv6 Transition) Working Group of IETF circa June 1996
IPv6 wish list from the “The Case for IPv6”
*
IPv6 Wish List
Scalable addressing and routing
Support for realtime services
Support of autoconfiguration (get your own IP address and domain name to
minimize manual operations)
Additional security support
Enhanced support for routing to mobile hosts (mobile means switching
between different networks and/or geographies)
*
Internet Protocol (IP) PDU header
IPv4 (IP Version 4) PDU header IPv6 (IP Version 6) PDU header
Source, Source
IPv6 PDU header
VERS = IPv6
TRAFFIC CLASS: specifies the routing priority or QoS requests
FLOW LABEL: used by applications requesting performance guarantees
PAYLOAD LENGTH: like IPv4’s datagram length, but doesn’t include the
header length like IPv4
NEXT HEADER: indicates the type of the next object in the packet, either
type of extension header or type of data
HOP LIMIT: like IPv4’s TimeToLive field but named correctly
NO CHECKSUM (processing efficiency)
*
IPv6 address space
IPv4 (32 bits) versus IPv6 (128 bits)
➢ 4 billion versus 3.4 * 1038
➢ 1500 IPv6 addresses per square foot of the earth surface: significant for
divisibility/granularity reasons
Still divide address into prefix that designates network/subnet, and suffix that
designates host
No set classes, boundary between suffix and prefix can fall anywhere (CIDR
only)
Prefix length associated with each address
*
IPv6 address types
Unicast: delivered to a single computer
Multicast: delivered to each of a set of computers (can be anywhere)
➢ Conferencing
➢ Subscribing to a broadcast
Anycast: delivered to one of a set of computers that share a common prefix
*
IPv6 address notation
Colon hexadecimal notation (8 groups)
For example: 69DC:8768:9A56:FFFF:0:5634:343
Or even better with zero compression (replace run of all 0s with double ::)
Makes host names look even more attractive?
Some special addresses, e.g. 96 zeros + IPv4 address = valid IPv6 address
*
IPv6 PDU format
Base header, 0-to-N extension headers, data
Why extensible headers?
➢ Only have to allocate space for and spend
time processing headers implementing
features relevant to a particular network
resource
➢ When add new feature just add an extension
header type without changing rest of protocol,
and only sender/receiver/relevant parties
need to understand the new header (other
resources along path can blindly pass
extension headers along)
IPv6 (IP Version 6) PDU header
Source *
IPv6 flow labels
Virtual Circuit-like behavior over datagram-style (i.e. packet-switched) net
Sender can request network to establish a path with certain requirements
(e.g. traffic class can specify general requirement of delay < 100ms)
If the path can be established, the network returns an identifier that the
sender places along with the traffic class in the flow label
Routers use this identifier to efficiently route the packet along the
prearranged/preoptimized path
*
ICMPv6
New version of ICMP
Additional message types, like “Packet Too Big”
Multicast group management functions
*
IPv6’s key similarities to IPv4
Connectionless (each packet contains destination address and is routed
separately)
Best-effort (not truly Virtual Circuit-style and certainly not circuit-switched)
Maximum Hops field so can avoid packets circulating indefinitely (i.e. routing
loops)
*
IPv6’s key differences from IPv4
Bigger address space (128-bit addresses)
➢ CIDR-only
➢ Any cast addresses
New extensible header format to help speed up processing and forwarding
➢ Checksum removed entirely to reduce processing time at each hop
➢ No fragmentation
Options are possible, but outside of base header, indicated by Next Header
Ability to influence the path a packet will take through the network (Virtual
Circuit-like behavior for enforcing Quality of Service (QoS))
*
Transition from IPv4 to IPv6
Most hosts support both IPv4 and IPv6 today, but not all networks are
configured to support both
How can IPv4 and IPv6 peacefully coexist?
➢ Many popular websites have both IPv4 and IPv6 DNS resource records
(RRs) for resolving hostnames to IP addresses, so hosts can choose
which address to use (based upon what their networks support)
➢ Dual stack: Some routers with dual stack (IPv6 and IPv4) can “translate”
between formats
➢ Tunneling: IPv6 carried as payload (encapsulated within) IPv4 packet to
then travel among IPv4 networks/routers
*
Dual stack (IP address translation)
*
Tunneling (IPv6 inside of IPv4)
*
Local Area Networks (LANs) & IPs
Some IP address/subnet ranges are
reserved for intra-network use only
(not used on the Internet(work)), and
we’ll learn more when discussing firewalls (e.g. 10.0.0.0/8, 192.168.0.0/16)
Some IP address/subnet ranges are reserved for loopback (localhost) use
(e.g. 127.0.0.1, 127.0.0.0/8, ::1/128)
IP addresses can be statically- (fixed allocation for a host) or dynamically-
allocated (host “leases” an address for a specific amount of time)
IP addresses can be manually configured (i.e. editing an operating system
configuration file on a host) or dynamically configured (via DHCP protocol,
where hosts use a broadcast packet to make a DHCP request for an IP
address lease/assignment and receive a response from a DHCP server) Source
Internet Protocol, in conclusion
Why study the Internet Protocol, IP addresses, IP address allocation, and
subnets? They’re everywhere (“IP on everything”), and they are fundamental
for addressing hosts and for routing data to/from hosts, for every Internet-
enabled network/thing. Very few networks don’t use IP!
A good idea to read the following to reinforce, e.g., the Datagram-style and
Virtual Circuit-style internetworking discussion and other basics in lecture:
https://book.systemsapproach.org/internetworking/switching.html
Please read (need to know):
➢ https://book.systemsapproach.org/internetworking/basic-ip.html
➢ https://book.systemsapproach.org/scaling/ipv6.html
*
References & attribution:
Original slides by Patrick F. Wilbur, 2024.
Other slides adapted from slides by Professor Yu Liu and Professor Jeanna Matthews, which were adapted from IPv6 slides originally by
Gordon Chaffee (http://bmrc.berkeley.edu/people/chaffee/advnet98/).
In this file, slides marked * are heavily adapted or taken from slides by Professor Yu Liu and Professor Matthews.