Notes by: Dharmesh Shah

 

11/10/03

 

ARP – Address Resolution Protocol

 

-         Network Hardware only recognizes MAC Address and not the IP address

o       Ethernet address – 6 bytes

o       IP address – 4 bytes

-         IP only uses IP addresses

-         ARP does the translation from IP addresses to Ethernet addresses.

-         Potentially ARP can be used for any kind of network hardware address

o       ARP input:

§         IP address of C, a computer in a locally(directly)  connected network

§         Output: The hardware address(Ethernet address) of C.

 

ARP lookup algorithm

(Fig 1)

-         Host A wants to deliver IP packet to B

-         B can be a router or a host that is in the same network

-         A will lookup in the ARP table if the translation of IB to its Ethernet address is there.

o       ARP Table

Ic    Ec

ID   ED

-         If the Ip address of B is not found in the table then:

o        A broadcasts request asking the Ethernet address of B

o       (Fig 2)

o       B receives the request and it will reply with its own Ethernet address. This reply is a unicast.

o       (Fig 3)

o       B will add the entry (IA,EA) to its own ARP table

o       A will add the entry (IB,EB) to ARP table after receiving the reply.

o       The ARP table is kept in kernel memory. ARP is part of the network protocol stack.

o       The ARP table entries are kept in memory for ~20 minutes.

o       In some implementations of ARP, a machine broadcasts a gratuitous ARP reply when it boots.

§         Example A sends a packet to B and (IB,EB) is not in the ARP table of A

§         (Fig 4)

o       The ARP table contains entries of directly connected network.

o       The ARP table is also called ARP cache.

o       You may use the command

            /usr/sbin.arp –a    to print the arp table entries

            dev         IP Addr                     Ether addr

            elxl0       128.10.3.54               00:c0:ob:40:30:c0

            elxl0       128.10.3.58               70:cd:d8:03:f0:03

o       The IP destination and source addresses of an IP packet remain constant during the transit of the packet.

o       What changes is the hardware, source and destination addressees

o       (Fig 5)

X sends a packet to A

It uses router R

InN1, the packet will have

Fig 6

Esrc = Ex       Edst = Er  ( variable )

Isrc = Ix          Idst =IA   ( constant )

In N2, the packet will have

Esrc = Er       Edst = EA  ( variable )

Isrc = Ix          Idst =IA    (constant)

 

11/12/03

Datagram Transmission,

            Fragmentation and Reassembly

 

-         Source Host

o       Forms Datagram

o       Includes destination address

o       If destination is directly connected (same network) then it will deliver otherwise, if the destination is not in the same network, the host sends the datagram to the nearest router.

o       (Fig 1)

o       Intermediate routers

§         They forward datagram to the next router

§         (Fig 2)

o       Final router

o       Delivers the packet to destination host

 

In conclusion

            Ip datagram survives the entire trip

            The hardware frame (Ethernet frame etc) survives only one hop.

 

-         Networks may have different MTU’s (Machine Transfer Unit)

-         (Fig 3)

-         A sends a 1500 byte datagram to B

-         R1 fragments packet into two fragments 1000, and 500

-         R2 fragments packet with 1000 bytes into 2 500 byte packets

-         B receives 3 fragments of 500 bytes.

-         Data fragmentation will be done only by routers. The source host should not fragment.

-         Each fragment will have its own IP header and itself it is in an IP packet.

-         Fragments are sent separately and potentially they may follow different routes.

-         The final destination reassembles fragments

o       Why? Fragments may follow different paths

-         It is possible to fragments an already fragmented packet.

-         All fragments will have the same IP Id (Assuming they come from the same packet) and also they will have the same source, destination address.

-         The IP header offset field will tell where in the original packet the fragment will be placed.

-         The more fragments flag bit will be set in all the fragments except the last one.

-         The receiver collects all incoming fragments and reassembles them in a reassembly buffer using the offset field.

-         The last packet will tell the total length of the packet.

-         Once all the fragments are received the whole packet is passed to the TCP or UDP stack

-         The receiver will not know the identity of the router that did the fragmentation

-         After the first fragment is received the receiver will start a timer. If after 255 seconds (max time to live) the packet is not reassembled, all the fragments are thrown away and the reassembly buffers released. This is called the reassembly timer.

-         The receiver cannot request missing pieces.

-         In summary the fields used for reassembly are :

o       Source IP address

o       ID number

o       Offset

o       More fragments bit

 

ICMP

-         (Fig 4)

-         Internet Control Message Protocol

-         It is a protocol used for error reporting and information

-         (Fig 5)

-         ICMP sends errors to the original source

-         Types of ICMP

o       Type 4 Source quench

§         Sent by router when a packet is dropped, due to buffer overrun (congestion)

§         This request is sent to  the source to slow down transmission

-