unix network programming concepts common

1.p2p (peet to peer, peer to peer network) network communications technology terms

P2P refers internet each computer has the same functionality, without distinction from the master, can be used as a computer server are set for the shared resource used by other computers in the network, but also as a workstation, no dedicated server, there is no dedicated workstation. Peer networks are commonly used in small local area networking.

 

2.DHCP protocol (Dynamic Host Configuration Protocol, Dynamic Host Configuration Protocol Type: Computer network application layer protocol)

The main purpose:

1) Configuration Security: avoid configuration errors because of the need to manually input values ​​caused by each PC

2) prevent address conflicts: help prevent configuring a new PC thing to reuse previously assigned IP address on the network caused by address conflict

3) reduce the Configuration Management: Using DHCP servers can greatly reduce the user to configure and reconfigure the value of time online PC

 

3. What is the API

Full name API: Application Programming Interface (application programming interface)

Operating system left to the application of a call interface, applications, the operating system command to execute an application (action) by calling the operating system API.

(From Baidu Encyclopedia)

API is part of the operating system or application program interface.

 

4. (new concept) multiple host

(Traditional view) having a plurality of host interfaces

(New think) has a multi-layer visible to the host IP interface.

 

Compare 5.IPv4 and IPv6

  IPv4 IPv6
The length of the address # 32 128 of
The difference between the written form of In four numbers separated by decimal numbers, called dotted decimal notation Eight hexadecimal 16-bit numbers separated by colons values,
     

 

6.LAN sum WAN

LAN (local area network) local area network

WAN (wide area network) WAN

Currently the largest wide area network is the Internet (Internet)

 

7. Initial recognition network program

  1. Include the header file
  2. Command line parameters
  3. Create a TCP socket
  4. IP address and port of the server
  5. Establish a connection to the server
  6. Read and output from the server response
  7. Terminate the program

8.HTTP (hypertext transfer protocol) Hypertext Transfer Protocol

 

9. The wrapper function (error processing)

Each wrapper function to complete the actual function call, check the return value and terminates the process when an error occurs.

We agreed wrapper function name is the first letter of the actual function name in uppercase.

 

10. The process of reading the content should be noted:

Such as "connect function returns ECONNREFUSED" This sentence can be understood:

This function returns an error (typically function returns a value of -1), while errno is set to a predetermined constant value.

 

11. Open Systems Interconnection model (OSI model)

7 Application layer
6 Presentation layer
5 Session Layer
4 Transport Layer
3 Network layer
2 data link layer
1 Physical Layer
  OSI model

 

12. The Internet protocol suite

      Application layer
 TCP      UDP

  IPv4 、IPV6

Device drivers and hardware
Internet protocol suite

11. Interface name

Loopback (loopback) interface called lo

Ethernet interface called eth0

12.POSIX (portable operating system interface) Portable Operating System Interface

Guess you like

Origin www.cnblogs.com/181118ljh123/p/12002296.html
Recommended