Community discussions

MikroTik App
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed May 25, 2016 3:56 am

understanding packets flow

Sat May 26, 2018 6:42 pm

noob question sorry :


For exemple, my laptop want to reach www.google.com web site. How does packets flow from the pc to the Google's servers?

Realy basic exemple :
src :192.1y68.0.10 dst : 8.8.8.8
router : lan2 to lan5 in bridge
lan 1 is our wan port.

packet leave my computer lan card, then hit the router's lan2 port. What happens at this specific time? Is the ARP table looks for a match or it looks for a route in routes table?

My guess is that it looks for a route first but not sure.
 
ubikrotik
Member Candidate
Member Candidate
Topic Author
Posts: 158
Joined: Wed May 25, 2016 3:56 am

Re: understanding packets flow

Sat May 26, 2018 6:47 pm

Hoo, I found :

Condition -1 PC1 -192.168.1.5 PC2 192.168.1.3 Condition -2 PC1 192.168.1.5 PC2 192.168.2.3

Condition-1

When PC 1 one want o send packet to PC 2 it will first check for Source and Destination MAC as all Communication happens at Layer 2 or Data Link layer happens at MAC . Source MAC address will be of PC 1 and destination MAC address will be of of PC 2 which is unknown in this situation . PC will generate ARP to find the MAC address of PC 2 as both Host and Destination are on same network that is 192.168.1.1 once the ARP request Fetch the MAC address of PC Switch will look in CAM table to which port he need to forward the frame. if there is no entry in CAM table , Switch will send broadcast to find out on which port PC 2 is connected and forward the frame to PC 2

Condition 2

When PC see source IP and Destination IP address are not of same sub net it know the packet need to forwarded to default gateway . It will start looking for MAC address of default gateway which should be available , in case MAC address for Default gateway is not available then it will generate ARP request find the Default gateway MAC address and send it to default gateway .

at default gateway new frame is created Source Ip 192.168.1.5 Destination IP 192.168.2.5 Source MAC of PC 1 and Destination MAC of Default gateway .

at router will check what interface 192.168.2.1 is connected and will route the Packet to particular interface .

now the destination is on same sub net it will look for the MAC address of 192.168.2.3 and forward the frame to PC 2

Please note Source IP and Destination IP never changes in packet flow .

Source and Destination MAC changes
 
sri2007
Member Candidate
Member Candidate
Posts: 206
Joined: Wed May 20, 2015 10:14 pm
Location: Lake Grove, NY

Re: understanding packets flow

Wed May 30, 2018 4:07 pm

Hi.. and also if you want to take a look a deeper view of the packet flow through RouterOS, then you'll need to check this link:

https://wiki.mikrotik.com/wiki/Manual:Packet_Flow_v6

Who is online

Users browsing this forum: hazem, raiser and 53 guests