33
1 CMPE 150- Introduction to Computer Networks CMPE 150 Fall 2005 Lecture 25 Introduction to Computer Networks

CMPE 150 Fall 2005 Lecture 25

  • Upload
    ronny

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

CMPE 150 Fall 2005 Lecture 25. Introduction to Computer Networks. Announcements. Homework 4 due today by midnight. No class on Friday, 11.25.05. IMPORTANT: No lab tonight. Make up lab session next week. Final exam: December 7 th . 4-7pm In class. Closed books/notes. Course evaluation. - PowerPoint PPT Presentation

Citation preview

Page 1: CMPE 150 Fall 2005 Lecture 25

1CMPE 150- Introduction to Computer Networks

CMPE 150

Fall 2005Lecture 25

Introduction to Computer Networks

Page 2: CMPE 150 Fall 2005 Lecture 25

2CMPE 150- Introduction to Computer Networks

Announcements

• Homework 4 due today by midnight.• No class on Friday, 11.25.05.• IMPORTANT: No lab tonight.– Make up lab session next week.

• Final exam: December 7th. 4-7pm– In class.– Closed books/notes.

• Course evaluation.– Need volunteers!

• CE 151 will be offered in Winter 06!

Page 3: CMPE 150 Fall 2005 Lecture 25

3CMPE 150- Introduction to Computer Networks

Today

• IP (Cont’d).

Page 4: CMPE 150 Fall 2005 Lecture 25

4CMPE 150- Introduction to Computer Networks

IP (Internet Protocol)

• Glues Internet together.

• Common network-layer protocol spoken by all Internet participating networks.

• Best effort datagram service:– No reliability guarantees.

– No ordering guarantees.

Page 5: CMPE 150 Fall 2005 Lecture 25

5CMPE 150- Introduction to Computer Networks

IP Versions

• IPv4: IP version 4.– Current, predominant version.

– 32-bit long addresses.

• IPv6: IP version 6 (aka, IPng).– Evolution of IPv4.

– Longer addresses (16-byte long).

Page 6: CMPE 150 Fall 2005 Lecture 25

6CMPE 150- Introduction to Computer Networks

IP Datagram Format

• IP datagram consists of header and data (or payload).

• Header:– 20-byte fixed (mandatory) part.

– Variable length optional part.

Page 7: CMPE 150 Fall 2005 Lecture 25

7CMPE 150- Introduction to Computer Networks

The IP v4 Header

Page 8: CMPE 150 Fall 2005 Lecture 25

8CMPE 150- Introduction to Computer Networks

IP Options

5-54

Page 9: CMPE 150 Fall 2005 Lecture 25

9CMPE 150- Introduction to Computer Networks

IP Addresses

• IP address formats.

Page 10: CMPE 150 Fall 2005 Lecture 25

10CMPE 150- Introduction to Computer Networks

IP Addresses (Cont’d)

• Class A: 128 networks with 16M hosts each.• Class B: 16,384 networks with 64K hosts

each.• Class C: 2M networks with 256 hosts each.

• More than 500K networks connected to the Internet.

• Network numbers centrally administered by ICANN.

Page 11: CMPE 150 Fall 2005 Lecture 25

11CMPE 150- Introduction to Computer Networks

IP Addresses (Cont’d)

• Special IP addresses.

Page 12: CMPE 150 Fall 2005 Lecture 25

12CMPE 150- Introduction to Computer Networks

Scalability of IP Addresses

• Problem: a single A, B, or C address refers to a single network.

• As organizations grow, what happens?

Page 13: CMPE 150 Fall 2005 Lecture 25

13CMPE 150- Introduction to Computer Networks

Example: A Campus Network

Page 14: CMPE 150 Fall 2005 Lecture 25

14CMPE 150- Introduction to Computer Networks

Solution

• Subnetting: divide the organization’s address space into multiple “subnets”.

• How? Use part of the host number bits as the “subnet number”.

• Example: Consider a university with 35 departments.– With a class B IP address, use 6-bit subnet

number and 10-bit host number.

– This allows for up to 64 subnets each with 1024 hosts.

Page 15: CMPE 150 Fall 2005 Lecture 25

15CMPE 150- Introduction to Computer Networks

Subnets

• A class B network subnetted into 64 subnets.

Page 16: CMPE 150 Fall 2005 Lecture 25

16CMPE 150- Introduction to Computer Networks

Subnet Mask

• Indicates the split between network and subnet number + host number.

Subnet Mask: 255.255.252.0 or /22 (network + subnet part)

Page 17: CMPE 150 Fall 2005 Lecture 25

17CMPE 150- Introduction to Computer Networks

Subnetting: Observations

• Subnets are not visible to the outside world.• Thus, subnetting (and how) is a decision

made by local network admin.

Page 18: CMPE 150 Fall 2005 Lecture 25

18CMPE 150- Introduction to Computer Networks

Subnet: Example• Subnet 1: 10000010 00110010 000001|00 00000001

– 130.50.4.1

• Subnet 2: 10000010 00110010 000010|00 00000001– 130.50.8.1

• Subnet 3: 10000010 00110010 000011|00 00000001– 130.50.12.1

