Can we specify service name and transport protocol in a URL?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












3















A URL has its own syntax.



  1. In a URL, we can specify either hostname or IP address. Similarly, while we can specify port number, can we specify service name instead of port number ?
    If we can't, how can we specify service name when it is needed (e.g. in case that we don't remember port number for a service)?


  2. Can we specify transport protocol in URL? If we can't specify transport protocol in a URL, how can we specify
    transport protocol when it is needed? The need to do that is that a service name may
    correspond to two transport protocols, for example, in
    /etc/services



    http 80/tcp # Hypertext Transfer Protocol
    http 80/udp
    ssh 22/tcp # Secure Shell
    ssh 22/udp
    telnet 23/tcp # Telnet
    telnet 23/udp
    smtp 25/tcp # Simple Mail Transfer Protocol
    smtp 25/udp


Thanks.










share|improve this question
























  • Uh…you never enter such URL in web browser?

    – 炸鱼薯条德里克
    Feb 15 at 15:53











  • never. How do you do it?

    – Tim
    Feb 15 at 16:36











  • …By typing "ht tps://unix.stackexchange.com:443" in the browser? Stackexchange force me to use a space, just ignore that

    – 炸鱼薯条德里克
    Feb 16 at 3:29
















3















A URL has its own syntax.



  1. In a URL, we can specify either hostname or IP address. Similarly, while we can specify port number, can we specify service name instead of port number ?
    If we can't, how can we specify service name when it is needed (e.g. in case that we don't remember port number for a service)?


  2. Can we specify transport protocol in URL? If we can't specify transport protocol in a URL, how can we specify
    transport protocol when it is needed? The need to do that is that a service name may
    correspond to two transport protocols, for example, in
    /etc/services



    http 80/tcp # Hypertext Transfer Protocol
    http 80/udp
    ssh 22/tcp # Secure Shell
    ssh 22/udp
    telnet 23/tcp # Telnet
    telnet 23/udp
    smtp 25/tcp # Simple Mail Transfer Protocol
    smtp 25/udp


Thanks.










share|improve this question
























  • Uh…you never enter such URL in web browser?

    – 炸鱼薯条德里克
    Feb 15 at 15:53











  • never. How do you do it?

    – Tim
    Feb 15 at 16:36











  • …By typing "ht tps://unix.stackexchange.com:443" in the browser? Stackexchange force me to use a space, just ignore that

    – 炸鱼薯条德里克
    Feb 16 at 3:29














3












3








3








A URL has its own syntax.



  1. In a URL, we can specify either hostname or IP address. Similarly, while we can specify port number, can we specify service name instead of port number ?
    If we can't, how can we specify service name when it is needed (e.g. in case that we don't remember port number for a service)?


  2. Can we specify transport protocol in URL? If we can't specify transport protocol in a URL, how can we specify
    transport protocol when it is needed? The need to do that is that a service name may
    correspond to two transport protocols, for example, in
    /etc/services



    http 80/tcp # Hypertext Transfer Protocol
    http 80/udp
    ssh 22/tcp # Secure Shell
    ssh 22/udp
    telnet 23/tcp # Telnet
    telnet 23/udp
    smtp 25/tcp # Simple Mail Transfer Protocol
    smtp 25/udp


Thanks.










share|improve this question
















A URL has its own syntax.



  1. In a URL, we can specify either hostname or IP address. Similarly, while we can specify port number, can we specify service name instead of port number ?
    If we can't, how can we specify service name when it is needed (e.g. in case that we don't remember port number for a service)?


  2. Can we specify transport protocol in URL? If we can't specify transport protocol in a URL, how can we specify
    transport protocol when it is needed? The need to do that is that a service name may
    correspond to two transport protocols, for example, in
    /etc/services



    http 80/tcp # Hypertext Transfer Protocol
    http 80/udp
    ssh 22/tcp # Secure Shell
    ssh 22/udp
    telnet 23/tcp # Telnet
    telnet 23/udp
    smtp 25/tcp # Simple Mail Transfer Protocol
    smtp 25/udp


Thanks.







