Computer network protocol basis

1, OSI seven-layer model

  Open Systems Interconnection Reference Model (Open System Interconnect referred to as OSI) is the OSI Reference Model International Organization for Standardization (ISO) and the International Telegraph and Telephone Consultative Committee (CCITT) jointly developed to provide a system for the interconnection information is open frame structure functions. Its purpose is to provide a common framework for the base and the standard heterogeneous computer connections and provides a common reference in order to maintain consistency and compatibility with standards. Open systems mentioned here, refers to the worth is to follow the OSI reference model and associated protocols enable computer system with various application purposes of interconnection.

  OSI uses a hierarchical structuring techniques, is divided into seven layers: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer

2, TCP / IP model

  OSI model is more complex and academic, so the TCP / IP model we actually use, is divided into four layers, link layer, network layer, transport layer, application layer. Correspondence between the two models as shown:

 

  Whatever the model, each layer of abstraction built on low-level services provided, and provides services to higher level.

3, TCP / IP protocol suite.

  Transmission Control Protocol / Internet Protocol short, the translation of the Transmission Control Protocol / Internet interconnection agreements, is the basic protocol of the Internet, basic Internet Internet by the TCP transport layer protocol IP protocol and network layers. Protocol uses a hierarchical structure of four layers. However, in many cases, it is the use of IP for group communication protocol collectively the lock must be used. That is, it is actually a family of protocols, by a number of protocols, and are in different layers, is the basis of the communication infrastructure of the Internet.

TCP / IP layer model concept

Features

TCP / IP protocol suite.

 

Application layer

File transfer, e-mail, file services, virtual terminal

TFTP,HTTP,SNMP,FTP,SMTPDMS,Telnet

Data formatting, code conversion, data encryption

No agreement

Lift or establish contact with other contacts

No agreement

Transport Layer

Provide end interface

TCP,UDP

     Network layer

Routing the data packet

IP,ICMP,RIP,OSPF,BGP,IGMP

 

 

 

Link layer

And a transmission frame has an error detection function address

SLIP,CSLIP,ARP,RARP,MTU

Transmitting data in a form of binary data on physical media

ISO2110,IEEE802,IEEEE802.2

4, TCP and UDP

  In the above table, the IP network protocol is TCP / IP protocol is very important. Responsible for data plus IP address (host has to send its address (same address) and accepted by its host address (destination address)) and other data to determine the target transmission.

       TCP and UDP protocols are the transport layer, the transport layer mainly provides end to end communication order for the application to the two hosts.

       But TCP and UDP are the most different places, TCP can provide a reliable data transmission service, TCP is a connection-oriented, that is to say, the two hosts using TCP communication manager of a process must first establish a connection, wait until the connection established after the start of transmission data, and the transfer is in a "positive acknowledgment with retransmission" technology to achieve transmission reliability. TCP also by way called "sliding window" flow control, will close the connection after the transmission is completed. Therefore, more reliable TCP than UDP.

       UDP (User Datagram Protocol short, the Chinese teacher User Datagram Protocol) is sent directly to the data, regardless of whether the other party is not acceptable, regardless of whether the other party to accept, and do not need to receive confirmation, are unreliable transport It may appear on the package phenomenon, programmers coding to verify the actual application requirements.

       Note: We are basically common network applications based on TCP and UDP, the two protocols will use IP protocol network protocol. But we can bypass the TCP and UDP, the direct use of IP, such as LINUX in LVS, or even direct access to the link layer, such as tcpdump program and link layer is to communicate directly.

 

 

 

  The figure above, a number of other terms of the agreement explanation,

  ICMP: Control Message Protocol

  IGMPA: internet group management protocol

  ARP: ARP

  RARP: Reverse Address Resolution Protocol

5, address and port number

  我们常说MAC地址和IP地址。MAC地址及以his媒体介入层上使用的地址,也叫物理地址、硬件地址或链路地址,有网络设备制造商生产是写在硬件内部。MAC地址与网络无关,也即无论将带有这个地址的硬件(如网卡。集线器、路由器等)接入到网络的何处,都有相同的MAC地址,他有厂商写在网卡的BIOS里,理论上讲,除非盗来硬件,否则是没有办法毛宁顶替的。

       IP地址后来用来识别TCP/IP网络中互联的额主机和路由器。IP地址基于逻辑,比较灵活,不受硬件限制,也容易记忆。

       在传输层也有这种类似于地址的概念,那就是端口号。端口号用来识别同一台计算机中进行通信的不同应用程序。因此,它也被称为程序地址。

       一台计算机上同时可以运行多个程序。传输层协议正式利用这些端口识别本机正在进行通信的应用程序,并准确的将数据传输。

6、端口号的确定

  标准既定的端口号:这种方法也叫静态方法。她是值每个应用程序都有其指定的端口号。但并不是说可以随便使用任何一个端口号。例如HTTP、FTP、TELNET等广为使用的应用协议中所使用的端口号就是固定的。这些端口号被称为知名端口号,分布在0~1023之间;除了知名端口号外,还有一些端口号被正式之策,它们分布在1024~49151之间,不过这些端口号可用于任何通信用途。

       时序分配法:服务器有必要确定监听端号,但是接受服务的客户端没必要确定端口号。在这种方法下,客户端应用程序完全可以不用自己设置端口号,而全权交给操作系统进行分配。动态分配的端口号范围在49152~65535之间。

7、端口号和协议

  端口号由其使用的传输层协议决定。因此,不同的传输层协议可以使用相同的端口号。

       此外,哪些知名的端口号豫传输层协议并无关系。只要端口一直都将分配同一种应用程序进行处理。

Guess you like

Origin www.cnblogs.com/houqx/p/12100546.html