1 Ethernet and Internet Control Protocols EE 122: Intro to Communication Networks Fall 2010 (MW 4-5:30 in 101 Barker) Scott Shenker TAs: Sameer Agarwal,

Slides:



Advertisements
Similar presentations
Computer Networks21-1 Chapter 21. Network Layer: Address Mapping, Error Reporting, and Multicasting 21.1 Address Mapping 21.2 ICMP 21.3 IGMP 21.4 ICMPv6.
Advertisements

CSE 461: IP/ICMP and the Network Layer. Next Topic  Focus:  How do we build large networks?  Introduction to the Network layer  Internetworks  Service.
Internet Control Protocols Savera Tanwir. Internet Control Protocols ICMP ARP RARP DHCP.
COS 461 Fall 1997 The Network Layer FTPHTTPSMTPDNSFinger TCPUDP IP EthernetATMmodemSHRIMP application layer transport layer network layer data link layer.
8-1 Last time □ Network layer ♦ Introduction forwarding vs. routing ♦ Virtual circuit vs. datagram details connection setup, teardown VC# switching forwarding.
CSCI 4550/8556 Computer Networks Comer, Chapter 23: An Error Reporting Mechanism (ICMP)
Week 5: Internet Protocol Continue to discuss Ethernet and ARP –MTU –Ethernet and ARP packet format IP: Internet Protocol –Datagram format –IPv4 addressing.
Internet Control Message Protocol (ICMP)
Chapter 5 The Network Layer.
1 ICMP/ARP and General Link-Layer EE122 Fall 2011 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica,
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Subnetting.
1 Internet Control Protocols Reading: Section 4.1 COS 461: Computer Networks Spring 2006 (MW 1:30-2:50 in Friend 109) Jennifer Rexford Teaching Assistant:
1 CCNA 2 v3.1 Module 8. 2 TCP/IP Suite Error and Control Messages CCNA 2 Module 8.
Chapter 23: ARP, ICMP, DHCP IS333 Spring 2015.
IP Address 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to
Class 4 Internet Protocols
1 ICMP : Internet Control Message Protocol Computer Network System Sirak Kaewjamnong.
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Support Protocols and Technologies. Topics Filling in the gaps we need to make for IP forwarding work in practice – Getting IP addresses (DHCP) – Mapping.
CCNA Introduction to Networking 5.0 Rick Graziani Cabrillo College
1 CMPT 471 Networking II ICMP © Janice Regan, 2012.
TELE202 Lecture 10 Internet Protocols (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »Internet Protocols (1) »Source: chapter 15 ¥This Lecture »Internet.
CS 6401 Internet Protocol Outline Introduction to Internet Protocol Header and address formats ICMP Tools.
Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES Internet Control Message Protocol ICMP author -- J. Postel, September The purpose.
Guide to TCP/IP, Third Edition
Network Administration
ICMP (Internet Control Message Protocol) Computer Networks By: Saeedeh Zahmatkesh spring.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
Internet Control Message Protocol (ICMP)
Network Layer – Subnetting and Control Protocols Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing,
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
Exploring the Packet Delivery Process Chapter
1 Version 3.1 modified by Brierley Module 8 TCP/IP Suite Error and Control Messages.
Page 19/13/2015 Chapter 8 Some conditions that must be met for host to host communication over an internetwork: a default gateway must be properly configured.
1 IP: putting it all together Part 2 G53ACC Chris Greenhalgh.
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
1 Link-Layer and ICMP EE122 Fall 2012 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 2 Module 8 TCP/IP Suite Error and Control Messages.
© 2002, Cisco Systems, Inc. All rights reserved..
CCNA 2 Week 8 TCP/IP Suite Error Control Messages.
Fall 2005Computer Networks20-1 Chapter 20. Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv ARP 20.2 IP 20.3 ICMP 20.4 IPv6.
Missing pieces + Putting the pieces together CS 168, Fall 2014 Sylvia Ratnasamy Material thanks to Ion Stoica, Scott Shenker, Jennifer Rexford, Nick McKeown,
1 Internet Control Message Protocol (ICMP) Used to send error and control messages. It is a necessary part of the TCP/IP suite. It is above the IP module.
Internet Protocols. Address Resolution IP Addresses are not recognized by hardware. If we know the IP address of a host, how do we find out the hardware.
1 Network Layer Lecture 16 Imran Ahmed University of Management & Technology.
4: Network Layer4a-1 13: Intro to IP and ICMP Last Modified: 11/9/2015 7:16:06 PM.
Error and Control An IP datagram travels from node to node on the way to its destination Each router operates autonomously Failures or problems may occur.
Chapter 23 Internet Control Message Protocol used to report information and errors IP uses ICMP when it sends an error message ICMP uses IP to transport.
Transport Layer3-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
1 An Error Reporting Mechanism (ICMP). 2 IP Semantics IP is best-effort Datagrams can be –Lost –Delayed –Duplicated –Delivered out of order –Corrupted.
1 Chapter 23 Internetworking Part 3 (Control Messages, Error Handling, ICMP)
Lecture 8: Internet Control Protocols Reading: Section 4.1 ? CMSC 23300/33300 Computer Networks
Cisco 2 - Routers Perrine. J Page 112/19/2015 Chapter 8 TCP/IP Error Message Some of the conditions that must be met in order for host to host communication.
ICMPv6 Error Message Types Informational Message Types.
1 Connectivity with ARP and RARP. 2 There needs to be a mapping between the layer 2 and layer 3 addresses (i.e. IP to Ethernet). Mapping should be dynamic.
1 Chapter 4: Internetworking (Internet Protocol) Dr. Rocky K. C. Chang 16 March 2004.
1 Internetworking: IP Packet Switching Reading: (except Implementation; pp )
Lecture 21: Network Primer 7/9/2003 CSCE 590 Summer 2003.
1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 2 v3.1 Module 8 TCP/IP Suite Error and Control Messages.
21-2 ICMP(Internet control message protocol)
Byungchul Park ICMP & ICMPv DPNM Lab. Byungchul Park
Internet Control Message Protocol (ICMP)
CS 457 – Lecture 10 Internetworking and IP
Advanced Computer Networks
Internet Control Message Protocol (ICMP)
Ethernet and Internet Control Protocols
Internetworking Outline Best Effort Service Model
CS 457 – Lecture 11 More IP Networking
Presentation transcript:

1 Ethernet and Internet Control Protocols EE 122: Intro to Communication Networks Fall 2010 (MW 4-5:30 in 101 Barker) Scott Shenker TAs: Sameer Agarwal, Sara Alspaugh, Igor Ganichev, Prayag Narula Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson and other colleagues at Princeton and UC Berkeley

Questions to be answered today What must a host know before it can operate? –Local information –Remote information How do you avoid manual configuration? –Management: most important issue in networking today! How can host learn about local network? How can host learn about the rest of the Internet? 2

3 Answers Involve…. Bootstrapping an end host (local) –Learning its own configuration parameters (DHCP) –Learning the link-layer addresses of other nodes (ARP) Network control messages (global) –Internet Control Message Protocol (ICMP) –Exploiting ICMP for discovering Internet path properties

Bootstrap and Control Protocols Very different mechanisms For very different environments 4

Internet versus LAN Scale: –Huge vs Limited Management: –Ad Hoc vs Managed Delivery Model: –No broadcast vs broadcast 5

As a result….. Local mechanisms: broadcast to find things –“Bootstrapping” Remote mechanisms: investigate path –How to use what routing has already found –“Network Control Messages” 6

Preliminary Observations 7

Broadcast at Link-Level Use broadcast address: ff:ff:ff:ff:ff:ff If have return MAC address, use that in response Unless want everyone to know result 8

Broadcast at IP Level Can’t broadcast to all IP hosts But application might want to send “local” broadcast Uses IP broadcast address Link-layer then users link-layer broadcast 9

Reaching a Host First look up IP address Need to know where local DNS server is –How does a host know this? 10

Sending a Packet On same subnet: –Use MAC address of destination –How do a host know that? On some other subnet: –Use MAC address of first-hop router –How do a host know that? 11

Bootstrapping a Host 12

13 What Does a Host Need to Know? What IP address the host should use? What local DNS server to use? How to tell which destinations are local? How do we address them using local network? How to send packets to remote destinations? host DNS... host DNS... router / / ??? router

14 Avoiding Manual Configuration Dynamic Host Configuration Protocol (DHCP) –End host learns how to send packets –Learn IP address, DNS servers, “gateway”, what’s local Address Resolution Protocol (ARP) –For local destinations, learn mapping between IP address and MAC address host DNS... host DNS... router / / router 1A-2F-BB AD

15 Key Ideas in Both Protocols Broadcasting: when in doubt, shout! –Broadcast query to all hosts in the local-area-network –… when you don’t know how to identify the right one Caching: remember the past for a while –Store the information you learn to reduce overhead –Remember your own address & other host’s addresses Soft state: eventually forget the past –Associate a time-to-live field with the information –… and either refresh or discard the information –Key for robustness in the face of unpredictable change

16 MAC Address vs. IP Address MAC addresses –Hard-coded in read-only memory when adaptor is built –Like a social security number –Flat name space of 48 bits (e.g., 00-0E-9B-6E-49-76) –Portable, and can stay the same as the host moves –Used to get packet between interfaces on same network IP addresses –Configured, or learned dynamically –Like a postal mailing address –Hierarchical name space of 32 bits (e.g., ) –Not portable, and depends on where the host is attached –Used to get a packet to destination IP subnet

17 Bootstrapping Problem Host doesn’t have an IP address yet –So, host doesn’t know what source address to use Host doesn’t know who to ask for an IP address –So, host doesn’t know what destination address to use Solution: shout to “discover” server that can help –Broadcast a server-discovery message (ff:ff:ff:ff:ff:ff) –Server(s) sends a reply offering an address host... DHCP server

18 Response from the DHCP Server DHCP “offer” message from the server –Configuration parameters (proposed IP address, mask, gateway router, DNS server,...) –Lease time (duration the information remains valid) Multiple servers may respond –Multiple servers on the same broadcast network –Each may respond with an offer Accepting one of the offers –Client sends a DHCP “request” echoing the parameters –The DHCP server responds with an “ACK” to confirm –… and the other servers see they were not chosen

19 Dynamic Host Configuration Protocol arriving client DHCP server DHCP discover (broadcast) DHCP offer DHCP request DHCP ACK (broadcast) Why all the broadcasts? (broadcast)

20 Soft State: Refresh or Forget Why is a lease time necessary? –Client can release the IP address (DHCP RELEASE) oE.g., “ipconfig /release” at the DOS prompt oE.g., clean shutdown of the computer –But, host might not release the address oE.g., the host crashes (blue screen of death!) oE.g., buggy client software –And you don’t want the address to be allocated forever Performance trade-offs –Short lease time: returns inactive addresses quickly –Long lease time: avoids overhead of frequent renewals & lessens frequency of lease being denied

21 So, Now the Host Knows Things IP address Mask Gateway router DNS server And can send packets to other IP addresses But: how to use the local network to do this?

22 Figuring Out Where To Send Locally Two cases: –Destination is on the local network oSo need to address it directly –Destination is not local (“remote”) oNeed to figure out the first “hop” on the local network Determining if it’s local: use the netmask –E.g., mask destination IP address w/ –Is it the same value as when we mask our own address? oYes = local oNo = remote host DNS... host DNS... router / / router 1A-2F-BB AD

23 Where To Send Locally, con’t If it’s remote, look up first hop in (very small) local routing table –E.g., by default, route via –Now do the local case but for rather than ultimate destination IP address For the local case, need to determine the destination’s MAC address host DNS... host DNS... router / / router 1A-2F-BB AD

24 Sending Packets Over a Link Adaptors only understand MAC addresses –Translate the destination IP address to MAC address –Encapsulate the IP packet inside a link-level frame host DNS router IP packet

25 5 Minute Break Questions Before We Proceed?

26 Address Resolution Protocol Every node maintains an ARP table – pair Consult the table when sending a packet –Map destination IP address to destination MAC address –Encapsulate and transmit the data packet But: what if IP address not in the table? –Sender broadcasts: “Who has IP address ?” –Receiver responds: “MAC address D7-FA-20-B0” –Sender caches result in its ARP table Link-layer protocol (RFC 826) –Because necessary to bootstrap IP connectivity

27 Example: A Sending a Packet to B How does host A send an IP packet to host B? A R B 1. A sends packet to R. 2. R sends packet to B.

28 Host A Decides to Send Through R A R B Host A constructs an IP packet to send to B –Source , destination Host A has a gateway router R –Used to reach destinations outside of /24 –Address for R learned via DHCP

29 Host A Sends Packet Through R Host A learns the MAC address of R’s interface –ARP request: broadcast request for –ARP response: R responds with E6-E BB-4B Host A encapsulates the packet and sends to R A R B

30 R Decides how to Forward Packet Router R’s adaptor receives the packet –R extracts the IP packet from the Ethernet frame –R sees the IP packet is destined to Router R consults its forwarding table –Packet matches /24 via other adaptor A R B

31 R Sends Packet to B Router R’s learns the MAC address of host B –ARP request: broadcast request for –ARP response: B responds with 49-BD-D2-C7-56-2A Router R encapsulates the packet and sends to B A R B

32 Security Analysis of ARP Impersonation –Any node that hears request can answer … –… and can say whatever they want Actual legit receiver never sees a problem –Because even though later packets carry its IP address, its NIC doesn’t capture them since not its MAC address Or: Man-in-the-middle attack –Imposter updates frames w/ correct MAC address and forwards whatever it receives to the legit destination … o…. but gets to inspect (& maybe alter) it first Does the attacker have to “win” a race? –Maybe not, if sender blindly believes ARP responses

Network Control Messages (and how to use them for discovery) 33

34 Error/Status Reporting Examples of errors a router may see –Router doesn’t know where to forward a packet –Packet’s time-to-live (hop count) field expires –Packet is too big for link-layer router needs to use Router doesn’t really need to respond –Best effort means never having to say you’re sorry –So, IP could conceivably just silently drop packets But: silent failures are really hard to diagnose –IP includes basic feedback about network problems –Internet Control Message Protocol (ICMP / RFC 792)

35 Internet Control Message Protocol ICMP runs on top of IP –Same level as TCP and UDP –Though viewed as an integral part of IP (not transport) Diagnostics –Triggered when an IP packet encounters a problem oE.g., Time Exceeded or Destination Unreachable –ICMP packet sent back to the source IP address oIncludes the error information (e.g., type and code) o… and IP header plus 8+ byte excerpt from original packet –Source host receives the ICMP packet oInspects excerpt (e.g., protocol and ports) to identify socket –Exception: ICMP not sent if problem packet is ICMP oAnd just for fragment 0 of a group of fragments

36 Types of Control Messages Need Fragmentation –IP packet too large for link layer, DF set TTL Expired –Decremented at each hop; generated if  0 Unreachable –Subtypes: network / host / port o(who generates Port Unreachable?) Source Quench –Old-style signal asking sender to slow down Redirect –Tells source to use a different local router

37 Discovering Network Path Properties ICMP provides way for routers to talk to end hosts Can be used in clever ways to probe the network to discover things about its internals: –PMTU Discovery: oWhat is largest packet that can be sent completely through the network w/o needing fragmentation? Most efficient size to use (Plus fragmentation can amplify loss) –Traceroute: oWhat is the series of routers that a packet traverses as it travels through the network?

38 Path MTU Discovery MTU = Maximum Transmission Unit –Largest IP packet that a link supports Path MTU (PMTU) = minimum end-to-end MTU –Sender must keep datagrams no larger to avoid fragmentation How does the sender know the PMTU is? Strategy (RFC 1191): –Try a desired value –Set DF to prevent fragmentation –Upon receiving Need Fragmentation ICMP … o… oops, that didn’t work, try a smaller value

39 Issues with Path MTU Discovery What set of values should the sender try? –Usual strategy: work through “likely suspects” –E.g., 4352 (FDDI), 1500 (Ethernet), 1480 (IP-in-IP over Ethernet), 296 (some modems) What if the PMTU changes? (how could it?) –Sender will immediately see reductions in PMTU (how?) –Sender can periodically try larger values What if Needs Fragmentation ICMP is lost? –Retransmission will elicit another one How can The Whole Thing Fail? –“PMTU Black Holes”: routers that don’t send the ICMP

40 Discovering Routing via Time Exceeded hostDNS... host DNS... router host Host sends an IP packet –Each router decrements the time-to-live field If TTL reaches 0 –Router sends Time Exceeded ICMP back to the source –Message identifies router sending it oSince ICMP is sent using IP, it’s just the IP source address Time exceeded

41 Traceroute: Exploiting Time Exceeded Time-To-Live field in IP packet header –Source sends a packet with TTL ranging from 1 to n –Each router along the path decrements the TTL –“TTL exceeded” sent when TTL reaches 0 Traceroute tool exploits this TTL behavior source destination TTL=1 Time exceeded TTL=2 Send packets with TTL=1, 2, … and record source of Time Exceeded message

42 traceroute to ( ), 30 hops max, 40 byte packets

43 traceroute to ( ), 30 hops max, 40 byte packets 1 cory115-1-gw.EECS.Berkeley.EDU ( ) ms ms ms

44 traceroute to ( ), 30 hops max, 40 byte packets 1 cory115-1-gw.EECS.Berkeley.EDU ( ) ms ms ms 2 cory-cr-1-1-soda-cr-1-2.EECS.Berkeley.EDU ( ) ms ms ms

45 traceroute to ( ), 30 hops max, 40 byte packets 1 cory115-1-gw.EECS.Berkeley.EDU ( ) ms ms ms 2 cory-cr-1-1-soda-cr-1-2.EECS.Berkeley.EDU ( ) ms ms ms 3 soda-cr-1-1-soda-br-6-2.EECS.Berkeley.EDU ( ) ms ms ms 4 g3-8.inr-202-reccev.Berkeley.EDU ( ) ms ms * 5 ge inr-002-reccev.Berkeley.EDU ( ) ms ms ms 6 oak-dc2--ucb-ge.cenic.net ( ) ms ms ms 7 dc-oak-dc1--oak-dc2-p2p-2.cenic.net ( ) ms ms ms 8 * * * 9 dc-lax-dc1--sac-dc1-pos.cenic.net ( ) ms ms ms ( ) ms ms ms 11 dc-tus-dc1--lax-dc2-pos.cenic.net ( ) ms ms ms 12 a deploy.akamaitechnologies.com ( ) ms ms ms Lost ReplyRouter doesn’t send ICMPs Final Hop No PTR record for address

46 Ping: Echo and Reply ICMP includes simple “echo” functionality –Sending node sends an ICMP Echo Request message –Receiving node sends an ICMP Echo Reply Ping tool –Tests connectivity with a remote host –… by sending regularly spaced Echo Request –… and measuring delay until receiving replies ICMP includes other forms of probing –See /usr/include/netinet/ip_icmp.h on a Unix system –However, very often disabled … :-( Probing hosts –Try (say) traceroute and ping

47 Security Implications of ICMP? Attacker can cause host to accept an ICMP if the excerpt looks correct (assuming the host checks) –Must guess recent IP packet header & 8B of payload –All that really matters is source/destination addresses and ports Threat: –Denial-of-Service (DoS) oUnreachable, Redirect –Impaired performance oNeed Fragmentation, Source Quench

48 Summary Important control functions –Bootstrapping –Error/status reporting and monitoring Internet control protocols –Dynamic Host Configuration Protocol (DHCP) –Address Resolution Protocol (ARP) –Internet Control Message Protocol (ICMP) Next lecture: Shortest-Path Routing –K&R 4.5, 4.6.1, 4.6.2