About client port allocation
i am wondering whether libtpa may alloc the same client port with kernel stack , then libtpa and kernel stack use the same client port to communicate with different server, can this work well ?
i find libtpa use bind to solve server port allocation, so how to deal with client side..
i find libtpa use bind to solve server port allocation, so how to deal with client side..
It works the same for active connections. Once an ephemeral is taken by one TPA application, no other applications (including TPA and Linux apps) could use it.
i find libtpa use bind to solve server port allocation, so how to deal with client side..
It works the same for active connections. Once an ephemeral is taken by one TPA application, no other applications (including TPA and Linux apps) could use it.
Can u show more details, if tpa uses port 12345 on client side, how kernel stack know that, does tpa use syscalls to tell kernel?
Yes, as said earlier, Libtpa uses the bind() API to reserve one specific port for one Libtpa instance. Once a port is occupied by a Libtpa instance, no other Libtpa instances would be allowed to use it (the bind would fail). Meanwhile, Linux kernel also will not use it for ephemeral port.
Just said, it works the same for both active and passive connections in Libtpa.
In addition, you might want to check the arch figure. You will see that, for client connections, a range of ports are reserved for each Libtpa worker thread. Again, the reservation is done by the bind() syscall.