[Computer Network] Computer Network Study Notes

00. Table of Contents

01. Learning Objectives

02. Overview of Computer Networks

2.1 Computer network

Insert image description here

"Triple Network Integration": Integration of modern computer network technology
Insert image description here

Internet (Internet: currently the most popular and de facto standard translation): the world's largest and most important computer network

Internet+: a new economic form

  • Refers to "Internet + various traditional industries".
  • Deeply integrate the innovative achievements of the Internet into various economic and social fields.
    Insert image description here

Negative effects of the Internet

Insert image description here

2.2 Overview of the Internet

Computer network : It consists of several nodes and links connecting these nodes. Nodes can be computers, hubs, switches or routers, etc.

Insert image description here

Internet (internetwork or internet): Multiple networks are connected to each other through some routers to form a computer network with larger coverage. "network of networks".

Insert image description here

Networks and the Internet

  • Network: Connecting many computers together.
  • Internet: Many networks are connected together through some routers. Computers connected to a network are often called hosts.

2.3 Three stages of Internet development

Phase 1: 1969 – 1990

  • ARPANET: Originally a single packet-switched network, not an Internet network.
  • In 1983, the TCP/IP protocol became the standard protocol on ARPANET, allowing all computers using the TCP/IP protocol to communicate with each other using the Internet.
  • People regard 1983 as the year when the Internet was born.
  • In 1990, ARPANET officially announced its closure.

Insert image description here

Second phase: 1985 – 1993

  • National Science Foundation Network NSFNET.
  • Three-level structure: backbone network, regional network and campus network (or enterprise network).
  • Covering major universities and research institutes across the United States, it has become a major component of the Internet.
    Insert image description here

Phase Three: 1993 – Present

  • The Internet Service Provider (ISP) appeared:

    • Provides access to the Internet.

    • A certain fee is required.

  • Multi-level ISP structure:

    • Backbone ISP, regional ISP and local ISP.
    • Differences in coverage area and number of IP addresses owned

Insert image description here

  • Internet Exchange Point IXP (Internet eXchange Point): allows two networks to be directly connected and quickly exchange packets.
    • Network switches working at the data link layer are often used.
    • The peak throughput of the world's largest IXPs is in the Tbit/s level.
  • Content Provider: A company that provides video and other content to all users on the Internet. No Internet transfer service is provided to users.

2.4 Switching technology

Typical switching technologies include:

  • circuit switching

  • packet switching

  • Message exchange, etc.

The core of the Internet uses packet switching technology.

(1) Circuit switching

The number of pairs of wires as a function of the number of telephone sets.

Insert image description here

As the number of telephone sets increased, telephone switches were used to connect the telephones.

Insert image description here

Each phone is connected directly to a switch, which uses switching to allow phone users to easily communicate with each other. This switching method is circuit switching.

The meaning of switching

Insert image description here

Transfer: To connect one telephone line to another.
From the perspective of communication resource allocation, it means dynamically allocating transmission line resources in a certain way.

Circuit switching features

Divided into three stages:

  • Establish a connection: Establish a dedicated physical path (occupying communication resources).
  • Call: The calling party and the called party talk to each other (always occupying communication resources).
  • Release connection: Release the dedicated physical channel just used (return communication resources).

This switching method that must go through the three steps of "establishing a connection (occupying communication resources), talking (always occupying communication resources), and releasing the connection (returning communication resources)" is called circuit switching.

Characteristics of circuit switching: The two users on the call always occupy end-to-end communication resources.

Insert image description here

Computer data hasSudden, which results in a very low utilization rate of communication lines when transmitting data. The time actually used to transmit data is often less than 10%, or even less than 1%. The communication line resources that have been occupied by users are used most of the time. is free.

(2) Packet switching

Main features of packet switching

  • Use store-and-forward technology.

Insert image description here

At the sending end, the longer message is first divided into smaller equal-length data segments.

Adding a header in front of the data segment forms a packet.

Insert image description here

Packet switching uses "packet" as the data transmission unit

The Internet uses packet switching technology. A packet is a unit of data transmitted over the Internet.

The sending end sends each packet to the receiving end in turn.

Insert image description here

After receiving the packet, the receiving end strips off the header and restores it to the original message.

Insert image description here

Forwarding of packets on the Internet

  • Forwarding based on the destination address, source address and other important control information contained in the header.
  • Each packet independently chooses a transmission path in the Internet.
  • Routers located at the core of the network are responsible for forwarding packets, that is, packet switching.
  • Routers create and dynamically maintain forwarding tables.

Insert image description here

Each packet independently selects a transmission path

Insert image description here

