1. Network Reference Model
OSI Reference Model TCP/IP Reference Model
2. Seven Floor Brief
1) Physical layer: The main definition of physical equipment standards, such as the interface type of network cable, the transfer rate of various transmission media. The main function is to transmit the bit stream (that is, 1, 0 is converted to the current strength to carry out transmission, to the destination and then converted to 1, 0, that is, often said the digital and analog-to-digital conversion). The data for this layer is called bit (bit), the main device: hub
2) Data Link layer: The main data received from the physical layer of the MAC address packaging and unpacking. This layer of data is often called frames, the main equipment: network cards, switches
3) Network layer: Select the appropriate inter-network routing and switching nodes, to ensure that the data in a timely manner, the data received from the lower layer of IP address encapsulation and encapsulation. This layer of data is often called a packet, the main device: the router.
4) Transport Layer: Defines a number of transmission data protocols and ports, such as TCP, UDP protocol, mainly from the lower level of data received from the segment and transmission, to the destination address and then re-reorganization, the layer of data used to be called a segment.
5) Session Layer: The data transmission path is established through the transport layer. Initiate a session between systems or accept session requests (devices need to know each other)
6) Presentation layer: The main is to carry out the interpretation of the received data, compression and decompression, that is, the computer can recognize something to transform what adults can recognize (film, sound, etc.)
7) Application layer: mainly some terminal applications, such as FTP (various file download), browser, QQ, etc., it can be understood as a computer screen can see things, that is, terminal applications.
3. Contact
The TCP/IP reference model is a simplified version of the OSI Reference Model and is simplified into 4 layers.
4. TCP/IP protocol
Network protocol is the network/Internet transmission, management information of some specifications. As people communicate with each other in order to follow certain rules, the communication between computers needs to abide by a certain rule, these rules are called network protocols.
TCP/IP protocol is the basis of the network, is the language of the Internet, it can be said that there is no TCP/IP protocol today's Internet.
IP is the network layer, TCP is the transport layer, and UDP is the transport layer.
5.TCP & UDP
TCP (Transmission Control Protocol)
Establish a connection to form a channel for transmitting data
Large data transfer in a connection (unlimited size)
Complete connection via three handshake, reliable protocol, secure delivery
The connection must be established and the efficiency will be slightly lower
UDP (User Datagram Protocol)
Encapsulates data and sources and purposes into packets without establishing a connection
Limit the size of each datagram within 64K
Because there is no connection, it is an unreliable protocol
No need to establish connection, fast speed
6. Network communication elements
1) IP address (only for network devices):
Marking of devices in the network
Not easy to remember, you can use host name
Local loopback address: 127.0.0.1 host name: localhost
2) port number (locator)
The logical address used to mark the process, and the marking of the different processes
Valid ports: 0~65535, where 0~1024 is used by the system or reserved ports, do not use ports below 1024 in development
3) Transfer Protocol (how to interact with it)
Rules of Communication
Common protocols: TCP, UDP
4) URL (Uniform Resource location) http://ip:80/file path
5) HTTP is the data Transfer format protocol, TCP is the data transfer method, TCP is equivalent to mailing envelopes or phone calls, HTTP equivalent to the letter or telephone is English or Mandarin communication.
Use Telnet to see if the service is turned on. such as Telnet 127.0.0.1 8888
Once you have finished this knowledge, you can begin to look at the socket knowledge:
IOS Socket 02-socket Basics
IOS Socket 01-Network Protocol Basics