ICS 156: Lecture 2 (part 1) Today: IP addressing Data link protocols and ARP Notes about lab
IP Addressing Addressing defines how addresses are allocated and the structure of addresses IPv4 Classful IP addresses (obsolete) Classless inter-domain routing (CIDR) (RFC 854, current standard) IP Version 6 addresses
What is an IP Address? An IP address is a unique global address for a network interface. An IP address uniquely identifies a network location. Routers forwards a packet based on the destination address of the packet. Exceptions: DHCP and NAT (lab 7)
IP Addresses
0x40x50x d x068bff 32 bits
An IP address is often written in dotted decimal notation Each byte is identified by a decimal number in the range [0..255]: st Byte = nd Byte = rd Byte = th Byte =
Structure of an IP address network prefixhost number An IP address encodes both a network number (network prefix) and an interface number (host number). network prefix identifies a network the host number identifies a specific host (actually, interface on the network). 0 31
How long the network prefix is? Before 1993: The network prefix is implicitly defined (class-based addressing) After 1993: The network prefix is indicated by a netmask.
Before 1993: Class-based addressing The Internet address space was divided up into classes: Class A: Network prefix is 8 bits long Class B: Network prefix is 16 bits long Class C: Network prefix is 24 bits long Class D is multicast address Class E is reserved
Classful IP Adresses (Until 1993) Each IP address contained a key which identifies the class: Class A: IP address starts with “0” Class B: IP address starts with “10” Class C : IP address starts with “110” Class D: IP address starts with “1110” Class E: IP address starts wit “11110”
The old way: Internet Address Classes
Problems with Classful IP Addresses Fast growing routing table size Each router must have an entry for every network prefix ~ 2 21 = 2,097,152 class C networks In 1993, the size of routing tables started to outgrow the capacity of routers
Other problems with classful addresses Address depletion for large networks Class A and Class B addresses were gone How many class A/B network prefixes can there be? Limited flexibility for network addresses: Class A and B addresses are overkill (>64,000 addresses) Class C address is insufficient (256 addresses)
Classless Inter-domain routing (CIDR) Network prefix is of variable length Addresses are allocated hierarchically Routers aggregate multiple address prefixes into one routing entry to minimize routing table size
CIDR network prefix is variable length A network mask specifies the number of bits used to identify a network in an IP address Addr Mask
CIDR notation CIDR notation of an IP address: /24 /24 is the prefix length. It states that the first 24 bits are the network prefix of the address (and the remaining 8 bits are available for specific host addresses) CIDR notation can nicely express blocks of addresses An address block [ , ] can be represented by an address prefix /16 How many addresses are there in a /x address block? 2 (32-x)
CIDR hierarchical address allocation IP addresses are hierarchically allocated. An ISP obtains an address block from a Regional Internet Registry An ISP allocates a subdivision of the address block to an organization An organization recursively allocates subdivision of its address block to its networks A host in a network obtains an address within the address block assigned to the network ISP / /16 Foo.com /16 Library CS / / /24 University Bar.com
Hierarchical address allocation ISP obtains an address block /8 [ , ] ISP allocates /16 ([ , ]) to the university. University allocates /24 ([ , ]) to the CS department’s network A host on the CS department’s network gets one IP address
CIDR allows route aggregation ISP1 announces one address prefix /8 to ISP2 ISP2 can use one routing entry to reach all networks connected to ISP1 ISP / /16 Foo.com /16 Library CS /16 University Bar.com I ISP3 You can reach /8 via ISP /8 ISP1
CIDR summary A network prefix is of variable length: a.b.c.d/x Addresses are hierarchical allocated Routers aggregate multiple address prefixes into one routing entry to minimize routing table size.
What problems CIDR does not solve (I) An multi-homing site still adds one entry into global routing tables Mutil-home.com / / /16 ISP2 ISP1 You can reach /8 And /16 via ISP1 ISP /16 ISP / /8 ISP1
What problems CIDR does not solve (II) A site switches provider without renumbering still adds one entry into global routing tables Switched.com / / /16 ISP2 ISP1 You can reach /8 And /16 via ISP1 ISP /8 ISP /16 ISP1
Global routing tables continue to grow Source:
Special IP Addresses Reserved or (by convention) special addresses: Loopback interfaces all addresses are reserved for loopback interfaces Most systems use as loopback address loopback interface is associated with name “localhost” Broadcast address Host number is all ones, e.g., Broadcast goes to all hosts on the network Often ignored due to security concerns Test / Experimental addresses Convention (but not a reserved address) Default gateway has host number set to ‘1’, e.g.,
IP Addressing Addressing defines how addresses are allocated and the structure of addresses IPv4 Classful IP addresses (obsolete) Classless inter-domain routing (CIDR) (current standard) IP Version 6 addresses
IPv6 - IP Version 6 IP Version 6 Designed to be the successor to the currently used IPv4 Specification completed in 1994 Makes improvements to IPv4 (no revolutionary changes) One (not the only !) feature of IPv6 is a significant increase in of the IP address to 128 bits (16 bytes) IPv6 will solve – for the foreseeable future – the problems with IP addressing addresses per square inch on the surface of the Earth.
IPv6 Header
IPv6 vs. IPv4: Address Comparison IPv4 has a maximum of 2 32 4 billion addresses IPv6 has a maximum of = (2 32 ) 4 4 billion x 4 billion x 4 billion x 4 billion addresses
Notation of IPv6 addresses Convention: The 128-bit IPv6 address is written as eight 16-bit integers (using hexadecimal digits for each integer) CEDF:BP76:3245:4464:FACE:2E50:3025:DF 12 Short notation: Abbreviations of leading zeroes: CEDF:BP76:0000:0000:009E:0000:3025:D F12 CEDF:BP76:0:0:9E :0:3025:DF12 “:0000:0000:0000” can be written as “::” CEDF:BP76:0:0:FACE:0:3025:DF12 CEDF:BP76::FACE:0:3025:DF12
IPv4 address in IPv6 IPv6 addresses derived from IPv4 addresses have 96 leading zero bits. Convention allows to use IPv4 notation for the last 32 bits. ::80:8F:89:90 ::