Summary of basic knowledge of computer network (reproduced)

Source: Internet
Author: User
Tags ack file transfer protocol

Read the catalogue

    • 1. Network Hierarchy Division
    • 2. OSI seven-tier network model
    • 3. IP Address
    • 4. Subnet mask and network partitioning
    • 5. Arp/rarp Agreement
    • 6. Route Selection Protocol
    • 7. TCP/IP protocol
    • 8. UDP protocol
    • 9. DNS protocol
    • Ten. Nat protocol
    • One. DHCP protocol
    • HTTP protocol
    • 13. An example of

The core content of computer network learning is the study of network protocol. A network protocol is a set of rules, standards, or conventions that are established for the exchange of data in a computer network. Because the different user's data terminal may take the character set to be different, both need to communicate, must carry on the certain standard. A very image of the metaphor is our language, we have a large number of people, the local language is also very rich, and the gap between dialects is huge. The dialect of a region may not be acceptable to people in area B, so we have to communicate the national name to establish a language standard, which is our role in Putonghua. Similarly, in the world, we communicate with foreign friends in the standard language is English, so we have to hard to learn English.

Computer network protocols are as diverse as our language. The ARPA company and 1977 to 1979 launched a network protocol called ARPANET has been widely hot, the most important reason is that it launched a well-known TCP/IP standard network protocol. At present, the TCP/IP protocol has become the "common language" in the Internet, which uses TCP/IP to communicate between different computer groups.

1. Network Hierarchy DivisionIn order to enable computers from different computer manufacturers to communicate with each other in order to build up a computer network in a larger context, the International Organization for Standardization (ISO) introduced the "Open Systems Interconnection Reference Model" in 1978, the famous OSI/RM model (open system Interconnection/reference Model). It divides the communication protocol of the computer network architecture into seven layers, from bottom to top: the physical layer (Physics layer), the data link layer, the network layer, the Transport layer (Transport layer), Session layer, Presentation layer (Presentation layer), Application layer (application layer).  The fourth tier completes the data transfer service, above three levels to the user. In addition to the standard OSI seven layer model, the common network hierarchy is the TCP/IP four layer protocol and the TCP/IP five protocol, which corresponds to the corresponding relationship as shown in: 2. OSI layer Seven Network model TCP/IP protocol is undoubtedly the foundation of the Internet Protocol, without it is impossible to surf the internet, any and Internet-related operations are inseparable from the TCP/IP protocol. Whether it is the OSI seven-layer model or the four-tier, five-tier model of TCP/IP, each layer has its own proprietary protocol, which completes its own work and communicates with the upper and lower levels. Since the OSI seven layer model is the standard hierarchy of the network, we introduce the OSI seven layer model as an example from the bottom up. 1) Physical layers (physical layer)

Activates, maintains, and shuts down the mechanical characteristics, electrical characteristics, functional characteristics, and process characteristics between communication endpoints. This layer provides a reliable physical medium for the upper level protocol to transmit data. Simply put, the physical layer ensures that the original data can be transmitted on a variety of physical media. the physical layer remembers two important device names, repeaters (Repeater, also called amplifiers), and hubs.

  2) Data Link layer

The data link layer provides services to the network layer on the basis of the services provided by the physical layer, and its most basic service is to reliably transfer the data from the network layer to the target network layer of the neighboring nodes. To achieve this goal, the data link must have a series of corresponding functions, mainly: How to combine data into a data block, in the data link layer called the Data block frame, the frame is the transmission unit of the Data link layer, how to control the transmission of the frame on the physical channel, including how to deal with transmission errors, How to adjust the send rate to match the receiver, and to provide management of the establishment, maintenance, and release of data link paths between the two network entities. 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.

Important points of knowledge about the data link layer:

  The 1> Data link layer provides the network layer with reliable data transmission;

2> Basic data Unit is frame;

3> Main protocol: Ethernet protocol;

4> two important device names: bridges and switches.

  3) Network layer

The purpose of the network layer is to realize the transparent transfer of data between two end systems, including addressing and routing, establishing, maintaining and terminating the connection. It provides services that do not require the transport layer to understand the data transfer and switching technologies in the network. If you want to use as few words as possible to remember the network layer, it is "path selection, Routing and logical addressing."

