As usual here, people have ideas about routing that are not (completely) correct. So I'll respond. But jkbarik, do your own homework. Or tell us next time you have a homework question that you can't answer.
if you need three separate networks than you need a routing protocol setup like RIP or OSPF.
No.
You need a routing protocol when you have multiple separate networks, that are not directly connected. In other words: when the hopcount between two of those networks is larger than 1. In other words: when you have more than 1 router in your network.
And even then, you can design/configure all those networks with static routes, in stead of a routing protocol. Only when you have redundancy in your network, then you need a routing protocol. In other words: when you have more than 1 path between router A and router B.
Than you need to tell your router the three networks.
I don't think so.
Notice the description of the question.
Router is connected to switch-A. Switch-A is connected to switches B, C and D. A switch means a bridge. Most of the time. (The word "switch" sucks in networking. It can use many things. Better wording would be: "bridge").
So from a routing perspective, a layer-3 perspective, it is one big ethernet.
Network A 192.168.0.0 subnet mask 255.255.255.0 default gateway 192.168.0.1 address ranges used for hosts 192.168.0.2 to 192.168.0.254
Network B 192.168.1.0 subnet mask 255.255.255.0 default gateway 192.168.1.1 address ranges used for hosts 192.168.1.2 to 192.168.1.254
Network C 192.168.2.0 subnet mask 255.255.255.0 default gateway 192.168.2.1
address ranges used for hosts 192.168.2.2 to 192.168.2.254
That's correct, if we were talking about multiple networks. And even then, because there are 4 switches, if we did 1 subnet per switch, we should need 4 networks.
I'm assuming you need three separate networks? is this correct
That's what jkbarik should tell us. But I doubt he can, because it seems he doesn't even understand the question.
Also there is the issue: do you need to assign a subnet mask that just works ? Or a subnet-mask that works, but is also as long as possible. A /24 (as you use) has 256-2=254 ip-addresses available for hosts (and routers). Here we need 8 ip-addresses for hosts, and 1 or 2 for routers.So we need a subnet that has 10 ip-addresses. That means we need a /28. With 28 bits subnet mask we have 2^4 = 16 - 2 = 14 available ip-addresses.
But these are 4 switches, then this is one subnet. The easiest thing would be to just assign 192.168.0.1/24 (24 = length of the netmask in bits) to the one subnet. And give the 24 (24 = 3 * 8) hosts an IP-address from that range. Say 192.168.0.101 till 192.168.0.124.
Edit: oh, for the uninitiated:
a /24 means a netmask which is a bitstring of 24 ones and 8 zeros. 11111111111111111111111100000000.
a /28 means a netmask which is a bitstring of 28 ones and 4 zeros. 11111111111111111111111111110000.
If you write that as separate bytes, you'll end up with all ones in the first 3 times 8 bits.
11111111 in binary is 255 in decimal.
00000000 in binary is 0 in decimal.
11110000 in binary is 240 in decimal.
So a /24 will be written in dotted-4-octet-notation as: 255.255.255.0
And a /28 will be written in dotted-4-octet-notation as 255.255.255.240.