Computer Network (Third Edition) Hu Liang After-Class Exercises Chapter 5 Answers

Computer Network (Third Edition) Hu Liang After-Class Exercises Chapter 5 Answers

1. What is the highest layer of the communication subnet?

The communication subnet consists of the physical layer, data link layer and network layer. The network layer is the highest layer of the communication subnet.

2. What are the two main functions of the network layer?

The network layer mainly provides two functions: switching and routing.

Switching is the establishment of a snack connection between two or more devices, enabling communication between two or more devices that are not directly connected by a physical link.

Routing means choosing the best path to send a packet from one point to another when more than one path is available.

3. In the OSI model, what two services does the network layer provide?

In the OSI model, the network layer provides two types of services: connection-oriented network services (CONS) and connectionless network services (CLNS).

4. What processes are required for a connection-oriented network service to complete a transmission?

  1. The sender sends a connection request packet;
  2. The receiver confirms using a connection confirmation packet;
  3. The sender transmits data;
  4. The sender sends a connection request termination request packet;
  5. The receiver acknowledges this with a Connection Termination Acknowledgment packet.

5. Explain the advantages and disadvantages of connection-oriented services and connection-less services?

connection-oriented network services

advantage:

  1. Allows a protocol to include comprehensive sequence, error, and flow control.
  2. Used in datagrams for less protocol control information.

shortcoming:

  1. Once a connection is established, routing flexibility is non-existent;
  2. Network service speed is slow and packets must be inspected or acknowledged or retransmitted.

For connectionless network services

advantage:

  1. Faster, less overhead
  2. The network service process is relatively simple

shortcoming:

  1. Transmission unreliable
  2. The overhead of each packet is large, and each information packet must carry complete address information.

6. Explain why each node in the network numbers virtual telegrams independently?

In a network, a virtual circuit can be viewed as a logical circuit that does not physically exist. In order to correctly route packets in the network, each virtual circuit needs to be assigned a unique identifier, called a virtual circuit number. Individually assigning a virtual circuit number to each node ensures that the identifier of each virtual circuit in the network is unique and avoids conflicts and confusion. This is crucial to ensure the reliability and efficiency of network communications.

7. What are the basic requirements for routing?

  1. correctness
  2. simplicity
  3. firmness
  4. stability
  5. fairness
  6. optimality

8. What is congestion? What causes congestion? What impact does congestion have on the system?

The presence of too many packets in a network or part of it, causing a linear degradation in network performance is called congestion.

The cause of congestion: the processing speed of the node and the transmission speed of the link are not high enough.

Impact of congestion on the system: impact on system throughput and impact on transmission delay. This will cause a significant reduction in system throughput and a sudden increase in packet transmission delay.

9. What are the methods of congestion control?

  1. preallocated buffer
  2. discard packet
  3. Limit the number of packets in the network
  4. flow control
  5. blocking packet

10. In flow control, what kind of deadlock is likely to occur if datagram mode is used? If virtual telegrams are used to work, what kind of deadlocks are likely to occur?

Working in datagram mode: it is easy to produce direct store and forward deadlock ("can't send out, can't come in") and indirect store and forward deadlock.

Working in virtual telegram mode: prone to reload deadlock.

11. What are the two commonly used methods for calculating the shortest path?

Distance vector routing algorithm and link state routing algorithm

12. Compare distance vector routing and link state routing?

Distance vector routing is a distributed algorithm in which each node records the distance to each destination node and sends this distance information to its neighboring nodes. Neighboring nodes will update their own distance vector with the distance information they know, and pass the updated distance vector to its neighboring nodes. This process will be repeated until the distance vectors of all nodes converge to the minimum value or reach the set threshold. The advantage of distance vector routing is that the algorithm is simple and takes up less resources. However, since each node only knows the distance to its neighboring nodes, the path selection of the entire network may not be optimal.

Link state routing is a centralized algorithm. In link-state routing, each node propagates its connectivity status to the network, which includes information about neighbor nodes and shortest paths to other nodes. All nodes can calculate the shortest path to any destination in their routing table. The advantage of link state routing is that path selection is more accurate and optimal, but it requires more resources and more protocol communication.

In general, the choice of which routing algorithm to use depends on network size, resource constraints, real-time requirements, maintainability and other factors.

13. What is a router and which layers of OSI does it work on?

A router is a network device that forwards data packets between different networks and enables them to communicate with each other. Routers work at the network layer (layer 3) of the OSI model, which uses IP addresses to determine how data packets are transmitted in the network.

14. Compare distance routing and link state routing? Which type of routing protocol does OSPF belong to? What type of protocol does the BGP protocol belong to?

Distance routing and link state routing are two routing algorithms. Distance routing protocols calculate routes based on distance, bandwidth and other indicators in the network; link state routing protocols calculate the optimal path to the network target by exchanging topology information between routers. OSPF is a link state routing protocol. Its characteristic is that routing information is only updated when the link state changes, and the Dijkstra algorithm is used to calculate the shortest path. The BGP protocol is a path vector routing protocol that uses BGP attributes and path vector information and is widely used in the Internet.

15. What is a layer 3 switch?

A three-layer switch is a switch with some router functions and works on the third layer of the OSI network standard model: the network layer. The most important purpose of a Layer 3 switch is to speed up data exchange within a large LAN, and its routing function also serves this purpose, capable of routing once and forwarding multiple times.

16. How many Class A, Class B, and Class C network numbers are there at most in an IPV4 network?

