i know port numbers used identifying different processes running on server, multiple processes can use same networking resources. how work internally?
for example, if request website http://www.my-awesome-website.com:80
reaches server, how server know there web server running on port 80? mean, request pipeline between getting request finding out web server running on port 80 , forwarding request web server?
after opening socket(which open file used network communications), user of socket may use directly ephemeral port(selected os), typical if application client application.
what server processes call bind()
socket api call set port socket, , call listen()
in case of tcp socket start listening incoming connection requests.
because of bind()
call os know particular socket 1 receiving data sent particular port number.
the packets sent on network contain source , destination ip addresses source , destination ports:
http://www.techrepublic.com/article/exploring-the-anatomy-of-a-data-packet/
so os has data structure open sockets listed port numbers , pass received data correct socket's input buffer. sent data marked port number of sending socket.
Comments
Post a Comment