33
ARP and ICMP

ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

  • Upload
    others

  • View
    22

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

ARP and ICMP

Page 2: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Outline

à Address resolution protocol

à Proxy ARP à Reverse ARP à Internet Control Message Protocol

Page 3: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

ADDRESS RESOLUTION PROTOCOL (ARP)

Page 4: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

In the Protocol Model

TCP UDP  

RPC  

XDR  

NFS  

RTP  SNMP  

Telnet  FTP  SMTP  HTTP  

       IP  

Data link

Network

Trasport

Session

Presentation

Application

ICMP  ARP  

Rou6ng  protocols  

IGMP  

Page 5: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

General Features

à Solicitation protocol based on broadcast

à Mapping between a layer 3 address and a layer 2 address

à Any layer 2 and 3 protocols à Specified in each message

Page 6: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Operating Principles

à Ethernet encapsultion à Ethertype OxO8O6

à Address mapping <MAC address> <IP address>

à Stored in a cache à APR cache

Page 7: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à When a layer 3 packet is to be sent à If mapping is in cache, send

à If not, an ARP Request is generated

Page 8: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Address Resolution

MAC  broadcast   h   H  (IP)  h  (MAC)   G  (IP)  ??  

Relevant  fields  of  a  MAC  frame   Relevant  fields  of  an  ARP  message  

ARP  Req  

h  (MAC)   g   G  (IP)  g  (MAC)   H  (IP)  h  ARP  Reply  

 G  

 H  

3  

ARP  Reply:  from  (G,g)  to  (H,h)  

ARP  Request:  from  (H,h)  to  (G,?)  

 h  

 R  

 r    g   Ethernet  address  

IP address

.....    G  →  g    .....  

4  

ARP  Cache  

.....  H  →  h  .....  

.....  H  →  h    .....  

ARP  Cache  2  

1  

Page 9: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

ARP Message Format

Hardware  Type   Protocol  Type  

Opera6on  

Sender  Hardware  Address  

Sender  HW  Address  

Sender  IP  Address  

Target  Hardware  Address  

HLEN   PLEN  

Sender  IP  Address  

Target  HW  Address  

Target  IP  Address  

0   8   16   31  

Page 10: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

PROXY ARP

Page 11: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Relaxing the Physical/Logical Network Correspondence

Same LIS (logical IP subnet) on two or more physical networks

H1  R  

192.168.1.5

192.168.1.1

H2  

192.168.1.130 192.168.1.129

Page 12: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Why one LIS on multiple physical networks?

à  Unexpected growth and expansion

H1  R  

192.168.1.5 192.168.1.1

H2  

192.168.1.2

Page 13: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à An originally single physical network is split

H1  R  

192.168.1.5

192.168.1.1

H2  

192.168.1.130 192.168.1.2

Page 14: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Why one LIS on multiple physical networks?

à  By mistake

H1  R  

192.168.1.5/24

192.168.1.1/25

H2  

192.168.1.130/25 192.168.1.129/25

Page 15: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Operating Principle

H1  R  

192.168.1.5

192.168.1.1

H2  

192.168.1.130 192.168.1.129

à Proxy ARP (router) replies on behalf of host

Page 16: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

REVERSE ARP (RARP)

Page 17: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

General Features

à  Knowing the layer 2 address of a host, discover layer 3 one

Page 18: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à  Same packet format, different value for Operation field

à  Solicitation protocol based on broadcast

Page 19: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à Once used by diskless hosts to find out their own address at boot

à RARP EtherType: Ox8O35 à Replaced by DHCP

à More flexible

Page 20: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Operating Principle

RARP  Request  A B

E D C

RARP  Reply  

A B

E D C

MAC  A   ??  MAC  A   ??  MAC  A  RARP  Req  

Relevant  fields  of  a  MAC  frame   Relevant  fields  of  an  ARP  message  

MAC  broadcast  

MAC  E   IP  E  MAC  E   IP  A  MAC  A  RARP  Reply  MAC  A  

Page 21: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

INTERNET CONTROL MESSAGE PROTOCOL

(ICMP)

Page 22: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

In the Protocol Model

TCP   UDP  

RPC  

XDR  

NFS  

RTP  SNMP  

Telnet  FTP  SMTP  HTTP  

       IP  

ICMP  ARP  

Rou6ng  Protocols  

IGMP  

Data link

Network

Transport

Session

Presentation

Application

Page 23: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

General Features

à Service protocol à Encapsulated in IP

à Protocol type OxO1 à Error/condition reporting protocol à It does not specify (re)actions

Page 24: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à Message generation is not mandatory

à Messages can be ignored à Use cases

à Check network status à Report anomalies à Discover netmask à Improve routing

Page 25: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Message Format

0   7  

Type-­‐specific  Data  IP  Header  

+  First  64  bytes  of  datagram  

Checksum  

Type   Code  15  

Page 26: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Echo Message

à Used to check whether a host is reachable

à A Sequence Number is used to correlate Reply and Request messages

à Used by the PING application

Page 27: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Destination Unreachable Message 0    Network  unreachable  1    Host  unreachable  2    Protocol  unreachable  3    Port  unreachable  4    Fragmenta6on  needed  and  DF  set  6    Des6na6on  network  failed  7    Des6na6on  host  failed  8    Source  host  isolated  9    Comm.  with  dest.  network  administra6vely  prohibited  10    Comm.  with  dest.  host  administra6vely  prohibited  11    Network  unreachable  for  type  of  service  12    Host  unreachable  for  type  of  service  

Code

Page 28: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à  To suggest a better next hop to destination

à  Not usable to notify a router (not the source)

Redirect Message

DG R

Page 29: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à TTL on an IP packet is zero à Used by the TRACEROUTE application

à Reassembly time out expires

Time Exceeded

Page 30: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à A problem with any of the fields in an IP header à E.g., invalid option

à Pointer field shows problematic field

Parameter Problem

Page 31: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Autoconfiguration Support

à Router Advertisement/ Solicitation à Default gateway autoconfiguration

Page 32: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

à Address Mask à From host to know the netmask in use on subnet

à Directly to router or broadcasted

Page 33: ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A.pdf · Proxy ARP (router) replies on behalf of host . REVERSE ARP (RARP) General Features ! Knowing the layer

Source Quence

à Request to reduce packet rate