Can a port use multiple interfaces for communication?

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











up vote
2
down vote

favorite












My understanding of the following command:



tcpdump -i any -nn port X


  • tcpdump -> Start service to capture packets.


  • -i any -> On any/all interface(s).


  • -nn -> Don't convert host addresses to names (Avoid DNS lookup) and
    don't convert protocols and port numbers either.


  • port X -> Apply this
    rule to port X


Assuming the above is correct, I feel this command implies that port (logical endpoint for process) X could be using any interface available to it in order to communicate with another process/device etc... and this tcp dump is going to capture all packets across all these available interfaces.



Is there some way I can view a list of all available interfaces available for a given port (command?)?







share|improve this question





















  • I don't know what you are asking for. A port (TCP/UDP) ist not the criterion to choose a specific interface. You can have any port on any interface.
    – Winnie Tigger
    May 18 at 9:13










  • @Winnie Tigger thanks. The problem probably stems from the fact that I am a Linux newbie, so I am a little hazy with such concepts. In the hope of increasing clarity; Some process (Pc) gets bound to some port (Pt). Pc depends on some protocol (Pr) to achieve it's task. Assuming Pc depends on Pr=TCP, how does the OS know which interfaces are available to the process? If the OS/Kernal has a list of these interfaces, is there a command I can execute so that I can see all interfaces available to all ports, can I can choose when writing a program which interface will be used for communication?
    – MarkMark
    May 18 at 9:24














up vote
2
down vote

favorite












My understanding of the following command:



tcpdump -i any -nn port X


  • tcpdump -> Start service to capture packets.


  • -i any -> On any/all interface(s).


  • -nn -> Don't convert host addresses to names (Avoid DNS lookup) and
    don't convert protocols and port numbers either.


  • port X -> Apply this
    rule to port X


Assuming the above is correct, I feel this command implies that port (logical endpoint for process) X could be using any interface available to it in order to communicate with another process/device etc... and this tcp dump is going to capture all packets across all these available interfaces.



Is there some way I can view a list of all available interfaces available for a given port (command?)?







share|improve this question





















  • I don't know what you are asking for. A port (TCP/UDP) ist not the criterion to choose a specific interface. You can have any port on any interface.
    – Winnie Tigger
    May 18 at 9:13










  • @Winnie Tigger thanks. The problem probably stems from the fact that I am a Linux newbie, so I am a little hazy with such concepts. In the hope of increasing clarity; Some process (Pc) gets bound to some port (Pt). Pc depends on some protocol (Pr) to achieve it's task. Assuming Pc depends on Pr=TCP, how does the OS know which interfaces are available to the process? If the OS/Kernal has a list of these interfaces, is there a command I can execute so that I can see all interfaces available to all ports, can I can choose when writing a program which interface will be used for communication?
    – MarkMark
    May 18 at 9:24












up vote
2
down vote

favorite









up vote
2
down vote

favorite











My understanding of the following command:



tcpdump -i any -nn port X


  • tcpdump -> Start service to capture packets.


  • -i any -> On any/all interface(s).


  • -nn -> Don't convert host addresses to names (Avoid DNS lookup) and
    don't convert protocols and port numbers either.


  • port X -> Apply this
    rule to port X


Assuming the above is correct, I feel this command implies that port (logical endpoint for process) X could be using any interface available to it in order to communicate with another process/device etc... and this tcp dump is going to capture all packets across all these available interfaces.



Is there some way I can view a list of all available interfaces available for a given port (command?)?







share|improve this question













My understanding of the following command:



tcpdump -i any -nn port X


  • tcpdump -> Start service to capture packets.


  • -i any -> On any/all interface(s).


  • -nn -> Don't convert host addresses to names (Avoid DNS lookup) and
    don't convert protocols and port numbers either.


  • port X -> Apply this
    rule to port X


Assuming the above is correct, I feel this command implies that port (logical endpoint for process) X could be using any interface available to it in order to communicate with another process/device etc... and this tcp dump is going to capture all packets across all these available interfaces.



Is there some way I can view a list of all available interfaces available for a given port (command?)?









share|improve this question












share|improve this question




share|improve this question








edited May 18 at 9:05









ilkkachu

48.1k669133




48.1k669133









asked May 18 at 8:56









MarkMark

9917




