1. What is a computer network?
The distribution of computers in different geographical areas and specialized external equipment with communication lines interconnect into a large, powerful network system, so that many computers can easily transfer information to each other, sharing hardware, software, data information and other resources.
2. Main functions of computer network
Resource sharing
Information transmission and centralized processing
Balanced load and distribution processing
Integrated Information Services (www/Integrated Services Digital Network ISDN), etc.
3. Network Communication Protocol
To make a computer network can communicate information, need to data transmission rate, transmission code, code structure, Transmission control procedures, error control and set up a set of standards, this group of common standards is the Communication Network communication protocol, the different computers must use the same communication protocol for communication.
Network communication interface
In order to enable dialogue between the two nodes, communication tools (i.e. interfaces) must be established between them so that information can be exchanged between each other. The interface consists of two parts:
(1) Hardware Device: Realize the information transmission between nodes.
(2) Software device: a contractual agreement that provides for communication between the parties
4.tcp/ip
TCP/IP: Transmission Control Protocol/Internet protocols, also known as Network Communication protocol, this Protocol is the most basic Internet Protocol, the foundation of Internet International Network, simply speaking, is composed of IP protocol and Transport Layer TCP protocol.
IP Address: A label for each computer in the network, local ip:127.0.0.1 localhost
Port number (port): Port number range: 0~65535 between 0~1023 for some well-known network services and applications
Physical Layer--Data link layer--network layer--Transport Layer--session layer--presentation layer--Application layer
5. Data development structure
Network programming is to complete the development of C/s program, the development structure of the program has two kinds:
c/S (client/server) development of two sets of procedures, two programs need to maintain at the same time, for example: QQ. CS program is generally more stable
b/S (browser/server) develops a set of programs that customers access using a browser, for example: various forums. BS programs generally have poor stability and poor safety. However, the C/S program development in Java application is very few, and the whole of Java is basically based on B/S.
c/S program can complete the following two kinds of program development:
TCP: Transmission Control Protocol, the use of three-way handshake to ensure accurate continuous operation.
UDP: Datagram protocol, send datagram, for example: SMS or QQ message
Data frame format simple legend for TCP and UDP:
Where the protocol type is used to differentiate between TCP, UDP
Network programming--Basic concepts