IP datagrams contains mac or not ?

Hello friends,
Can anyone tell me whether there is MAC address inside Datagram or not ?
If there is no mac, then how do we identify the desired system(receiver) in its network ?

Replies

  • silverscorpion
    silverscorpion
    IP packets won't contain MAC. They willonly contain IP address, of both the source and recipient.

    The MAC address of the recipient is found from the recipient's IP address using the ARP protocol.

    This is called address resolution, and it happens in layer 2 or Data Link Layer. 😀
  • Sachin Jain
    Sachin Jain
    Sorry but i did not get what you are saying.

    Suppose my architecture is like this

    Source-->Router1---->Router2----->Destination
    Source : 172.19.6.59
    172.19.6.1--------Router1----172.17.15.1
    172.17.15.64-----Router2-----172.31.1.4
    Destination : 172.31.1.6

    Assume Mac are : S,R1a,R1b,R2a,R2b,D

    Now, i want to send data from 172.19.6.59 to 172.31.1.6
    so i want to know how data will travel from S to D.
    As i know to move from one node to other it needs H/w address of other device.

    Please reply....
  • Munguti
    Munguti
    As an addition mac addresses are only used for hosts on the same network, while IP addresses are used for hosts on different networks. Read more on ethernet communications and routing
  • Kishan Gupta
    Kishan Gupta
    Munguti saying right, mac address is only used for same network and ip address for different network.

    Suppose my architecture is like this

    Source-->Router1---->Router2----->Destination
    Source : 172.19.6.59
    172.19.6.1--------Router1----172.17.15.1
    172.17.15.64-----Router2-----172.31.1.4
    Destination : 172.31.1.6

    Assume Mac are : S,R1a,R1b,R2a,R2b,D

    Now, i want to send data from 172.19.6.59 to 172.31.1.6
    so i want to know how data will travel from S to D.
    As i know to move from one node to other it needs H/w address of other device.

    Please reply....
    NOw as your assumption, your ip's are Class B.
    Source transfer data to router1, here router 1 knows the mac address of source (or use mac address to communicate with it).
    Router 1 read destination address, and on its table information it send data (packet) to router 2.
    Router 2 receive data and read destination.
    Router 2 found destination in local network, it send packets to destination system. Here mac address is again used.

    In between no mac address is used.
    However if we want to trace source then we need to go back in reverse order.
    I think it is enough for you.
  • Sachin Jain
    Sachin Jain
    jcksn
    In between no mac address is used.
    However if we want to trace source then we need to go back in reverse order.
    But as i know we need MAC address to deliver packets to a node or system.As you are saying "in between no mac is used".
    I am thinking its wrong.
    As router1 (2nd Nic) and Router2 (1st nic) are on same network so to send packet from router1(2nd nic) to router2(1st nic) , there id need of mac of router2(1st nic) by router1(2nd nic)
    Tell me if i am wrong.
  • durga ch
    durga ch
    @blunderboy

    can you show your example in pictures? from what i understand, S is connected to R1 and D is connected to R2 right?
    Lets name the LAN created by R1 as L1 and similarly LAN by R2 as L2. R1, R2 are connected, but that doesnot mean they are on a 'network' infact they form a network
    now, consider the case when S has to send a packet within L1, though it knows that the IP address prefix is same , it will have to know the MAC address , and thats where ARP is used.This has already been pointed out
    Now the case where Packet has to traverse to a different LAN in this case L2. The source puts in the public IP address of the destination D in the packet and pushes it to R1, R1 verifies the public address . Apart from the routing tables what a router uses , router as well does a forwarding functionality. In sense, it explicitly sees on what port (interface/card) is it supposed to forward the packet to in order to send the packet to destination. In case the Interface 1(I1) of R1 is connecting to R2, then R1 forwards the packet to I1 .It might at this point, look of MAC address of the I1 NIC.
  • Munguti
    Munguti
    blunderboy
    But as i know we need MAC address to deliver packets to a node or system.As you are saying "in between no mac is used".
    I am thinking its wrong.
    As router1 (2nd Nic) and Router2 (1st nic) are on same network so to send packet from router1(2nd nic) to router2(1st nic) , there id need of mac of router2(1st nic) by router1(2nd nic)
    Tell me if i am wrong.
    I agree with blunder boy, mac addressses are used btn routers since they are on the same network. The source and destination MAC addresses change as the packet is moved from one network to another but the source and destination IPaddresses never change. This is why there is need for both forms of addressing.
  • Sachin Jain
    Sachin Jain
    Thanx Guys,
    I have understood the concept well why we need both forms of addressing.
    Just tell me one more thing when an intermediate node will send the frame to the next hop,
    then the source MAC will be of itself or the original sender's MAC.
    I mean will the intermediate node change the Source MAC or not ?

    I hope the question is clear.
  • Munguti
    Munguti
    blunderboy
    Thanx Guys,
    I have understood the concept well why we need both forms of addressing.
    Just tell me one more thing when an intermediate node will send the frame to the next hop,
    then the source MAC will be of itself or the original sender's MAC.
    I mean will the intermediate node change the Source MAC or not ?

    I hope the question is clear.
    The source MAC will be of itself(the intermediate node) and the destination MAC that of the next hop. But the source IP will be that for the original sender and the destination IP that of the final receiver.

    So to answer your question, yes it will change the MAC address to be that of its own.

You are reading an archived discussion.

Related Posts

Guys, I did not get the concept that IP datagrams that are used over internet to transfer messages is connectionless service and HTTP use TCP(connection oriented) service. My confusion is...
I vividly remember the day when I went to that bookstore. "Crossword" was newly opened in my city. I, along with my 3 friends went there. And boy, we were...
ScanCorner aims to solve the problem faced by many people who have the 'hard copies' of their photographs and want to convert them into high quality digital images. The startup...
hi guys' can we test a 555 timer ic using cro,probes and function generator? if so ,how?
hi, anyone who can give me the IS code 2116 - 1980. its very urgent pls