I've been learning about networks recently at a new job, and I did a presentation on what I've learnt so far. When I was describing the relationship between the datalink and network layer, I mentioned that datalink handles the hops while network is end to end. After I was done they grilled me with some questions, and one of them asked me if the datalink layer handles packets traveling across the internet, to which I replied yes. They told me I was wrong, but I didn't ask them for the right answer because I was nervous and it really didn't cross my mind to ask. But now that I've gone back to researching this topic I'm starting to get confused and I was hoping I could have someone clear this up for me. Was I wrong? Or perhaps I explained it poorly? Here's my knowledge so far:
The packet comes with headers that contain information concerning packet delivery and whatnot. The IP header has the source and destination IP address for the packet, which is used to get the packet across the internet. On the other hand the layer 2 frame header (ethernet or whatever) has the MAC address of the source (which would be the original host at this point) and the MAC address of the next router the packet is to be sent to (using ARP). The IP packet is left alone but with each hop the frame header is rewritten with a new source (the router's) MAC address and a new destination (the next hop). This is repeated within the network until a gateway within that network is reached, where the packet is then forwarded onto the ISP/provider's network. The same thing happens within the ISP/provider's network, with the packet (frame) being sent over the datalink layer while using the IP header for ARP. EGPs like BGP are used across networks, and IGPs are used within networks. And while IP addresses indicate the final destination, even over the internet MAC addresses are used to transport the data from router to router.
This makes sense to me because the internet is physically connected and MAC addresses are king when it comes to physical connections. But after being told I was wrong I've kinda lost confidence and now I'm just confusing myself. Is a different protocol or method used when data is sent from within the local network into the internet? Are MAC addresses only relevant within a network? Any help clearing this up for me is greatly appreciated. Thanks!