Java Network Programming のosi

Source: Internet
Author: User

We can understand the client and the remote server as host A and Host B, the user and host a can interact with the application in host A, and the interaction between host A and Host B is through the computer network communication.

Each machine in the network is called a node. Most nodes are computers, in addition, printers, routers, bridges, gateways, and dumb terminals are also nodes.

People communicate with each other through a language, and the hosts in the network communicate through "language", a language we call network protocols.

  

So how are the different protocols interconnected? Through the TCP/IP protocol.

  

OSI Reference Model

At the beginning of the computer network, each computer manufacturer has its own network architecture, which is incompatible with each other. An OSI architecture (open System interconnect) was specifically studied for this ISO. A network system that follows the OSI model can be connected to other network systems that are located anywhere in the world and follow the OSI model.

The OSI Reference Model divides the network into 7 layers, namely the physical layer, the data link layer, the network layer, the transport layer, the conversation layer, the presentation layer and the application layer, each layer uses the service provided by the next layer, and provides services to the upper level.

  

The same layer between different hosts is called the peer layer.

1. Physical Layer

The transmission of information is inseparable from physical media, but physical media is not within the OSI 7 layer, the physical medium is generally referred to as the No. 0 layer. The physical layer's task is to provide a physical connection to its upper layer.

2. Data Link Layer

The data link layer is responsible for transmitting the data in frames on the line between the two adjacent nodes without error. Each frame includes a certain amount of data and some necessary control information. The data link layer is responsible for establishing, maintaining, and releasing the connection to the data link. When transmitting data, if the receiving Party detects errors in the transmitted data, it is necessary to notify the sender to resend the frame.

3. Network layer

There may be many data links between the two computers that communicate in the computer network, or they may go through many communication subnets. The task of the network layer is to select the appropriate inter-network routing and switching nodes to ensure that the data is transmitted to the target host in a timely manner. The network layer consists of a packet of frames provided by the data link layer, which is encapsulated with a network layer header, and the packet header contains logical address information----The network address of the source host and the destination host.

  

The line between host A and Node 1, Node 1 and Node 4, node 4 and Host B is called a data link, and the entire path from host A to Host B is routed. The task of the network layer is to select the appropriate route.

4. Transport Layer

The task of this layer is to make the best use of network resources according to the characteristics of the communication subnet, providing the members of the two-terminal system with the ability to establish, maintain and cancel the transmission connection, and transmit the data in a reliable or unreliable way. The so-called reliable way is to ensure that the data sent by the source host is correctly delivered to the target main sentence; the so-called unreliable means that the data sent by the source host is not guaranteed to be properly delivered to the target host, and the data may be lost or faulted. In this layer, the transmitting unit of information is the message.

5. Session Layer

This layer can also be called the meeting layer or the dialogue layer, in the conversation layer and above, the unit of data transmission is no longer named, collectively referred to as the message. The session layer manages the session between processes, which is responsible for establishing, managing, and terminating sessions between processes. The session layer also enables synchronization of data by inserting checkpoints into the data.

6. Presentation Layer

The presentation layer transforms the upper data to ensure that data from the application layer of one host can be understood by the application layer of the other host. The data transformation of the presentation layer includes encryption, decryption, compression, decompression, and format conversion of the data.

7. Application Layer

The application layer determines the actual use of communication between processes to meet the actual needs of the user. Browsing Web sites, sending and receiving email, uploading or downloading files, and Telnet servers can all be seen as the actual use of communication between processes.

  

When the source host sends data to the target host, on the source host side, the data is passed down from the upper layer, each layer sends the data to the previous layer with a header, which is then sent to the lower level and finally to the target host via physical media. In the target host side, the data is transferred from the lower layer up, each layer first to the data processing, the information head removed, and then to the upper transmission, and finally reached the top, will be restored to actual data.

The OSI Reference Model divides the network into multiple layers, each with a clear division of labor, which simplifies the design process of the network system. For example, when designing the application layer, we only need to consider how to create an application that meets the actual needs of the user, and when designing the transport layer, we only need to consider transferring data between the two hosts.

Communication between peers requires adherence to certain rules, such as the content of the communication and the means of communication, which are called network protocols. OSI does not have a specific implementation, but it provides a framework for establishing network protocols for computer manufacturers or organizational structures.

Java Network Programming のosi

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.