http://www.360doc.com/content/11/0421/17/4154133_111328225.shtml
OSI has 7 layers application,presentation,session,transportation,network,data link and physical layer.
The last three is more related to network engineering,named as media layer, the rest of it costs more concern on users, named as host layer.
http protocol: application.(others like ftp,telnet)
tcp protocol: transportation.
ip protocol: network.
socket is the encapsulation of the tcp/ip protocol, but an API,through it, we can use tcp/ip.
1. tcp connection(through 3 times handshaking)
a. client --syn--server, status: SYN_SEND.
b. server get syn, ack client SYN, server--(syn+ack)--client, status:SYN_RECV
c. client get (syn+ack), client--ack--server, status:ESTABLISHED
after this the data begin transportation. To terminate needs 4 times handshaking.
2.http connection
Http is an application that is based on the TCP.
It's a short and allowed overlapped connection.
3.socket
a.basic operation unit. including five essential elements: the ip and port number of the client and server. as well as protocol.
b.the procedure. imagine through 1.a
4.socket and tcp connection.
what make the difference, in the actual transportation,socket can support UDP.
5
a.connection.
b.message.
c.request.
d.response
e.resource
f.entity
g.client
h.user agent
i.server
j.origin server
k.proxy
l.gateway
m.tunnel
n.cache