Page 19: CMPE 150 Fall 2005 Lecture 25

19CMPE 150- Introduction to Computer Networks

Problem with IPv4

• IPv4 is running out of addresses.• Problem: class-based addressing scheme.– Example: Class B addresses allow 64K hosts.• More than half of Class B networks have fewer

than 50 hosts!

Page 20: CMPE 150 Fall 2005 Lecture 25

20CMPE 150- Introduction to Computer Networks

Solution: CIDR• CIDR: Classless Inter-Domain Routing.– RFC 1519.

• Allocate remaining addresses in variable-sized blocks without considering classes.

• Example: if an organization needs 2000 addresses, it gets 2048-address block.

• Forwarding had to be modified.– Routing tables need an extra entry, a 32-bit

mask, which is ANDed with the destination IP address.

– If there is a match, the packet is forwarded on that interface.

Page 21: CMPE 150 Fall 2005 Lecture 25

21CMPE 150- Introduction to Computer Networks

Network Address Translation• Another “quick fix” to the address shortage in IP v4.• Specified in RFC 3022.• Each organization gets a single (or small number of)

IP addresses.– This is used for Internet traffic only.– For internal traffic, each host gets its own “internal” IP

address.• Three IP ranges have been declared as “private”.

– 10.0.0.0 – 10.255.255.255/8– 172.16.0.0 – 172.31.255.255/12– 192.168.0.0 – 192.168.255.255/16

• No “private” IP address can show up on the Internet, i.e., outside the organization’s network.

Page 22: CMPE 150 Fall 2005 Lecture 25

22CMPE 150- Introduction to Computer Networks

NAT – Network Address Translation

Page 23: CMPE 150 Fall 2005 Lecture 25

23CMPE 150- Introduction to Computer Networks

Internet Control Protocols

• “Companion” protocols to IP.• Control protocols used mainly for signaling

and exchange of control information.• Examples: ICMP, ARP, RARP, BOOTP, and

DHCP.

Page 24: CMPE 150 Fall 2005 Lecture 25

24CMPE 150- Introduction to Computer Networks

ICMP

• Internet Control Message Protocol.• A way to “debug” the Internet and find out

what is happening at routers.• Defines a dozen different messages that are

generated typically by routers upon some unexpected event.

Page 25: CMPE 150 Fall 2005 Lecture 25

25CMPE 150- Introduction to Computer Networks

ICMP Message Types

5-61

Page 26: CMPE 150 Fall 2005 Lecture 25

26CMPE 150- Introduction to Computer Networks

Address Resolution Protocol

• ARP.• RFC 826.• Protocol for machines to map IP addresses to

Ethernet addresses.– This is needed when packet needs to be

delivered to a local host on a LAN (Ethernet).

Page 27: CMPE 150 Fall 2005 Lecture 25

27CMPE 150- Introduction to Computer Networks

ARP: Example

. Host 1 wants to send packet to host 2. . Assume that host 1 knows host 2’s IP address. . Host 1 builds packet with host 2’s IP address. . IP knows it’s a local destination but now needs host 2’s Ethernet address.

Page 28: CMPE 150 Fall 2005 Lecture 25

28CMPE 150- Introduction to Computer Networks

ARP Operation

• Host 1 broadcasts an ARP request on the Ethernet asking who owns host 2’s IP address.

• Host 2 replies with its Ethernet address.

• Some optimizations:– ARP caches.– Piggybacking host’s own Ethernet address on

ARP requests.– Proxy ARP: services ARP requests for hosts

on separate LANs.

Page 29: CMPE 150 Fall 2005 Lecture 25

29CMPE 150- Introduction to Computer Networks

Beyond ARP

• ARP solves the problem of mapping IP address to Ethernet address.

• How do we solve the inverse problem?– I.e., how to map an Ethernet address to an IP

address?

• Older protocols: RARP (RFC 903) and BOOTP (RFC 951).– RARP broadcasts not forwarded by routers.

– BOOTP uses UDP but requires manual configuration of IP-Ethernet mappings.

Page 30: CMPE 150 Fall 2005 Lecture 25

30CMPE 150- Introduction to Computer Networks

DHCP

• Dynamic Host Configuration Protocol.• RFCs 2131 and 2132.• Assigns IP addresses to hosts dynamically.• DHCP server may not be on the same LAN

as requesting host.• DHCP relay agent.

Page 31: CMPE 150 Fall 2005 Lecture 25

31CMPE 150- Introduction to Computer Networks

DHCP Operation

• Newly booted host broadcasts a DHCP DISCOVER message.

• DHCP relay agent intercepts DHCP DISCOVERs on its LAN and unicasts them to DHCP server.

Page 32: CMPE 150 Fall 2005 Lecture 25

32CMPE 150- Introduction to Computer Networks

DHCP Operation

Page 33: CMPE 150 Fall 2005 Lecture 25

33CMPE 150- Introduction to Computer Networks

DHCP: Address Reuse

• How long should an IP address be allocated?• Issue: hosts come and go.• IP addresses may be assigned on a “Lease”

basis.• Hosts must renew their leases.