The network and data link layers are responsible for delivering the data from the source device to the destination device. As shown in Figure2-4; protocols at both layers contain a source and destination address, but their addresses have different purposes.
Network Layer Addresses
Network layer address (source and destination)
Responsible for delivering the IP packet from the original source to the final destination; whichever on the same network or to a remote network.
Data link layer address (source and destination)
The IP packet contains two IP addresses:
- Source IP address– The IP address of the sending device; the original source of the packet.
- Destination IP address– The IP address of the receiving device; the final destination of the packet.
Data Link Layer Addresses
The data link, or Layer 2, physical address(MAC Address) has a different role. The function of the data link address is to deliver the data link frame from one network interface; to another network interface on the same network. This process is illustrated in Figures 2.6
Before an IP packet to be sent over a wired or wireless network; it must be encapsulated in a data link frame so it can be transmitted over the physical medium.
As the IP packet travels from host to router; router to router, and finally router to host; at each point along the way the IP packet is encapsulated in a new data link frame. Each data link frame contains 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.
The Layer 2, 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 as it is received on one NIC and adds new data link information before forwarding out the exit NIC on its way towards the final destination.
The IP packet is encapsulated in a data link frame that contains data link information, including a:
Source data link layer addresses
The physical address of the device’s NIC that is sending the data link frame.
Destination data link layer addresses
The physical address of the NIC that is receiving the data link frame. This address is either the next hop router or of the final destination device.