Electrical engineer here trying to understand things. So I guess this might be simple or very complex, but how exactly does a router route traffic between say 2 PCs that are on a LAN?
eg. PC-1 and PC-2 are two laptops sitting on the table in front of me that are connected to the same router/modem. PC-1 IP is 192.168.10.1 PC-2 IP is 192.168.10.2. After reading this very informative article here: https://www.think-like-a-computer.com/2011/07/18/how-routing-works/ I understand that when they communicate to say PC-3 in Germany on IP address 126.96.36.199 the router abstracts the IP address to subnet mask 200.200.100.x, sends it along to a different router, which sends it to a different router, which eventually routes it to the subnet mask connected to PC-3's router with address 200.200.100.x, which then identifies the packet as headed to PC-3 and sends it there. But how does the last step actually happen?
What language is the code that routers operate on written in, C/C++/Assembler? How would it be possible to send a packet(s) manually from PC-1 to PC-2? Is this sort of low-level communication possible in desktop PCs running Windows 10, through the command line or a program? Can I read this source code that the router is using to route packets on a LAN or is it publicly available somewhere? I have done a lot of searching but every website basically says 'and then the router identifies the packet as belonging to PC-x and sends it on its way' without going into more detail as to how that actually happens, probably because the average Google user troubleshooting has no need for this knowledge. Thank you very much!