In the Class A network address range, the first bit of the first byte must be 0, so the network address range is:

00000000 ~ 01111111
Therefore, it is 0~127. Therefore, the network number of a Class A address should be 2^7 minus the loopback test address starting with 127, and then minus the addresses that are all 0 (the network number field of the Class A address occupies one byte, and only 7 bits are available, but The number of assignable network numbers is 126 (that is, 2 to the 7th power - 2). The reasons for subtracting 2 are: first, all 0s in the IP address are reserved addresses, meaning "this network". Second, the network number 127 (i.e. 01111111) is reserved for local software loopback testing of communication between processes on this host.), a total of 2^7-2=126

In the Class B network address range, the first two digits of the first byte must be 10, so the network address range is:

10000000 ~ 10111111
Therefore, it is 128 ~ 191. Therefore, the network number of a Class B address should start with 10 in the first two digits, that is, the network number is 10000000.00000000~10111111.11111111. Remove the address that indicates that the network numbers of this network are all 0, that is, 10000000.00000000, then the assigned network number is 2^14-1= 16383

In the Class C network address range, the first two digits of the first byte must be 110, so the network address range is:

11000000 ~ 11011111
Therefore, it is 192 ~ 223. Therefore, the network number of a Class C address should start with 10 in the first two digits, that is, the network number is 11000000.00000000.00000000~11011111.11111111. Remove the address that indicates that the network numbers of this network are all 0, that is, 11000000.00000000, then the assigned network number is 2^21- 1=2097151

Simple judgment, recorded as:

All addresses starting with 000 are Class A addresses.

All addresses starting with 100 are Class B addresses.

All addresses starting with 110 are Class C addresses.

17. How many hosts can a Class C network contain at most?

In the Class C network address range, the first two digits of the first byte must be 110, so the network address range is:

11000000 ~ 11011111
Therefore, it is 192 ~ 223. Therefore, the network number of a Class C address should start with 10 in the first two digits, that is, the network number is 11000000.00000000.00000000~11011111.11111111. Remove the address that indicates that the network numbers of this network are all 0, that is, 11000000.00000000, then the assigned network number is 2^21- 1=2097151

18. Try to explain the various layers included in the TCP/IP protocol suite, what protocols each layer mainly contains, and the main functions completed by each layer.

https://blog.csdn.net/github_33736971/article/details/51024457 参考

19. How does the ICMP protocol direct errors?

ICMP redirects errors by sending redirection error messages. Redirect error messages tell the host which router the datagram should be sent to in order to reach its destination faster. After receiving the redirection error message, the host will update its routing table and send datagrams according to the new route.

20. What is the general loopback address? What is its main function?

The loopback address is generally 127.0.0.1, also called the local host address. Its main function is to allow TCP/IP communication between client programs and server programs running on the same host. Datagrams sent to the loopback address do not leave the host but are received by itself. The loopback address can be used for testing and development purposes.

21. Is 255.255.0.255 a qualified subnet mask?

255.255.0.255 is not a qualified subnet mask. A qualified subnet mask should have consecutive 1s and 0s, rather than 0s in the middle. A common subnet mask is 255.255.255.0, which is used to divide IPv4 networks.

22. What information does the routing table in the IP protocol generally contain? How does the IP protocol complete the routing function?

Generally contains the following information:

  1. Destination network address: Specify the destination network to which the packet is to be sent.
  2. Next hop address: Specify the IP address of the next router to forward the packet.
  3. Egress interface: Specify the local interface to send packets.
  4. Routing metric: specifies the cost or distance to reach the target network and is used to select the optimal route.
  5. Routing source: Specify the method of learning or configuring the route, such as static routing, dynamic routing protocol, etc.

Routing selection function: Simply put, it determines the best path by comparing the priorities and metric values ​​of different routes. The priority is determined based on the route source, and different sources have different weights. The metric value is determined based on the routing protocol, and different protocols have different calculation methods. Generally speaking, the route with high priority and low metric value will be selected as the best path and added to the IP routing table.

23. Explain the process of TCP connection establishment.

Establish a connection through three-way handshake
Connection establishment phase:
First handshake: The client's application process actively opens and sends a request to the server Message segment. In its header: SYN=1,seq=x.
Second handshake: The server application process is passively opened. If the client's request is agreed, a confirmation message is sent back, with the header: SYN=1, ACK=1, ack=x+1, seq=y.
The third handshake: After receiving the confirmation message, the client notifies the upper application process that the connection has been established and sends a confirmation message to the server, with the header: ACK=1,ack=y+ 1. When the server receives the client's confirmation message, it also notifies its upper-layer application process that the connection has been established.

24. Which parts of the TCP header are related to congestion control, flow control and error control?

The fields related to congestion control, flow control and error control in the TCP header are:

(1) Congestion Window (CWND): Indicates a sending window set by the sender based on network congestion to limit the amount of data injected into the network by the sender.

(2) Receive Window (RWND): Indicates the amount of data that the receiver can currently receive and is used to implement flow control.

(3) Sequence Number (SEQ): Indicates the sequence number of the first byte of data sent in this message segment.

(4) Acknowledgment Number (ACK): Indicates the sequence number of the first data byte expected to be received from the other party's next message segment.

(5) Checksum (Checksum): Represents the check code obtained by summing the entire TCP message segment and is used to implement error control.

Guess you like

Origin blog.csdn.net/m0_46335449/article/details/129357864