services url protocols






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 15 at 16:35







Tim

















asked Feb 15 at 14:55









TimTim

27.6k78264480




27.6k78264480












  • Uh…you never enter such URL in web browser?

    – 炸鱼薯条德里克
    Feb 15 at 15:53











  • never. How do you do it?

    – Tim
    Feb 15 at 16:36











  • …By typing "ht tps://unix.stackexchange.com:443" in the browser? Stackexchange force me to use a space, just ignore that

    – 炸鱼薯条德里克
    Feb 16 at 3:29


















  • Uh…you never enter such URL in web browser?

    – 炸鱼薯条德里克
    Feb 15 at 15:53











  • never. How do you do it?

    – Tim
    Feb 15 at 16:36











  • …By typing "ht tps://unix.stackexchange.com:443" in the browser? Stackexchange force me to use a space, just ignore that

    – 炸鱼薯条德里克
    Feb 16 at 3:29

















Uh…you never enter such URL in web browser?

– 炸鱼薯条德里克
Feb 15 at 15:53





Uh…you never enter such URL in web browser?

– 炸鱼薯条德里克
Feb 15 at 15:53













never. How do you do it?

– Tim
Feb 15 at 16:36





never. How do you do it?

– Tim
Feb 15 at 16:36













…By typing "ht tps://unix.stackexchange.com:443" in the browser? Stackexchange force me to use a space, just ignore that

– 炸鱼薯条德里克
Feb 16 at 3:29






…By typing "ht tps://unix.stackexchange.com:443" in the browser? Stackexchange force me to use a space, just ignore that

– 炸鱼薯条德里克
Feb 16 at 3:29











2 Answers
2






active

oldest

votes


















1














Your question is unclear on what you will use these URLs for. Without knowing what they will be used for, we must assume they need to conform to the standard. If we start using URLs that don't meet the standard then something is likely to break.



RFC 3986 is the standard for URLs. And ...



  • it does NOT specify a protocol. However it does specify a scheme. Typically the scheme is used to specify the protocol. For example HTTP in http://example.com/blah.html.

  • it does NOT specify a service. However it does specify a numeric port. Usually this port number is sufficient to specify the service. That's because services are registered with IANA.

If you need to get round the lack of a service because a port number is insufficient, the most common thing I've seen is to define a unique scheme per protocol/port pair.