There are many protocols involved in the network layer, including the most important protocol and the core protocol--IP protocol of TCP/IP. The IP protocol is simple enough to provide only unreliable, non-connected delivery services. The main functions of IP protocol are: non-connected datagram transmission, datagram Routing and error control. With the IP protocol used to implement its functions, there are address Resolution Protocol ARP, reverse address Resolution Protocol RARP, Internet Message Protocol ICMP, Internet Group Management Protocol IGMP. Specific protocols we will summarize in the following sections, the focus of the network layer is:

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

2> Basic data unit is IP datagram;

3> contains the main protocols:

IP protocol (Internet Protocol, Internet Interconnection Protocol);

  ICMP protocol (Internet Control message Protocol, Internet Controlled message Protocol);

  ARP protocol (address Resolution Protocol, addresses resolution Protocol);

RARP protocol (Reverse address Resolution Protocol, reverse addressing protocol).

4> important devices: routers.

  4) Transport Layer (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.

The task of the Transport layer is to provide the function of establishing, maintaining and canceling the transmission connection, and responsible for the reliable end-to-end data transmission, according to the characteristics of the communication subnet and the best utilization of network resources for the session layer of the two-terminal system.  In this layer, the Protocol Data unit of the information transmission is called a segment or a message.  The network layer simply transmits the packet from the source node to the destination node based on the network address, while the transport layer is responsible for reliably transmitting the data to the appropriate port. Focus on the network layer: The 1> Transport layer is responsible for segmenting upper-layer data and providing end-to-end, reliable or unreliable transmission, as well as end-to-end error control and flow control issues; 2> contains the main protocol: TCP protocol (transmission Control Protocol, Transmission Protocol), UDP protocol (user Datagram Protocol, Subscriber Datagram Protocol); 3> Important device: Gateway.

  5) 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.

  6) 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.

  7) Application Layer

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

Session layer, presentation layer, and application layer focus:

  1> Data Transmission Unit is a message;

2> contains the main protocols: FTP (File Transfer Protocol), Telnet (Telnet protocol), DNS (Domain name Resolution Protocol), SMTP (mail Delivery Protocol), POP3 Protocol (Post Office Protocol), HTTP protocol (Hyper Text Transfer Protocol).

3. 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.

Let's recall the following A,b,c,d-class 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.

Note: Only the A,B,C has the network number and the host number, the Class D address and the class E address do 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.

Note: 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

4. Subnet mask and network partitioning

With the continuous expansion of the application of the interconnection network, the drawbacks of the original IPv4 are gradually exposed, that is, the network number occupies too much, and the host number is too small, so it can provide more and more host address is scarce, at present, in addition to using NAT within the enterprise using reserved address self-distribution, Typically, a high-class IP address is re-partitioned to form multiple subnets for use by user groups of different sizes.

The main purpose here is to effectively use IP address in network segmentation, by the high portion of the host number as the subnet number, from the usual network bit boundaries to expand or compress the subnet mask, to create a class of address more subnets. However, when more subnets are created, the number of available host addresses on each subnet is less than the original.

  What is a subnet mask?

The subnet mask is a 32-bit binary address that flags whether two IP addresses belong to a subnet, and each of the 1 represents the bit as a network bit and 0 for the host bit. It is also represented as an IP address using dotted decimal. If the two IP addresses have the same results as the bitwise AND of the subnet mask, they are all in the same subnet.

  When calculating the subnet mask, we should pay attention to the reserved address in the IP address, namely "0" address and broadcast address, they refer to the host address or network address is all "0" or "1" when the IP address, they represent the network address and broadcast address, generally cannot be counted.

  Calculation of the subnet mask:

For IP addresses that do not need to be partitioned into subnets, their subnet masks are simple enough to be written according to their definition: If a class B IP address is 10.12.3.0, the subnet mask of the IP address is 255.255.0.0. If it is a Class C address, its subnet mask is 255.255.255.0. Other analogies are no longer detailed. Below our key to introduce is an IP address, also need to its high-level host bit again as the partition of the subnet network number, the remaining is the host number of each subnet, then how to do each subnet mask calculation.

Here's a summary of common interview questions about subnet masks and network partitioning:

1) Use the number of subnets to calculate

Before you can find the subnet mask, you must first understand the number of subnets to divide, and the number of required hosts within each subnet.

