Basics of network programming java

computer network:

Some host (Host) 1. To achieve the information transfer and the sharing of resources, connected through a communication line

2. Internet: connected (Internet) point to point

3. World Wide Web: (WWW - World wide web) end is connected to the end

4. things: - connected (IoT Internet of things) and the product was

5. Network Programming: Let establish a connection between the computer and the computer to communicate

Network model:

OSI (Oper System Ineterconnection) Open Systems Interconnection:

First layer: physical layer and a physical medium for the transmission of data signals between the communication devices. (Twisted pair, fiber optic)

Second layer: in the physical layer link layer to control the correctness of the data transmitted by the protocol or protocol (error control). (MAC)

The third layer: The network layer is responsible for defining the network nodes can identify all the logical addresses. (IP address)

Fourth layer: the transport layer is responsible for error recovery if the selected protocol, to reuse the data stream, the error order rearrangement. (TCP, UDP)

Fifth Layer: Session layer is responsible for establishing and maintaining the application session, the communications continue to restore communication at the time of failure. (http)

Sixth layer: The presentation layer is responsible for converting a data format is defined, and encryption, allowing selection transmitted in ASCII or binary format.

Seventh Layer: The application layer is responsible for file access and management, reliable transportation services, Remote Operations Service. (HTTP, FTP, SMTP)

TCP / IP model:

A set of interconnection network for realizing communication protocol, the protocol is divided into four levels:

The first layer by layer is responsible for opening the circuit-connecting construction of the text, the whole was treated with the same lattice basis, typical protocols include Ethernet, the ADSI like.

Second layer: the network layer is responsible for assigning addresses and transmit binary data, the main protocol is IP protocol.

Third layer: transport layer is responsible for transferring text data, the main protocol is TCP, UDP protocol. 

Fourth layer: an application layer is responsible for transmitting data of various final form, is a layer which deal directly with the user, the typical protocol is HTTP, FTP and the like. 

TCP/UCD:

Protocol TCP: Transmission Control Protocol Transmission Control Protocol: a connection-oriented, reliable transport layer protocol based on the byte stream. Unlimited data size. The process requires three-way handshake to establish a connection, disconnection procedures requires four wave. 

Protocol UDP: User Datagram Protocol User Datagram Protocol: transport layer protocol is a connectionless, provide unreliable simple transaction-oriented messaging services, each of the packet size 64KB.

IP:

IP protocols: Internet Protocol Address Internet Protocol Address / Internet protocol addresses assigned to Internet devices ● digital label (the only identification)

IP addresses are divided into two types: 

A: the IPV4: 4-byte 32-bit integer, and divided into 4 8-bit binary segments, each separated by dots 8, each 8-bit integers can be converted into a decimal integer of 0 to 255. 
Format: DDDD example: 255.255.255.255 

Class A: government agencies, 1.0.0.1 ~ 126.255.255.254

Class B: Medium, 128.0.0.1 ~ 191.255.255.254 

Class C: individual users, 192.0.0.1 ~ 223.255.255.254

Class D: for multicast, 224.0.0.1 ~ 239.255.255.254

Class E: for the experiment, 240.0.0.1 ~ 255.255.255.254 

Loopback address: 127.0.0.1, refers to the machine, - - generally used for testing. View IP command: ipconfig

IP test command: ping DDDD

Two: IPV6: 16 128-byte integer, and divided into 8 sections hexadecimal numbers, each separated by dots 16, each 16-bit integers can be converted to a decimal number from 0 to 65535.
Format: XXXXXXXX example: FFFF.FFFF.FFFF.FFFF.FFFF.FFF.FFFF.FFFF

Port:

Port number: uniquely identifies networks that communicate over a communications entity program.

Port Category:

1. recognized port: 0 to 1023

2. Register port: 1024 ~ 49151 

3. The dynamic or private port: 49152 to 65535 

Common ports:

1.MySql: 3306

2. Oracle: 1521

3.Tomcat: 8080 

4.SMTP: 25

5.Web server: 80

6.FTP server: 21

 

Published 38 original articles · won praise 105 · Views 7497

Guess you like

Origin blog.csdn.net/S9264L/article/details/104975933
Recommended