Obviously, if it is not connected directly to the network, it cannot obtain the IP address itself (this would be impractical if it could). If there is an IP address assigned to it, it must be located on the host machine, routing packets to the smart card.
Or, since the standard states in the JCRE 3.0.1 specification of the connected version are:
Implementation of the Java Card Platform is not required to support TCP / IP or UDP / IP on the card. Connections via HTTP, HTTPS, and TLS and datagrams over the UDP protocol MAY be supported over IP as well as non-IP protocols, using a gateway on a terminal or hosting. The TLS protocol MUST be supported on the card.
But also:
Applications MUST NOT know that a non-IP protocol is being used.
Thus, basically the host will receive the TCP / IP stream and convert it into packets with respect to the card.
source share