The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
66 views

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

asked in Computer Networks by Boss (16.1k points) | 66 views
0

In order to identify connection uniquely , port number is not sufficient , Two host chossen the same host

or IP address is also not sufficient because there is a chance that the  two host have same IP addresses  

, they can choose any port number inside the computer , it might so happen that , the number which they have choose is also 'X'

So we are not going to use Only prt number , Or only  IP address to identify the connection uniquely

therefore we combine both (IP + Port = Socket)

 

 

0

two IP choosen by the same host within a same network will be same

It will be Two port.

0
I want to say that

How to identify the the connection uniquely

two host can choose the same port number

or two host can have same IP address

therefore we can combine both (IP address + post = socket)
0
How this is possible two hosts with the same IP??

As I know IP address is globally unique??
0
two host can have same port number that's why we use IP + port number to uniquely indetify???
0

How this is possible two hosts with the same IP??

 How said ??

https://www.makeuseof.com/tag/whats-ip-conflict-resolve/

read it !

0

if you see in your image You have given same port (x) But different IP address IA and IB.

0
I'm just trying to explain the concept  with the help of diagram

that's Y I write down below the whole summary ....you can't visualize everything with this   diagram :p
0
According to you Ip address and port may be same. Then

How we will uniquely identify any network ???Then What's use of Socket ???
0
@Magma-Can we say that since TCP handles each client concurrently and has a incoming queue for each client to which it is connected, source port number is useful to identify to which service of source should the TCP server respond right?
0

yeah correct Ayush Upadhyaya

0

kumar.dilip

probability of occuring (same port no + same IP address ) of the two host at the same instant of time 

is very very very very very low :3

0
It is already told that TCP arrives in a host and now it is finding appropriate socket

So, it has no need to find destination IP again

right?
0
@srestha-But to direct it to correct socket, you need destination Ip because socket=IP+Port
0

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?

0

@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.

Please log in or register to answer this question.

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

42,625 questions
48,616 answers
155,897 comments
63,872 users