A computer network is a collection of autonomous computers interconnected by a single technology. Two computers are interconnected if they are able to exchange information.

A distributed system is very similar to a computer network; its key distinction is that in a distributed system, a collection of independent computers appears to its users as a single coherent system. Often, a layer of software on top of the operation system (middleware) is responsible for this. So in effect, a distributed system is a software system built on top of a network. The best known distributed system is the World Wide Web.

Some important applications of computer networks are: resource sharing, applying a client-server model, uses as communication medium (e.g. e-mail, instant messaging, etcetera), e-commerce (b2c, b2b, g2c, c2c, p2p), access to remote information, interactive entertainment, fixed wireless networking, mobile wireless networking (WAP), m-commerce, and many more!

Protocols

A protocol is an algorithm for communication between two or more parties. It defines the rules of how we communicate. They typically provide a service, like streaming, for example. Peers are the entities using a protocol to communicate.

The protocol would work like an algorithm, and the service would be like function signature (you give a certain input, and you get a certain output).

Few of such protocols are TCP, IP, UDP, ARP, DHCP, FTP and so on.

Network protocols often share a common set of design goals:

Layers

If the protocol is the algorithm and service the function signature, there is something similar to classes? Layers, or levels, would be the similar thing.

First, let’s talk about layers in a general context. Layers are specific type of level of abstraction. Each layer provides services but only to the layer above. They shield those layers from the details of how the offered services are actually implemented.

Layer 1 provides services to Layer 2 and this one to Layer 3. This also means Layer 1 does not directly provide services to Layer 3.

Layer 1 provides services to Layer 2 and this one to Layer 3. This also means Layer 1 does not directly provide services to Layer 3.

As shown, there is hierarchical organization.

What does this need to do with networks? In the network we have the same layout on different machines. Lowest one (Layer 1) does the actual communication (sending bits).

Layer 1 of Machine 1 sends bits to Layer 1 of Machine 2. Higher layers, like Layer 3, can now use this new data from Layer 1 in Machine 2.

Layer 1 of Machine 1 sends bits to Layer 1 of Machine 2. Higher layers, like Layer 3, can now use this new data from Layer 1 in Machine 2.