First, computer network foundation

1.1 The meaning of computer network

A collection of autonomous computer systems that are interconnected in a manner capable of sharing resources with each other.

1.2 Composition and characteristics of the Internet

  • Edge: Consists of all hosts connected to the Internet for communication and resource sharing.
  • Core: Consists of a large number of networks and the routers that connect these networks. This part serves the edge part.

1.3 Advantages and disadvantages of circuit switching, packet switching and message switching

  1. Circuit switching: The advantage is suitable for the transmission of large amounts of continuous real-time data. The disadvantage is low channel utilization for burst data.
  2. Packet switching: Improves the average response time of the entire system. The storage and forwarding delay is shorter than that of packet switching. Flexible routing improves the network survival. The disadvantage is that packets may queue up when forwarding at each node, the end-to-end delay is uncertain, and network congestion may result when the network traffic is too large. The control information carried at the packet head incurs some additional overhead.
  3. Packet switching: The advantages are simple and high channel utilization. Its disadvantages are that the storage and forwarding time is prolonged. A high bit error rate of excessively long packets is not conducive to reliable transmission, and excessively long packets occupy a long link time, which is not conducive to resource sharing.

1.4 Network Performance Indicators

rate

Connected to a computer network the rate at which hosts transmit over digital channels, also called data rate or bit rate, in b/s(bits per second).

bandwidth

The capacity of a network’s communication lines to transmit data, i.e., “maximum data rate” in b/s(bits per second)

Channel utilization

Indicate the percentage of time that data passes in a channel, i.e. channel utilization = time that data passes /(yes + no) time that data passes

throughput

The amount of data passing through a network per unit of time. Throughput is limited by network bandwidth or network rated rate

Time delay

The total time it takes for data to travel from one end of the network to the other. It consists of transmission delay, propagation delay, processing delay, and queuing delay.

Send time delay

The time it takes a node to push all the bits of the group to the link.

Propagation delay

The time it takes for a bit to travel from one end of a link to the other.

1.5 Network system and network architecture

Network architecture adopts hierarchical structure because “hierarchical” can transform huge and complex problems into several smaller local problems, and these smaller local problems are easier to study and deal with.

1.6 Layers of the five-layer protocol model and functions of each layer

The physical layer

Transparent transmission of raw bitstreams for data end devices over physical media

Data link layer

It can be summarized as frame formation, error control, flow control and transmission management, etc

The network layer

Responsible for forwarding packets from the source host to the destination host via intermediate routers. The core functions are logical addressing, routing and packet forwarding.

The transport layer

The transport unit is TCP or UDP and is responsible for the logical communication (end-to-end communication) between two processes on the host. Specific include: reuse and reuse, reliable data transmission, flow control, congestion control and so on.

The application layer

To implement specific network applications through interaction between application processes, users or application processes can directly provide specific application services, such as file transfer and email.

sample

Exercise 1: The transmission distance between the receiving and receiving ends is 1000 km, and the transmission rate of the signal on the media is 2 x108 m/s. Try to calculate the transmission delay and propagation delay for the following two cases. (1) The data length is 107bit, and the data transmission rate is 100 kbit/s; (2) The length of the data is 103bit, and the data transmission rate is 1 Gbit/s. What conclusions can be drawn from the above calculation results? Answer :(1) transmission delay is 100 s, transmission delay is 5 ms. Transmission delay is much larger than propagation delay. (2) The transmission delay is 1 microsecond and the transmission delay is 5 ms. The transmission delay is much smaller than the transmission delay.

Exercise 2: THE protocol structure of a system has N layers, the application generates M byte long packets, and the network software adds H byte protocol headers to each layer. What percentage of the network bandwidth is at least used for the transmission of protocol header information? Solution :(N Ɨ h/(N Ɨ h + M)) Ɨ 100%. If the packets generated by the application are divided into multiple smaller packets, the ratio is larger.

2. šŸø Physical layer

The basic concept

Data, signals and symbols

Data is an entity that transmits information. Signal is the electrical or electromagnetic representation of data, and is the existence form of data in the transmission process. Symbol refers to the use of a fixed time signal waveform (digital pulse) to represent a K-base number, representing different discrete values of the basic waveform is the digital signal measurement unit in digital communication.

Source, channel and home

A message source is the source that produces and sends data, and a message home is the end point of receiving data. A channel can be divided into analog channel and digital channel according to the different forms of transmitting signals.

Rate, baud, and bandwidth

The concepts of rate and bandwidth have been introduced here. Baud rate: The number of symbols (also known as pulses) transmitted by a digital communication system per unit of time. Baud is a unit of symbol transmission rate.

Encoding, modulation and demodulation

coding

To encode digital data into digital signals, there are zero return coding, non – zero return coding, reverse non – zero return coding, Manchester coding, differential Manchester coding

modulation

Modulate digital data into analog signals

demodulation

Analog signal to digital signal, three steps: sampling, quantization, coding.

Nye criterion and its application

Prerequisites: In ideal low-pass (no noise, limited bandwidth) channel:

The limit symbol transmission rate is 2W baud, where W is the bandwidth of the ideal low communication channel, in Hz. The limiting data rate is 2Wlog2V, where V refers to how many codes there are.

sample

It is assumed that the maximum bit rate of a channel limited by Nye’s criterion is 20000 bit/s. If amplitude shift keying is used, how high data rate (b/s) can be obtained if the amplitude of the symbol is divided into 16 different levels for transmission? Answer: 16 levels can represent 4 bits of binary number, each symbol can represent 4 bits, therefore, you can obtain a data rate of 80,000 B /s.

Shannon theorem and its application

Prerequisites: In a channel with limited bandwidth and white Gaussian noise interference, the limiting data rate is Wlog2(1+S/N). W is the bandwidth of the channel, S/N is the signal-to-noise ratio, S is the average power of the signal transmitted in the channel, and N is the power of gaussian noise inside the channel.

conclusion

Nye’s criterion only considers the relation between bandwidth and extreme symbol transmission rate, while Shannon’s theorem considers not only bandwidth but also SNR.

Concept and function of channel multiplexing

Frequency Division multiplexing (FDM)

A multiplexing technique in which multiple subgrade band signals are modulated onto different frequency carriers and then superimposed to form a composite signal.

Time division multiplexing (TDM)

A physical channel is divided into several time slices and allocated to multiple signals in turn.

Wavelength Division multiplexing (WDM)

Frequency division multiplexing of light. Because light wave is in the high frequency band of the spectrum, it has a high bandwidth, so it can realize multichannel WDM.

Code division multiplexing (CDM)

A multiplexing method in which different codes are used to distinguish the original signals. Different from FDM and TDM, it shares both the frequency and time of the channel.

Code Division Multiple Access (CDMA)

A method of code division multiplexing in which a unique orthogonal code is assigned to each user and the data of different users are encoded with this orthogonal code at the sending end and then multiplexed to the same channel for transmission. At the receiving end, the same orthogonal code decoding is used for segmentation. CDMA is mainly used for wireless communication and has strong anti-interference ability.

sample

There are four users for CDMA communication. The chip sequence of the four users is as follows: A: (– 1-1 — 1 +1 +1 — 1 +1 +1); B: (- 1-1 + 1-1 + 1 + 1 + 1, 1) C: (- 1 + 1-1 + 1 + 1 + 1, 1, 1); D: (- 1 + 1-1-1-1-1 + 1-1) is now receiving code sequence: (, 1 + 1-3 + 1-1-3 + 1 + 1). Which users sent the data? Is it a 1 or a 0? Solution: the inner product of A is 1, the inner product of B is -1, the inner product of C is 0, the inner product of D is 1. Therefore, A and D send 1, B sends 0, and C sends no data.

šŸ¹ Data link layer

