linux learning the basics --- Network

1.1 IP address

  IP address consists of two parts, a network number and host number. IP network address number composed of upper, lower and the host number is composed of an IP address, two depends on the type of network.

  The IP address is divided into a network address: A Class, Classes B, Class C, Class D, E class.

  (1) A Class A IP address type

    Class A IP address of a three byte network number and host number of bytes. Highest network address must be "0", the address range: 1.0.0.0 to 126.0.0.0.

  (2) Class B IP address type

    Class B IP addresses by the two-byte network number and host number of two bytes. Highest network address must be "10", the address range: 128.0.0.0 to 191.255.255.255.

  (3) Class C IP address type

    Class C IP address consists of three bytes of a byte network number and host number. Highest network address must be "110", the address range: 192.0.0.0 to 223.255.255.255.

  (4) for the Class D Multicast address

    Class D IP addresses of the first byte to "1110" starts, which is a special reserved address. It does not refer to a specific network, this type of multicast address is used, a multicast address for addressing a group of computers that share a set of computer identifies the same protocol.

  (5) E class IP address type

    With "1110" began, reserved for future use.

1.2 Subnet Mask

  Also called network mask subnet mask, is generally composed of a network address part are "1", the host address of all "0", for example, Class C IP addresses: 192.168.1.134 known Class C network with three bytes It represents a network number, a byte host number. So its subnet mask: 255.255.255.0 (default subnet mask).

  Subnet mask effect: discrimination data packet is transmitted by the host is sent out inwardly network or transmission network. Such as host A to host B sends the data packet, the host first own subnet mask and the destination IP address of the target host & made (AND) operation. Since the network address part of a subnet mask of all "1", the host address are all "0", so that the operation result is a network address.

  For example: IP address is 192.168.1.115, subnet mask host is 255.255.255.0, take the IP address with the subnet mask phase (&) operation to get the result: 192.168.1.0. Is the network address of the IP address is located.

  A host obtained the network address, the network address obtained in the IP address and took B where the comparison, if the two network addresses are identical, i.e. host A and host B inside the same network, the packet transmission network inwardly. If not, the network sends out, i.e. it needs to be sent to the gateway.

Gateway 1.3

  Gateway also called gateways, protocol converters. Is mainly used to implement a network gateway is connected, it is the most complex networking equipment, only two different high-level protocols on the transport layer network interconnection. Gateway can be used either WAN, LAN interconnection can also be used. Gateway is a computer system or a device for converting the task of acting as. Between the use of different communication protocols, data formats or languages, even architecture completely different systems, is a gateway translator.

  So what in the end the gateway is it? ? Gateway is essentially a network IP address leading to other networks. For example, there network A and network B, IP address range of the network A is: 192.168.1.1 ~ 192.168.2.1, subnet mask: 255.255.255.0; IP address range of network B: 192.168.2.1 ~ 192.168.2.254. Subnet mask: 255.255.255.0. In the absence of routers, between the two networks can not be TCP / IP communications. Even if two networks connected to the same switch (or hub), TCP / IP protocol will be based on the subnet mask (255.255.255.0) determines whether or not the master of the network in two different networks. And to communicate with each other between the two networks, it must be through the gateway, if the network A host that the destination host the packet is not in the local network, put forward the packet to its gateway. Then forwarded by the gateway to the gateway network B, network gateway B forwarded to a host of network B's.

  So, just set the gateway IP address, TCP / IP protocol to communicate with each other between different networks. Then the IP address is the IP address which machine it? ? IP address of the gateway is the IP address of the device has a routing function, the device has a routing function routers, routing protocols enabled server (essentially serves as a router), the proxy server (also serves as a router).

1.4 DNS server

  The domain name server DNS is an abbreviation computer system, which is composed by the parser and the domain name server, the domain name server is a domain name is stored in the network and the corresponding IP addresses of all hosts, and may convert the domain name to the IP address of the server function . Among them, a domain name must correspond to the IP address and the IP address does not have a domain name. The Domain Name System uses a hierarchical structure similar to the directory tree. Domain Name Server is a client / server mode, the server side, it is mainly in two forms: primary and redirect servers. Mapping domain names to IP addresses is called "domain name resolution."

  For example, we often enter "www.baidu.com", where "www.baidu.com" is the domain name. If you want your computer to successfully enter the Baidu home page, you must set the DNS server, host server to connect the front and Baidu, must resolve the domain name server to obtain the actual IP address of Baidu services.

 

Guess you like

Origin www.cnblogs.com/eokey/p/11741502.html