Datalink and Network Layer Addresses

Data Delivery from the source device to a destination device is the primary responsibility of the network layer and data link layer. Protocols at both layers contain a source and destination address, but their addresses have different purposes.

Network Layer Addresses

Network Layer addresses deliver the IP packet from the source device to the destination device.  The destination may be on the same network or may be on the remote network. An IP address is also known as the network layer address. The IP address is also known as a logical address.  Any IP packet contains two network layer addresses:-

  • Source IP address– The IP address of the sending device and the packet’s source.
  • Destination IP address– The IP address of the receiving device and the packet’s final destination.

The figure below illustrates the source and destination IP address in the packet sent over the network.

network layer addresses

Data Link Layer Addresses

The data link layer delivers the data link frame from one network interface card (NIC) to another network interface (NIC) on the same network.  The address working on the data link layer is called the physical address or MAC address.

It has a different role than the IP address. It delivers the data link frame from one network interface card to another on the same network. Before an IP packet is sent over a wired or wireless network, it is encapsulated in a data link frame and transmitted over the physical medium.

The figure below illustrates the data link layer address or L2 address. As the IP packet travels from host to router, router to router, and finally router to host at each point, the IP packet is encapsulated in a new data link frame. Each data link frame has the source data link address of the NIC card sending the frame and the destination data link address of the NIC card receiving the frame.

In layer 2, the data link protocol is only used to deliver the packet from NIC-to-NIC on the same network. The router removes the Layer 2 information it received on one NIC and adds new data link information before forwarding out the exit NIC on its way toward the final destination. The IP packet is encapsulated in a data link frame that has data link information, including:

  • Source data link layer addresses – The physical address of the device’s NIC sending the data link frame.
  • Destination data link layer addresses—The physical address of the NIC receiving the data link frame. This address is either the next-hop router or the final destination device.
Data Link Layer Addresses