View Feed
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12940 Members
Join this group to post and comment.
jeethu • Feb 8, 2011

Doubt on Network Layer

I read the below statements(quoted) in some forum and I believe this is true

"Ip address(network address) is just use for transfering informatiom from one network to an other.travelling of information among networks uses ip addresses.

Mac addresses(physical addresses) is actually uses for distrubution of the summay is:-

1) carring of information from one network to another.
2) distrubtion of information(resources) is based upon mac address.

Network A Network B and Network C are three networks.all network are having 5 nodes(client).if i want to send information to node 3 for network B.

1) first i send infomation to network by the help of IP address of that network(Network B).Ip addresses are unique on network layer(this is the fact).

2)after that it will send infomation to node 3 of network B by the help of mac address which is unique at layer 2(DLL)."

But I have some doubts in this.

1)Do we need network layer to transfer data inside a LAN ?

2)In the solution part of above statements, do we(sending machine) need to know the ip address of both network B and the node (of network B) ? If we don't need to know the ip address of node in network B, how will the router in network B know that it is for that particular client ?

3) After the packet reaches the destination Network B, it is said that "it will send infomation to node 3 of network B by the help of mac address which is unique at layer 2" how does the router(of network B) know the mac address of that node ? does it use rarp ? or does it have a table ?
durga ch
durga ch • Feb 9, 2011
in this case, you can read the movement of the packet between two post offices as traversing between 2 routers.

now, it then becomes the responsibilbity of the courier folk to deliver the packet at the address specified right? now once he puts the packet infront of the destination house , it doesnot become his repsonsislbity to make sure the correct person takes it. he just drops it in the post box . Its the logic within the house , which makes sure correct person opens the letter/courier.

Now, the rules and regulations while tranferring these packets are put down by transport layer ( we are done with analogy)

keeping this analogy in mind, lets consider you case
the general structure I would conisder in this case is

-three LANs, with 3 different switches and then a router connecting all three switches are connected using a router

Switches in general are used to make LANs. while routers in general are used to connect 2 LANs.
you might ask why are we using siwtches here. We generally tend to divide the huge LANs into smaller ones for various reasons like to restirct the broadcast domain , to implement various privacy settings etc
For host 1 from LAn1 ( H1 L1) to send packet to host1 Lan1( H1L3)

Host node should be aware of destination address , be it MAC or IP . same as you should be knwing the destination postal address in the above analogy. To know the Ip address of the speicific destination client you might be using a DNS server (say google etc)( incase you are using standard web applications )
we will need to know the IP address of the host , the network address can be deduced from the destination address and subnet masks available.
once the IP address is known, ARP is used to see what is the MAC address concerned to the specific IP.
I think you are not using any switches ( l2) here. anyways, when H1 L1 has data packet to be sent to H1L3, it first verfiies that the specific host H1L3, doesnot belong to its own network.Since subnet address for every LAN is different, the host computer H1L1, should be able to decide if the destination address belongs to its network or not, if not then it sends a ARP to router to understand if it is aware of the destination IP. If the router is aware , the packet is prepared to be forwarded to the router. It thus forwards the data packet to the switch . the switch too realises the same ( by checking its switchign tables) and then forwards the packet ot its default gateway which is the router. the router has an entry made for all the three LAns and forwards the pacekt to the H1L3.

Does this help? I would be more at ease, if you can give me a topolgy of the network you are tlaking about
jeethu • Feb 9, 2011
Thanks for clearing that up.
I still have a doubt on packet traveling inside 1LAN

Let me Explain,

Topology1:- h1, h2,h3,h4 connected to a Router(R1) using a Switch(S1)

ie. h1,h2,h3,h4 <------>S1<------>R1

Now if h1 wants to send a packet to h3, Does the packet has to go to the router and come back ? or it will come back directly from the switch ?

Topology2:- Replace the switch S1 with a HUB

What happens now if h1 wants to send a packet to h3 ? Since HUB is a repeater, it should duplicate the packets and send to all hosts (including the Router). So here does h3 receives a packet from HUB and also from the Router ?
durga ch
durga ch • Feb 9, 2011
in case of S1, the packet need not go to the router as switch already has the entry made for H3 in the swtch look up table.
in case of HUB, since H3 is connected to the HUB and HUB broadcasts agina, we dont have to approach router, rememebr that only when you are going out of ypur LAn you would need a router. this applied in cases where you have VLAns configured and traversing between two VALNs happen through a router even if theya re on same switch.
jeethu • Feb 14, 2011
Great!! thanks for clearing that up!

Share this content on your social channels -