A router structure would look like linecards all connected by a routing fabric(switchplane) so if a packet is received by a linecard it will remove the ethernet header then make changes to ip header and lookup in routing table using destination ip to get the output interface and next-hop ip. Then passes the packet without the ethernet header to the fabric with an internal header containing the output interface number then according to the internal header the fabric puts the packet(without ethernet header) in the output interface now since the packet doesnt have the ethernet header. It will need to add one but how will the output port know what will be the destination mac since the destination ip is not always the same as the next-hop ip and the destination mac will be based on that.
Problem: So would the output interface again lookup in the routing table for next-hop ip and according to that lookup in the ARP table or does the receiving interface pass the next-hop ip to the output interface in the internal header as well ?
If there are any conceptual gaps please explain them as well if possible.