(1) The number of subnets is converted into binary to represent;

If you want to divide Class B IP address 168.195.0.0 into 27 subnets: 27=11011;

(2) The number of bits obtained for the binary is n;

The binary is a five-digit number, N = 5

(3) Obtains the class subnet mask of the IP address, the first n position of its host address Part 1 that is the subnet mask of the IP address division subnet.

The subnet mask of Class B address 255.255.0.0 the host address of the first 5 position 1, get 255.255.248.0

  2) Use the number of hosts to calculate

If you want to divide Class B IP address 168.195.0.0 into several subnets, there are 700 hosts in each subnet:

(1) Convert the number of host to binary to represent;

700=1010111100;

(2) If the number of hosts is less than or equal to 254 (note that the reserved two IP addresses), then get the host's bits number, N, here is definitely n<8. If it is greater than 254, then n>8, which means that the host address will occupy more than 8 bits;

The binary is a 10-digit number, n=10;

(3) Use 255.255.255.255来 the number of host address bits for the IP address to 1, then the n bits from the back forward are all set to 0, which is the subnet mask value.

Set the subnet mask of the Class B address to the host address of the 255.255.0.0 all 1, get 255.255.255.255, then from the back forward will be 10 position 0, That is: 11111111.11111111.11111100.00000000, that is, 255.255.252.0. This is the subnet mask that you want to divide into class B IP address 168.195.0.0, which hosts 700 units.

  3) There is also a type of question, you want to based on the number of hosts per network subnet address planning and calculates the subnet mask. This can also be calculated in accordance with the above principles.

For example, if a subnet has 10 hosts, the IP address required for this subnet is:

10+1+1+1=13

  Note: The first 1 plus refers to the gateway address required for this network connection, and the next two 1 refer to the network Address and broadcast address.

Because 13 is less than 16 (16 equals 2 of 4), the host bit is 4 bits. And 256-16=240, so the subnet mask is 255.255.255.240.

If a subnet has 14 hosts, many people often make the mistake of still allocating a subnet with 16 address space and forgetting to assign an address to the gateway. This is wrong because 14+1+1+1=17,17 is greater than 16, so we can only allocate subnets with 32 addresses (32 equals 2 of the 5-square) space. At this point the subnet mask is: 255.255.255.224.

5. Arp/rarp Agreement

  The Address Resolution Protocol, known as ARP Resolution Protocol, is a TCP/IP protocol that obtains physical addresses based on IP addresses. when the host sends the message, the ARP request containing the destination IP address is broadcast to all hosts on the network, and the return message is received to determine the physical address of the target, and when the return message is received, the IP address and physical address are stored in the native ARP cache and retained for a certain amount of time. Query the ARP cache directly on the next request to conserve resources. The Address Resolution Protocol is based on the trust of each host in the network, the host on the network can send the ARP reply message autonomously, and the other host will not detect the authenticity of the message when it receives the reply packet, which will be credited to the native ARP cache, thus the attacker can send a pseudo-ARP reply message to a host. Causing the information to be sent cannot reach the intended host or reach the wrong host, which constitutes an ARP spoofing. The arp command can be used to query the corresponding relationship between the IP address and MAC address in the native ARP cache, add or remove static correspondence, and so on.

Examples of ARP workflow:

Host A's IP address is 192.168.1.1,mac address is 0a-11-22-33-44-01, Host B's IP address is 192.168.1.2,mac address is 0a-11-22-33-44-02, when host A to communicate with Host B, Address Resolution Protocol can resolve host B's IP address (192.168.1.2) to Host B's MAC address, the following is the workflow: (1) According to the contents of the routing table on host A, IP determines the forwarding IP address used to access Host B is 192.168.1.2.  The A host then checks Host B's matching MAC address in its own local ARP cache. (2) If host A does not find a mapping in the ARP cache, it will ask the 192.168.1.2 's hardware address to broadcast the ARP request frame to all hosts on the local network. The IP address and MAC address of source host A are included in the ARP request. Each host on the local network receives an ARP request and checks to see if it matches its own IP address.  If the host discovers that the requested IP address does not match its own IP address, it discards the ARP request.  (3) Host B determines that the IP address in the ARP request matches its own IP address, and adds the IP address and MAC address mappings for host A to the local ARP cache.  (4) Host B sends an ARP reply message containing its MAC address directly back to host a. (5) When host a receives an ARP reply message from Host B, the ARP cache is updated with the IP and MAC address mappings of Host B. The native cache has a lifetime, and after the lifetime is over, the above procedure is repeated again. Once the MAC address of Host B is determined, host a can send IP traffic to Host B.

  Inverse Address Resolution Protocol, that is, the Rarp, the function and the ARP protocol, which translates the physical address of a host in the LAN to an IP address , such as a local area network host only know the physical address and do not know the IP address, A broadcast request to solicit its own IP address can then be issued through the RARP protocol, which is then answered by the RARP server.