Advantages of Packet Switching

advantage means used
Efficient In the process of packet transmission, the transmission bandwidth is dynamically allocated, and the communication link is occupied segment by segment.
flexible The most appropriate forwarding route is selected independently for each packet.
fast Using packets as transmission units, packets can be sent to other hosts without establishing a connection first.
reliable Network protocols that ensure reliability; distributed multi-routing packet switching networks make the network highly survivable.

Problems caused by packet switching

  • Queuing delay: Packets need to be queued when stored and forwarded by each router.
  • Bandwidth is not guaranteed: dynamic allocation.
  • Increased overhead: Each packet must carry control information; the router must temporarily store the packets, maintain forwarding tables, etc.

(3) Message exchange

In the 1940s, telegraph communication adopted message switching based on the store-and-forward principle.
However, the delay in message exchange is relatively long, ranging from several minutes to several hours.
Message switching is rarely used nowadays.

The main differences between circuit switching, message switching and packet switching

Insert image description here

  • If you want to continuously transmit a large amount of data, and the transmission time is much longer than the connection establishment time, the transmission rate of circuit switching is faster.
  • Message switching and packet switching do not require pre-allocation of transmission bandwidth, which can improve the channel utilization of the entire network when transmitting burst data.
  • Since the length of a packet is often much smaller than the length of the entire message, packet switching has a smaller delay than message switching and also has better flexibility.

2.5 Computer network classification

Classification according to the scope of the network

category Scope or distance
WAN (Wide Area Network) Usually tens to thousands of kilometers. Sometimes also called long haul network ****. It is the core part of the Internet.
MAN ( Metropolitan Area Network) The scope of action is generally a city, and the range of action is about 5 to 50 kilometers.
LAN ( Local Area Network) Limited to a smaller range (such as about 1 km). Usually high-speed communication lines are used.
Personal Area Network PAN (Personal Area Network) The range is very small, about 10 meters. Sometimes also called Wireless Personal Area Network WPAN (Wireless PAN).

Categorize by network users

category Scope or distance
public network A network that anyone who pays the required fees can use. It can also be called the **** public network.
private network A network built for specific business needs.

03. Agreement concept

Network protocol, referred to as protocol for short, is a rule, standard or convention established for data exchange in the network.
Three components:

  • Syntax: The structure or format of data and control information.
  • Semantics: What control information needs to be sent, what actions to complete, and what responses to make.
  • Synchronization: A detailed description of the order in which events are achieved.

Network protocols are an integral part of computer networks.

Insert image description here

From an application perspective, protocols can be understood as “rules”, which are rules for data transmission and data interpretation.

​ Suppose that both parties A and B want to transfer files. Regulation:

​The first time, the file name is transmitted, the receiver receives the file name, and responds OK to the transmitter;

​The second time, the size of the file is sent, and the receiver receives the data and responds with an OK again;

​The third time, transfer the file content. Similarly, the receiver responds OK after receiving the data, indicating that the file content has been received successfully.

Therefore, no matter what kind of file is transferred between A and B, it is completed through three data transmissions. The simplest data transmission rule is formed between A and B. Both parties send and receive data according to this rule. The mutually abiding rules reached between A and B are agreements.

​ This agreement that is only observed between A and B is called the original agreement . As this protocol is adopted by more people, it will continue to be added, improved, maintained, and perfected. Finally, a stable and complete file transfer protocol is formed, which is widely used in various file transfer processes. The protocol becomes a standard protocol . The earliest ftp protocol was derived from this.

04. Hierarchy

Insert image description here

OSI seven-layer model

1). Physical layer : mainly defines physical equipment standards, such as network cable interface types, optical fiber interface types, transmission rates of various transmission media, etc. Its main function is to transmit bit streams (that is, converting 1 and 0 into current strength for transmission, and then converting into 1 and 0 after reaching the destination, which is what we often call digital-to-analog conversion and analog-to-digital conversion). The data at this level are called bits .

2). Data link layer : defines how to transmit formatted data in frames and how to control access to physical media. This layer also typically provides error detection and correction to ensure reliable transmission of data. For example: 115200, 8, N, 1 used in serial communication

3). Network layer : Provides connection and path selection between two host systems in networks located in different geographical locations. The development of the Internet has greatly increased the number of users accessing information from sites around the world, and the network layer is the layer that manages this connection.

4) .Transport layer : Defines some protocols and port numbers for data transmission (WWW port 80, etc.), such as: TCP (Transmission Control Protocol), which has low transmission efficiency and strong reliability. It is used for transmission with high reliability requirements and large data volume. data), UDP (User Datagram Protocol, which is exactly the opposite of TCP characteristics. It is used to transmit data with low reliability requirements and small data volume. For example, QQ chat data is transmitted in this way). The main purpose is to segment and transmit the data received from the lower layer, and then reassemble it after reaching the destination address. This layer of data is often called a segment .

