Linux Basics for Big Data

61 / 87
Networking: Sockets and ports

There are some programs that need to keep running all the time. Such programs are called services.

You can communicate with such programs even from another computer. These programs or processes bind themselves to a port. No two programs can listen on same port.

For example, usually, A web server listens on 80 port and an email server listens on 25 port.

You can connect and talk to any service using nc command in the following way:

    nc computer_name(or ip_address) port_number

The way a person refers to himself as "I", a computer refers itself as localhost or IP Address 127.0.0.1.