Chap 07 Modified PP2003

Embed Size (px)

Citation preview

  • 7/25/2019 Chap 07 Modified PP2003

    1/36

    TCP/IP Protocol Suite 1

    Chapter 7Chapter 7

    Upon completion you will be able to:

    ARP and RARPARP and RARP

    Understand the need for ARP

    Understand the cases in which ARP is used

    Understand the components and interactions in an ARP package

    Understand the need for RARP

    Objectives

  • 7/25/2019 Chap 07 Modified PP2003

    2/36

    TCP/IP Protocol Suite 2

    Figure 7.1 ARP and RARP

  • 7/25/2019 Chap 07 Modified PP2003

    3/36

    TCP/IP Protocol Suite 3

    Figure 7.2 Position of ARP and RARP in TCP/IP protocol suite

    Notice that ARP and RARP are supplemental to IP.

  • 7/25/2019 Chap 07 Modified PP2003

    4/36

    TCP/IP Protocol Suite 4

    7.1 ARP

    ARP associates an IP address with its physical address !n a typicalARP associates an IP address with its physical address !n a typicalphysical network" such as a #A$" each de%ice on a link is identified by aphysical network" such as a #A$" each de%ice on a link is identified by a

    physical or station address that is usually imprinted on the $ICphysical or station address that is usually imprinted on the $IC

    Logical address to physical address translation can bedone statically not practical! or dynamically "ith ARP!.

  • 7/25/2019 Chap 07 Modified PP2003

    5/36

    TCP/IP Protocol Suite 5

    Figure 7.3 ARP operation

  • 7/25/2019 Chap 07 Modified PP2003

    6/36

    TCP/IP Protocol Suite 6

    Figure 7.4 ARP packet

    #ard"are

    Type $ %thernetis type &

    Protocol Type$IP'()*+,++

    #ard"are

    Length-length o%thernetAddress !

    ProtocolLength-length o

    IP'( address (!

  • 7/25/2019 Chap 07 Modified PP2003

    7/36

    TCP/IP Protocol Suite 7

    Figure 7.5 &ncapsulation of ARP packet

    The ARP pac0et is encapsulated "ithin an %thernet pac0et.Note- Type 1eld or %thernet is *+,+

  • 7/25/2019 Chap 07 Modified PP2003

    8/36

    TCP/IP Protocol Suite 8

    Figure 7.6 'our cases using ARP

  • 7/25/2019 Chap 07 Modified PP2003

    9/36

    TCP/IP Protocol Suite 9

    A host with IP address ()*+),)+* and physical

    address -+:),:..:(*:++:(* has a packet to send to

    another host with IP address ()*+),)+. and

    physical address A,:&:',:.0:1):A- 2which is

    unknown to the first host3 The two hosts are on the

    same &thernet network 4how the ARP re5uest and

    reply packets encapsulated in &thernet frames

    Example1

    See Next Slide

  • 7/25/2019 Chap 07 Modified PP2003

    10/36

    TCP/IP Protocol Suite 10

    4olution

    'igure 66 shows the ARP re5uest and reply packets

    $ote that the ARP data field in this case is +1 bytes"

    and that the indi%idual addresses do not fit in the ,7

    byte boundary That is why we do not show the

    regular ,7byte boundaries for these addresses Also

    note that the IP addresses are shown in he8adecimal

    'or information on binary or he8adecimal notationsee Appendi8 -

    Example1 (Continued)

    See Next Slide

  • 7/25/2019 Chap 07 Modified PP2003

    11/36

    TCP/IP Protocol Suite 11

    Figure 7.7 &8ample (

  • 7/25/2019 Chap 07 Modified PP2003

    12/36

    TCP/IP Protocol Suite 12

    Figure 7.8 Pro8y ARP

    A pro*y ARP2 running in a router2 can respond to an ARPre3uest or any o its proteges. The pro*y ARP replies"ith its o"n 4AC address. 5hen the pac0et arri'es2 the

    router deli'ers it to the appropriate host.

  • 7/25/2019 Chap 07 Modified PP2003

    13/36

    TCP/IP Protocol Suite 13

    7.2 ARP PACKAGE

    In this section" we gi%e an e8ample of a simplified ARP software packageIn this section" we gi%e an e8ample of a simplified ARP software packageto show the components and the relationships between the componentsto show the components and the relationships between the components

    This ARP package in%ol%es fi%e modules: a cache table" 5ueues" anThis ARP package in%ol%es fi%e modules: a cache table" 5ueues" an

    output module" an input module" and a cache7control moduleoutput module" an input module" and a cache7control module

    The topics discussed in this section include:The topics discussed in this section include:

    Cache TableCache Table

    9ueues9ueues

    !utput odule!utput oduleInput oduleInput odule

    Cache7Control oduleCache7Control odule

  • 7/25/2019 Chap 07 Modified PP2003

    14/36

    TCP/IP Protocol Suite 14

    The Cache Table

    A sender usually has more than oneIP dataram to send to the samedest!nat!on"

    #o$ !t !s !ne%c!ent to use the A&P'rotocol (or each 'ac)et dest!ned(or the same host or router"

    #olut!on *+ Cache table" Problem *+Cache table,s s'ace !s

    -ery l!m!ted *+ An entry !s deleted!( not used (or some t!me"

  • 7/25/2019 Chap 07 Modified PP2003

    15/36

    TCP/IP Protocol Suite 15

    Figure 7.9 ARP components

  • 7/25/2019 Chap 07 Modified PP2003

    16/36

    TCP/IP Protocol Suite 16

    The Cache Table Contents

    #tate. /&$ PI$

    ardare ty'e. same as A&P eld

    Protocol ty'e. same as A&P eld

    ardare lenth. same as A&P eld

    Protocol lenth. same as A&P eld

    Inter(ace number. 'ort number:m0$m1$ m2;

  • 7/25/2019 Chap 07 Modified PP2003

    17/36

    TCP/IP Protocol Suite 17

    The Cache Table Contents

    T!me*out. ho lon unt!l th!s address !stossed out :need the room !n cache;

    ardare address. dest!nat!on hardareaddress

    Protocol address. dest!nat!on IP address

  • 7/25/2019 Chap 07 Modified PP2003

    18/36

    TCP/IP Protocol Suite 18

    o oes the Cache

    ?or)>The output modulea!ts (or an IP

    'ac)et !th a re=uest

    Chec)s the cache (or an e@!st!n entry I( entry (ound and state $

    e already ha-e th!s AC address

    I( entry (ound and state PI$'ac)et a!ts unt!l dest hard addr(ound

  • 7/25/2019 Chap 07 Modified PP2003

    19/36

    TCP/IP Protocol Suite 19

    o oes the Cache

    ?or)> I( no entry (ound$ out'ut module

    'laces th!s re=uest !n =ueue$ and a

    ne entry !s 'laced !n cache !thstate PI and ATTPT# setto 1" An A&P re=uest !s then

    broadcast

  • 7/25/2019 Chap 07 Modified PP2003

    20/36

    TCP/IP Protocol Suite 20

    o oes the Cache

    ?or)>The input modulea!ts unt!l an A&P

    re=uest or re'ly arr!-es

    odule chec)s the cache (or th!s entry I( entry !s (ound and state !s PI$

    module u'dates entry,s taret

    hardare address$ chanes state to$ and sets the TI*BT-alue

  • 7/25/2019 Chap 07 Modified PP2003

    21/36

    TCP/IP Protocol Suite 21

    o oes the Cache

    ?or)> I( entry !s (ound and state

    $ module st!ll u'dates

    the entry :taret hardare addresscould ha-e chaned; and the TI*BT -alue reset

    I( entry not (ound$ module createsa ne entry" #tate !s set to and TI*BT !s set

  • 7/25/2019 Chap 07 Modified PP2003

    22/36

    TCP/IP Protocol Suite 22

    o oes the Cache

    ?or)> o the module chec)s to see !(

    arr!-ed A&P 'ac)et !s a &e=uest" I(

    !t !s$ the module !mmed!atelycreates an A&P &e'ly messae andsends !t bac) to sender"

  • 7/25/2019 Chap 07 Modified PP2003

    23/36

    TCP/IP Protocol Suite 23

    o oes the Cache

    ?or)>The cache*control module 'er!od!cally

    chec)s each cache entry

    I( entry,s state !s /&$ s)!'s !t I( entry,s state !s PI$ Attem'ts

    eld !s !ncremented by 1" Th!s -aluereater than ma@> Toss th!s entry

    :and mar) entry as /&;" ess thanma@> #end another A&P re=uest

  • 7/25/2019 Chap 07 Modified PP2003

    24/36

    TCP/IP Protocol Suite 24

    o oes the Cache

    ?or)> I( state o( entry !s $

    module decrements -alue o( T!me*

    out eld accord!nly I( T!me*out eld 0$ then remo-e

    entry and set state to /&

  • 7/25/2019 Chap 07 Modified PP2003

    25/36

    TCP/IP Protocol Suite 25

    Table 6(Table 6( !riginal cache table used for e8amples!riginal cache table used for e8amples

  • 7/25/2019 Chap 07 Modified PP2003

    26/36

    TCP/IP Protocol Suite 26

    The ARP output module recei%es an IP datagram2from the IP layer3 with the destination address

    ((,.610 It checks the cache table and finds that an

    entry e8ists for this destination with the R&4!#;&