RARP Protocol Workflow:

(1) Send a local RARP broadcast to the host, declare its own MAC address in this broadcast packet, and request any RARP server that receives this request to assign an IP address;

(2) When the RARP server on the local network segment receives this request, it checks its Rarp list to find the IP address corresponding to the MAC address;

(3) If present, the RARP server sends a response packet to the source host and provides the IP address to the other host for use, (4) The RARP server does not respond to this if it does not exist, (5) The source host receives the response from the RARP server and communicates with the IP address it obtains If the response to the RARP server has not been received, it indicates that the initialization failed. 6. Route Selection Protocol

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 ProtocolOpening shortest Path first Open Shortest path priority, underlying is the Dijkstra algorithm, is the link state routing protocol, it chooses the metric of the route is bandwidth, latency. 7. TCP/IP protocol The TCP/IP protocol is the basic protocol of Internet and the foundation of Internet, which consists of the IP protocol of the network layer and the TCP protocol of the Transport layer. In layman's terms: TCP is responsible for discovering the problem of transmission, signaling when there is a problem, and requesting retransmission until all data is safely and correctly transmitted to the destination. IP is a single address for every networked device on the Internet. The IP layer receives packets sent from a lower layer (such as an Ethernet device driver) and sends the packet to a higher-level---TCP or UDP layer, whereas the IP layer transmits packets received from the TCP or UDP layer to the lower level. IP packets are unreliable because IP does not do anything to verify that packets are sent sequentially or corrupted, that the IP packet contains the address (source address) of the host that sent it, and the address of the host receiving it (the destination).

TCP is a connection-oriented communication protocol, the connection is established through three handshake, the communication is completed to remove the connection, because TCP is connection-oriented so can only be used for end-to-end communication. TCP provides a reliable data flow service, using "positive confirmation with retransmission" technology to achieve the reliability of transmission. TCP also uses a method called "sliding window" for traffic control, so-called window actually represents the ability to receive, to limit the sending speed.

  TCP Packet Header format:

  Three handshake and four waves of the TCP protocol:

Note: Seq: "sequance" serial number;ack: "Acknowledge" confirmation number;SYN: "Synchronize" request synchronization flag;; ACK: " Acknowledge "confirm sign";FIN: "Finally" End flag.

  TCP connection Establishment process: First the client side sends the connection request message, the Server section accepts the connection to reply the ACK message, and allocates the resources for this connection. An ACK message is also sent to the server segment after the client receives an ACK message, and the resource is allocated so that the TCP connection is established.

  TCP Connection Disconnect process: Assume that client side initiates an interrupt connection request, which is to send a fin message. After the server receives the fin message, it means "My client has no data to send to you", but if you have data that is not sent, you do not need to close the socket, you can continue to send data. So you first send an ACK, "tell the client that your request I received, but I am not ready, please continue to wait for my message." At this point the client enters the fin_wait state and continues to wait for Fin messages on the server side. When the server side determines that the data has been sent, the fin message is sent to the client side, "Tell the client side, OK, my side of the data is finished, ready to close the connection." Client side received fin message, "I know can shut down the connection, but he still do not believe the network, afraid the server side do not know to shut down, so send an ACK into the time_wait state, if the server does not receive an ACK can be re-transmitted. "When the server side receives an ACK," You know you can disconnect. " Client side waiting for 2MSL still not received a reply, the server side has been properly shut down, well, I can also close the client terminal connection. The OK,TCP connection is closed like this!

  Why do you have to wave three times?

