ics 156: lecture 2 (part 1)

31
ICS 156: Lecture 2 (part 1) Today: IP addressing Data link protocols and ARP Notes about lab

Upload: varen

Post on 19-Jan-2016

26 views

Category:

Documents


0 download

DESCRIPTION

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) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ICS 156:  Lecture 2 (part 1)

ICS 156: Lecture 2 (part 1)

Today: IP addressing Data link protocols and ARP Notes about lab

Page 2: ICS 156:  Lecture 2 (part 1)

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

Page 3: ICS 156:  Lecture 2 (part 1)

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)

Page 4: ICS 156:  Lecture 2 (part 1)

IP Addresses

Application dataTCP HeaderEthernet Header Ethernet Trailer

Ethernet frame

IP Header

version(4 bits)

headerlength

Type of Service/TOS(8 bits)

Total Length (in bytes)(16 bits)

Identification (16 bits)flags

(3 bits)Fragment Offset (13 bits)

Source IP address (32 bits)

Destination IP address (32 bits)

TTL Time-to-Live(8 bits)

Protocol(8 bits)

Header Checksum (16 bits)

32 bits

Page 5: ICS 156:  Lecture 2 (part 1)

IP Addresses

Application dataTCP HeaderEthernet Header Ethernet Trailer

Ethernet frame

IP Header

0x4 0x5 0x00 4410

9d08 0102 00000000000002

128.143.137.144

128.143.71.21

12810 0x06 8bff

32 bits

Page 6: ICS 156:  Lecture 2 (part 1)

An IP address is often written in dotted decimal notation

Each byte is identified by a decimal number in the range [0..255]:

1000111110000000 10001001 10010000

1st Byte

= 128

2nd Byte

= 143

3rd Byte

= 137

4th Byte

= 144

128.143.137.144

Page 7: ICS 156:  Lecture 2 (part 1)

Structure of an IP address

network prefixnetwork prefix host numberhost 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

Page 8: ICS 156:  Lecture 2 (part 1)

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.

Page 9: ICS 156:  Lecture 2 (part 1)

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

Page 10: ICS 156:  Lecture 2 (part 1)

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”

Page 11: ICS 156:  Lecture 2 (part 1)

The old way: Internet Address Classes

Class C network id host11 0

Network Prefix24 bits

Host Number8 bits

bit # 0 1 23 242 313

Class B 1 network id host

bit # 0 1 15 162

Network Prefix16 bits

Host Number16 bits

031

Class A 0Network Prefix

8 bits

bit # 0 1 7 8

Host Number24 bits

31

Page 12: ICS 156:  Lecture 2 (part 1)

Class D multicast group id11 1bit # 0 1 2 313

04

Class E (reserved for future use)11 1bit # 0 1 2 313

14

05

The old way: Internet Address Classes

Page 13: ICS 156:  Lecture 2 (part 1)

Problems with Classful IP Addresses

Fast growing routing table size Each router must have an entry for every

network prefix ~ 221 = 2,097,152 class C networks In 1993, the size of routing tables started to

outgrow the capacity of routers

Page 14: ICS 156:  Lecture 2 (part 1)

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)

Page 15: ICS 156:  Lecture 2 (part 1)

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

Page 16: ICS 156:  Lecture 2 (part 1)

CIDR network prefix is variable length

A network mask specifies the number of bits used to identify a network in an IP address.

1000111110000000 10001001 10010000

1111111111111111 1111111 00000000

128 143 137 144

255 255 255 0

Addr

Mask

Page 17: ICS 156:  Lecture 2 (part 1)

CIDR notation

CIDR notation of an IP address: 128.143.137.144/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

[128.195.0.0, 128.195.255.255] can be represented by an address prefix

128.195.0.0/16 How many addresses are there in a /x address

block? 2 (32-x)

Page 18: ICS 156:  Lecture 2 (part 1)

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

ISP128.0.0.0/8

128.1.0.0/16

Foo.com

128.2.0.0/16

Library CS

128.195.0.0/16

128.195.1.0/24 128.195.4.0/24

University

Bar.com

