router knows all networks that are connected to it so within it there
is no need for setting up routing protocols
This is exactly correct: the single router gets an "interface route" for each network it is directly connected to. it doesn't know about anything else unless configured with static routes or a routing protocol to learn the routes. In your example, if the hosts are configured with the router as their default gateware (by DHCP or any other method) then all the hosts will correctly forward to the router.
The following are taken from a real production router with two interfaces and a single static default route:
ip address 172.30.20.251 255.255.255.0
ip address 172.31.20.254 255.255.255.0
ip route 0.0.0.0 0.0.0.0 172.30.20.254
show ip route gives the
S static route and the two interface routes marked
C for connected.
L shows the local addresses.
S* 0.0.0.0/0 [1/0] via 172.30.20.254
172.30.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.30.20.0/24 is directly connected, FastEthernet0/0
L 172.30.20.251/32 is directly connected, FastEthernet0/0
172.31.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.31.20.0/24 is directly connected, FastEthernet0/1
L 172.31.20.254/32 is directly connected, FastEthernet0/1