Date post: | 24-Dec-2015 |
Category: |
Documents |
Upload: | lydia-willis |
View: | 212 times |
Download: | 0 times |
Support Protocols and Technologies
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
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
Getting IP Address
• Old days – manual configuration
• Problems?
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.
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
DHCP Protocol Stack
• DHCP is a client-server application– Uses UDP ports 67,68
DHCP
UDP
IP
Ethernet
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
A DHCP Process
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
More on DHCP
• After-class reading: Section 23.15 – 23.17– DHCP Message format– Indirect DHCP Server– IPv6 Autoconfiguration
• Lab exercise 4: DHCP
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?
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
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
“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
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
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
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
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
Example ICMP Messages
Ping: Host sends Echo Request, and destination responds with an Echo Reply
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
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
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.
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
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
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
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
NAT Software and Systems for Use at Home
I’m a NAT box too!
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)