Computer network Knowledge

Source: Internet
Author: User
Tags file transfer protocol

1. OSI, TCP/IP, five-layer protocol architecture

OSI layering (layer 7) : Physical layer, Data link layer, network layer, transport layer, Session layer, presentation layer, application layer.

TCP/IP tiering (layer 4) : Network interface layer, internetwork layer, Transport layer, application layer.

Layer Five Protocol (layer 5) : Physical layer, Data link layer, network layer, Transport layer, application layer.

the function of each layer is as follows :

Physical layer : Activates, maintains, and shuts down the mechanical, electrical, functional, and process characteristics between communication endpoints. This layer provides a physical medium for the upper level protocol to transmit data.

Data Link Layer : The data link layer provides reliable transmission on unreliable physical media. The functions of this layer include: Physical address addressing, data framing, flow control, data error checking, re-sending, etc.

Network layer : The network layer is responsible for routing the packets between subnets. In addition, the network layer can also realize congestion control, Internet interconnection and other functions.

Transport Layer : The first end-to-end, that is, the host-to-host hierarchy. The transport layer is responsible for segmenting the upper data and providing an end-to-end, reliable, or unreliable transmission. In addition, the transport layer also handles end-to-end error control and flow control issues.

Session Layer : The session layer manages the session process between hosts, which is responsible for establishing, managing, and terminating sessions between processes. The session layer also uses the insertion of checkpoints in the data to synchronize data.

Presentation Layer : The presentation layer transforms the upper data or information to ensure that one host application layer information can be understood by another host's application. The data transformation of the presentation layer includes data encryption, compression, format conversion, and so on.

Application Layer : An interface that provides access to network services for an operating system or network application.

2. Classification of IP addresses

Class A address: Starting with 0, the first byte range: 0~127;

Class B Address: Starting with 10, the first byte range: 128~191;

Class C Address: Starting with 110, the first byte range: 192~223;

Class D Address: Starting with 1110, the first byte range is 224~239;

3.        How the arp  protocol works

First, each host establishes an ARP list in its own ARP buffer to represent the correspondence between the IP address and the MAC address. When the source host needs to send a packet to the destination host, it first checks its ARP list for the MAC address of the IP address, and if so, sends the packet directly to the MAC address, and if not, initiates an ARP request broadcast packet to the local network segment. Query the MAC address of this destination host. This ARP Request packet includes the IP address of the source host, the hardware address, and the IP address of the destination host. After all hosts in the network receive this ARP request, the destination IP in the packet is checked for consistency with its own IP address. If this packet is not the same, the host first adds the MAC address and IP address of the sending side to its own ARP list, overwrites it if the IP information already exists in the ARP table, and then sends an ARP response packet to the source host. Tell the other person that it needs to find the MAC address; After the source host receives this ARP response packet, it adds the IP address and MAC address of the destination host to its own ARP list and uses this information to start the data transfer. If the source host has not received an ARP response packet, it indicates that the ARP query failed.

4. Routing devices and related layers

Physical layer : Repeater (Repeater, also called amplifier), hub.

Data Link Layer : bridge, switch.

Network layer : router.

Gateway : A device above the network layer.

5. Common routing protocols, and their differences

Common routing protocols are: RIP protocol, OSPF protocol.

RIP protocol : The lower level is the Bell Ford algorithm, it chooses the route metric (metric) is the hop number, the maximum hop number is 15 hops, if greater than 15 hops, it discards the packet.

OSPF protocol : The underlying is the Dijkstra algorithm, which is the link-State routing protocol, which selects the metric for routing is bandwidth, latency.

6. The difference between TCP and UDP

UDP is a non-connected, unreliable datagram service;

TCP is a connection-oriented, reliable byte-stream service.

7. How is TCP reliability guaranteed?

The reliability of TCP is achieved by sequential numbering and acknowledgment (ACK).

8. The entire process of the TCP three handshake and four waves


10. All procedures performed after entering www.baidu.com in the browser