In the case of only two "handshake", suppose the client wants to establish a connection with the server, but because the datagram of the connection request is lost, the client has to resend it again; this time the server receives only one connection request, so the connection can be established properly. However, sometimes the client resend the request is not because the datagram is lost, but it is possible that the data transfer process because the network concurrency is very large in a node is blocked, in this case the server side will receive 2 requests, and continue to wait for two client requests to send data to him ... The problem is here, the cient side actually only one request, and the server side has 2 responses, the extreme situation may be due to the client side repeatedly resend the request data caused by the server side finally established N multiple response waiting, resulting in a great resource waste! So, "three-time handshake" is necessary!

  Why do you have to wave four times?

Imagine if you were a client now, what would you do if you wanted to disconnect all the connections to the server? In the first step, you stop sending data to the server and wait for the server to reply. But the thing is not finished, although you do not send data to the server, but because you have established an equal connection, so at this time he also has the initiative to send you data, so the server side also have to terminate the initiative to send you data, and wait for your confirmation. In fact, plainly is to ensure that the two sides of a contract to complete the implementation!

Protocol using TCP: FTP (File Transfer Protocol), Telnet (Telnet protocol), SMTP (Simple Mail Transfer Protocol), POP3 (and SMTP relative, for receiving mail), HTTP protocol, etc.

8. UDP protocol UDP User Datagram Protocol, is for the non-connected communication protocol, UDP data including the destination port number and the source port number information, because the communication does not need to connect, so it can achieve broadcast transmission. UDP communication does not need to be confirmed by the receiver, is unreliable transmission, there may be packet loss phenomenon, practical applications require programmer programming verification. UDP is located at the same level as TCP, but it does not matter the order, error, or re-send of packets. Therefore, UDP is not applied to connection-oriented services that use virtual circuits, and UDP is primarily used for services that are query-----responsive, such as NFS.  These services need to exchange less information relative to FTP or telnet. Each UDP message is divided into two parts: UDP header and UDP data area. The header consists of four 16-bit long (2-byte) fields that describe the source port, destination port, message length, and checksum value of the message respectively. The UDP header consists of 4 domains, each of which occupies 2 bytes, as follows:
(1) Source port number, (2) Target port number, (3) datagram length; (4) checksum value. The use of UDP protocol includes: TFTP (Simple File Transfer Protocol), SNMP (Simple Network Management Protocol), DNS (Domain name Resolution Protocol), NFS, BOOTP. TCP   with the   UDP   The difference:TCP is a connection-oriented, reliable byte-stream service; UDP is a non-connected, unreliable datagram service. 9. DNS protocol DNS is an abbreviation for the Domain Name System (Domainnamesystem) that is used to name computers and network services that are organized into a domain hierarchy. can be simply understood as converting URLs to IP addresses。 Domain name is a string of dots separated by a series of words or abbreviations, each domain name corresponds to a unique IP address, the Internet domain name and IP address is one by one corresponding to DNS is the server for domain name resolution. DNS naming is used in TCP/IP networks such as the Internet to find computers and services through a user-friendly name. Ten. Nat protocol

  The NAT network address translation (translation) is an Access wide area network (WAN) technology that transforms 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.

One. DHCP protocol

The DHCP Dynamic Host Provisioning Protocol (PROTOCOL) is a LAN protocol that works with the UDP protocol and has two uses: automatically assigning IP addresses to internal networks or network service providers, For users or internal network administrators as a means of central management of all computers.

HTTP Protocol Hypertext Transfer Protocol (Http,hypertext Transfer Protocol) is one of the most widely used network protocols on the Internet. All WWW documents must comply with this standard.

HTTP What requests are included in the agreement?

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.

HTTP , The difference between POST and GET

1) Get gets the data 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 in the form, which can be seen in the URL.

3) The amount of data sent by get is small and cannot be larger than the amount of data transmitted by 2kb;post, which is generally not restricted by default.

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.

13. An example of

enter in the browser All the procedures performed after www.baidu.com

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 resolves to the IP address of the www.baidu.com through DNS to 220.181.27.48, which locates the client-to-server path through this IP address. 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 is not related to the application layer or the transport layer of things, the main thing is to find the routing table to determine how to reach the server, during the period may pass through a number of routers, these are done by the router, not too much description, is simply to find the route table to reach the server through that path.

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 you get a response, you can use the ARP request answering the IP packets can now be transferred, The IP packet is then sent to the address of the server.

Summary of basic knowledge of computer network (reproduced)

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.