Protocols & Ports

In notebook:
FrontEndMasters Networking and Streams
Created at:
2017-09-23
Updated:
2017-09-23
Tags:
backend Fundamentals

Examples of network protocols:

  • HTTP - browse web pages
  • HTTPS - browse web pages with encryption (with a layer of TLS encryption)
  • SMTP - send and receive emails (very simple, similar to http)
  • IMAP, POP3 - load emails from an inbox (also text based protocol)
  • IRC - chat
  • FTP - file transfer
  • SSH - remote shell over an encrypted connection
  • SSL - low-level secure data transfer (used by HTTPS)

They all have their "default" ports. FTP has a command port, designed to work like satellites. You have port 21 to listen on then it can open additional ports for the file transfer. With satellites, you have a lower, reliable frequency for the command opening, then a higher frequency with higher speed.

ports

Port is between 1 and 65535. On most system, to use a lower port number, you need higher, admin privileges.

  • 21 - ftp (control port)
  • 22 - ssh
  • 25 - smtp
  • 80 - http
  • 443 - https
  • 3306 - mysql
  • 5432 - postgresql
  • 5984 - couchdb
  • 6667 - irc (the most typically used one)
$ nc -lp 1024
^C
$ nc -lp 1023
Can't grab 0.0.0.0:1023 with bind : Permission denied

nc is netcat to run commands. The above command tells to listen on that port. On 1013 it won't run.