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 destination; whichever on the same network or to a remote network.
- Data link layer address (source and destination)
Responsible for delivering the data link frame from one network interface card (NIC) to another NIC on the same network.
An IP address is the network layer, or Layer 3; logical address used to deliver the IP packet from the original source to the destination; as shown in Figure 2-5.
The IP packet has 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 destination of the packet.
Data Link Layer Addresses
The data link, or Layer 2, physical address(MAC Address) has the 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 illustrated in Figures 2.6
Before an IP packet to sent over a wired or wireless network, it encapsulated in a data link frame and then 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 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.
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 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 encapsulated in a data link frame that has 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.