Using Named Ports

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Using Named Ports

  • Creator
  • #49538
    Paul Tiffany

    Does anyone know why named ports would not work inside of Cloverleaf?  Is this a setup issue or a bug in Cloverleaf?  Anyone else using named ports successfully?


       Clover 5.5 rev 1

       RedHat Linux AS 4

    I know they work outside of Cloverleaf because I can use telnet to verify a connection to another server using a named port…

    Any thoughts would be greatly appreciated.

Viewing 9 reply threads
  • Author
    • #62374
      Jim Kosloskey


      We are on AIX.

      I am assuming you are naming your ports in the /etc/services file.

      That is where we name ours and they are referenced by Cloverleaf(R).

      Jim Kosloskey


    • #62375
      Paul Tiffany

      Thanks, Jim.  It’s good to know that it works under AIX.  Does anyone have it working under Linux?  Is there such a thing as “port permissions” per an application (Cloverleaf)?  Hmm…

    • #62376
      Richard Hart


      We have used Cloverleaf on a few Unix flavours and have never had an issue with named ports.

    • #62377
      Russ Ross

      Jim Kosloskey is right that we sometimes use named ports by placing entries in the /etc/services files.

      In fact, I’m the one who has root access and manages the entries in this file at MD Anderson Cancer Center.

      One thing I’ve observed is that QDX can’t handle just any of the names that you might invent.

      Even though you will be able to ping any port name you create something about the IDE will choke on certain port names.

      It seems somewhat random in nature but if you are having an issue try changing the port name and it might start working.

      Here are some entires in one of our /etc/services file you can use as a reference:


      # entries for Clover Leaf interfaces after May 12, 2004 go below this comment in port sorted order
      # entries for Clover Leaf interfaces before this date can be migrated below this comment onced named properly
      # the naming convention for these entries require they start with “qdx_prod_” or “qdx_test_”
      # the rest of the name is up to the descresion of the developer
      qdx_prod_pat1_adt_ob            9401/tcp    # Patient1 OB from Cloverleaf IB to Patient1
      qdx_prod_ob_picis_ormgr_adt    15175/tcp    # outbound ADT to PICISI (OR Manager)
      qdx_prod_ob_xrt_adt            18023/tcp    # outbound ADT to XRT (Radiation Oncology)
      qdx_prod_ob_apollo_adt         18202/tcp    # Outbound ADT to Cardio Lab testing environment
      qdx_prod_jr_iftp_030           18210/tcp    # jump receive at prod_sms_sched for XTB batch cancellations
      qdx_prod_ob_escription_adt     30016/tcp    # outbound adt for HIMS transcription system escription
      qdx_prod_sched_hops            18220/tcp    # prod_sms_sched hs_sms_sched and hr_sms_sched
      qdx_prod_ods_rss               18230/tcp    # prod_sms_sched ob_ods_rss
      qdx_prod_ob_neps_adt           18236/tcp    # outbound ADT to Neps (old wallace software)
      qdx_prod_ob_neps_forms         18240/tcp    # outbound scheduling to wallace
      qdx_prod_ob_cbord_adt          18302/tcp    # Outbound ADT to CBORD/dietary
      qdx_prod_ob_cbord_order        18306/tcp    # Outbound orders to CBORD/dietary
      qdx_prod_ods_adt               20040/tcp    # prod_global_adt ob_ods_adt
      qdx_prod_ob_lis_rslts_ods      20041/tcp    # LIS Orders/results to LIS ODS
      qdx_prod_ob_ods_sched          21002/tcp    # Outbound SMS sched to ODS (SDR)
      qdx_prod_ob_eiw_adt            21003/tcp    # Outbound ADT to EIW Data Warehouse
      qdx_prod_ob_bedtrk_adt         30011/tcp    # outbound adt for bed management dashboard (bed tracking)
      qdx_prod_ob_xcelera_adt        32151/tcp    # outbound ADT for Xcelera
      qdx_prod_ob_pyramis_order      40235/tcp    # Outbound ORM to Pyramis

      Russ Ross

    • #62378
      Paul Tiffany

      Thanks for all the replies.  I have discovered why we are having trouble, but I can’t tell at this point if it is due to a Cloverleaf bug, or an OS setting.

      My /etc/services file (snippet):

      testport1 10000/tcp

      testport2 20000/tcp

      When I cranked-up the EO I discovered that named port “testport1” (10000) was getting converted to 4135.  I thought this was an odd conversion.  So I tried using “testport2” (20000).  It was converted to 8270.  I did a little bit of math and noticed that 8270 is double 4135.  Hmm.  That discovery (plus a co-worker saying the word “hexadecimal” at that moment) led me to try 10000 and 20000 as hex.  Results were 2710h and 4E20h respectively.  Now if you change the “endianness” from big-endian to little-endian you get 1027h (4135) and 204Eh (8270).  See the pattern?  (Hint: flip the bytes.)  I tried this with several ports to the same result.

      dec port -> hex port -> flip bytes -> dec port

      10000 -> 2710h -> 1027h -> 4135

      20000 -> 4E20h -> 204Eh -> 8270

      Fun, eh?

      So, bottom-line.  Do I have a Cloverleaf bug with named ports, or an OS setting to fix?

      My hardware is little-endian.  By default “network byte-order” is big-endian.  I’m running Cloverleaf 5.5 on RedHat 4 on Xeon (little-endian) processors.

      Any thoughts?  Do I need to clarify this jumbled mess of an explanation?

    • #62379
      Robert Milfajt

      I remember way back in the past century, that AIX 3.2.5 had a similar problem, in that when you reached a certain port number, it started couting backwards.  This was a limitation of the OS, not Cloverleaf, and this seems to be similar to the problem you have now.

      We solved it by finding the port threshold (highest number we could safely use) and limited our ports that way.  AIX 4 and 5 do not seem to be constrained in this manner as I now have 5 digit port numbers 21xxx.

      If I were you, I would find the highest port number that does not change.  I would start with base two numbers, like 8192 plus 1, only because of the computer binary thing.

      Hope this helps (and I would love to know what you find),

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #62380
      Paul Tiffany

      Thanks for your input.  I’ll gladly let you know what the final resolution is.

      There isn’t a “range” that will work.  For example, even port 1 which is 0001h (hexadecimal) becomes 0100h when you flip the endianness.  🙁

      The only ports that we have found that work are when the individual bytes are the same.  For example port 4626 (decimal) would still be 4626 — because 1212h flipped is still 1212h.

      So ultimately there are only 255 ports that we could use that are the same regardless of endianness.  Ports that work: 257, 514, 771, 1028, etc…

      Clear as mud, right?

      Ultimately I am still looking for a setting in Linux or confirmation of a Cloverleaf bug.

      Thanks all!!!

    • #62381
      Paul Tiffany


    • #62382
      Robert Milfajt

      Did you report your problem on the Red Hat sites?  I believe that the probability of your problem being OS related is 90%+, especially since other flavors of Unix have no problem using /etc/services with higher numbered ports.

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #62383
      Paul Tiffany

      Thanks, Robert.  Actually the named ports work just fine outside of Cloverleaf…  For example, I can use “telnet testport” and it will connect to the correct port that “testport” refrences.

      Thanks for the thought, I will revist the Red Hat forums again just in case.

Viewing 9 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
Topic Tags