Simple understanding of computer communication

Source: Internet
Author: User

Simple understanding of computer communication

Write in front:

When the computer just appears, can only perform some arithmetic processing in the machine, want to transfer data from one computer to another computer, need to transfer through external storage media, such as tape, floppy disk. And the advent of network technology, so that the computer can be through some transmission media (network cable, fiber, etc.), to achieve rapid data transmission and information interaction. Now that the network is everywhere, how exactly does the computer communicate? The following is a simple understanding of the communication process between computers through some basic network knowledge.

Network communication model:

The network communication model is a conceptual model and framework designed to interconnect a wide range of computers to a network worldwide. With the OSI seven layer model and the TCP/IP four layer model, most of the network traffic is now based on the TCP/IP four layer model. Their corresponding levels are as follows:

OSI seven-layer model and TCP/IP four-tier model

OSI has seven layers: from top to bottom, the application layer, the presentation layer, the session layer, the Transport layer, the network layer, the data link layer, the physical layer

TCP/IP has four layers: from top to bottom, the application layer, the transport layer, the Interconnect layer (network layer), the Network interface layer (link layer).

Because of most of the current TCP/IP models, we use TCP/IP as an example to understand the communication between the two computers, which is the transmission process of the data:

Process of data transfer between computers

Data encapsulation:

In the detailed understanding of TCP/IP each layer of the respective role, the first to understand the concept of data encapsulation, the data in the network interface before transmission, will pass through layers of packaging, each layer will be on the basis of the previous add their own information, in the transmission to the other computer, and will be layered after the package to obtain the final data. The process is as follows:

Data encapsulation and encapsulation process

TCP/IP Reference Model:

The TCP/IP reference model is an abstract layered model in which all TCP/IP series network protocols are categorized into 4 abstract "layers". Each abstraction layer is created on the service provided on the lower tier and serves the upper tier. Accomplishing certain tasks requires a multitude of protocols that are distributed across different layers of the reference model and are sometimes called a protocol stack.

  Application layer (Application layer): This layer includes all protocols that work together with applications that leverage the underlying network to exchange application-specific data. The application layer is the layer that most ordinary network-related programs use to communicate with other programs over the network. The processing of this layer is unique to the application, and the data is transmitted from a network-related program in a format used internally by this application and then encoded into the standard protocol format.

Common application-layer protocols are HTTP, FTP, DNS, SNMP( UDP-based)

  Transport Layer (Transport layer): provides end-to-end communications primarily for applications on two hosts, including the TCP protocol (Transmission Control Protocol) and UDP(User datagram protocols).

The port number is provided by this layer and is unique on a single computer.

UDP provides a very simple service for the application layer. It only sends packets called datagrams from one host to another, but does not guarantee that the datagram will reach the other end. Any required reliability must be provided by the application layer.

TCP provides high-reliability data communication for two hosts. The work it does involves putting the data that the application gives to it into the appropriate small pieces to the following network layer, confirming the received packet, setting the timeout clock to send the last acknowledgment packet, etc., because the transport layer provides high-reliability end-to-end communication, so the application layer can ignore all these details.

Because TCP is a connection-oriented protocol, two applications that use TCP must first establish a TCP connection, known as the TCP three handshake, before exchanging data with each other, as shown in:

To establish a connection protocol process: (TCP three-time handshake protocol)1) The client sends a SYN segment indicating the port of the server to which the customer intends to connect, and the initial sequence number (ISN). 2) The server sends back the SYN message segment that contains the initial sequence number of the server as a reply. At the same time, the confirmation number is set to customer's ISN plus 1 to confirm the customer's SYN message segment. A SYN occupies an ordinal number. 3) The customer will confirm that the serial number is set to the server's ISN plus 1 to confirm the SYN message segment of the server.

  Network layer (Internet layers): handles the grouping of activities in a network. The network layer protocol includes the IP protocol (Internet Protocol), theicpm (Internet Control Message Protocol), and the IGMP protocol (Internet Group Management Protocol), where the IP protocol body is tcp/ The most important protocol in the IP protocol cluster. IP provides an unreliable, non-connected packet delivery service.

  IP Address:

Talking about IP protocol should talk about IP address, IP address is assigned to the network using IP Protocol device digital label, there are two categories of IPv4 and IPV6, we are currently using the majority of the IPV4 address, hereinafter referred to as the IP address, IP address is composed of 32-bit binary number, for ease of use, Often expressed in XXX.XXX.XXX.XXX form. IP address consists of two fields: Network number (NET-ID) and host number (Host-id), for convenient IP address management, IP address is divided into five categories, such as:

Where A,B, andC addresses are unicast (unicast) addresses, Class D addresses are multicast (multicast) addresses, and class E addresses are reserved addresses for future special purposes. The IP addresses currently in use are in the category A,B, andC three addresses.

Class A address range:0.0.0.0~127.255.255.255

Class B address range:128.0.0.0~191.255.255.255

Class C address range:192.0.0.0~223.255.255.255

private network address range: 10.0.0.0~10.255.255.255, 172.16.0.0~172.31.255.255,192.168.0.0~192.168.255.255, private network address can only be used in local LAN, not used in the public network.

subnets and masks:

Traditional IP Address allocation method, the waste of IP address is very serious. In order to make full use of the existing IP address, the concept of mask and subnet (subnet) is proposed.

The mask is a 32-bit number corresponding to the IP address, some of which are 1, and some 0. In principle these 1 and 0 can be arbitrarily combined, but generally in the design mask, the network number and subnet number of the bit value is 1, the host number of the bit value is 0. A mask can divide an IP address into two parts: the subnet address and the host address. The portion of the IP address that corresponds to 1 in the mask is the subnet address, and the other bits correspond to the host address. When subnetting is not performed, the subnet mask is the default value, and the length of "1" in the subnet mask is the length of the network number. The Mask default value for Class A addresses corresponds to the 255.0.0.0;b class address, the default value for the 255.255.0.0;c class address mask is 255.255.255.0.

IP Routing options:

  Concept: If the destination host is in the same shared network as the source host, the IP datagram is delivered directly to the destination host, otherwise the host sends the datagram to the default router, which is forwarded by the router for datagram.

link layer: typically includes device drivers and network interface cards. Handles physical interface details with the transport medium. The main protocols are: ARP protocol and RARP protocol

MAC Address: The data link layer has its own addressing mechanism (48bit address), when a host sends an Ethernet data frame to another host on the same LAN, the destination interface is determined based on the Ethernet address of the 48bit.

While the ARP and RARP protocols provide mappings for IP addresses and MAC addresses:

We are judging whether the network between the two host applications is normal, usually to determine whether the other IP and port can pass.

Common Network Judgment commands:

Windows:

Ping $IP: The most commonly used command to determine whether a network is accessible.

tracert $IP: Traces the route, that is, to print out the local to the destination IP.

telnet $IP $port: You can test whether an IP and an application port are able to pass.

netstat: View the port on which the computer listens and establishes the connection.

Linux:

Ping $IP: The most commonly used command to determine whether a network is up or down

traceroute $IP: Traces the route, that is, to print out the local to the destination IP.

or using the mtr-ni 0.1 $IP, you can achieve the above two common effects

nc-vz $IP $PORT: Test to the destination IP of the application port is able to pass.

NETSTAT-TUPLN: You can view the port that the machine is currently listening on

Reference:

Https://en.wikipedia.org/wiki/Internet_protocol_suite

"TCP/IP Detailed Volume 1: Protocol"

Simple understanding of computer communication

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.