9917











  • I don't know what you are asking for. A port (TCP/UDP) ist not the criterion to choose a specific interface. You can have any port on any interface.
    – Winnie Tigger
    May 18 at 9:13










  • @Winnie Tigger thanks. The problem probably stems from the fact that I am a Linux newbie, so I am a little hazy with such concepts. In the hope of increasing clarity; Some process (Pc) gets bound to some port (Pt). Pc depends on some protocol (Pr) to achieve it's task. Assuming Pc depends on Pr=TCP, how does the OS know which interfaces are available to the process? If the OS/Kernal has a list of these interfaces, is there a command I can execute so that I can see all interfaces available to all ports, can I can choose when writing a program which interface will be used for communication?
    – MarkMark
    May 18 at 9:24
















  • I don't know what you are asking for. A port (TCP/UDP) ist not the criterion to choose a specific interface. You can have any port on any interface.
    – Winnie Tigger
    May 18 at 9:13










  • @Winnie Tigger thanks. The problem probably stems from the fact that I am a Linux newbie, so I am a little hazy with such concepts. In the hope of increasing clarity; Some process (Pc) gets bound to some port (Pt). Pc depends on some protocol (Pr) to achieve it's task. Assuming Pc depends on Pr=TCP, how does the OS know which interfaces are available to the process? If the OS/Kernal has a list of these interfaces, is there a command I can execute so that I can see all interfaces available to all ports, can I can choose when writing a program which interface will be used for communication?
    – MarkMark
    May 18 at 9:24















I don't know what you are asking for. A port (TCP/UDP) ist not the criterion to choose a specific interface. You can have any port on any interface.
– Winnie Tigger
May 18 at 9:13




I don't know what you are asking for. A port (TCP/UDP) ist not the criterion to choose a specific interface. You can have any port on any interface.
– Winnie Tigger
May 18 at 9:13












@Winnie Tigger thanks. The problem probably stems from the fact that I am a Linux newbie, so I am a little hazy with such concepts. In the hope of increasing clarity; Some process (Pc) gets bound to some port (Pt). Pc depends on some protocol (Pr) to achieve it's task. Assuming Pc depends on Pr=TCP, how does the OS know which interfaces are available to the process? If the OS/Kernal has a list of these interfaces, is there a command I can execute so that I can see all interfaces available to all ports, can I can choose when writing a program which interface will be used for communication?
– MarkMark
May 18 at 9:24




@Winnie Tigger thanks. The problem probably stems from the fact that I am a Linux newbie, so I am a little hazy with such concepts. In the hope of increasing clarity; Some process (Pc) gets bound to some port (Pt). Pc depends on some protocol (Pr) to achieve it's task. Assuming Pc depends on Pr=TCP, how does the OS know which interfaces are available to the process? If the OS/Kernal has a list of these interfaces, is there a command I can execute so that I can see all interfaces available to all ports, can I can choose when writing a program which interface will be used for communication?
– MarkMark
May 18 at 9:24










1 Answer
1






active

oldest

votes

















up vote
4
down vote



accepted










