Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions
Interview Questions and Answers :: Amazon

38. What is network/subnet mask. Explain how a host A sends a message/packet to host B in below scenario.
(a) When both are on same network.
(b) When both are on different networks.
Explain which layer takes routing decision and how.

Answer:

[Host-A]-----------------------------[Host-B]

When both are on the same network (Scenario: a)
Host-A:192.168.2.2
Subnet mask of Host-A: 255.255.255.0
Host-B: 192.168.2.100

When both are on different networks: (Scenario: b)
Host-A: 192.168.2.2
Subnet mask of Host-A: 255.255.255.0
Host-B: 192.168.1.100

Subnet mask of destination IP is not required. Consider both the scenarios, Now if Host-A tries to send some packets to Host-B it is obvious to identify the immediate hop where host-A should forward the packets.This is achieved by below manipulation

1. Perform bitwise AND operation between Host A IP and subnet mask of the source and let the result be subnet address 'x' ( In scenario (a) if we do that we get x =192 .168.2.0 and similarly for scenario (b) x= 192.168.2.0)
2. Perform bitwise AND operation between Host B IP and subnet mask of the source and let the result be subnet address 'y' (In scenario (a) if we do that we get y= 192.168.2.0 and similarly for scenario (b) y= 192.168.1.0)

Observe that for the scenario (a) both x and y are the same so that Host A understands that destination is in the same subnet and now it sends an ARP broadcast to get MAC details and sends the packets directly to the destination host.

Now let's consider scenario (b) where x and y are different. So it is vivid that destination host is not in direct reach and hence source host forwards the packet to default gateway router .now the default gateway router acts as the source and the same manipulation is done here. The destination address remains unchanged in the routing process.

Post Your Answer Here:      Public      Private

Rate This: +0 -0
Report     

Post Your Reply Here:     

Report Error

Report Error

Please Login First Click Here