Can a port use multiple interfaces for communication?
Clash 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?)?
linux networking tcpdump
add a comment |Â
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?)?
linux networking tcpdump
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
add a comment |Â
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?)?
linux networking tcpdump
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?)?
linux networking tcpdump
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
add a comment |Â
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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered May 18 at 9:19
ilkkachu
48.1k669133
48.1k669133
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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