LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-14-2016, 06:45 AM   #1
avyadav555
LQ Newbie
 
Registered: Apr 2016
Posts: 20

Rep: Reputation: Disabled
why two ports?


why we used two or more port for services like FTP 20,21, pop 110,995 IMAP 143,993 SMTP 25,587

Last edited by avyadav555; 05-14-2016 at 06:49 AM.
 
Old 05-14-2016, 06:58 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,719

Rep: Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034Reputation: 3034
How many directions does a single port have?
 
1 members found this post helpful.
Old 05-14-2016, 07:00 AM   #3
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,040

Rep: Reputation: 1329Reputation: 1329Reputation: 1329Reputation: 1329Reputation: 1329Reputation: 1329Reputation: 1329Reputation: 1329Reputation: 1329Reputation: 1329
Quote:
Originally Posted by avyadav555 View Post
why we used two or more port for services like FTP 20,21, pop 110,995 IMAP 143,993 SMTP 25,587
The reasons differ by application, in general. FTP originally used two ports, one for data and one for control. Pop runs on 110 normally, but on 995 encrypted. Most more modern services run on multiple ports for different modes of communication and security.

I prefer protocols like ssh, that run ONLY under secure modes and need no non-dynamic additional ports. Something like SMTP needs to maintain the standard port 25 operation because there are so very many other servers and clients that cannot support secure only modes.

BYW: a little google would have given you VOLUMES of more eloquent and detailed answers.
 
1 members found this post helpful.
Old 05-14-2016, 07:31 AM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,508

Rep: Reputation: 1811Reputation: 1811Reputation: 1811Reputation: 1811Reputation: 1811Reputation: 1811Reputation: 1811Reputation: 1811Reputation: 1811Reputation: 1811Reputation: 1811
Quote:
Originally Posted by grail View Post
How many directions does a single port have?
TCP ports are bidirectional.
 
1 members found this post helpful.
Old 05-14-2016, 09:07 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,842

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
Quote:
Originally Posted by avyadav555 View Post
why we used two or more port for services like FTP 20,21, pop 110,995 IMAP 143,993 SMTP 25,587
I'll focus a bit more on FTP.

The early FTP only transferred data one way. Handling interrupts/aborts/control signals required the use of out-of-band information - and were tricky to handle appropriately as they are given higher priority than data packets by the hosts on both ends. This introduced the problem that a signal could arrive before all the data had been processed related to that signal. Thus, a second socket was used.

In the implementations, the server socket was used for commands, and one of the commands passed was the return socket created by the client. So the server then makes a connection to the client to transfer data.

UNFORTUNATELY, this introduced a problem when NAT networking started being used. The return data path was blocked. This was worked around by introducing a "passive" mode which directs the server to create a second socket that the client can connect to (a PITA and kludge if ever there was one), and allow the client to send signals to the server without interrupting the data transfer.

If FTP were reimplemented now, it would use a single TCP connection, and use data and control blocks to transfer data instead of just streaming the data, allowing the use of the bidirectional nature of the TCP stream.
 
1 members found this post helpful.
  


Reply

Tags
imap, pop, smtp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to block all ports and then selectively enable ports? Key-authentication 22 greenace92 Linux - Server 2 11-11-2015 09:09 AM
Need to block all ports and open only select ports on Ubuntu 7.1 Mr.J Linux - Networking 1 11-18-2008 02:45 AM
open ports for utorrent using iptables n close smpt to that ports shtorrent00 Linux - Networking 2 09-30-2008 03:34 PM
Problem opening ports - ports appear open, but do not work. computer_freak_8 Linux - Software 10 09-20-2008 09:39 PM
how? redirect apache2 outbound ports to specific ports w/iptables? nowshining Linux - Security 5 05-27-2008 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration