Linux Network (i)

Source: Internet
Author: User

first, the Computer Network Foundation
Second, Mac&ip&port
III. communication subnets and resource subnets
Four, network interface naming specification

first, the Computer Network Foundation
Linux Network Properties Configuration
Network:
Text flow: Turns the file into a bit (01) stream, transmission, text transmission in the online cable is a bit stream
According to the clock frequency to determine: for example, 1s vibration 1000 times, identify 1s can transmit 1000 data streams

In order to complete the data transfer: modulation of the digital signal frequency is very important
Synchronous transfer
Asynchronous transfer
The start and end position of the file, the frequency of the transmission, synchronous or asynchronous: both require a contract between the two devices.
Receiver blocking, data loss, medium effective distance and other issues
Network:
TCP/IP: protocol stack, protocol stack (use)
ISO: International Organization for Standardization
OSI: Development system Interconnect//seven-layer model, learning model
The OSI is later refined
CSMA/CD//CSMA/CD (Carrier sense multiple Access with collision Detection
Token ring//who gets the token, who first sends
Mac:media Access Control:
Bits:iana,icann//6 segment 8-bit
8bit,2^4*2==16*2
24bits: Need to Buy, 2^24, the first 24bit needs to apply
Address Block: 2^24 the second party

The Open is permanent.
Bridge/Switch: Isolate conflict domains
Local communication on both sides of the interface: will not be sent to other networks, within this interface of the bridge, and not to other interfaces
By default, it travels across the network
Non-local communication: passing this information
MAC Address Table
Note: There is a table inside the bridge, MAC Address table, record transfer information, just start empty

Routers: Isolating broadcast domains
Second, Mac&ip&port
Ip:internet Protocol Address: Network number + host number
ip:32bits,4 segment 8bit 2^8=256
Ipv4:128bits,
IP Address Category: 0000-0111
Class A//first place is 0000
1-127.*.*.*//0000 0000-0111 1111
Number of networks: 126,127 loopback Address
Number of hosts per network: 2^24-2
Full 0 identifies the network itself, full 1 identifies the broadcast
Subnet Mask: 255.0.0.0
Private network Address: 10.0.0.0/255.0.0.0
Class B//1000-1011
The first two bits are the network number, the last two bits are the host number
1000 0000-1011 1111//128-191
Network number: 2^24
Number of hosts per network: 2^16-2
Default Subnet Mask: 255.255.0.0
Private network Address: 172.16.0.0-172.31.0.0
Class C: 1100-1101
The first three bits are the network number, the last 1 Dan host number
1100 0000-1101 1111//192-223
Number of networks: 2^8
Number of hosts in each subnet: 2^8-2
Default Subnet Mask: 255.255.255.0
Private network Address: 192.168.0.0-192.168.255.255
Class D://Multicast Communication 1110
The first four bits are the network number, and the rear
1110 0000-1110 1111//224-239
Default subnet mask: 255.255.255.
Number of networks: 2^4-2
Private network Address:
Class E://scientific research 1111 0
Ago
1111 0000-1111 0111//240-255
Number of hosts per network: 2^3-2
Default Subnet Mask:
Private network Address

Network Bridge: MAC Address Table
Statically specified
Dynamic Learning: Based on source address learning,
TTL life cycle
Switches: Switch: Multi-port Bridge
Router: router
Statically specified
Dynamic Learning
RIP2,OSPF,EIGRP, et
OS: Multi-user, multi-tasking
Multitasking: Multi-process running at the same time

Client: Active, temporary available address, port
Port: Identifies the network traffic for each process
2^16:65535:1-65535
Server: Port pinning
1-1023: Fixed assignment, only administrators have permission to start
1024-4W: Semi-fixed, uncommon,
4 W: Random port, each process temporary communication, can be used
Server: Fixed and unambiguous address, waiting for
Process Address: Ip:port,socket address
Provided by the kernel, apply to the kernel
OS: Hardware, kernel, application, library application
OS: Kernel space + user space//kernel | User space
A port, at the same time, can only be used by one process
The process needs to register sockets: Port Usage
Processes are required to communicate by sockets
A minimum of three addresses are required to complete the communication:
MAC Address: Implement local communication
IP Address: cross-network communication//is used only to identify the use, specific to the intranet or Mac communication, the IP into a MAC address
Socket Address: Initiator of communication

MAC: Local communication: Range: Local Area Network
IP: Define communication host, source and target, scope: global Internet
Port: Scoping, Scope: Host

How the internal data is organized requires a application layer to view
Communication Subnets + resource Subnets

iii. Communication Subnets and resource subnets
650) this.width=650; "src=" Https://s2.51cto.com/oss/201710/29/d5aebcf6a0210f350276f387c4a89297.png "title=" Sogou 20171029164718.png "alt=" D5aebcf6a0210f350276f387c4a89297.png "/>========================================== ================
OSI model TCP/IP stack
Communication subnets: implementation in kernel space
Resource subnets: implemented in user space

Communication process: encapsulation and unpacking
Transport Header: Network layer header: Data link beginning
A-r1-r2--b//Intermediate Mac is changed back and forth, but the encapsulated IP layer is immutable
Communication between all the different segments: router forwarding is required

Default gateway: Equivalent to the general agent

ARP: Address Resolution Protocol,
Internal network: Get the MAC address of each other via ARP request
ARP can be cached, not authoritative results
TTL life cycle Save freshness

Route entry:
Destination address Next hop (Next hop)//Gateway
Category of Destination address:
Host: Host Routing
Networking: Network Routing
0.0.0.0/0.0.0.0 default route

www.baidu.com-->IP--->mac
FQDN-->IP:
Local:/etc/hosts file
DNS: Find the IP address of DNS, request destination IP

Connect a Linux host to the network
Ip/netmask: Local Communication
Routing (Gateway): cross-network communication
DNS server address: Host-name-based communication
Primary DNS server address:
Alternate DNS server address:
Third Backup DNS address:
How to configure:
Statically specified: The server is generally statically specified
Command: Some can be saved to the file, some cannot
Configuration file: May not take effect immediately, some need to force kernel to re-execute configuration file

four, network interface naming specification
How to name the network interface:
Traditional naming
Ethernet: Ethx,eth0,eth1,...
PPP Naming: Pppx,ppp0,ppp1,...
Predictable naming//according to Udev
Support for many different naming mechanisms
Fireware, topological structure
For example, the first few slots on the interface and so on
(1) If the firmware or BIOS integrated device on the main Board provides index information available, the index is named according to the
such as: Eno1,eno2
(2) If the index information provided by the firmware or BIOS for the PCI-E expansion slot is available and predictable, the ens1,ens2 is named according to the secondary index,...
(3) If the physical location information of the hardware interface is available, it is named according to this information, such as ENP2S0,
(4) If the user is explicitly defined, it can also be defined according to the MAC address, for example Enx122161ab2e10,..
None of the above is available, the traditional way of naming is still used

Based on (motherboard/PCI-E expansion slot) index, depending on the interface location, MAC
Eno1,ens1,en2s0,enx "12-bit", eth0
The composition of the naming format:
En:ethernet
Wl:wlan
Ww:wwan

Type of name:
0:INDEX&GT: Device index number of the integrated device on the Fireware
S:slot>: Expansion slots
X:mac>
P:bus,s:slot: Naming p:public based on bus and slot topology


This article is from the "Dark Horse vacated" blog, please be sure to keep this source http://hmtk520.blog.51cto.com/12595610/1977175

Linux Network (i)

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.