I searched on google and it only gave me limited information on the differences. I need to know what are also the components on the two encapsulations. Not much information on IP packets except just packets.
OSI Model – Difference Between NIC Frame and IP Packet
osi
Related Solutions
You should search for the OSI model:
A full explanation of the OSI model is too broad to give here, but applications like browsers and web servers use the transport layer to communicate with each other, not the network layer where IP addresses are.
What you are missing is that HTTP uses TCP as the transport protocol. By default HTTP servers listen on TCP port 80. A host using a browser will use a random, ephemeral, TCP port as its source port. NAT will do something similar for each host for which it translates the IP address, and it keeps track of which port is assigned to which host in a traffic flow. It ends up being a combination of layer-3 address (e.g. IP address), transport protocol (e.g. TCP), and layer-4 address (e.g. TCP port) for what gets used as a unique identifier.
First a word about:
I understand word persistent as following : no one else can occupy wire at the time of persistent connection. So this connection is only one-to-one. But this is not right. Persistent connection can be established while other packets are going through the same wire.
This is circuit-switched network vs packet-switching network
circuit-switched network
In such networks, a physical dedicated line is established between the two hosts who wants to communicate.
The better example is the first phone networks where human operators manually connect two phone lines to establish communications on request.
Latter human operators where replaced with mechanisms. The enterprise internal version of such mechanism is known as "PBX" (Private Branch eXchange).
In this case you actually have a physical connection that is maintained and nobody else can use any of the circuit during that time.
packet-switching network
IP networks are packet-switched networks. As you said many packets from several applications can flow on the wire at the same time, and for a single conversation, different packets can take different routes.
This allow better utilization of the link and more robust design (of course it has some drawbacks).
So at the IP layer there's no "connection" nor "session" established.
There's an emerging trend to identify flows and apply specific switching and / or routing rules to them, and a flow can for example correspond to a TCP session but this is not what we usually refer to when speaking about connection / session.
Connection
IP provide two main protocols (among others) to establish communication between two hosts : UDP and TCP.
UDP is connection-less. That means (quoted from Wikipedia) that "a message can be sent from one end point to another without prior arrangement. The device at one end of the communication transmits data addressed to the other, without first ensuring that the recipient is available and ready to receive the data".
TCP is connection-oriented. Before actually transmitting date, the two hosts talk to each other to check that they are both available and agree to exchange some kind of data (think of the preamble of a typical phone call). This connection is maintained until one host signal that it want to end it or after some time has passed without exchanging any data.
A VPN connection usually work the same way. Two hosts exchange some information (including which encryption protocol to use, some cryptography keys and user authentication mechanism etc...) and if bot agree on the terms, a connection is established and maintain. Usually some keep-alive packets are sent at regular interval to say "I'm still here, don't drop the connection".
Session
Sessions are established by applications. A session can correspond to a single TCP connection, but a session can use several different TCP connection or use UDP as the transport protocol.
A HTTP(s) session for example may use cookies to identify the user and can provide access to different resources (think about web banking).
A Voice Over IP (VOIP) phone call will use the SIP protocol. SIP means "Session Initiation Protocol" and it can run over UDP.
The exact mechanism of establishing / maintaining / closing a session depends on the applications used.
Best Answer
Dear you must know that there is no thing called NIC frames because NIC is OSI layer 1 device such like hubs and cables so it simple generate bits (0s and 1s) , each OSI layer generate different type of Data called protocol data unit PDU and special device can understand it as next
Where each layer adds its header on the previous PDU and generates its own PDU in the encapsulation process and vise versa in the decapsulation process
For example during the encapsulation process L5 (Data) encapsulated in L4 header and generate new PDU called Segment and during the decapsulation process L4 segment header will be striped off to get Data from it as the next
now we can answer your question , each Layer add functional header to the previous layer for example L3 will add header indicate source and distination L3 address (IPs) or some times called logical address and other informations provide end to end delivery insurance and so on as next