Computer Network [Detailed Explanation of Chapter 3 Exercises]

written in front

Welcome to Chapter 3, Duck! ! !

Chapter 3 (7,8,9,20,22,24,25,30,33)

insert image description here
analyze

Calculation of redundant codes:
(1) The polynomial generated by CRC (in this question, the highest bit corresponds to X 4 , the lowest bit corresponds to X 0 ) to get the divisor P: 10011, the divisor has 5 bits, so the number of redundant codes n=4 bits , one bit less than the divisor
(2) Send data M: 1101011011, use the binary modulo 2 operation to perform 2 n times M operations, that is, add n 0s after M, and then use it as the dividend
(3) Modulo 2 Division operation to get the remainder
Judging whether the receiving end can find: 被除数加上帧检验序列FCSAfter that, as a new dividend, and then 经模2除法运算得到余数check whether the remainder is equal to 0.
After the receiving end passes the CRC check on each frame received, there are the following two situations:
(1) If it is obtained 余数R=0, it is judged that this frame has no error, 就接受.
(2) If 余数R≠0, then it is judged that this frame has an error (but it is impossible to determine which bit or which bits have an error), 就丢弃.
余数R=0时,接收端不能发现;余数R≠0时,接收端能发现

在数据链路层若仅仅使用循环冗余检验CRC差错检测技术,则只能做到对帧的无差错接受, that is: "For any frame accepted by the data link layer at the receiving end, we can consider that these frames have no errors during transmission with a probability very close to 1." 接收端丢弃的帧虽然曾收到了,但最终还是因为有差错被丢弃, that is, not accepted. The above can be approximately expressed as (usually considered as such): "All frames accepted by the data link layer at the receiving end are error-free".

Solution
insert image description here
Only using CRC check, the transmission of the data link layer is still unreliable transmission

Computing Remainders:
insert image description here
insert image description here
Analysis

Refer to the analysis of the previous question

untie
insert image description here

Calculate the remainder:
insert image description here

insert image description here

analyze

When PPP uses asynchronous transmission, it defines the escape character as 0x7D (that is, 01111101), and uses byte padding. RFC1662 stipulates the padding method as follows: (1) put each byte that appears in the
information 0x7Efield into a 2-byte sequence (0x7D, 0x5E).
(2) If a 0x7Dbyte appears in the information field (that is, the same bit combination as the escape character appears), then convert 0x7D into a 2-byte sequence (0x7D, 0x5D).
(3) If a control character of ASCII code (that is, a numerical 小于0x20character) appears in the information field, a 0x7D byte should be added in front of the character, and the code of the character should be changed at the same time. For example, the occurrence of 0x03 ("End of Transmission" ETX in the control character) is converted to a 2-byte sequence (0x7D, 0x23).
Due to byte stuffing at the sending end, the number of information bytes transmitted on the link exceeds the original number of information bytes. However, after receiving the data, the receiving end performs the opposite transformation of the byte filling at the sending end, so that the original information can be restored correctly.

untie
insert image description here

insert image description here
analyze

The CSMA/CD protocol is a protocol that cannot perform duplex.
Its working principle is: before sending data, it will first monitor whether the channel is idle, and if it is idle, send data immediately. If the channel is busy, wait for a period of time until the information transmission in the channel ends before sending data; if two or more nodes simultaneously request sending after the last piece of information is sent, it will be judged as a conflict. If a conflict is detected, stop sending data immediately, wait for a random period of time, and try again.
The principle is simply summarized as: listen first and then send, listen while sending, stop sending due to conflicts, and resend after a random delay.
Calculation formula: 最短数据帧长(bit)/数据传输速率(Mbps)=2*(两站点间的最大距离(m)/传播速度)(When a conflict occurs, you don't know it, you have to wait until the news comes, so the maximum is twice)

untie
insert image description here

insert image description here
analyze

Ethernet specifies one 最短帧长64字节, 512 bits. For 10 Mbit/s Ethernet, 发送512比特的时间需要51.2us, which is the contention period; for 100Mbit/s Ethernet, it takes 5.12us to send 512 bits;
等待时间=争用期时间×随机数r

untie
insert image description here

insert image description here
analyze
insert image description here

A number of bytes of preamble and frame delimiter should be added in front of the MAC frame, which is 8 bytes in total. A sends the shortest frame with 64 bytes, so the total bit time is the difference between the two stations (64+8)*8=576
. The propagation delay between is 225 bit times, so B will detect the A signal at 225 bit times

untie
insert image description here

insert image description here
analyze

Ethernet specifies 帧间最小间隔为9.6 usthat is equivalent to 96 bit times. This is done so that the receive buffer of the station that has just received the data frame can be cleared in time to prepare for receiving the next frame.
The r value of A is 0, and the r value of B is 1, so A 一个帧最小间隔can retransmit the data first after passing through, and 一个争用期512比特时间+一个帧最小间隔retransmit the data after B passes through

untie
insert image description here

insert image description here
analyze

For traditional 10 Mbit/s shared Ethernet, if there are 10 users in total, the average bandwidth occupied by each user is only 1Mbit/s. If an Ethernet switch is used to connect these hosts, although the bandwidth from each port to the host is still 10Mbit/s, because of one 用户在通信时是独占而不是和其他网络用户共享传输媒体的带宽, the total capacity of a switch with 10 ports is 100Mbit/s. This is the biggest advantage of the switch.

Solution
The maximum throughput is 1100 Mbit/s. Each of the three departments has a host to access the two servers and access the Internet through a router. Other hosts communicate within the department.

insert image description here
Analyze
the self-learning function of the Ethernet switch:
insert image description here假定A先向B发送一帧, enter the switch from port 1. After the switch receives the frame, it first looks up the switching table. Now there is no address of B in the table. So, 交换机把此帧的源地址A和端口1写入交换表中, and broadcast this frame to all ports except port 1 (frames received from port 1 should obviously not be forwarded from port 1)

广播发送可以保证让B收到这个帧,而C和D在收到帧后,因目的地址不匹配将丢弃此帧. This process is also known as filtering.

Since the item (A, 1) is written in the switching table, no matter from which port the frame is received, as long as the destination address is A, the received frame is forwarded from port 1 to A. The rationale for this is:既然A发送的帧是从端口1进入交换机的,那么从端口1转发出的帧肯定到达A。

Next assume that B sends a frame to A via port 3. The switch looks up the switching table, 发现交换表中的MAC地址有A, indicating that all frames sent to A (that is, frames whose destination address is A) should be forwarded through port 1. Obviously, the received frame should now be forwarded directly from port 1 to A, 而没有必要再广播收到的帧. At this time, the switching table writes an item (B, 3) with the source address B, indicating that if there is a frame sent to B in the future, it should be forwarded from port 3.

After a period of time, as long as hosts C and D also send frames to other hosts, the switching table in the Ethernet switch will write the port number (2 or 4) that should be forwarded to C or D into the switching table. In this way, the items in the switching table gradually increase, and the forwarding port can be found directly from the switching table when forwarding frames in the future, without using the method of sending broadcast frames

untie
insert image description here

other chapters

Chapter One
Chapter Two

Continuously updating...
insert image description here

Guess you like

Origin blog.csdn.net/qq_51453356/article/details/125212074