Now suppose that if we enter http://www.baidu.com in the client (client) browser, and baidu.com is the server (server) to be accessed, the following is a detailed analysis of a series of protocol operations performed by the client in order to access the server:


1, the client browser through the DNS resolution to the Www.baidu.com IP address 220.181.27.48, through this IP address to find the client-to-server path. The client browser initiates an HTTP session to 220.161.27.48, and then encapsulates the packet via TCP, which is entered into the network layer.


2, in the client's transport layer, the HTTP session request into the message segment, add the source and destination port, such as the server use 80 port to listen to the client's request, the client by the system randomly select a port such as 5000, and the server to exchange, the server to return the corresponding request to the client's 5000 port. Then use the IP address of the IP layer to find the destination.


3, the client's network layer does not have the relationship between the application layer or the transport layer of things, the main thing is to find a route table to determine how to reach the server, the period may pass through a number of routers, these are the work done by the router, I do not make too much description, nothing more than to find the route through the path to the server


4, the link layer of the client, the packet is sent through the link layer to the router, through the neighbor protocol to find the MAC address of the given IP address, and then send the ARP request to find the destination address, if the response will be able to use the ARP request to answer the exchange of IP packets can now be transferred, The IP packet is then sent to the address of the server.


What are the requests for the HTTP protocol?


GET: Request to read the information that is flagged by the URL.


POST: Add information (such as comments) to the server.


PUT: Stores a document under a given URL.


Delete: Deletes the resource that is flagged by the given URL.


In HTTP, the difference between POST and GET


(1) Get is the data that is fetched from the server, and post is the data that is sent to the server.


(2) Get is the URL where the parameter data queue is added to the Action property of the submission form, and the value corresponds to the field one by one within the form, as seen in the URL of the CAs.


(3) Get transmits a small amount of data, can not be larger than the amount of data transmitted 2kb;post, generally by default is unrestricted.


(4) According to the HTTP specification, get is used for information acquisition and should be secure and idempotent.


I. So-called security means that the operation is used to obtain information rather than modify information. In other words, GET requests generally should not have side effects. That is, it simply gets the resource information, just like a database query, without modification, adding data without affecting the state of the resource.


Ii. idempotent means that multiple requests to the same URL should return the same result.


In TCP/IP, the corresponding protocol for each layer


Network layer: IP protocol, ICMP protocol, ARP protocol, RARP protocol.


Transport layer: UDP protocol, TCP protocol.


Application layer: FTP (File Transfer Protocol), Telenet (Telnet protocol), DNS (Domain name Resolution Protocol), SMTP (mail Delivery Protocol), POP3 Protocol (Post Office Protocol), HTTP protocol.


TCP-corresponding protocol and UDP-corresponding protocol


TCP corresponds to the protocol:


(1) FTP: Defines the file transfer protocol, using 21 ports. Often said that a computer opened the FTP service is to start the file transfer service. The FTP service is used to download files and upload the homepage.


(2) Telnet: It is a port for remote login, the user can remotely connect to the computer as their own identity, through which can provide a DOS-based communication service. As the previous BBS is-the pure character interface, the support BBS server will open 23 ports, external services.


(3) SMTP: Defines the Simple mail delivery protocol, which is now used by many mail servers to send mail. As the common free mail service is used in this mail service port, so in the e-mail settings-often see such SMTP port Settings This column, the server is open Port 25th.


(4) POP3: It corresponds to SMTP and POP3 is used to receive mail. Typically, the POP3 protocol uses 110 ports. Also said that, as long as you have the appropriate use of the POP3 protocol (such as Fo-xmail or Outlook), you can not Web access to the mailbox interface, directly with the mail program can receive mail (in the case of 163 mailbox there is no need to first enter the NetEase website, and then into their own mail-box to receive the letter).


(5) HTTP protocol: a transfer protocol that transmits hypertext to a local browser from a WEB server.


Protocol for UDP:


(1) DNS: Used for the domain name resolution service to convert the domain name address to an IP address. DNS is using port 53rd.


(2) SNMP: Simple Network Management protocol, using port 161th, is used to manage network equipment. Because of the many network devices, the non-connected service embodies its advantages.


(3) TFTP (trival file Transfer protocal), which uses the UDP service on well-known port 69.


15. Special IP Address


(1) Network address


The IP address consists of the network number (including the subnet number) and the host number, the host number of the network address is full 0, and the network address represents the entire network.


(2) Broadcast address


Broadcast addresses are often referred to as direct broadcast addresses in order to differentiate between restricted broadcast addresses.


The broadcast address is the opposite of the host number of the network address, and the host number is 1 in the broadcast address. When a message is sent to a broadcast address on a network, all hosts within that network can receive the broadcast message.


(3) Multicast address


The Class D address is the multicast address.


Just remember the a,b,c,d address.


Class A address begins with 00, the first byte as the network number, the address range is: 0.0.0.0~127.255.255.255;


Class B address starts with 10, the first two bytes as the network number, the address range is: 128.0.0.0~191.255.255.255;


The Class C address begins with 110, the first three bytes as the network number, and the address range is: 192.0.0.0~223.255.255.255.


The Class D address begins with 1110, and the address range is the 224.0.0.0~239.255.255.255,d class address as the multicast address (one-to-many communication);


The E-class address begins with 1111, and the address range is the 240.0.0.0~255.255.255.255,e class address, which is reserved for later use.


Notice: Only the A,B,C has the network number and the host number cent, the class D address and the class E address does not divide the network number and the host number.


(4) 255.255.255.255


This IP address refers to a restricted broadcast address. The difference between a restricted broadcast address and a general broadcast address (a direct broadcast address) is that a restricted broadcast address can only be used for a local network, and the router does not forward a packet with the destination address for the restricted broadcast address, and the general broadcast address can be broadcast either locally or across the network segment. For example: After the direct broadcast packet on the host 192.168.1.1/30, another network segment 192.168.1.5/30 can receive the datagram, and if a limited broadcast datagram is sent, it cannot be received.


Notice: The general broadcast address (direct broadcast address) can pass through some routers (not all routers, of course), while restricted broadcast addresses cannot pass through the router.


(5) 0.0.0.0


Often used to find their own IP address, such as in our RARP,BOOTP and DHCP protocol, if an unknown IP address of the diskless machine want to know their IP address, It sends IP request groupings to servers in the local scope (specifically, in the range blocked by each router) by using 255.255.255.255 as the destination address.


(6) Loopback address


127.0.0.0/8 is used as a loopback address, the loopback address represents the address of the native, often used to test the native, the most used is 127.0.0.1.


(7) A, B, Class C private address


Private addresses, also called private addresses, are not used globally and have only local meaning.


Class A private address: 10.0.0.0/8, range is: 10.0.0.0~10.255.255.255


Class B Private Address: 172.16.0.0/12, range is: 172.16.0.0~172.31.255.255


Class C Private Address: 192.168.0.0/16, range is: 192.168.0.0~192.168.255.255


The role of the NAT protocol, DHCP protocol, and DNS protocol


NAT Protocol: Network address translation (Nat,network addresstranslation) belongs to access wide area network (WAN) technology,


is a conversion technology that converts a private (reserved) address into a legitimate IP address, which is widely used in various types of Internet access and various types of networks. The reason is simple, Nat not only solves the problem of LP address insufficiency, but also can effectively avoid attacks from outside the network, hiding and protecting the computer inside the network.


DHCP protocol: Dynamic Host Provisioning Protocol (Dynamics host Configurationprotocol, DHCP)


is a LAN network protocol, using UDP protocol work, mainly has two purposes: to the internal network or network service providers automatically assigned IP address, to the user or internal network administrator as a means of central management of all computers.


DNS protocol: DNS is the abbreviation for the domain Name System, which is a core service of the Internet, as a distributed database that can map domain names and IP addresses to each other, making it easier for people to access the Internet without remembering the number of IP strings that can be read directly by the machine.


Source: http://blog.csdn.net/htq__/article/details/50929724

From for notes (Wiz)

Computer network Knowledge

Related Article

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.