There's a few types of devices in networking. At the basic level you have the host, a switch, and a router. A host would be your computer. A switch (at a basic level) allows you to talk to everyone connected to that switch. A router (again at a basic level) allows you to talk to everyone else not connected to that switch.
As for your example, your computers, the hosts, (in that room) connected to a switch. This makes it so all the computers in that room could communicate to each other if needed. That switch then would connect to a router, other rooms switches would also connect to that router. That way your room could talk to the room next door.
An example of communication. You have computer 1 and 2 in the same room and computer 3 in the room next door. If you want to communicate from computer 1 to computer 2 then the information would flow from computer 1 to the switch in the room to computer 2, because they are connected to the same switch.
If you wanted to talk to computer 3 from either computer 1 or 2 that's a bit different. Computer 1/2 cannot talk to 3 directly because it's in a different room. AKA not on the same local area network (LAN). It would be on a wide area network or a WAN. So computer 1/2 would send information to the switch into the room. From that switch it would send the information to the router. From the router it would "route" the information to the correct switch that has computer 3 connected. That switch would send the information to computer 3.
At each layer there is some form of security. At the physical it can be said that the security is physical tampering/protecting equipment. Think behind a locked door and not exposing wiring/leaving ethernet ports open in a room.
At the data link layer you have security provided by switches which can stop the connection of non-approved layer 2 addresses, shut down ports, etc. But it also has some security in the frame itself with the cycle redundancy check which would allow it to ensure the frame is correct.
At the network layer there are too many security mechanisms to list. For your example though it would be similar to protecting the interior network (the LAN, aka each computer room) from the outside world. You would utilize a port address translation or network address translation technique to protect the interior IP addresses from exposure to the world while also allow the interior network, which is on non publicly routable (can't work on the internet) to use a publicly routable address for communication. It uses a lookup up table that maps internal addresses to the external address(es)
There are other mechanisms at the higher layers, and a bunch more at the layers i did the quick and dirty basics for, but there are books that hit that topic. entire books.
Note: I used very, very basic examples here. A LAN is any local area network, which can technically span incredible distances through use of different technologies.