5). Session layer : Establish a data transmission path through the transport layer (port number: transmission port and receiving port). It mainly initiates sessions or accepts session requests between your systems (devices need to know each other, which can be IP, MAC or host name).

6). Presentation layer : It ensures that the information sent by the application layer of one system can be read by the application layer of another system. For example, a PC program communicates with another computer, one of which uses Extended Decimal Interchange Code (EBCDIC), while the other uses American Standard Code for Information Interchange (ASCII) to represent the same characters. If necessary, the presentation layer converts between multiple data formats using a common format.

7). Application layer : It is the OSI layer closest to the user. This layer provides network services to user applications such as email, file transfer, and terminal emulation.

The lower the layer, the closer to the hardware; the higher the layer, the closer to the user

TCP/IP four-layer model

The TCP/IP network protocol stack is divided into four layers: application layer (Application), transport layer (Transport), network layer (Network) and link layer (Link).

Insert image description here

05. Communication process

Insert image description here

Insert image description here

Insert image description here

06. Data link layer

6.1 frames

Encapsulation into framing (framing): Add a header and a trailer before and after a piece of data to form a frame.

An important role of the header and trailer is to perform frame delimitation (ie, determine the boundaries of the frame).

Insert image description here

Maximum Transfer Unit MTU (Maximum Transfer Unit): Specifies the upper limit of the length of the data part of the frame that can be transmitted.

6.2 Topology

LAN topology

Insert image description here

LAN transmission media

Insert image description here

The role of the adapter

Insert image description here

  • Perform serial/parallel conversion.
  • Cache the data.
  • Install device drivers in your computer's operating system.
  • Implement the Ethernet protocol.

Insert image description here

6.3 Hardware address of MAC layer

Hardware address is also called physical address, or MAC address.

The IEEE 802 standard specifies a 48-bit global address (referred to as address) for LAN, which refers to the address solidified in the ROM of the adapter in each computer on the LAN.

Note: If a host or router connected to a LAN has multiple adapters installed, the host or router will have multiple "addresses."

Insert image description here

  • The IEEE registration authority RA is responsible for allocating the first 3 bytes (ie, the upper 24 bits) to manufacturers, which is called the Organizationally Unique Identifier OUI (Organizationally Unique Identifier).
  • The last 3 bytes (lower 24 bits) assigned by the manufacturer are called extended identifiers.
  • It must be ensured that the adapters produced do not have duplicate addresses.
  • The address is fixed in the adapter's ROM.

Adapter has filter function

  • Each time a MAC frame is received, the MAC address in the frame is first checked by hardware.
  • If the frame is sent to this station, it will be accepted, and then other processing will be performed.
  • Otherwise, the frame will be discarded and no other processing will be performed.

"Frames sent to this site" include the following three types of frames:

  • Unicast frame (one-to-one)
  • Broadcast frame (pair of all)
  • Multicast frame (one-to-many)

Kind tips

An Ethernet adapter operating in promiscuous mode will receive frames as long as it "hears" them being transmitted on the Ethernet.

6.4 Extending Ethernet at the physical layer

Extension using hub

Insert image description here

advantage

  • Enable computers that originally belong to different collision domains (conflict domains) to communicate across collision domains.
  • Expanded geographical coverage of Ethernet.

shortcoming

  • The collision domain is increased, but the overall throughput is not improved.
  • If different Ethernet technologies are used (e.g. different data rates), then they cannot be interconnected using a hub.

collision domain

Collision domain, also known as collision domain, refers to that part of the network where frames sent by one station will collide or conflict with frames sent by other stations.

The larger the collision domain, the higher the probability of collision.

Insert image description here

6.5 Extending Ethernet at the data link layer

In the early days, bridges were used, and now Ethernet switches are used.

Insert image description here

Bridges and Ethernet switches

Insert image description here

Characteristics of Ethernet switches

  • Essentially a multi-interface bridge.
    • There are usually a dozen or more interfaces.
  • Each interface is directly connected to a single host or another Ethernet switch, and generally operates in full-duplex mode.
  • Ethernet switches are parallelizable.
    • It can connect multiple pairs of interfaces at the same time, allowing multiple pairs of hosts to communicate at the same time.
    • Hosts communicating with each other all occupy the transmission medium exclusively and transmit data without collision.
    • Each port and the host connected to the port form a collision domain.

Insert image description here

