For example I enter this address: 192.168.4.5:9300 into the browser then all of this DATA is passed to Transport Layer in binary
It is not passed as a single binary blob, however. The interface between layers is not limited to that – it is defined in terms of various functions (or 'primitives' as OSI calls them) that the lower layer provides to the upper layer, and those can be specified to take any number of parameters, not necessarily just 'binary data'.
For example, ITU-T X.214 aka ISO 8072 (which is the OSI "Transport Service" definition) specifies that the Transport layer should provide the function T-CONNECT(src_address, dst_address, [etc], user_data)
in addition to T-DATA(user_data)
.
(Though OSI service definitions were not written for TCP/IP – e.g. the "Transport" layer actually describes the competing OSI TP0-TP4 protocols, but they're overall similar to Internet's TCP in function.)
Similarly, RFC 9293 (the TCP/IP specification), specifically section 3.9.1 "User/TCP interface", defines an OPEN (local port, remote socket, active/passive, [etc])
function in addition to SEND (...)
.
In practice this is usually implemented in the "BSD sockets" style, where the browser creates a socket, calls connect(<address, port>)
on the socket (requesting TCP to perform the handshake) and then each send()
references the already established socket handle.
In other words, the address and port are specified as separate fields, so there is nothing that the Transport Layer (or any lower layer, for that matter) needs to extract.
(These fields become a single data blob once they leave their corresponding layer – e.g. the TCP port number is passed from application to TCP as a separate field, but becomes part of 'data' once it is passed from TCP to the lower (internetwork) layer. Likewise, the IP address is passed as a separate field all the way down to IP, only becoming part of the binary data (IP header) once the whole thing is given to the data-link / local-network layer.)