You are on page 1of 9

Object – Packet flow between two different network

• Let’s understand it by simple topology


• Here I have taken three routers to check packet flow instead of real PC.
• Every device which has Ethernet port available and IP address has configured on that device
there will become ARP entry means ARP table and in that ARP table by default will be available
self IP address & mac-address.
• How ping command works .

First you will go to command prompt and type – Like something this -

C:\> ping 10.1.2.1

Then what happens inside the machine. ICMP protocol comes in this picture because ping works on
ICMP and ICMP protocol will encapsulate echo message on layer-3.

It will handover to IP protocol on Layer-3 and IP protocol will add IP header with this payload and
encapsulate packet.

Now IP protocol handovers this payload on layer 2 ARPA protocol and ARPA protocol will add Ethernet
header.
Process hold -????.

Reason – Here process will be hold as PC1 will check destination IP address (10.1.2.1) whether is same
network or different network but in my case here is the destination IP address is in the different
network. Then will PC1 will add destination mac-address of its gateway but when it check gateway’s
mac-address its ARP table but there is no mac-address of its gateway (10.1.1.100).

Now on Layer-2 ARPA protocol will handover this payload to ARP Protocol, ARP Protocol will add
following things for ARP request.

ARP protocol handover this ARP request to Layer-2 , ARPA protocol will encapsulate Ethernet header.

1. Source IP address – 10.1.1.1


2. Source mac-address-0A
3. Destination IP address- 10.1.1.100 ( Gateway IP address which we have configured on PC1)
4. Destination mac-address- 000000
5. OPcode - 1
6. Type code- 0X0806

Now on layer-2 ARPA protocol will add Ethernet header.

Now this frame will handover to Layer-1 to whom Physical layer.—

Physical layer accepts this frame and convert into bits with the help of LAN CARD/Ethernet CARD.

Like this –

On router (R1) end –

As soon as Router receives Frame on its Ethernet port/LAN card it will convert those bits into frame.
Now layer-1 will handover this frame on layer-2 to ARPA protocol, ARPA protocol will remove Ethernet
header and check that destination mac-address if destination mac-address is broad cost then it will
accept that frame and remaining payload to handover ARP protocol with the help of type code- 0X0806.

ARP protocol -

ARP protocol will open the payload and check that what the destination IP address is. If it finds
destination address is mine then it will accept and check the remaining payload by op-code. If OPcode is
-1 it means ARP request and check that who has sent the ARP request so in my case here is the source IP
address is 10.1.1.1 then ARP protocol will immediately update his ARP table.

On Router –

ARP Table
• 10.1.1.100 0B
• 10.1.2.100 0C
• 10.1.1.1 0A (ARP Table has been updated by ARP protocol).

ARP reply –

Now that ARP table has been updated then ARP protocol will reply with OPcode-2 and handover on
layer-2 to ARPA protocol.
AT receiving end PC1

Layer -1 handover this from to Layer-2 and ARPA protocol will remove Ethernet header and check that
what the destination mac-address is.

If destination mac-address is 0A then it accepts that frame and remaining payload will handover to ARP
protocol by identify type code – 0X0806.

Now ARP protocol opens this payload check that what is the destination ip address.

IF destination address is mine then ARP protocol will accept it and check whether it is ARP reply or not
by OPCODE -2, If it is ARP reply then it will immediately update his ARP table.

PC-1

ARP Table
• 10.1.1.1 0A
• 10.1.1.100 0B

Till then ICMP timer gets expired as ICMP time out is – 2sec.

1st Request time out when from router ARP request is going to send Gateway

---------------------------------Request time out --------------------------- First request time out message.

Then PC 1 will send again ICMP packet and at this time looks like this type of message.

1. C:\> 10.1.2.1
2. L3 (ICMP) - echo request type code - 8
3. L3 (IP)--> echo req. source ip address 10.1.1.1 destination ip address - 10.1.2.1 P 1 TTL – 255
4. L2 (ARPA)---> Packet source mac-address - 0A Destination mac-address - 0B type code -
0X0800
5. L1 (Physical layer) ----> Frame received ----> LAN Card will convert this frame into bits
010101010 and will transmit.
AT Router end for Second ICMP packet –

No sooner had At routers’ interface gigaethernet 0/0 then LAN card covert that bits into frame and
handover on Layer-2 ARPA protocol-

L1(physical layer) --→ bits received convert into frame.

L2(ARPA protocol)-→ Frame received, ARPA protocol will remove Ethernet header and check the
destination mac-address – 0B then it will accept and handover this payload to L3(Internet protocol).

Now IP protocol will remove IP header and check that what the destination IP address is –

Now here destination IP address is the – 10.1.2.1 now what will happen because destination mac-
address doesn’t have router’s ARP table where as destination network is directly connected to this
router if we check –
Step -1 – If destination mac-address is ARP table then router will modify IP header as here one process
works that is called packet rewriter inside the router.

1. L3(IP)---> packet src IP add- 10.1.1.2 destination IP address - 10.1.2.1 TTL - 254

2. L2(IP)--> packet src mac-address - 0C destination mac ---??

3. Handover to ARP protocol -

4. ARP protocol ---> ARP request Src ip address - 10.1.2.100 src mac-address - 0C destination
IP address 10.1.2.1 destination mac-add - 000000 opcode- 1 typecode - 0X0806

5. L2 (ARPA) ---> ARP request source mac-address - 0C Destination mac-address - FFFFFFFFF


type code - 0X0806

6. L1 (physical layer) --- frame received , convert into bits - 0111101001 and transmit over the
LAN card.

NOW PC-02

On layer1 ---> received bits ---LAN card covert bits into frame and handover on layer-2 to ARPA
protocol.

L2(ARPA Protocol) ---> remove Ethernet header and check that what is the destination mac-
address - FFFFFF ( here is FFFF) then it will accept.
handover remaining payload to ARP protocol by identify type code - 0X0806.

ARP protocol - will accept this payload and check that what is the destination IP address if
destination address is mine then will update own ARP table by identifying OPcode - 01 whether is ARP
request or not.

Now ARP protocol will reply ---> ARP reply source ip address 10.1.2.1 source mac-address - 0D
destination ip address - 10.1.2.100 destination mac-address -0C Opcode - 2 type code - 0X0806.

and handover on Layer-2 to ARPA protocol, now ARPA protocol will add Ethernet header - source
mac-add 0D destination mac-address - 0C type code code -0X0806.
encapsulate frame & handover to layer1 .

Layer-1(Physical layer) - Received frame convert into bits -01010101 and transmit over the
Ethernet car.

On router –

1. Bits will receive bits convert into frame and handover on layer-2 to ARPA protocol.
2. On Layer-2 ARPA protocol remove the Ethernet frame and check what the destination mac-
address is. Remaining payload will check by ARP type code and handover to ARP protocol.
3. Now ARP protocol will check destination ip address – 10.1.2.1 remaining payload will identify by
the OPcode means its ARP replay what we have sent. Then it will immediately update his ARP
table on the router.
2nd Request time out when from router ARP request is going to send PC2

---------------------------------Request time out --------------------------- First request time out message.

Blank mac-address on the three devices – only self-configured IP & mac-address

Now lets check when I tried to ping from PC1 to PC2 whether ARP table has been updated or not.
Below is the output – what we have discussed up to here.
In this doc. I have described all the things as per my understanding if there is any kind of issue request
you to please comment in order to I can Improve my skills.

Thank you all.

Umesh Prajapati

You might also like