Java---Network programming fundamentals

Source: Internet
Author: User

OSI Reference Model

The model is mainly divided into 7 layers: physical layer, Data link layer, network layer, transport layer, Session layer, presentation layer, application layer

Each tier uses services provided on the lower level and serves the upper layer.

The transmission of information is inseparable from physical media such as twisted pair and coaxial cable, but the physical medium is not in the OSI 7-layer Reference model. The physical layer's task is to provide a physical connection to its upper layer, as well as to specify the mechanical and electrical characteristics between the communication nodes. At this level, the data is transmitted as the original bit (bit) stream. Typical device on this layer is the hub hub

Data Link layer: Responsible for transferring data in frames on the line between 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 connections to the data link. When transmitting data, notify the sender to resend the frame if there are errors in the transmitted data detected by the receiving party. The typical device for this layer is the switch

Network layer: The task of the network layer is to select the appropriate inter-network routing and switching nodes to ensure the timely transmission of data to the target host. 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 header contains logical address information-----The network address of the source host and destination host. The typical device on this layer is the router

TCP/IP Reference Model and TCP/IP protocol

The TCP/IP reference model is divided into 4 levels: application layer, Transport layer, network interconnect layer, host-network layer . There is a corresponding agreement at each level. Specifically, the TCP/IP protocol should be referred to as the TCP/IP protocol set, which is a collection of three layers of protocols other than the host-network layer in the TCP/IP reference model, while the IP protocol and TCP protocol are the two most core protocols in the set of protocols.

Host-Network layer: In fact, the TCP/IP reference model does not really provide this layer of implementation, nor provide a protocol. It only requires a third-party implementation of the host-the network layer can provide an access interface for the upper layer (network interconnect layers), so that the network interconnect layer can use the host-network layer to pass IP packets. Ethernet: IEEE802.3 Token Ring Network: IEEE802.4

Network interconnect Layer: It is the core of the entire reference model. Its function is to send IP packets to the target host. In order to send data as quickly as possible, the IP protocol divides the raw data into multiple packets and then passes the packets along different paths. The order in which the packets arrive and the order in which they are sent may be different, which requires that the packet be reordered by the upper (transport layer) and restored to the original data. In addition, the network Interconnect layer has the function of connecting heterogeneous network. Ethernet and Token Ring networks are different types of networks, and they have different network topologies. Both the Ethernet and Token Ring networks provide a unified access interface to the network interconnect layer, which hides the differences of the underlying network to the network interconnect layer, so that the packets can be passed smoothly between the two networks. The network interconnect layer uses the IP protocol, which specifies the format of the packet and specifies the process for finding the route for the packet.

Transport Layer: The function of the transport layer is to enable the incoming layer of the source host and the target host to be able to session. Two protocols with different quality of service are defined at the transport layer, namely TCP (transmission Control Protocol, Transmission Protocol) and UDP (user Datagram Protocol, Subscriber Datagram Protocol). The TCP protocol is a connection-oriented, reliable protocol. It sends the stream of bytes emitted by the source host to the target host on the Internet without error. in the sending segment, the TCP protocol is responsible for transferring the data from the upper layer into the packet segment to the lower layer. At the receiving end, the TCP protocol is responsible for reorganizing the received messages to the upper layer. The TCP protocol also handles end-to-end traffic control to avoid slow receivers not having enough buffers to receive large amounts of data sent by the sender. The UDP protocol is an unreliable, non-connected protocol .

IP address: IP URL and IP host address. The IP URL represents the address of the network, and the IP host address represents the host address in the network. The netmask is used to determine which part of the IP address is the URL and which part is the host address. The network mask and IP address are binary and operation, and the result is IP URL.

IP is a package-oriented protocol in which data is divided into small packets, which are then transmitted separately. A host on an IP network can only take a packet directly to another host on the local web. The host actually has two different addresses: Physical address and IP address. The physical address is identified by the network card on the host, and the physical address is the real address of the host.

Java---Network programming fundamentals

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.