IP Flow :: In General

Let’s discuss in general on how a packet from a source machine flows to the destination machine (for now we are not considering any switch or router in between). The packet details are not shown under this topic.

1) A user machine maintains two types of tables: a)Network Table and b)ARP Table. Both this table works in hand to hand.
a) Network Table – This table contains the IP address(IPv4) of all the address(destination) that it has initiated its communication with or will be communicating with. In case of windows, we use cmd and if you type route print. This will give the below output and it tells the PC to what to do with packets.

b)ARP Table – This table is also called as ARP cache. This table maintains a correlation between each MAC address and its corresponding IP address. To check the arp entry in a Windows PC use arp -a command in the CLI Diagram show below:

2) Let us the consider the below diagram to understand this topic. Please click on the below image to get a general idea of this communication :


We have 4 workstation which are connected with each other by a shared medium. Now for communication for even to begin each PC should be connected to network(which means their NIC should have an IP address to talk over the network). Now when PC-A would like to send some data(payload) to PC-D it will initiate a communication frame which will be send across that network.

Data(Payload) – Consists of the actual data or information.
Source IP(SIP) – This is the IPv4 address which source machine will get from its NIC.
Destination IP(DIP) – The destination IP will be received either by the user if they already know what they want to access or with the help of DNS.
Source MAC(SMAC) – This field will be filled in by the source PC.
Destination(DMAC) – The source PC needs to check if the destinaion MAC address is mentioned in its ARP table. If the address is mentioned in its ARP table, the source PC will take and fill that information in the packet and send it across to the network to its desired destination.

Now PC(A) generates a frame filling in all the information in block as shown below. Considering that PC (A) knows the IP address of PC(D) but does not know the DMAC, so it will initiate a ARP broadcast with the help of ARP program. PC(A) will fill in all the information of that packet except the DMAC field since it is not aware of PC(D) MAC address so instead it will fill the field with Layer 2 broadcast address which is (FF:FF:FF:FF:FF:FF)

ARP Broadcast Frame:

Now the ARP broadcast is shared in the medium and all the workstation which are connected to this medium will receive this ARP packet. Now PCs(B, C & D) receives this packet via layer 1 and checks the layer 2 address both source and destination MAC address. PCs(B, C & D) notes down the MAC address of PC(A) in its own ARP table. Now when the PCs(B, C & D) learns that the DMAC address is Layer 2 broadcast address, then it forwards the packet up another layer(i.e. Layer 3/Network Layer). At this Layer 3, PCs(B & C) discards the packet since they learn that the Destination IP(DIP) is not their own IP address and hence the packet gets discarded but before discarding both the PCs notes down the IP address of PC(A). When the PC(D) opens up the layer 3 header, it learns that PC(A) wants to initiate a communication. So PC(D) reverts back with a reply frame and in that frame the fields position changes. This means under destination IP Addresss it will PC(A) IP address and under Source IP it will be the address of PC(D). Similary the same case with SMAC and DMAC. Please click on the image below for more information:

Reply Frame:

Now this message flowing from PC(D) to PC(A) its a Unicast message. Now PC(A) receives the unicast message from PC(D) and opens the up the packet and reads the PC(D)’s MAC address and IP address and list down in its own Network table and ARP table. Now PC(A) initiate communicates with its PC(D) and this message will be a Unicast message.

The initial message<broadcast frame> from PC(A) to PC(D) it was a Multicast message.

Note: This is just a overall idea of the communication frame, in actual there is more details in a packet or a frame which we will see in future topics.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *