Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Yesterday i have captured some frames using ethereal... I have noticed that my http requests have the port 32778 ... I wan to know why the client does not use the 80 port and use another one...
Thx
Were you looking at the source or destination port? The destination port from a client will normally be port 80, but it doesn't have to be. If you've followed a link it could potentially send you to another port. If you are looking at the source port on your client, this will be a variable high value, normally starting from 1024 and working upwards, its quite possible for it to be using this as a source port.
I am talking about the source port. I cannot understand why it is not the same as the destination... Some application use the same port for client and the server but some other does not (ex. apache) Why?
One of the functions of the TCP/UDP layer where ports are used, is to multiplex multiple connections from a single host onto the same destination/source ip addresses. Obviously it is possible to open more than one HTTP session from your PC to a web host. So for each session you have the same source/destination IP pair. So how does the IP stack know which packets go with which session? It does this by using different port numbers.
Now obviously you can't easily go changing the destination port as this identifies to the server which service you want. Hence the term "well known ports" - 23 = telnet, 80 = HTTP, 69 = tftp etc. So to make each session unique the client creates a source port unique to the session so that the source IP and port number taken together, collectively known as a 'socket', uniquely identifies the session.
Where you have a function that does not have multiple potential sessions to the same end-point you tend to have the source and destination ports the same. So for instance RIP uses a source and destination port of 520, because what it sends is an IP and MAC layer broadcast and the information will only ever be sent once from each host so why bother allowing for multiple sessions when there won't ever be multiple sessions?
Its really just a case of each protocol following different design principles to best perform their function without over complicating things.
If you want more in depth info on this, google for 'user datagram protocol rfc', you'll get more info on this than you could ever want!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.