One, the main three kinds of network
(1) Telecommunications Network (telephone network), responsible for voice communications, that is, call, answer the phone.
(2) Cable TV network, mainly provide video services.
(3) computer network, mainly data transmission services, that is, resource sharing, the main service is the Internet.
Three kinds of networks transmit information under their respective communication protocols and provide communication services to users.
Second, computer network background
Since the 1940s, people have dreamed of having a world-wide information base. In this repository, information can be accessed not only by people around the world, but also easily linked to information elsewhere, making it easy and quick for users to access important information. As a result, the internet emerged.
The internet is ubiquitous, and the Internet is one of the internet, called the Internet, but it is not the only internet in the world. In Europe, for example, there are "European Union Networks" (euronet), "European Academic and Research Network" (EARN), "European Information Network" (EIN), and "International Academic Network" (BITNET) in the United States, as well as the worldwide "flying Multi-Network" (Global BBS System).
The main services provided by the Internet are the World Wide Web (WWW), file transfer (FTP), e-mail (email), Telnet (telnet), mobile phone (3GHZ), etc. The World Wide Web Consortium is known as www.
The World Wide Web (WWW) is often referred to as the web. Divided into Web clients and Web server programs. WWW allows Web clients (browsers) to access pages on a Web server in accordance with Hypertext Transfer Protocol (HTTP). WWW is a system of many interconnected hypertext that can be accessed over the Internet. In this system, each useful thing is called the same "resource" and is identified by a global "Uniform Resource Identifier" (URI), which is passed to the user via the Hypertext Transfer Protocol (hypertext Transfer Protocol), which is then clicked on to obtain resources.
Third, the composition of the Internet
The internet is mainly composed of core and marginal parts, and the core of the network is the most complex part of the Internet. The core part of the network provides connectivity to a large number of hosts in the network edge, allowing any host in the edge to communicate with other hosts (that is, to transmit or receive various forms of data).
The core of the Internet is made up of many networks and routers that interconnect them, while the host is at the edge of the Internet. Routers in the core of the Internet are usually connected by high-speed links, while the host at the edge of the network is connected to the core in a relatively low-speed link.
The communication between programs running in the end system of the network edge can usually be divided into two categories: Client server (c/s) and peer mode. There is also a browser server mode (b/S mode) is a special case of C/S method.
Four, inter-node information transmission mode in the Internet
1, Circuit switching
Circuit switching first establishes a connection at the sending and receiving end, then transmits the message past and finally releases the connection. Three phases of circuit switching: Establish connections, communicate, release connections. Communication between two nodes is realized through the switch in circuit switching. A circuit exchange used by a telecommunications network (telephone network).
2, Message exchange
In the process of communication, the communication between the two parties is called message exchange, which realizes the communication mode of data interaction by using the storage-forwarding mechanism. Send a telegram to use for the exchange of messages.
3, packet switching
Packet switching uses the same storage-forwarding mechanism as the message exchange, but packet switching divides the messages into multiple groupings, grouping them into units and using the storage-forwarding mechanism to achieve data interaction. On the sending side, the longer messages are divided into short, fixed-length data segments, each data segment is preceded by the first constituent group, each packet is sent to the receiving end, the receiving end receives the packet, strips the header, and assembles it into a message. A packet exchange used by a computer network.
Five, Route selection protocol
After the message is split into groups, from the sending side, through a number of routers to reach the receiving end, these routers according to a certain routing protocol according to the packet header address packet forwarding to the appropriate port, routing protocol is very important.
1. About "Best Route"
(1.1) There is no absolute optimal routing algorithm.
(1.2) The so-called "best" can only be compared to a specific requirement to obtain a more reasonable choice.
(1.3) The actual route selection algorithm should be as close as possible to the ideal algorithm.
(1.4) Route selection is a very complex problem.
(1.4.1) It is the result of co-ordination of all nodes in the network.
(1.4.2) The environment in which routing is selected is often changing, and this change is sometimes not known in advance.
2, from the routing algorithm of self-adaptability considerations:
(2.1) Static route selection strategy, which is non-adaptive routing, is characterized by simple and low cost, but it can not adapt to the change of network state in time.
(2.2) Dynamic routing strategy, i.e. adaptive routing, is characterized by its ability to adapt to the changes of network state, but it is more complex and expensive to implement.
3, the Internet in two major types of routing protocol:
(3.1) Internal Gateway protocol IGP (Interior Gateway Protocol), which is a routing protocol used within an autonomous system. This type of routing protocol is most commonly used, with a number of specific protocols, such as RIP and OSPF protocols. Rip:routing Information Protocol Routing Information protocol. Three points of the RIP Protocol: (a) exchanging information only with neighboring routers. (b) The information exchanged is all information known to the current router, i.e. its own routing table. (c) Exchange routing information at regular intervals, for example, every 30 seconds; Ospf:open Shortest Path First Open Shortest path takes precedence.
(3.2) External Gateway Protocol EGP (External gateway Protocol), if the source station and destination station are in different autonomous systems, when the data is transmitted to the boundaries of an autonomous system, it is necessary to use a protocol to pass routing information to another autonomous system. Such a protocol is an external gateway protocol EGP. BGP-4 is currently the most used in the external gateway protocol. Bgp:border Gateway Protocol Border Gateways protocol. BGP is the protocol for exchanging routing information between routers of different autonomous systems. Border Gateway Protocol BGP is only trying to find a better route that can reach the destination network (not in circles), rather than looking for an optimal route.
VI, network protocol
The rules, standards, or conventions established for the exchange of data in the network are called network Protocols, and network protocols are referred to as protocols. It consists of three elements: (1) syntax, i.e., the organization or format of data and control information, and (2) semantics, namely, what control information needs to be emitted, what action to complete and what response; (3) synchronization, which is a detailed description of the sequence of event implementations.
Thus, network protocol is an indispensable part of computer network. In fact, as long as we want to connect to another computer on the network to do something, we need to have a protocol. For very complex computer network protocol, its structure should be hierarchical, we put the various layers of computer network and the set of protocols to become the network architecture. The architecture is abstract, while entities are concrete and are really running computer hardware and software.
Seven, the architecture of the computer network
There are two architectures of the computer network: (1) The OSI seven-layer protocol architecture, the concept is clear, the theory is complete, but it is both complex and not practical. (2) TCP/IP four-tier architecture, it has been widely used, but in essence, TCP/IP has only the top three, because the bottom of the network interface layer and there is no specific content. Therefore, in the study of the principle of computer networks using a compromise approach, that is, the advantages of integrated OSI and TCP/IP, using a five-layer protocol-based architecture.
Assume that two hosts in a network are connected, transferring data between them, and the application process's data undergoes a change in the transfer process between layers, as shown in.
Entity, which represents any hardware or software process that can send or receive information, a protocol that controls the collection of rules that communicate with two peer entities (or multiple entities), and under the control of the Protocol, the communication between two peer entities enables the layer to provide services on a level. To implement this layer of protocol, you also need to use the services provided in the following layer. Thus, the agreement is horizontal, and the service is vertical.
What we call the TCP/IP protocol is the TCP/IP protocol family, which is the TCP/IP four layer of all protocol collections. The TCP/IP protocol family is characterized by the upper and lower two large and middle small: the application layer and the network interface layer have a variety of protocols, and the middle of the IP layer is very few, the upper layer of the various protocols are converging down to an IP protocol. The compromise is like an hourglass. The TCP/IP protocol family of the shape of the timer indicates that the TCP/IP protocol can serve a wide variety of applications, and that the TCP/IP protocol allows the internet to run on a wide variety of network components. It is not difficult to see the IP protocol in the one-day network core role.
Eight, the five-storey structure of computer network
1, Physical Layer
A data communication system can be divided into three parts, i.e. source systems (including source points and transmitters), transmission systems and destination systems (including receivers and endpoints). Information change process is: The computer text into digital bit stream (digital signal), through the modem into analog signal, the analog signal sent to the receiving end, the receiving end of the analog signal into a digital bit stream (digital signal), and then converted to text, displayed in the computer. Specific process
The purpose of communication is to send messages, such as voice, text, images, etc., as messages. The data is the entity that transports the message. The signal is the electrical or electromagnetic performance of the data. The signal can be divided into analog signal and digital signal, analog signal (or continuous signal), representing the parameters of the message is continuous, digital signal (or discrete signal), the value of the parameter representing the message is discrete, when the waveform of the time domain is used to represent the digital signal, The basic waveform representing different discrete values is called a code element. When using binary encoding, there are only two different code elements, one representing 0 and the other representing the 1 state.
In the computer network to use the term "channel", the channel is different from the circuit, the channel generally represents the media to send messages to a certain direction. Therefore, a communication circuit often contains a transmit channel and a receiving channel. From the way of communication between the two sides of the information, there are three ways: (1) simplex communication, can only have one direction of communication without the opposite direction of the interaction, radio or cable radio and television broadcasts belong to this type. (2) Half-duplex communication, both sides of the communication can send messages, but cannot send simultaneously. This mode of communication is sent by the other party to receive, over a period of time in turn. (3) Full-duplex communication, both sides of the communication can send and receive information at the same time. Simplex communication requires only one channel, while half-duplex and full-duplex communication requires two channels. Obviously, the transmission efficiency of two-way simultaneous communication is highest.
2, Data Link Layer
The data link layer belongs to the bottom of the computer network, there are two types of channels used: (1) Point-to-point channel, using one-to-one point-to-point communication mode. Using a point-to-Point Protocol PPP, in the age of poor communication, the use of an open transport protocol at the data link layer was once a good idea, so high-level data link control HDLC for reliable transmission became the more popular Data Link layer protocol, but now HDLC is seldom used, for point-to-point links, A much simpler point-to-Point protocol PPP is the most widely used data Link layer protocol, and the PPP protocol is the data Link layer protocol used by the user's computer and ISP to communicate. (2) Broadcast channel, this channel uses a one-to-many broadcast communication mode, so the process is complex, broadcast channels connected to a large number of hosts, must use a dedicated shared channel protocol to coordinate the data transmission of these hosts.
LAN is the use of broadcast channels, LAN characteristics of the network is a unit owned, and the geographical location and the number of sites are limited. LAN has the following advantages: (1) has a broadcast function, from a site can easily access the entire network, the host on the local area network can share a variety of hardware and software resources connected to the LAN. (2) To facilitate the expansion and gradual evolution of the system, the location of the equipment can be flexibly adjusted and changed. (3) Improve the reliability, availability and survivability of the system.
The topological structure of LAN is star-shaped network, ring network, bus network and tree-shaped network. Because of the emergence of hubs and the large number of twisted-pair wires used in LAN, star Ethernet and multi-level star-shaped Ethernet have gained a wide range of applications. Ring network, the most typical is the token ring network, referred to as Token Ring, bus network, each station directly connected to the bus, The matching resistors at both ends of the bus absorb the energy of the electromagnetic signal transmitted on the bus, and avoid harmful electromagnetic wave reflection on the bus. Bus network can use two kinds of protocols, one is Ethernet, the other is token delivery bus network, that is, the bus network is physically a token ring network logically. The former bus network has evolved into a star-shaped network, and then a token-passing bus network has exited the market. A local area network using the Ethernet specification is called an Ethernet, and a local area network using a token network specification is called a token ring network. Most LANs now have Ethernet.
On the local area network, it is often a transmission medium connected with multiple computers (such as bus type and ring type LAN), that is, everyone shares the same transmission medium. While a transmission medium can only be used by one computer at a time, who can use or access the transmission media at a certain moment? This requires a common guideline for controlling and coordinating the simultaneous access of a computer to a transmission medium, which is either a protocol or a media access control method. According to this, LAN can be divided into Ethernet, Token Ring network and so on.
Ethernet (Ethernet) refers to the baseband LAN specification created by Xerox and jointly developed by Xerox, Intel, and Dec, which is the most common standard of communication protocol used by existing LANs today. The Ethernet network uses CSMA/CD (carrier monitoring multiplexing and collision detection) technology and operates on multiple types of cables at 10m/s rates. Ethernet is similar to the IEEE802.3 series standard.
3, Network Layer
Internet Protocol IP is one of the two most important protocols in the TCP/IP system and one of the most significant Internet protocol protocols. There are four protocols that are used with IP protocol: Address Resolution Protocol ARP, obtain its physical address according to IP address, reverse Address Resolution Protocol RARP, obtain its IP address according to physical address, Internet Control Message Protocol ICMP, Internetwork Group Management Protocol IGMP. The relationship between IP protocol and its supporting protocol is as follows,
4, Transport Layer
From the point of view of communication and information processing, the Transport layer provides communication services to the application layer above it, which belongs to the highest level of the communication part, and also the bottom of the user's function. When the host in the edge part of the network uses the function of the core part of the network for end-to-end communication, only the host's protocol stack has the transport layer, and the routers in the core of the network only use the function of the next three layers when forwarding packets.
The transmission layer mainly has two protocols, all are the official Internet standard, (1) User Datagram Protocol UDP[RFC 768], (2) Transmission Control Protocol TCP[RFC 793]. The Transport layer protocol in the TCP/IP system is as follows:
The Transport Layer Protocol (UDP or TCP) used primarily by the application and application layer protocols is shown in the following table.
The port number of the transport layer is divided into the following two categories: (1) server-side port number used, here are divided into two categories, the most important class is known as the port number or the system port number, the value is 0---1023, these values can be found in the URL www.iana.org. such as the FTP port number 21,telnet port number 23,smtp port number 25,dns port number 53,tftp port number 69,http port number 80,snmp port number 161,SNMP (TRAP) port number 162. The other class is called the registration port number, the value is 1024-49151, such a port number is used for applications that do not have a well-known port number. (2) The port number used by the client, the value is 49152-65535. Because such port numbers are only dynamically selected when the client process is running, they are also called ephemeral port numbers.
User Datagram Protocol UDP, the User Datagram Protocol UDP only adds a little bit of functionality to the IP Protocol datagram service, which is the function of multiplexing and splitting and error detection. The main features of UDP are: (1) UDP is not connected, that is, no connection is required before the data is sent (the sending data ends and no connection is released), thus reducing the overhead and delay before sending the data. (2) UDP uses the best effort to deliver, that is, does not guarantee reliable delivery, so the host does not need to maintain a complex connection state table. (3) UDP is a message-oriented, the sender of the UDP to the application of the message, after the addition of the header is delivered down to the IP layer. UDP does not merge or split the messages that are delivered by the application layer, but retains the boundaries of these messages. The application layer to the UDP long message, UDP is sent, so the application layer must choose the appropriate size of the message, or reduce the efficiency of the IP layer.
UDP Benefits: (1) UDP does not have congestion control, so congestion on the network does not degrade the sending rate of the source host, which is important for some real-time applications. Many real-time applications (such as IP telephony, real-time video conferencing, etc.) require the source host to send data at a constant rate, and allow some data to be lost while the network is congested, but the data is not allowed to have too much latency, and UDP is just right for this requirement. If many source hosts simultaneously send high-rate real-time video streams to the network, congestion can occur in the network, so UDP can cause serious network congestion problems. (2) UDP supports a pair of one or one-to-many, many-to-one, and many-to-many interactive communications. (3) The first overhead of UDP is small, only 8 bytes, which is shorter than the first 20 bytes of TCP.
TransmissionControl Protocol TCP, TCP protocol is more complex, TCP main features: (1) TCP is a connection-oriented transport layer protocol, the application layer before using the TCP protocol, must first establish a TCP connection, after the transfer is complete, must release the established TCP connection. (2) Each TCP connection can have only two endpoints, and each TCP connection can only be point-to-point (one-to-one). (3) TCP provides services that are reliably delivered, that is, data that is transmitted over a TCP connection, error-free, not lost, not duplicated, and arrives sequentially. (4) TCP provides full-duplex communication. (5) For byte streams, the "stream" in TCP refers to a sequence of bytes flowing into or out of the process. The meaning of "byte stream oriented" is that although the interaction between the application and TCP is a block of data at a time (varying in size), the sender TCP sends the sender application data as a series of unstructured byte streams. Sender TCP does not know the meaning of the transmitted byte stream, and does not guarantee that the data blocks received by the receiving application and the data blocks emitted by the application have a corresponding size relationship (for example, the sender application gives the sender TCP10 chunks of data, However, the receiver TCP may use only 4 data blocks to deliver the received byte stream to the upper-level application. However, the receiver application receives a byte stream that must be the same as the byte stream emitted by the sender application.
TCP and UDP are completely different in the way they are sent, and TCP does not care about how long the application process sends packets to the TCP cache at a time. TCP determines how many bytes a message segment should contain based on the window value given by the other and the current congestion level of the network (the length of the packet sent by UDP is given by the application process). If the data block that the application process transmits to the TCP cache is too long, TCP can divide it by a short amount. If the application process only sends one byte at a time, TCP can also wait for the accumulation of enough words to be sent out again to form the message segment.
TCP the reliable transmission of TCP the flow control, TCP congestion control, it's important to have TCP management of transport connections. TCP is a connection-oriented protocol, where transport connections are used to transmit TCP packets, and the establishment and release of TCP transport connections is an essential process in every connection-oriented communication. Therefore, there are three phases of the transport connection: connection establishment, data transfer, and connection release.
TCP The connection is established, three times the handshake . , assuming that host A is running a TCP client, and B runs a TCP server program, the TCP processes at both ends are in the closed (off) state, a actively opens the connection, and B passively opens the connection.
The TCP server process for B first creates the transport control block TCB, ready to receive connection requests from the client process. The server process is then in a listen (answer) state, waiting for the client's connection request. If there is, make the corresponding.
A TCP client process is also the first to create a Transport control module TCB, then send a connection request packet to B, then the same part of the header syn=1, and select an initial sequence number seq=x. TCP Specifies that the SYN message segment (that is, the syn=1 segment) cannot carry data, but consumes a sequence number. At this point, the TCP client process enters the syn-sent (synchronous sent) state.
b After receiving the connection request message segment, agree to establish a connection, then send acknowledgement to a. In the confirmation message section should be the SYN bit and the ACK bit 1, the confirmation number is ack=x+1, but also for their own selection of an initial sequence number seq=y. Please note that this segment is also not able to carry data, but it also consumes a serial number. At this point the TCP server process enters the SYN-RCVD (synchronously received) state.
TCP connection release is a four-time handshake.
5, Application Layer
Application layer has domain Name System DNS, File Transfer Protocol FTP, remote terminal Protocol Telnet, World Wide Web www (mainly using HTTP protocol), e-mail (mainly using SMTP protocol), Dynamic Host Configuration Protocol DHCP, Simple Network Management protocol SNMP, application process across network communication.
Summary of basic knowledge of computer network