Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

Packet Flow

Topology
R1- MAC - RA R2 – MAC - RB
G0/2-10.1.1.1 G0/2-10.1.1.2
G0/1 – 192.168.1.100
G0/1-192.168.2.100

S1 – MAC - AA

S2 – Mac - BB

Pc1-G0/1-192.168.1.1 PC2 – G0/2-192.168.2.1


Mac - PA MAC - PB
Packet flow from PC1 to Pc2
 Ping 192.16.2.1 source 192.168.1.1 when this command is used on pc1 it will generate an echo request
packet with type 8 and code 0
 This echo request packet is then sent to Layer3 of osi which is then clubbed with ip-header which has
source-ip, destination-ip, Protocol and ttl fields etc.
 Source ip = pc1 ip add, dest ip = pc2 ip , protocol = 1(ICMP) , TTL = 128 sec(Windows)
 The ip header is then sent to Layer2 of osi and encapsulated with ethernet frame Which has source Mac,
destination Mac, Type etc.
 Source Mac = PA, Type = 0x800(ipv4) While assigning the destination Mac it will check weather the
source ip & destination ip are same subnet or not
 If it is same subnet it will assign dest mac(Dmac) as dest ip mac, if it is not same it will assign gateway
Mac in Dmac, so it will check it arp cache to find default gate way mac add
 When there is no entry for gateway ip add it will put the packet on the hold and send an Arp request to
default gate way to get the mac add
 The arp request contains sip(pc1 ip) , smac(pc1 Mac), Target ip(Gateway ip) and Target Mac (0:0:0:0)
 When this arp packet reaches switch it learn the Smac and store it in mac table , As the target mac is
unknown it broadcasts the packet in the same network
Packet flow from PC1 to Pc2
 When this broadcast packet reaches the route R1 it will de-encapsulate the L1 header as the target mac in
L2 header is broadcast(FFFF) and arp opcode is 1(Request), it will De-encapsulate and move to the l3
header, in the packet it will find it own ip as trget ip .
 So, the R1 replies with arp reply back to the pc1 with opcode set as 2 , when it reaches switch it will mac
an entry about R1 mac add and send it towards pc1 as it already dmac info in cam table.
 The arp request contains sip(R1 ip) , smac(R1 Mac), Target ip(Pc1 ip) and Target Mac (Pc1 Mac).
 When the arp reply is received by pc1 it will update its mac table and resumes the icmp echo request
packet which is put on hold.
 It will give the destination mac of r1 mac add which gateway mac in the l2 frame of icmp echo packet
 When this packet reaches the route R1 it will de-encapsulate the L1 header as the target mac in L2 header
is its own mac, it will De-encapsulate and move to the l3 header, in the packet it will find the target ip is
not its own ip it has to drop the packet, but as it is an arp request it will not drop it
 It will check weather there is any info about the destination network in its routing table, if there is an info
about dst network it will change the smac , dmac and decrease the ttl value by 1.
 Smac = r1 mac , dmac = nexthop(r2 mac), as there is no info about next hop ip mac in its arp cache it will
generate an arp request and there will be an arp reply from next hop which is router 2 . As we got reply r1
will update its arp cache and assign dst mac as r2 mac
Packet flow from PC1 to Pc2
 When this packet reaches the route R2 it will de-encapsulate the L1 header as the target mac in L2 header
is its own mac, it will De-encapsulate and move to the l3 header, in the packet it will find the target ip is
not its own ip it has to drop the packet, but as it is an arp request it will not drop it.
 It will check weather there is any info about the destination network in its routing table, if there is an info
about dst network and if it is connected-network it will change the Dmac and decrease the TTL value by 1.
 Smac = r2 mac , dmac = nexthop(Pc2 mac), as there is no info about next hop ip mac in its arp cache it will
generate an arp request and there will be an arp reply from next hop which is Pc 2 . As we got reply r2 will
update its arp cache and assign dst mac as Pc2 mac.
 R2 repiles back to pc1 for arp request of the pc2 mac add.
 During this arp reply request between pc2 and r2 switch 2 will learn both the mac add and store it in cam
table and when the arp requests are generated there will be drop of ping request packets as timmer expires
pc1 will re-generate packet again until ttl value expires.
 Now all the arp caches and cam tables are updated the ping request generated from pc1 will go through r1
and r2 and reaches pc2 and pc2 will repile back to the pc1 ping request.
 During this process switch-1 will learn about mac add of pc2 mac add and switch 2 will learn about pc1
mac add.
 Thank you

You might also like