Network concept

Each UNIX machine has all the appropriate networking software to connect to the Internet. Historically, the Internet was developed at the same time as UNIX. UNIX thus natively has the notion of network, file sharing, etc.

On the Internet, each computer possesses a (unique) identifier that helps it communicate with other computers. Like for the UID, under UNIX, the identifier is not the name of the machine but a number, the IP number (Internet Protocol).

The actual IP number norm is IPv4. The identifier of a machine is a series of 4 bytes, usually refered as A.B.C.D where A, B, C, and D are numbers between 0 and 255.

Under Linux (the implementation of the command depends on the UNIX flavor), the IP address of a machine is obtained using the ifconfig command.

The matching between machine names and IP addresses is performed by specific servers: the DNS (Domain Name Servers).

A computer machine1 wants to communicate with machine2.subdomain.dom:

  • machine1 sends the name machine2.subdomain.dom to a DNS (whose address is stored in /etc/resolv.conf)

  • if the DNS can match an IP address, it sends it back. Otherwise, it transfers the request to another DNS (there exists a hierarchy of DNS until the root DNS) until found.

  • machine1 receives the IP address of machine2.subdomain.dom from its DNS. It can now communicate with it.

Under Linux, the command traceroute can track the IP communication between the host machine and a given remote computer.

To communicate, computers use ports so that they can differentiate between types of communication (web, email, ssh, etc.). Thus, to send a message, a computer must send not only the IP address of the remote computer through the network bu also the associated port number.

For example, port 80 is used for web browsing, port 42 for DNS, port 110 for email (pop), etc.