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: MAC broadcast address: FF:FF:FF:FF:FF:FF
A DHCP Process
Step 1: DHCPDiscovery (I need an IP.) – Source IP: – Destination IP: Step 2: DHCPOffer (Here is an IP, , and other related information. Do you want it?) – Source IP: – Destination IP: Step 3: DHCPRequest (I will take it!) – Source IP: – Destination: Step 4: DHCPAcknowledgement (You can take it.) – Source IP: – Destination IP:
More on DHCP After-class reading: Section – – 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 Source MAC I like you Dest. IP Source IP Layer 3 header Layer 3 payloadLayer 2 header Target From NIC From DHCP From ARP
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 ” “I'm the computer with IP address , and my MAC address is 11:22:33:44:55:66” ARP
Address resolution is always restricted to a single network at a time. Example: – X resolves the address of R 1 – R 1 resolves the address of R 2 – R 2 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 Local host Remote host 1 hop 2 hop 3 hop N-1 hop N 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., , ,… / / /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 : portExternal IP : port : : : : : :40003
How NAT works (3) SRC = :30000 DST = :80 SRC = :40001 DST = :80 Internal IP : portExternal IP : port : :40001 Internal External – Look up and rewrite source IP/port
How NAT works (4) SRC = :80 DST = :30000 SRC = :80 DST = :40001 Internal IP : portExternal IP : port : :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)