128.195.4.150

Page 19: ICS 156:  Lecture 2 (part 1)

Hierarchical address allocation

ISP obtains an address block 128.0.0.0/8 [128.0.0.0, 128.255.255.255]

ISP allocates 128.195.0.0/16 ([128.195.0.0, 128.195.255.255]) to the university.

University allocates 128.195.4.0/24 ([128.195.4.0, 128.195.4.255]) to the CS department’s network

A host on the CS department’s network gets one IP address 128.195.4.150

128.0.0.0 128.255.255.255128.195.0.0 128.196.255.255

128.195.4.0 128.195.4.255 128.195.4.150

Page 20: ICS 156:  Lecture 2 (part 1)

CIDR allows route aggregation

ISP1 announces one address prefix 128.0.0.0./8 to ISP2

ISP2 can use one routing entry to reach all networks connected to ISP1

ISP1128.0.0.0/8

128.1.0.0/16

Foo.com

128.2.0.0/16

Library CS

128.195.0.0/16

UniversityBar.com

IISP3

You can reach 128.0.0.0/8 via ISP1

128.0.0.0/8 ISP1

Page 21: ICS 156:  Lecture 2 (part 1)

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.

Page 22: ICS 156:  Lecture 2 (part 1)

What problems CIDR does not solve (I)

An multi-homing site still adds one entry into global routing tables

Mutil-home.com

128.0.0.0/8204.0.0.0/8

204.1.0.0/16

ISP2 ISP1

You can reach 128.0.0.0/8And 204.1.0.0/16 via ISP1

ISP3

204.1.0.0/16 ISP1204.1.0.0/16128.0.0.0/8 ISP1

Page 23: ICS 156:  Lecture 2 (part 1)

What problems CIDR does not solve (II)

A site switches provider without renumbering still adds one entry into global routing tables

Switched.com

128.0.0.0/8204.0.0.0/8

204.1.0.0/16

204.1.0.0/16

ISP2 ISP1

You can reach 128.0.0.0/8And 204.1.0.0/16 via ISP1

ISP3

128.0.0.0/8 ISP1

204.1.0.0/16 ISP1

Page 24: ICS 156:  Lecture 2 (part 1)

Global routing tables continue to grow

Source: http://bgp.potaroo.net/as6447/

Page 25: ICS 156:  Lecture 2 (part 1)

Special IP Addresses

Reserved or (by convention) special addresses: Loopback interfaces

all addresses 127.0.0.1-127.255.255.255 are reserved for loopback interfaces

Most systems use 127.0.0.1 as loopback address loopback interface is associated with name “localhost”

Broadcast address Host number is all ones, e.g., 128.143.255.255 Broadcast goes to all hosts on the network Often ignored due to security concerns

Test / Experimental addresses 10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255

Convention (but not a reserved address) Default gateway has host number set to ‘1’, e.g., 128.195.4.1

Page 26: ICS 156:  Lecture 2 (part 1)

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

Page 27: ICS 156:  Lecture 2 (part 1)

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 1024 addresses per square inch on the surface of

the Earth.

Page 28: ICS 156:  Lecture 2 (part 1)

IPv6 Header

Application dataTCP HeaderEthernet Header Ethernet Trailer

Ethernet frame

IPv6 Header

version(4 bits)

Traffic Class(8 bits)

Flow Label(24 bits)

Payload Length (16 bits)Next Header

(8 bits)Hop Limits (8 bits)

Source IP address (128 bits)

32 bits

Destination IP address (128 bits)

Page 29: ICS 156:  Lecture 2 (part 1)

IPv6 vs. IPv4: Address Comparison

IPv4 has a maximum of 232 4 billion addresses

IPv6 has a maximum of 2128 = (232)4 4 billion x 4 billion x 4

billion x 4 billion addresses

Page 30: ICS 156:  Lecture 2 (part 1)

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:DF12 Short notation: Abbreviations of leading zeroes:

CEDF:BP76:0000:0000:009E:0000:3025:DF12 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

Page 31: ICS 156:  Lecture 2 (part 1)

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 ::128.143.137.144