share|improve this answer
































    0














    Service name is an application level concept/service at OS level which is just translated to a port number. At the end of the day, it is just a name that is translated into a number.



    It is however, not allowed per RFC RFC 3986 § 3.2.3 (thanks @JdeBP), but you might get away using a service name in an URL, if a browser/application allows you to do that.



    Most parsers of the common URL/browser utilities will not allow you to do that (correctly).



    To illustrate the exception, as a curiosity, let's use a text-mode browser, lynx, it accepts an URL with a service name:



    lynx https://www.cnn.com:https


    or



    lynx http://www.sapo.pt:http


    It works, and ip appears to be browsing the corresponding sites correctly. Per the definition, the lynx utility/protocol is using TCP and won't pick up the service number UDP definition.






    share|improve this answer

























    • Psst! RFC 3986 § 3.2.3.

      – JdeBP
      Feb 15 at 15:31











    • @JdeBP yup and this answer breaks the RFC as predicted.

      – Philip Couling
      Feb 15 at 15:32











    • @JdeBP Yeah, I suspected that, corrected the wording. However service name it still a layer 7 concept on OS level at the end of the day.

      – Rui F Ribeiro
      Feb 15 at 16:05











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500892%2fcan-we-specify-service-name-and-transport-protocol-in-a-url%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Your question is unclear on what you will use these URLs for. Without knowing what they will be used for, we must assume they need to conform to the standard. If we start using URLs that don't meet the standard then something is likely to break.



    RFC 3986 is the standard for URLs. And ...



    • it does NOT specify a protocol. However it does specify a scheme. Typically the scheme is used to specify the protocol. For example HTTP in http://example.com/blah.html.

    • it does NOT specify a service. However it does specify a numeric port. Usually this port number is sufficient to specify the service. That's because services are registered with IANA.

    If you need to get round the lack of a service because a port number is insufficient, the most common thing I've seen is to define a unique scheme per protocol/port pair.






    share|improve this answer





























      1














      Your question is unclear on what you will use these URLs for. Without knowing what they will be used for, we must assume they need to conform to the standard. If we start using URLs that don't meet the standard then something is likely to break.



      RFC 3986 is the standard for URLs. And ...



      • it does NOT specify a protocol. However it does specify a scheme. Typically the scheme is used to specify the protocol. For example HTTP in http://example.com/blah.html.

      • it does NOT specify a service. However it does specify a numeric port. Usually this port number is sufficient to specify the service. That's because services are registered with IANA.

      If you need to get round the lack of a service because a port number is insufficient, the most common thing I've seen is to define a unique scheme per protocol/port pair.






      share|improve this answer



























        1












        1








        1







        Your question is unclear on what you will use these URLs for. Without knowing what they will be used for, we must assume they need to conform to the standard. If we start using URLs that don't meet the standard then something is likely to break.



        RFC 3986 is the standard for URLs. And ...



        • it does NOT specify a protocol. However it does specify a scheme. Typically the scheme is used to specify the protocol. For example HTTP in http://example.com/blah.html.

        • it does NOT specify a service. However it does specify a numeric port. Usually this port number is sufficient to specify the service. That's because services are registered with IANA.

        If you need to get round the lack of a service because a port number is insufficient, the most common thing I've seen is to define a unique scheme per protocol/port pair.






        share|improve this answer















        Your question is unclear on what you will use these URLs for. Without knowing what they will be used for, we must assume they need to conform to the standard. If we start using URLs that don't meet the standard then something is likely to break.



        RFC 3986 is the standard for URLs. And ...



        • it does NOT specify a protocol. However it does specify a scheme. Typically the scheme is used to specify the protocol. For example HTTP in http://example.com/blah.html.

        • it does NOT specify a service. However it does specify a numeric port. Usually this port number is sufficient to specify the service. That's because services are registered with IANA.

        If you need to get round the lack of a service because a port number is insufficient, the most common thing I've seen is to define a unique scheme per protocol/port pair.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 15 at 15:51

























        answered Feb 15 at 15:45









        Philip CoulingPhilip Couling

        1,694920




        1,694920























            0














            Service name is an application level concept/service at OS level which is just translated to a port number. At the end of the day, it is just a name that is translated into a number.



            It is however, not allowed per RFC RFC 3986 § 3.2.3 (thanks @JdeBP), but you might get away using a service name in an URL, if a browser/application allows you to do that.



            Most parsers of the common URL/browser utilities will not allow you to do that (correctly).



            To illustrate the exception, as a curiosity, let's use a text-mode browser, lynx, it accepts an URL with a service name:



            lynx https://www.cnn.com:https


            or



            lynx http://www.sapo.pt:http


            It works, and ip appears to be browsing the corresponding sites correctly. Per the definition, the lynx utility/protocol is using TCP and won't pick up the service number UDP definition.






            share|improve this answer

























            • Psst! RFC 3986 § 3.2.3.

              – JdeBP
              Feb 15 at 15:31











            • @JdeBP yup and this answer breaks the RFC as predicted.

              – Philip Couling
              Feb 15 at 15:32











            • @JdeBP Yeah, I suspected that, corrected the wording. However service name it still a layer 7 concept on OS level at the end of the day.

              – Rui F Ribeiro
              Feb 15 at 16:05
















            0














            Service name is an application level concept/service at OS level which is just translated to a port number. At the end of the day, it is just a name that is translated into a number.



            It is however, not allowed per RFC RFC 3986 § 3.2.3 (thanks @JdeBP), but you might get away using a service name in an URL, if a browser/application allows you to do that.



            Most parsers of the common URL/browser utilities will not allow you to do that (correctly).



            To illustrate the exception, as a curiosity, let's use a text-mode browser, lynx, it accepts an URL with a service name:



            lynx https://www.cnn.com:https


            or



            lynx http://www.sapo.pt:http


            It works, and ip appears to be browsing the corresponding sites correctly. Per the definition, the lynx utility/protocol is using TCP and won't pick up the service number UDP definition.






            share|improve this answer

























            • Psst! RFC 3986 § 3.2.3.

              – JdeBP
              Feb 15 at 15:31











            • @JdeBP yup and this answer breaks the RFC as predicted.

              – Philip Couling
              Feb 15 at 15:32











            • @JdeBP Yeah, I suspected that, corrected the wording. However service name it still a layer 7 concept on OS level at the end of the day.

              – Rui F Ribeiro
              Feb 15 at 16:05














            0












            0








            0







            Service name is an application level concept/service at OS level which is just translated to a port number. At the end of the day, it is just a name that is translated into a number.



            It is however, not allowed per RFC RFC 3986 § 3.2.3 (thanks @JdeBP), but you might get away using a service name in an URL, if a browser/application allows you to do that.



            Most parsers of the common URL/browser utilities will not allow you to do that (correctly).



            To illustrate the exception, as a curiosity, let's use a text-mode browser, lynx, it accepts an URL with a service name:



            lynx https://www.cnn.com:https


            or



            lynx http://www.sapo.pt:http


            It works, and ip appears to be browsing the corresponding sites correctly. Per the definition, the lynx utility/protocol is using TCP and won't pick up the service number UDP definition.






            share|improve this answer















            Service name is an application level concept/service at OS level which is just translated to a port number. At the end of the day, it is just a name that is translated into a number.



            It is however, not allowed per RFC RFC 3986 § 3.2.3 (thanks @JdeBP), but you might get away using a service name in an URL, if a browser/application allows you to do that.



            Most parsers of the common URL/browser utilities will not allow you to do that (correctly).



            To illustrate the exception, as a curiosity, let's use a text-mode browser, lynx, it accepts an URL with a service name:



            lynx https://www.cnn.com:https


            or



            lynx http://www.sapo.pt:http


            It works, and ip appears to be browsing the corresponding sites correctly. Per the definition, the lynx utility/protocol is using TCP and won't pick up the service number UDP definition.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 15 at 16:38

























            answered Feb 15 at 15:02









            Rui F RibeiroRui F Ribeiro

            41.4k1481140




            41.4k1481140












            • Psst! RFC 3986 § 3.2.3.

              – JdeBP
              Feb 15 at 15:31











            • @JdeBP yup and this answer breaks the RFC as predicted.

              – Philip Couling
              Feb 15 at 15:32











            • @JdeBP Yeah, I suspected that, corrected the wording. However service name it still a layer 7 concept on OS level at the end of the day.

              – Rui F Ribeiro
              Feb 15 at 16:05


















            • Psst! RFC 3986 § 3.2.3.

              – JdeBP
              Feb 15 at 15:31











            • @JdeBP yup and this answer breaks the RFC as predicted.

              – Philip Couling
              Feb 15 at 15:32











            • @JdeBP Yeah, I suspected that, corrected the wording. However service name it still a layer 7 concept on OS level at the end of the day.

              – Rui F Ribeiro
              Feb 15 at 16:05

















            Psst! RFC 3986 § 3.2.3.

            – JdeBP
            Feb 15 at 15:31





            Psst! RFC 3986 § 3.2.3.

            – JdeBP
            Feb 15 at 15:31













            @JdeBP yup and this answer breaks the RFC as predicted.

            – Philip Couling
            Feb 15 at 15:32





            @JdeBP yup and this answer breaks the RFC as predicted.

            – Philip Couling
            Feb 15 at 15:32













            @JdeBP Yeah, I suspected that, corrected the wording. However service name it still a layer 7 concept on OS level at the end of the day.

            – Rui F Ribeiro
            Feb 15 at 16:05






            @JdeBP Yeah, I suspected that, corrected the wording. However service name it still a layer 7 concept on OS level at the end of the day.

            – Rui F Ribeiro
            Feb 15 at 16:05


















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500892%2fcan-we-specify-service-name-and-transport-protocol-in-a-url%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)