Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!decvax.dec.com!shlump.nac.dec.com!uluru.enet.dec.com!tong From: tong@uluru.enet.dec.com (Benny Tong) Newsgroups: comp.protocols.tcp-ip Subject: tcp source port number assignment in new tcp connection Summary: How to assign tcp source port number Keywords: TCP Message-ID: <15096@shlump.nac.dec.com> Date: 3 Sep 90 07:08:24 GMT Sender: newsdaemon@shlump.nac.dec.com Organization: Digital Equipment Corporation Lines: 12 Does anyone know how to assign TCP source port number when opening a new TCP connection? Is there a RFC to suggest how to do this? Will the following scheme work ? Initialises the last assigned port number to the smallest port number to use (ex. 1000?). For each new tcp connection to be opened, increments the last assigned port number (and wraps around at the largest port number plus one). Check if this tcp port number is in use already. If it is, increments this port number until an unused port number is found. Opens a tcp connection with this as the tcp source port number.