Using the classical TCP/IP layers model, I am thinking about an application (for example a browser) acting as a client wanting to talk with a server (e.g. a web server). Of course it has to use the server's IP address to locate the server host in Internet. So my Application layer process (browser) knows the IP address of the destination (e.g. it received it from a DNS query).
In order to have this request processed, the browser passes it to the Transport layer and more precisely to a TCP process. My problem is that in a TCP segment there is no field for IP addresses, neither of destination, neither of source. Transport layer processes uses port as a way to address source and destination. When the segment is passed to the underlying layer and becomes an IP packet, here the IP addresses (both of destination and source) come back again. It seems magical!
This IP disappearing and reappearing two layers below is exactly what I am trying to understand. Is there some kind of breach of the layer structure that allows this information to seep down across the TCP layer? Or I am not understanding something very important?