Each interface of an Ethernet switch is a collision domain

Exclusive bandwidth for each user, increasing total capacity

Insert image description here

07. Network layer

7.1 Two levels of the network layer

Insert image description here

data level

  • The router forwards the received packets out of the found corresponding interface based on the forwarding table generated by this router.
  • Work independently.
  • Hardware is used for forwarding, which is fast.

control level

  • Calculate routes based on the routing algorithm used by the routing protocol and create a routing table for this router.
  • Many routers acting together.
  • Using software to calculate is slow.

7.2 Internet Protocol IP

Three protocols supporting the Internet Protocol IPv4:

  • Address Resolution Protocol ARP (Address Resolution Protocol)
  • Internet Control Message Protocol ICMP (Internet Control Message Protocol)
  • Internet Group Management Protocol IGMP (Internet Group Management Protocol)

Insert image description here

Network interconnection using routers

Insert image description here

Transmission of packets over the Internet

Insert image description here

Packet transmission path

Insert image description here

7.3 IP address

IP addresses and how they are represented

Insert image description here

Each interface of every host (or router) on the Internet is assigned a globally unique IP address.

Dotted decimal notation case

Insert image description here

IP addresses follow a 2-level structure

IP address::= { <network number>, <host number>}

IP addresses are unique across the entire Internet.

An IP address identifies a host connected to a network

Insert image description here

IP address classification

Insert image description here

Assignment ranges of various IP addresses

Insert image description here

Notice:

  • Among Class A network addresses, network numbers 0 and 127 are reserved addresses and are not assigned. 0 means "this network", 127 is reserved as the local loopback test address.
  • Among Class B network addresses, network number 128.0 is reserved by IANA and will not be assigned. Can be assigned when using Classless Addressing (CIDR).
  • Among Class C network addresses, the network number 192.0.0 is reserved by IANA and will not be assigned. Can be assigned when using Classless Addressing (CIDR).
  • When assigning a host number, all zeros and all ones must be deducted. All 0s and all 1s have special meanings and uses.

Special IP addresses not generally used

Insert image description here

7.4 Address mask

  • Also called subnet mask.
  • Number of bits: 32 bits.
  • Purpose: Let the machine quickly calculate the network address from the IP address.
  • It consists of a series of 1's followed by a series of 0's, and the number of 1's is the length of the network prefix.

Default subnet mask

Insert image description here

Network address = (binary IP address) AND (address mask)

Insert image description here

7.5 IP address and MAC address

Insert image description here

Insert image description here

08. Transport layer

8.1 Two major protocols at the transport layer

Formal standards for the Internet:

  • User Datagram Protocol UDP (User Datagram Protocol)
  • Transmission Control Protocol TCP (Transmission Control Protocol)

Insert image description here

8.2 Differences between UDP and TCP

Insert image description here

8.3 Typical applications and application layer protocols of UDP and TCP

Insert image description here

8.4 protocol port number

A protocol port number, or often simply port, is used at the transport layer. Set the port as the abstract end point of the communication.

Insert image description here

  • Ports are identified with a 16-bit port number, allowing 65,535 different port numbers.
  • The port number only has local significance and is only used to mark each process in the application layer of this computer.
  • In the Internet, there is no connection between the same port numbers on different computers.

Two major categories and three types of ports

Insert image description here

Commonly used and well-known ports

Insert image description here

8.5 User Datagram Protocol UDP

Main features of UDP

  • no connection. There is no need to establish a connection before sending data.
  • Use best effort delivery. That is, reliable delivery is not guaranteed.
  • Message-oriented. UDP transmits and delivers one complete message at a time.
  • There is no congestion control. Network congestion does not reduce the source host's sending rate. Very suitable for multimedia communication requirements.
  • Supports one-to-one, one-to-many, many-to-one, many-to-many and other interactive communications.
  • The header overhead is small, only 8 bytes.

Characteristics of UDP communication: simple and convenient, but unreliable.

8.6 Transmission Control Protocol TCP

The main features of TCP

  • TCP is a connection-oriented transport layer protocol.
  • Each TCP connection can only have two endpoints, and each TCP connection can only be point-to-point (one-to-one).
  • TCP provides services that are delivered reliably.
  • TCP provides full-duplex communication.
  • byte stream oriented
  • A "stream" in TCP refers to a sequence of bytes flowing into or out of a process.
  • Oriented to byte stream: Although the interaction between the application program and TCP is one data block at a time, TCP treats the data handed over by the application program as just a series of unstructured byte streams.

09. Application layer

slightly

10. Appendix

Guess you like

Origin blog.csdn.net/dengjin20104042056/article/details/132945668