function

It can be summarized as frame formation, error control, flow control and transmission management, etc.

Solution to transparent transmission method: zero bit filling method

Stop waiting protocol

That is, after each frame is sent, it stops sending, waits for confirmation, and then sends the next frame.

Why is there a stop waiting agreement?

In addition to the bit error, the underlying channel will also appear packet loss (physical line failure, device failure, virus attacks, errors and other reasons, will lead to the loss of packets), in order to achieve flow control, there is the stop wait protocol.

Study the premises of stop-wait agreements

Consider only one side sending data and one side receiving data.

Stop and wait protocol — no errors

Stop and wait agreement — something goes wrong

1. A data frame is lost or a frame error is detected

note: After sending a frame, a copy of it must be kept. Data frames and confirmation frames must be numbered.

2. Confirm that the frame is lost

3. Confirm that frames are late

Advantages and disadvantages of the hold up protocol

Simple but low channel utilization.

sample

Back N frame protocol GBN (send window greater than 1, receive window equal to 1)

Why is it called the Back N Frame protocol? In GBN protocol, the confirmation of N frame adopts the cumulative confirmation method, indicating that the receiver has received N frame and all previous frames. The protocol name comes from the behavior of the sender when a frame is lost or delayed too long. If a timeout occurs, the sender retransmits all frames that have been sent but have not been acknowledged.

Sliding window length

If n bits are used for frame numbering, 1< the length of the sending window < 2N āˆ’12^ n-12N āˆ’1. Because the sending window is too large, you cannot distinguish between old and new frames.

Select the retransmission protocol SR (send window > 1, accept window > 1)

Set a single confirmation, at the same time to increase the acceptance window, set the acceptance cache, cache out-of-order arrival of the frame.

How to design sliding window length?

The sending window is equal to the receiving window length W maxW to maxW Max = 2N āˆ’12^{n-1} 2N āˆ’1

Summary of GBN agreement

  1. The cumulative confirmation
  2. The receiver accepts frames sequentially and discards them ruthlessly
  3. Identifies the sequence arriving frame with the largest sequence number
  4. The maximum sending window is 2N āˆ’12^ n-12N āˆ’1, and the maximum receiving window is 1

Performance analysis

  • Continuous transmission improves channel utilization
  • Sending the correct frame will also be retransmitted, reducing transmission efficiency

sample

SR Protocol Summary

  1. Confirm the data frame one by one, accept one by one
  2. Only retransmit error frames
  3. The receiver has a cache
  4. Window length W maxW~maxW Max = 2nāˆ’12^{n-1}2nāˆ’1

Problem sets

CSMA/CD protocol

Also known as Carrier Sense Multiple Access with Collision Detection (CS) : Each station checks to see if there are other computers on the bus sending data before and while sending data. MA: Multi-point access: multiple computers are connected to a bus in multi-point access mode. Bus network. CD: The adapter detects signal voltage changes on the channel while sending data, so as to determine whether other stations are sending data when it is sending data. Why does it conflict to monitor and then send? Because electromagnetic waves always travel at a finite rate on the bus. There is propagation delay.

Influence of propagation delay on carrier listening

How to determine the retransmission timing after a collision

Truncated binary exponential avoidance algorithm

Minimum frame length problem

Station A sent A very short frame, but there was A collision, but the frame did not detect the collision until after it was sent, and it could not stop sending because it was finished. Define a minimum frame length. The transmission delay of the frame is at least twice as long as the transmission delay of the signal in the bus. Frame length/data transmission rate >=2āˆ— transmission delay Frame length/data transmission rate >=2āˆ— transmission delay Frame length/data transmission rate >=2āˆ— transmission delay Minimum frame length =2āˆ— transmission delay Data transmission rate minimum frame length =2āˆ— transmission delay Data transmission rate minimum frame length =2āˆ— transmission delay data transmission rate

Ethernet has a minimum frame length of 64B