The Networking Model and Virtual Networks

A simple introduction to networking, ip addresses, and virtual networks.

A network is a group of computers connected up so they can talk to each other using these ip addresses. Computers talk to each network they are connected to through an interface; it is this interface which is assigned the ip address. We normally use ip addresses to identify computers on a network. For instance, for a computer with ethernet and wifi, there is one interface attached to the ethernet and another to the wifi, and each is assigned an ip address from the corresponding network. We can tell the difference between ip addresses belonging to two different networks because they start with different numbers (the subnet).

A computer is identified on a network by an ip address specific to the network. Networks are distinguished by the subnet, or the starting portion of the ip address.

Processes running can look for all interfaces that they have access to. A process can then choose to bind a port on the ip address for that interface. We can communicate with a process by knowing the ip address and port that it is listening on. The special loopback interface is part of a network which only our computer is a part of. This way processes running on the same computer can open ports on the loopback ip address so that they can always be found by each other predictably.

Although we are used to interfaces being connected to physical networks where the data is transferred using wires and waves, we can also create virtual networks that are completely software based. All we need is that there are processes speaking and listening on different ip addresses connected to the network. Of course, if the processes are on different computers, and each is connected to the virtual network through a different virtual interface, then we need some clever software rules to direct traffic to and from a virtual interface ip address through the interface connected to the physical network on the same computer, because the data must flow somehow through something physical in the end.

Virtual networks operate in exactly the same way as physical networks, except that they are defined completely in software.

This means that we can effectively associate an ip address with a process or a group of processes that open ports on the address. Any other process that is on a network routable to this ip address (the network can figure out how to connect to the ip address through any intermediate networks or computers), can then talk to the former processes through the ports.

Virtual networks are neat because they let us create networks in nothing but software, and then we get all the benefits of a separate physical network: modularization and management; and routing, efficiency, and security. In addition, virtual networks allow us to create logical networks that span multiple physical networks, even across different locations and datacenters.


Hasura is an open-source engine that gives you realtime GraphQL APIs on new or existing Postgres databases, with built-in support for stitching custom GraphQL APIs and triggering webhooks on database changes.


Hasura

Hasura

The Hasura GraphQL Engine gives you realtime, high performance GraphQL on any Postgres app. Now supports event triggers for use with serverless.

Read More