Top Banner
Support Protocols and Technologies
29

Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Dec 24, 2015

Download

Documents

Lydia Willis
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Support Protocols and Technologies

Page 2: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Topics

• Filling in the gaps we need to make for IP forwarding work in practice– Getting IP addresses (DHCP)– Mapping IP to MAC addresses (ARP)

• What happens when something goes wrong during forwarding?– Need to be able to find the problem (ICMP)

• NAT (Network Address Translation): A widely used technology to get Internet connection for multiple devices at the edges of the network, e.g., homes

Page 3: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Getting IP Address

• Problem:– A node wakes up for the first time…– What is its IP address? What’s the IP address of its

router? Etc.– At least MAC address is on NIC

Page 4: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Getting IP Address

• Old days – manual configuration

• Problems?

Page 5: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Dynamic Host Configuration Protocol (DHCP)

• With DHCP, you don’t need • the IP of the gateway • the subnet mask• DNS server• contact IT office to get an IP

• Your computer needs a DHCP client to send out DHCP request.• A DHCP server in a network listens to DHCP requests and responses a

request with an IP assignment.

Page 6: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

DHCP • Assign IP addresses automatically

– The concept of plug-and-play networking

• DHCP addresses are leased for a finite period.– A host can renew the address.

• Normally, DHCP approves each lease extension• However, a server may be configured to deny lease extension for

administrative or technical reasons

ipconfig /all

Page 7: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

DHCP Protocol Stack

• DHCP is a client-server application– Uses UDP ports 67,68

DHCP

UDP

IP

Ethernet

Page 8: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

DHCP Addressing

• Bootstrap issue:– How does node send a IP message to DHCP server

before it is configured?

• Answer:– Node sends broadcast messages that delivered to

all nodes on the network• IP broadcast address: 255.255.255.255• MAC broadcast address: FF:FF:FF:FF:FF:FF

Page 9: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

A DHCP Process

Page 10: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

A DHCP Process• Step 1: DHCPDiscovery (I need an IP.)

– Source IP: 0.0.0.0– Destination IP: 255.255.255.255

• Step 2: DHCPOffer (Here is an IP, 192.168.1.100, and other related information. Do you want it?)– Source IP: 192.168.1.1– Destination IP: 255.255.255.255

• Step 3: DHCPRequest (I will take it!)– Source IP: 0.0.0.0– Destination: 255.255.255.255

• Step 4: DHCPAcknowledgement (You can take it.)– Source IP: 192.168.1.1– Destination IP: 255.255.255.255

Page 11: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

More on DHCP

• After-class reading: Section 23.15 – 23.17– DHCP Message format– Indirect DHCP Server– IPv6 Autoconfiguration

• Lab exercise 4: DHCP

Page 12: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Sending an IP packet

• Problem:– A node needs MAC addresses to send a frame

over the local link– How does it get the destination MAC address from

a destination IP address?

Page 13: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

ARP (Address Resolution Protocol)

• Node uses to map a local IP address to its Link layer (MAC) address

Dest. MAC

SourceMAC I like youDest.

IPSource

IP

Layer 3 header Layer 3 payloadLayer 2 header

TargetFromNIC

FromDHCP

FromARP

Page 14: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

ARP Protocol Stack

• ARP sits right on top of link layer– No servers, just asks node with target IP to

identify itself– Uses broadcast to reach all nodes

• Broadcast MAC address: FF:FF:FF:FF:FF:FF

ARP

Ethernet

Page 15: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

“I'm looking for the MAC address of a computer that has IP address 1.2.3.4”

“I'm the computer with IP address 1.2.3.4, and my MAC address is 11:22:33:44:55:66”

ARP

Page 16: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

ARP• Address resolution is always restricted to a single network at a time.• Example:

– X resolves the address of R1

– R1 resolves the address of R2

– R2 resolves the address of Y

Page 17: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

More on ARP

• After-class reading: Section 23.5 – 23.7– APR message format and encapsulation– ARP caching and message processing

• Lab exercise 5: Wireshark ARP

Page 18: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Internet Control Message Protocol (ICMP)

• ICMP is a companion protocol to IP– They are implemented together– Provides error report and testing– Sits on top of IP

Page 19: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

ICMP Errors

• When router encounters an error while forwarding:– It sends an ICMP error report back to the IP source

address– It discards to problematic packet; host needs to

rectify

Page 20: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Example ICMP Messages

Ping: Host sends Echo Request, and destination responds with an Echo Reply

Page 21: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Error Type 11: Time Exceeded

• IP header contains TTL (Time to live) field– Decremented every router hop, with ICMP error if it hits

zero– Protects against forwarding loops

Page 22: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Traceroute

• Traceroute repurposes TTL and ICMP functionality– Sends probe packets increasing TTL starting from 1– Receives an Time Exceeded error message from each

intermediate router, and an Echo Reply from the ultimate destination

3 probes

3 probes

3 probes

Local host Remote host1 hop 2 hop

3 hop N-1 hopN hop

Page 23: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

Network Address Translation (NAT)

• Motivated by IP address scarcity

• A mechanism to allow multiple computers at a site to share a single, globally valid IP address

• Transparent communication – These computers are perceived as "one" computer by

other computers.– These computers can access the Internet as if they have

their own IP address.

Page 24: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

24

How NAT works (1)

• NAT uses two types of addresses– The NAT device itself is assigned a single

globally-valid IP address– Hotel hotline

– Each computer at the site is assigned a unique private address

• E.g., 192.168.0.1, 192.168.0.2,…

10.0.0.0/8

172.16.0.0/12

192.168.0.0/16

Blocks of private addresses designed by IETF

Page 25: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

25

How NAT works (2)

• NAT keeps an internal/external table– Typically uses IP address + TCP port – Known as Network Address and Port Translation (NAPT)

• Need ports to make mapping 1-1 since there are fewer external IPs

Internal IP : port External IP : port192.168.0.1:30000 128.10.24.6:40001192.168.0.2:30000 128.10.24.6:40002

192.168.0.10:12345 128.10.24.6:40003

Page 26: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

How NAT works (3)

SRC = 192.168.0.1:30000DST = 198.133.219.25:80

SRC = 128.210.24.6:40001DST = 198.133.219.25:80

Internal IP : port External IP : port

192.168.0.1:30000 128.10.24.6:40001

• Internal External– Look up and rewrite source IP/port

Page 27: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

How NAT works (4)

SRC = 198.133.219.25:80DST = 192.168.0.1:30000

SRC = 198.133.219.25:80DST = 128.210.24.6:40001

Internal IP : port External IP : port

192.168.0.1:30000 128.10.24.6:40001

• External Internal– Look up and rewrite destination IP/port

Page 28: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

NAT Software and Systems for Use at Home

I’m a NAT box too!

Page 29: Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.

NAT Downsides

• Connectivity has been broken!– Can only send incoming packets after an outgoing

connection is setup– Difficult to run servers or P2P apps (Skypes) at home

• Doesn’t work so well when there are no connections (UDP apps)

• Breaks apps that unwisely expose their IP addresses (FTP)