The port numbers are a part of the TCP and UDP packet headers, and the port number used is pretty much orthogonal to the physical interface used to communicate. (On the other hand, interfaces are usually tied to IP addresses, but that's not really necessary either.)



An application can bind to a single IP address / interface, and then you can end up with two applications bound to different IP addresses, using the same port number. Or, a single application can bind to different interfaces separately, and use the same port number on all of them. Or use different ones. Port numbers and interfaces exist on different layers, so there's no restriction on what ports can be used on a particular interface.



Also note that both TCP and UDP have port numbers between 1 (0) and 65535, but the number spaces are distinct. An application can use TCP port 1234, while another uses UDP port 1234.




About the terminology, saying that a port "uses" an interface, or that an interface is "available" to a particular port doesn't make much sense. Port numbers are just identifiers, they don't "do" anything.



Though your last sentence also seems to conflate ports with commands, which is a bit inaccurate. Many applications have a well-known port (SSH uses TCP/22, HTTP uses TCP/80, etc.), but there's nothing to enforce that: you could run an SSH server on port 2222, and something completely different on port 22.






share|improve this answer





















    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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f444542%2fcan-a-port-use-multiple-interfaces-for-communication%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted










    The port numbers are a part of the TCP and UDP packet headers, and the port number used is pretty much orthogonal to the physical interface used to communicate. (On the other hand, interfaces are usually tied to IP addresses, but that's not really necessary either.)



    An application can bind to a single IP address / interface, and then you can end up with two applications bound to different IP addresses, using the same port number. Or, a single application can bind to different interfaces separately, and use the same port number on all of them. Or use different ones. Port numbers and interfaces exist on different layers, so there's no restriction on what ports can be used on a particular interface.



    Also note that both TCP and UDP have port numbers between 1 (0) and 65535, but the number spaces are distinct. An application can use TCP port 1234, while another uses UDP port 1234.




    About the terminology, saying that a port "uses" an interface, or that an interface is "available" to a particular port doesn't make much sense. Port numbers are just identifiers, they don't "do" anything.



    Though your last sentence also seems to conflate ports with commands, which is a bit inaccurate. Many applications have a well-known port (SSH uses TCP/22, HTTP uses TCP/80, etc.), but there's nothing to enforce that: you could run an SSH server on port 2222, and something completely different on port 22.






    share|improve this answer

























      up vote
      4
      down vote



      accepted










      The port numbers are a part of the TCP and UDP packet headers, and the port number used is pretty much orthogonal to the physical interface used to communicate. (On the other hand, interfaces are usually tied to IP addresses, but that's not really necessary either.)



      An application can bind to a single IP address / interface, and then you can end up with two applications bound to different IP addresses, using the same port number. Or, a single application can bind to different interfaces separately, and use the same port number on all of them. Or use different ones. Port numbers and interfaces exist on different layers, so there's no restriction on what ports can be used on a particular interface.



      Also note that both TCP and UDP have port numbers between 1 (0) and 65535, but the number spaces are distinct. An application can use TCP port 1234, while another uses UDP port 1234.




      About the terminology, saying that a port "uses" an interface, or that an interface is "available" to a particular port doesn't make much sense. Port numbers are just identifiers, they don't "do" anything.



      Though your last sentence also seems to conflate ports with commands, which is a bit inaccurate. Many applications have a well-known port (SSH uses TCP/22, HTTP uses TCP/80, etc.), but there's nothing to enforce that: you could run an SSH server on port 2222, and something completely different on port 22.






      share|improve this answer























        up vote
        4
        down vote



        accepted







        up vote
        4
        down vote



        accepted






        The port numbers are a part of the TCP and UDP packet headers, and the port number used is pretty much orthogonal to the physical interface used to communicate. (On the other hand, interfaces are usually tied to IP addresses, but that's not really necessary either.)



        An application can bind to a single IP address / interface, and then you can end up with two applications bound to different IP addresses, using the same port number. Or, a single application can bind to different interfaces separately, and use the same port number on all of them. Or use different ones. Port numbers and interfaces exist on different layers, so there's no restriction on what ports can be used on a particular interface.



        Also note that both TCP and UDP have port numbers between 1 (0) and 65535, but the number spaces are distinct. An application can use TCP port 1234, while another uses UDP port 1234.




        About the terminology, saying that a port "uses" an interface, or that an interface is "available" to a particular port doesn't make much sense. Port numbers are just identifiers, they don't "do" anything.



        Though your last sentence also seems to conflate ports with commands, which is a bit inaccurate. Many applications have a well-known port (SSH uses TCP/22, HTTP uses TCP/80, etc.), but there's nothing to enforce that: you could run an SSH server on port 2222, and something completely different on port 22.






        share|improve this answer













        The port numbers are a part of the TCP and UDP packet headers, and the port number used is pretty much orthogonal to the physical interface used to communicate. (On the other hand, interfaces are usually tied to IP addresses, but that's not really necessary either.)



        An application can bind to a single IP address / interface, and then you can end up with two applications bound to different IP addresses, using the same port number. Or, a single application can bind to different interfaces separately, and use the same port number on all of them. Or use different ones. Port numbers and interfaces exist on different layers, so there's no restriction on what ports can be used on a particular interface.



        Also note that both TCP and UDP have port numbers between 1 (0) and 65535, but the number spaces are distinct. An application can use TCP port 1234, while another uses UDP port 1234.




        About the terminology, saying that a port "uses" an interface, or that an interface is "available" to a particular port doesn't make much sense. Port numbers are just identifiers, they don't "do" anything.



        Though your last sentence also seems to conflate ports with commands, which is a bit inaccurate. Many applications have a well-known port (SSH uses TCP/22, HTTP uses TCP/80, etc.), but there's nothing to enforce that: you could run an SSH server on port 2222, and something completely different on port 22.







        share|improve this answer













        share|improve this answer



        share|improve this answer











        answered May 18 at 9:19









        ilkkachu

        48.1k669133




        48.1k669133






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f444542%2fcan-a-port-use-multiple-interfaces-for-communication%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?