Basic network knowledge learning

Source: Internet
Author: User


Computers rely on electrical pulses to turn 0.1 into a recognizable mechanism.
Encoding Rules, communication between two computers is transmitted between high and low levels
Before the encoding rule is passed, the recipient has a decoding rule,
The encoding and decoding rules must match.
The encoding and decoding rules follow the protocol rules.
Protocol
How does one represent two different files in the middle of two computers.
The two NICs must negotiate with each other. Separate messages according to certain rules (in this case, messages are sent)
Early networks were bus-type. ,
MAC is needed for computer communication, so that other people know who to communicate.
The number of transmission units is determined by the device. The data is intercepted at 1500.
1500 contains the accept address. When there are few, there is no problem, but when there are many
There is a problem, because there is a line in total, a communication channel appears at this time, Ethernet
And the starting ring network,
The Ethernet and the ring-based network solve the communication channel contention problem.
MAC
Ethernet, CSMA/CD carrier listener, multi-channel access, and conflict detection (after listening, send while listening, stop conflict, delay resend)
Ring-Net: you can send a token if you can catch the token.
Ethernet is public, open-source, and open-source is the most vital.
The starting ring is commercial.
Reduce conflicting domains and separate conflicting domains. What devices are used to isolate them,
In this case, a bridge is required. Early devices, even the bridge, are called bridges.
Later, a bit switch was developed,
How does a vswitch work? How does it isolate two networks,
How to forward packets between two computers.
A vswitch is intelligently determined by an interface corresponding to each physical address.
When a datagram file comes, view the interface corresponding to its physical address and forward it
The corresponding interface.
The switch can learn how to know the physical address and interface,
Learn to know.
How to Learn is based on the source address of the message.
If you do not know who to forward the message to, broadcast the message at this time, and then respond to the message at that time,
Then, record the switch. This completes a learning process.
The vswitch must be broadcast,
Conflict domain,
Broadcast domain. The range that a broadcast can reach is the range that a broadcast can reach.
Divide a big problem into several problems. At this time, even if it is layered,
Understand the meaning of hierarchy.
If the sending speed is different, throttling is required.
If an error occurs during sending, the Cyclic Redundancy verification code is required.
Verification Code valid data mark Limited Data Length source address Destination Address forward guide code
Why is the format like this? This is the protocol.
If you do not know 40 thousand hosts,
When the core switch keeps broadcasting, a broadcast storm may occur,
How to isolate broadcast domains,
In this case, you need a vro.
At this time, the IP address and logical address are necessary.
The router must know the networks connected to it.
A vswitch is linked to a host.
Router connected to the network.
You also need to learn how the router knows the network to connect.
The network layer appears.
In this case, you need to encapsulate a source network address in the destination network.
You need to disassemble and then encapsulate the source MAC
In this case, the network address and IP address are required.
Why is there a network address + host address.
The mask is used to determine the network.
The router knows the network, and the routing table matches one by one.
If both of them match, the matching result is the smallest.
To match the checking mechanism, the matching mechanism consumes a lot of CPU
MAC is used for local communication and IP is used for inter-network communication.
Verification code data source port number destination port number source network address destination network address source MAC target MAC forward guide code
How to reject a process: at this time, you need to mark the process address with the port number.
In addition, TCP UDP
Which information should be encapsulated in the IP header:
Packet header:
One 32-bit per four bytes
IP Header



IP version number (four bits) header length (four bits) service type (which is required for 8 bits efficiency and reliability) total length (DATA)
Frame ID (16-bit piece ID) 3-Piece Offset (13)
TTL value (8) Protocol (8) header checksum (16)
Source IP (32-bit)
Target IP address (32-bit)
Options
Date data

Tcp udp packets are required from the source process to the target process.
TCP Header:


Source Port Number (16 bits) Destination Port Number (16)
Serial number (32-bit)
Confirmation No. (32 bits)
Header Length (4 bits) reserved bits (6 bits) flag (6 bits, marking packet attributes) window size (16 bits)
TCP checksum (16-bit) Emergency pointer (available only when URG is 1)
Option Section
Data
Port Number, vro, and vswitch
Data + TCP Header (source process and target process ensure Process Communication) + IP header (source IP address and target IP address) + (source MAC and target MAC ensure local communication) + forward guide code
Split the Front Guide code, send the port, seal the Front Guide code, split the Front Guide code, and view the IP Encapsulation frame on MAC.
Message transmission: Packet ----- switch ----------------- switch -------------------------- router --------------- router ---- switch ---- host ---- Network Layer --- Application Layer
The application layer also requires the Protocol to regulate www http ftp
Application Layer Gateway Network Layer Gateway
Application Layer Routing network layer Routing
(The layer-4 device checks the port to see which service is Server Load balancer)
Modify the nat address
Router -------------- Router
Nat translation is safer. 2 It can also save IP addresses.
Source Address conversion target address conversion
Requests from the Intranet
TCP status: the finite state machine of TCP (converts in certain order and logic)




TIMEWAIT 240 seconds
A (closed) -------- SYN_SEND () -- B (listen) SYN_RECV confirm ESTABLISHED----A change (ESTABLISHED)
A (ESTABLISHED) ----- FIN (TIME_WAIT1) ---- B (ESTABLISHED) -- REV -- (CLOSE_WAIT) -- ACK---A (TIME_WAIT2)
A (TIMEWAIT)
The end of the active request is not necessarily the end of the active request.

Request service, request random port number, and the server response may use a dedicated port number to respond
These ports are 0-in total. 1024 only the administrator can call the API.
TCP: a protocol with links.
Establish a TCP connection: a dedicated communication line is established.
UDP: No connection protocol.
TCP three-way handshake


A (generate random serial number 1000) Send request B
B (the serial number is added to 1-1001, and the serial number is 6777 randomly generated by the user) responds to
A (confirmation number: 6778, serial number 1001) response B ()
Establish communication
If the recipient has responded to the retransmission, the retransmission will be ignored because
The confirmation number and serial number are the same as the previous one.
 
Flag: When URG is 1, valid 0 indicates invalid
ACK is confirmed as 1. After the zero connection is established, it is 1.
PSH push bit
PST reset bit
SYN synchronization bit (whether the serial number is valid three times, the first bit 1, and the other is zero)
FIN second BIT (FIN is 1 only at the end, and cannot be 1 when a connection is established for transmission)

Four disconnections: A request disconnects B Response
B requests A to respond to


Window Size: the number of recipients. For the first time, for example, if the size of the window is 10 and the size of the two windows is changed to two, the size of the window is changed. Sliding Window
Window size and number of reception
Receiving size
Number of socket buffers (equivalent to the cache area in the kernel) that can be processed by the window size. Receive Buffer and send buffer. Generated by negotiation, mainly small

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.