When a TCP segment arrives at a host, in order to direct it to the appropriate socket, the operating system's network stack uses which of the following?
(a)Transport protocol number
(b)Destination IP Address
(c)Source port number
(d)Destination port number
(e)Destination MAC Address
Answer is given to be a,b,c,d.
I understand why a,b and d are needed. Why source port number is needed?
Document Ref:
https://gateoverflow.in/?qa=blob&qa_blobid=8025344419025703520
check this
If the URGENT flag is set, segments sent to the destination TCP will have the urgent pointer set. The receiving TCP will signal the urgent condition to the receiving process if the urgent pointer indicates that data preceding the urgent pointer has not been consumed by the receiving process. The purpose of urgent is to stimulate the receiver to process the urgent data and to indicate to the receiver when all the currently known urgent data has been received. The number of times the sending user's TCP signals urgent will not necessarily be equal to the number of times the receiving user will be notified of the presence of urgent data. If no foreign socket was specified in the OPEN, but the connection is established (e.g., because a LISTENing connection has become specific due to a foreign segment arriving for the local socket), then the designated buffer is sent to the implied foreign socket. Users who make use of OPEN with an unspecified foreign socket can make use of SEND without ever explicitly knowing the foreign socket address. However, if a SEND is attempted before the foreign socket becomes specified, an error will be returned. Users can use the STATUS call to determine the status of the connection. In some implementations the TCP may notify the user when an unspecified socket is bound.
chk pg 46 https://tools.ietf.org/html/rfc793
Socket only need connections, not addresses
right?
@srestha-TCP supports concurrent connections. In case multiple connections are open from a single server, source IP is needed to identify which source is being served by which child process so that the incoming segment goes into the respective queue of the server.
64.3k questions
77.9k answers
244k comments
80.0k users