ARP and ICMP - polito.itnetgroup.polito.it/courses/Didattica/CN/arp_E_A_3x.pdf · ADDRESS...

Post on 05-Oct-2020

13 views 0 download

transcript

ARP and ICMP

Outline

à Address resolution protocol

à Proxy ARP à Reverse ARP à Internet Control Message Protocol

ADDRESS RESOLUTION PROTOCOL (ARP)

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  

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

Operating Principles

à Ethernet encapsultion à Ethertype OxO8O6

à Address mapping <MAC address> <IP address>

à Stored in a cache à APR cache

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

à If not, an ARP Request is generated

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  

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  

PROXY ARP

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

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

à 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

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

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

REVERSE ARP (RARP)

General Features

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

à  Same packet format, different value for Operation field

à  Solicitation protocol based on broadcast

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

à RARP EtherType: Ox8O35 à Replaced by DHCP

à More flexible

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  

INTERNET CONTROL MESSAGE PROTOCOL

(ICMP)

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

General Features

à Service protocol à Encapsulated in IP

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

à Message generation is not mandatory

à Messages can be ignored à Use cases

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

Message Format

0   7  

Type-­‐specific  Data  IP  Header  

+  First  64  bytes  of  datagram  

Checksum  

Type   Code  15  

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

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

à  To suggest a better next hop to destination

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

Redirect Message

DG R

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

à Reassembly time out expires

Time Exceeded

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

à Pointer field shows problematic field

Parameter Problem

Autoconfiguration Support

à Router Advertisement/ Solicitation à Default gateway autoconfiguration

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

à Directly to router or broadcasted

Source Quence

à Request to reduce packet rate