I am learning networks from hardware and software aspects.
assume below scenario: we call computers with c prefix, switches with s and routers with r. all macs and IPs are summerized.
c1 ip=1 mac=xx
c2 ip=2 mac=yy
connected to switch s1
c3 ip=3 mac=zz
c4 ip=4 mac=ww
connected to switch s2
each switch is one network. both switches s1 and s2 are connected to r1 which is our router.
my questions are:
when c1 sends a message to c2, will it go directly to c2 without traversing through router?
how switch s1 knows mac addr of c3 which is in another network?
what happen to src/dst mac addr of frames which going to one port of router, doesn't router check src mac addr of frames? does it accept any src mac addr?
does router know all nodes in any network recursively in sub networks or it only knows what actually connected to its ports, like only switches?
or if we sum all questions into one:
how packets and frames go through switches and routers to rich their destination without being modified?
thanks