Advanced Computer Network - Answers and Analysis of Related Exercises (lectured by Ren Xiuli of Liaoning University)

Table of contents

1. Answers to after-class exercises

1.8 Exercises

1. What are the functions of the "TTL" field and the "Protocol" field in the IP packet header?

2. The data part of a UDP user datagram is 4192B. The UDP user datagram passes through Ethernet during transmission. The maximum transmission unit (MTU) value of Ethernet is 1500B. The network layer uses the IP protocol to encapsulate UDP user datagrams and uses a 20B IP fixed header. How many IP fragments should the IP packet be divided into? Explain the length of the data part of each IP fragment, the value of the fragment offset and the value of the MF bit.

3. Try to explain the difference between IP address and physical address 

4. How many types of IPv4 unicast addresses are divided into? What is the maximum number of networks of various types of networks and the number of hosts that can be accommodated in each network?

5. Use "dotted decimal" format to represent the following IPv4 address in binary form: 10000000 00001010 00000010 00011110

6. Try to explain the address types of the following IP addresses: 10.20.30.40; 172.16.26.36; 202.101.244.101; 126.1.0.200

7. The subnet IDs (subNet ID) of a Class A network and a Class B network are 16-digit 1 and 8-digit 1 respectively. Write the subnet masks for these two networks respectively. What are the different meanings of these two subnet masks?

8. If the subnet mask of a network is 255.255255.248, how many hosts can be connected to each subnet?

9. In a network, the set IP address range is 172.88.32.1~172.88.63.254. Try to determine the appropriate subnet mask.

10. The given IP address is 192,55.12,120, and the subnet mask is 255.255.255.240. What are the subnet number and host number respectively? What is the direct broadcast address?

11. If two hosts are in the same subnet, what is the result of the "logical AND" operation between the IP addresses of the two hosts and their subnet masks?

12. A certain unit is assigned a Class B IP address, and its subnet ID is 129.250.0.0. The unit has 4,000 hosts spread across 16 different locations. Please analyze:

13. Try to explain the meaning of the following special IP addresses.

14. Describe the purpose of the dedicated or private IP address, and please list the address range of the dedicated or private IP address.

15. How many IP addresses should a router with N physical interfaces connected to the Internet have at least? Do the network prefixes of these IP addresses are the same? Why?

16. What is route aggregation?

17. What are the functions of ARP and RARP?

18. Please explain the meaning of "routed protocol" and "routing protocol". What are interior gateway protocols and exterior gateway protocols? Which type of routing protocols do RIP and OSPF protocols belong to? What about BGP routing protocol?

19. Under what circumstances will an ICMP destination unreachable message be generated? What is the function of the ICMP echo request/response message? How are ICMP messages encapsulated?

20. Why is it necessary to add a pseudo header when calculating the checksum of ICMP, TCP, and UDP messages? How to use the pseudo header to calculate the checksum?

21. Describe the role of ports in TCP or UDP protocols.

22. What is a socket? Explain its components and functions

23. In the TCP/IP model, why should we set up the connectionless transmission protocol UDP?

24. What are the functions of the "source port number" field, "confirmation number" field and "window size" field in the TCP segment header? Please explain the functions of the control flags SYN, ACK and FIN.

25. How are the source port number and destination port number used in the request message sent by the client to the server? How are they used in the response message sent by the server to the client? List 6 well-known TCP port numbers.

26. Use diagrams to illustrate the process of establishing a TCP connection.

27. What is a URL? What is its format?

28. In DNS, why does the resource record include the "time to live" field?

29. Please explain the role of SMTP protocol and POP3 protocol in the email system.

30. Try to explain the functions of port No. 20 and port No. 21 used by the FTP protocol.

31. When browsing information on the Internet, what protocol is used to transmit Web pages between the browser and the WWW server?

31. When browsing information on the Internet, what protocol is used to transmit Web pages between the browser and the WWW server?

32. Briefly analyze the functions of the following protocols and explain their positions in the TCP/IP protocol suite and the encapsulation relationship of protocol data: IP, ICMP, ARP, RARP, RIP, OSPF, BGP, TCP, UDP, DNS , SMTPPOP, FTP, TELNET.

33. Now we have intercepted 3 Ethernet frames #1 ~ Frame #3. It is assumed that these Ethernet frames passed the error check. The frame content expressed in hexadecimal is as follows

2.6 Exercises

1. Try to analyze the problems existing in IPv4

2. Please explain the technical characteristics of IPv6.

3. Compared with IPv4 addresses, IPv6 addresses are not just an expansion of space. Please describe IPv6 addressing technology

4. What are the main reasons for low routing efficiency in IPv4 networks? What measures have been taken to address these problems in IPv6?

3.6 Exercises

1. Regarding IPv6 addresses, please answer the following questions

2. Try to compare anycast, unicast and multicast

3. Use C language to write 4 functions to implement the following functions respectively (1) Convert the binary address format representation of IPv6 to colon-hexadecimal representation (2) Convert the IP4 address to the corresponding IPv6 compatible address (3) Convert the IPv4 address to the corresponding IPv6 mapped address (4) For any IPv6 address, display all possible address types of the address

4.11 Exercises

1. Try to compare the characteristics of IPv4 packet header and IPv6 packet basic header.

2. If the IPv6 packet consists of a basic header and a TCP segment, assuming the total length of the TCP segment is 256B. Try to represent this packet and give the values ​​of the fields that can be determined.

3. Please analyze the difference between the extended header of IPv6 grouping and the options of IPv4 grouping.

4. Please explain the meaning and function of the "next header" field in the IPv6 packet.

5.What extension headers are defined in RFC 2460? What is the order in which these extension headers appear in IP6 packets?

6. What design ideas need to be considered when designing new TLV options?

7. Under what circumstances are the two padding options pad1 and pad2 used?

8. Give an example to illustrate the change process of the destination address field of the IPv6 basic header and the main fields in the source route extension header during the transmission process of IPv6 packets containing type 0 source route extension header, as shown in Table 4-3

9. Transmit an IP6 packet from source node A to destination node B. In order for IPv6 packets to be delivered through R, R, R; R routers in order, a type 0 source routing extension header needs to be used. During the transmission process of this IPv6 packet, the values ​​of its basic header and type 0 source routing extension header will change. Please complete the following form and fill in the values ​​of relevant fields into the blank cells in the form.

10. What are the advantages of the IPv6 fragmentation mechanism? How is it different from the IPv4 fragmentation mechanism? If an IPv6 packet needs to be fragmented, which parts can be fragmented?

11. Assume that an original IPV6 packet with a payload of 4349B needs to be transmitted from node A to node B. The route MTU from A to B has been detected, that is, the PMTU is 1500B. Therefore, source node A must fragment this IPv6 packet. How many shards need to be divided into? And fill in the blank cells in Table 4-4 according to the situation of each shard.

5.7 Exercises

1. What is the purpose of stateless address automatic configuration?

2. Please list the main information carried in the router advertisement message when the router advertises a network prefix.

3. What is Duplicate Address Detection (DAD) and why is DAD performed?

4. Please fill in Table 5-8 to give the type of multicast address used by each NDP mechanism.

6. Assume that nodes A and B are on the same Ethernet link and both support the IP6 protocol mechanism. The local site address of node A is FEC0:2:0:0:2:A, and the link layer address is 00-50-3E-E4-4C-00; the local site address of node B is FEC0::2: 0:0:2:B, the link layer address is 00-50-3E-E4-4B-01. Please describe the process by which node A resolves the MAC address of node B.

6.5 Exercises

1. Try to compare the characteristics of three technologies: dual protocol stack, tunnel, network address and protocol conversion.

7.13 Exercises

1. What problems need to be solved to implement IP multicast function?

2. Why are multicast functions using unicast and broadcast methods not as efficient as IP multicast technology?

4. Please describe the characteristics of IP multicast

5. Please explain the main applications of IP multicast

6. IP4 uses Class D IP addresses to represent multicast groups. Please explain the characteristics of the 3D class P address space of 224.0.0.0~224.0.0.255, 224,.0.1.0~238.255.255.255 and 239.0.0.0~239.255.255.255.

7. What technologies are used to control multicast group scope?

8. Give the representation range of Class D IP multicast addresses. How does IP multicast map Class D IP multicast addresses to Ethernet multicast addresses? If an IP multicast address is 226.24,60.9, what is its corresponding Ethernet physical address?

9. What are the characteristics of IP multicast groups? (Class exercise)

8.6 Exercises

1. The router on the Ethernet receives the multicast IP packet, and its GroupID is 226.17.18.4. This address was found when the host checked its multicast group table.

2. Why does IGMP use the report suppression function? In addition, please explain the process of IGMPv2 group members leaving the multicast group.

3. Please explain the position of the IGMP protocol in the TCP/IP protocol stack, and give the IGMP message format. What is the role of the maximum response time in the IGMP message?

4. Explain how IGMP messages are encapsulated in IP packets, and explain the values ​​of key fields (eg protocol field, TTL field, destination IP address) in the IP packet header of the encapsulated ICMP message.

5. Please explain the mechanism for electing query routers in IGMPv2. (class exercise)

6. Compared with IPv4 using ARP, what are the advantages of IPv6 using NDP?

9.15 Exercises

1. What is a multicast forwarding tree? What types of multicast routing protocols are divided into? Which routing protocols do the multicast routing protocols DVMRPMOSPF, CBT, PIM-DM and PM-SM belong to?

2. Please explain the difference between the binary group (S, G) and the binary group (*, G).

8. Please explain the role of Multicast Source Discovery Protocol MSDP and describe the working process of MSDP.

9. Try to compare the MBGP and BGP protocols.

10. Please explain the new features of IPv6 multicast technology

2. Class exercises and final review

2.1 Frequently Asked Questions in Class

2.2 Final exam question types and points

3. Reference


1. Answers to after-class exercises

1.8 Exercises

1. What are the functions of the "TTL" field and the "Protocol" field in the IP packet header?

TTL is the abbreviation of time to live, which can be translated as "time to live" in Chinese. This survival time is an initial value set by the source host but is not a specific time of storage. Instead, it stores the maximum number of routes that an IP datagram can pass through. Each time After a process, the router will decrease this value by 1. When the value is 0, the datagram will be discarded and an ICMP message will be sent to notify the source host.

Protocol: The protocol field in the IPV4 header is used to inform the target system to which transport layer protocol or process that directly uses IP communication the data part of the IP packet should be delivered. All routers on the path of IP datagram transmission do not need the information in this field. Only the destination host needs the "protocol" field.

2. The data part of a UDP user datagram is 4192B. The UDP user datagram passes through Ethernet during transmission. The maximum transmission unit (MTU) value of Ethernet is 1500B. The network layer uses the IP protocol to encapsulate UDP user datagrams and uses a 20B IP fixed header. How many IP fragments should the IP packet be divided into? Explain the length of the data part of each IP fragment, the value of the fragment offset and the value of the MF bit.

3. Try to explain the difference between IP address and physical address 

IP address (Internet Protocol Address) is used to identify each host on the Internet. It is the unique identifier of each host. Networked devices identify themselves with physical addresses, such as network card addresses. TCP/IP uses IP addresses to identify source addresses and destination addresses, but the source and destination hosts are located in a certain network, so the source address and destination address are composed of network numbers and host numbers, but this label is just a logical number , rather than the physical addresses of the router and computer network card. For a computer, the IP address is based on logic, is more flexible, is not restricted by hardware, and is easy to remember; the MAC address is consistent with the hardware to a certain extent, is based on physics, and can identify specific objects; the IP address is variable, and physical The address is fixed.

The physical address is the hardware address, which consists of 48 bits. It is the unique identifier of the access network device and is encapsulated in the header of the data frame at the data link layer during data transmission. The IP address consists of 32 bits and is a logical address. In IP protocol communication, it is encapsulated in the header of the IP datagram. Since the IP address can be set to the corresponding network device, according to the structure of the IP address, it can be easily addressed and routed on the Internet, and converted into the corresponding hardware address. In communication, the two addresses work in different protocols. level. Therefore, these two addresses need to be used.

4. How many types of IPv4 unicast addresses are divided into? What is the maximum number of networks of various types of networks and the number of hosts that can be accommodated in each network?

It is divided into: Class A, Class B, Class C, Class
A 126 networks, each network can have 16,777,214 hosts,
Class B 16,384 networks, each network can have 65,534 hosts,
Class C 2,097,152 networks, each network can have 254 hosts.

5. Use "dotted decimal" format to represent the following IPv4 address in binary form: 10000000 00001010 00000010 00011110

6. Try to explain the address types of the following IP addresses: 10.20.30.40; 172.16.26.36; 202.101.244.101; 126.1.0.200

7. The subnet IDs (subNet ID) of a Class A network and a Class B network are 16-digit 1 and 8-digit 1 respectively. Write the subnet masks for these two networks respectively. What are the different meanings of these two subnet masks?

8. If the subnet mask of a network is 255.255255.248, how many hosts can be connected to each subnet?

9. In a network, the set IP address range is 172.88.32.1~172.88.63.254. Try to determine the appropriate subnet mask.

10. The given IP address is 192,55.12,120, and the subnet mask is 255.255.255.240. What are the subnet number and host number respectively? What is the direct broadcast address?


11. If two hosts are in the same subnet, what is the result of the "logical AND" operation between the IP addresses of the two hosts and their subnet masks?

After matching with the subnet, the network ID can be obtained. For example: IP: 192.168.0.1 Subnet mask: 255.255.255.0 The two addresses are combined to get 192.168.0.0, which is the Network ID of the network segment. In other words, IP addresses in the range of 192.168.0.1~192.168.0.255 can communicate with each other. All in the same network segment. So why do we get 192.168.0.0 after 192.168.0.1 and 255.255.255.0? You will understand why after converting them into binary. I won't convert 192.168.0.1. Only convert 255.255.255.0. After conversion, it is: 11111111.11111111.11111111.00000000. We know that 1 and any number are still the value of that number. And the sum of 0 and any number is 0. Therefore, after combining 255.255.255.0 and 192.168.0.1, we will get 192.168.0.0.


12. A certain unit is assigned a Class B IP address, and its subnet ID is 129.250.0.0. The unit has 4,000 hosts spread across 16 different locations. Please analyze:

Is it appropriate to choose a subnet mask of 255.255.255.0?
If appropriate, please assign a subnet number to each location and calculate the minimum and maximum host numbers in each subnet.

What if the subnet mask is 255.255.248.0?

13. Try to explain the meaning of the following special IP addresses.


0.0.0.0
255 255 255 255
127,0.0.1
202.196.73.0
202.196.73.255


14. Describe the purpose of the dedicated or private IP address, and please list the address range of the dedicated or private IP address.

15. How many IP addresses should a router with N physical interfaces connected to the Internet have at least? Do the network prefixes of these IP addresses are the same? Why?


16. What is route aggregation?

Route aggregation (also called summary) allows routing protocols to advertise many networks with a single address. It is designed to reduce the size of the routing table in the router to save memory and shorten the IP analysis of the routing table to find the route to the remote network. The time required for the path.


17. What are the functions of ARP and RARP?

ARP provides an efficient and easy-to-maintain dynamic address binding mechanism. Before communication, the sender broadcasts a special packet and requests a host with a certain IP address to respond. When the host responds, it restores its own physical address. The sender receives the physical address. After entering the address, communication can begin. The RARP function is the opposite of ARP. It is a protocol that requests an IP address based on the physical address of the network hardware.

18. Please explain the meaning of "routed protocol" and "routing protocol". What are interior gateway protocols and exterior gateway protocols? Which type of routing protocols do RIP and OSPF protocols belong to? What about BGP routing protocol?

19. Under what circumstances will an ICMP destination unreachable message be generated? What is the function of the ICMP echo request/response message? How are ICMP messages encapsulated?

20. Why is it necessary to add a pseudo header when calculating the checksum of ICMP, TCP, and UDP messages? How to use the pseudo header to calculate the checksum?


21. Describe the role of ports in TCP or UDP protocols.

The role of the port number: Since most network applications run on the same machine, the computer must be able to ensure that the software program on the destination machine can obtain the data packet from the source address machine, and that the source computer can receive the correct reply. This is done using the UDP "port number". For example, if a workstation wishes to use the DNS on workstation 128.1.123.1, it will give the packet a destination address of 128.1.123.1 and insert the destination port number 53 in the UDP header. The source port number identifies the local machine application that requests the domain name service. At the same time, all response packets generated by the destination station need to be designated to this port of the source host. Both tcp and udp contain the necessary source port and destination port information for network services to establish and implement network transmission services.


22. What is a socket? Explain its components and functions

The so-called socket is an abstraction of endpoints for two-way communication between application processes on different hosts in the network. A socket is one end of process communication on the network, providing a mechanism for application layer processes to exchange data using network protocols.

The socket contains three pieces of information:

  • IP address
  • The port number
  • transport layer protocol

The main function is to implement inter-process communication and network programming.

23. In the TCP/IP model, why should we set up the connectionless transmission protocol UDP?

UDP is a non-connection-oriented protocol. Non-connection-oriented means that there is no need to establish a connection with the other party before formal communication, and data is sent directly regardless of the other party's status. As for whether the other party can receive the data, the UDP protocol cannot control it, so UDP is an unreliable protocol. Many applications only support UDP, such as multimedia data streaming, without generating any additional data, and will not retransmit even if damaged packets are known. When transmission performance is emphasized rather than transmission integrity, especially in some application scenarios with strong real-time nature, such as audio and multimedia applications, online games, video conferencing, etc., UDP is the best choice.


24. What are the functions of the "source port number" field, "confirmation number" field and "window size" field in the TCP segment header? Please explain the functions of the control flags SYN, ACK and FIN.


25. How are the source port number and destination port number used in the request message sent by the client to the server? How are they used in the response message sent by the server to the client? List 6 well-known TCP port numbers.

Got it

26. Use diagrams to illustrate the process of establishing a TCP connection.

When TCP establishes a connection, three data packets are transmitted, commonly known as Three-way Handshaking.
When using connect() to establish a connection, the client and server will send three data packets to each other.

After the client calls the socket() function to create a socket, the socket is in the CLOSED state because no connection is established; after the server calls the listen() function, the socket enters the LISTEN state and starts listening to client requests.

At this time, the client starts to initiate requests:

1) When the client calls the connect() function, the TCP protocol will form a data packet and set the SYN flag, indicating that the data packet is used to establish a synchronous connection. At the same time, a random number 1000 is generated and filled in the "Sequence Number (Seq)" field, indicating the sequence number of the data packet. After completing these tasks and starting to send data packets to the server, the client enters the SYN-SEND state.

2) When the server receives the data packet and detects that the SYN flag has been set, it knows that this is a "request packet" sent by the client to establish a connection. The server will also form a data packet and set the SYN and ACK flags. SYN indicates that the data packet is used to establish a connection, and ACK is used to confirm receipt of the data packet just sent by the client.

The server generates a random number 2000 and fills the "Sequence Number (Seq)" field. 2000 has nothing to do with client packets.

The server adds 1 to the client packet sequence number (1000) to get 1001, and fills the "Ack" field with this number.

The server sends the data packet and enters the SYN-RECV state.

3) When the client receives the data packet and detects that the SYN and ACK flags have been set, it knows that this is a "confirmation packet" sent by the server. The client will check the "Ack" field to see if its value is 1000+1. If it is, the connection is successfully established.

Next, the client will continue to assemble the data packet and set the ACK flag, indicating that the client has correctly received the "confirmation packet" sent by the server. At the same time, add 1 to the packet sequence number (2000) just sent by the server to get 2001, and use this number to fill the "Confirmation Number (Ack)" field.

The client sends the data packet and enters the ESTABLISED state, indicating that the connection has been successfully established.

4) When the server receives the data packet and detects that the ACK flag has been set, it knows that this is the "confirmation packet" sent by the client. The server will check the "Ack" field to see if its value is 2000+1. If it is, it means the connection is successfully established and the server enters the ESTABLISED state.

At this point, both the client and the server have entered the ESTABLISED state, the connection is successfully established, and data can be sent and received. The key to the three-way handshake is to confirm that the other party has received its data packet. This goal is achieved through the "Confirmation Number (Ack)" field. The computer will record the sequence number Seq of the data packet sent by itself. After receiving the data packet from the other party, it will check the "Confirmation Number (Ack)" field to see whether Ack = Seq + 1 is true. If it is true, it means that the other party has correctly received its data. Bag.

27. What is a URL? What is its format?

 Uniform Resource Locator (URL, abbreviation of English Uniform Resource Locator), its English abbreviation is called URL. Also known as a web page address, it is the address of a standard resource on the Internet. URL is an identification method used to completely describe the address of web pages and other resources on the Internet, usually called a URL address.

The general syntax format of URL is: protocol :// hostname[:port] / path / [:parameters][?query]#fragment


28. In DNS, why does the resource record include the "time to live" field?

29. Please explain the role of SMTP protocol and POP3 protocol in the email system.

30. Try to explain the functions of port No. 20 and port No. 21 used by the FTP protocol.

31. When browsing information on the Internet, what protocol is used to transmit Web pages between the browser and the WWW server
?

31. When browsing information on the Internet, what protocol is used to transmit Web pages between the browser and the WWW server
?


32. Briefly analyze the functions of the following protocols and explain their positions in the TCP/IP protocol suite and the encapsulation relationship of protocol data: IP, ICMP, ARP, RARP, RIP, OSPF, BGP, TCP, UDP, DNS , SMTPPOP, FTP, TELNET.


33. Now we have intercepted 3 Ethernet frames #1 ~ Frame #3. It is assumed that these Ethernet frames passed the error check. The frame content expressed in hexadecimal is as follows

The method is the same as the following blog example. The graphical format of Ethernet frames and IP datagrams (including explanations of related examples, one question is enough)_Rebecca_yanhan's blog-CSDN blog

2.6 Exercises

1. Try to analyze the problems existing in IPv4

(1) IPv4 address resources are about to be exhausted. The IPv4 address structure is unreasonable, resulting in serious waste of address allocation; the number of users increases rapidly, and the demand for addresses increases sharply;

(2) Routing becomes a new bottleneck. The increase in the number of networks has resulted in huge routing tables maintained by backbone routers; the IPv4 address structure is poorly hierarchical, and it takes a long time to look up the routing table when selecting a route; the length of the IPv4 packet header is variable, which is not conducive to hardware processing; packets are routed independently, and packet transmission is not used dependency; the router needs to handle fragmentation, and fragmentation increases the processing burden on the router.

(3) Lack of service quality QoS guarantee. Poor real-time performance; poor security; lack of service diversity;

2. Please explain the technical characteristics of IPv6.

(1) The IPv6 address length is 128 bits, and the address space is increased by 2 to the 96th power;

(2) Flexible IP message header format. The variable-length options field in IPv4 is replaced with a series of fixed-format extension headers. The appearance of the option part in IPv6 has also changed, allowing the router to simply pass the option without doing any processing, speeding up packet processing. IPv6 simplifies the packet header format, with only 7 fields, speeding up packet forwarding and improving throughput.

(3) IPV6 supports resource allocation. The IPV6 group cancels the service type field and adds a flow identification field.

(4) Improve security and provide two network security mechanisms. Identity authentication and privacy are key features of IPV6.

(5) Support more service types and add support for automatic configuration. This is an improvement and extension to the DHCP protocol, making the management of the network (especially the LAN) more convenient and faster.

(6) Routing selection is enhanced. The multi-level address structure of IPV6 provides more routing information, helps route aggregation, and allows the protocol to continue to evolve and add new functions to adapt to the development of future technologies.

3. Compared with IPv4 addresses, IPv6 addresses are not just an expansion of space. Please describe IPv6 addressing technology

The use of IPv6 can not only solve the problem of the number of network address resources, but also solve the obstacles for multiple access devices to connect to the Internet.

4. What are the main reasons for low routing efficiency in IPv4 networks? What measures have been taken to address these problems in IPv6?

The main reasons for low routing efficiency are:

(1) The increase in the number of networks leads to huge routing tables maintained by backbone routers;

(2) The IPv4 address structure is poorly hierarchical, and when selecting a route, it takes a long time to look up the routing table;

(3) The length of the IPv4 packet header is variable, which is not conducive to hardware processing;

(4) Packets are routed independently without utilizing the correlation of packet transmission;

(5) The router needs to process fragmentation, and fragmentation increases the processing burden of the router.

Measures taken by IPv6: route aggregation, multiple addresses, stateless address automatic configuration, re-addressing

3.6 Exercises

1. Regarding IPv6 addresses, please answer the following questions

(1) The total length of an IPv6 address is 128 bits, usually divided into 8 groups, each group is 16 bits, each group is in the form of 4 hexadecimal numbers, and each group of hexadecimal numbers is separated by a colon. For example: FC00:0000:130F:0000:0000:09C0:876A:130B, which is the preferred format for IPv6 addresses.

(2)3FFF:0000:0000:0000:A2B3:0000:0000:DC69

(3) 0:0:0:0:0:0:CAC4:4910 or ::CAC4:4910 or ::202.196.73.16

Analysis: The above three addresses are only represented in different ways. The compatible address is to add 96 bits of 0 in front of the IPV4 address and then represent it. (See page 65 of the textbook)

(4) Network interface identification number: 020D:87FF:FE04:6F30, (see page 72 of the textbook)

(5) FF02::1, which represents the multicast address of all nodes within the range of this link, replacing the direct broadcast address and limited broadcast address in ipv4.

(6)FF02::1:FF04:6F30

Analysis: The prefix of the multicast address of the requested node is FF02::1:FF00:0/104. This 104-bit prefix plus the lower 24 bits of the anycast or unicast address (04:6F30) forms the requested node. Multicast address FF02::1:FF04 :6F30 .

(7)

1. First, insert the 16-bit value FFFE (hexadecimal) into the middle of the high 24 bits (OUI) and low 24 bits (extended identifier) ​​of the 48-bit Ethernet card address (MAC address).

2. Then set bit 7 of the first byte to 1 , which is the global management (1)/local management (0) G/L (global/local) bit.

(8)581E:1456:2314:ABCD::/64

(9)

IP address format The meaning of an IP address or prefix
::/128 Represents an unspecified address ,
::1/128 Loopback address, equivalent to localhost (127.0.0.1) in IPv4
::FFFF:202.196.73.4 ::FFFF:ABCD is an IPv6 address mapped from IPv4, where <ABCD> indicates the IPv4 address, for example::FFFF:202.196.73.4, which is used to represent IPv4 nodes on networks that do not support IPv6.
::202.196.73.4 ::ABCD is an IPv6 address compatible with IPv4, where <ABCD> indicates the IPv4 address: 202.196.73.4. These addresses will be used by IPv4/IPv6 nodes that automatically tunnel IPv6 packets across IPv4 networks.
FF02::1 Indicates the multicast address of all nodes within this link range, replacing the direct broadcast address and limited broadcast address in IPv4.
FF02::2 FF02::2 represents the multicast address of all router nodes on the local link
FF02::1:FF01:000A Requested node multicast address
FE80::/10 Link-local address for each network interface
FEC0::/10 local site address

2. Try to compare anycast, unicast and multicast

Unicast: refers to a transmission method in which packets are transmitted over a computer network with a single destination address. It is the most widely used network today. Most of the commonly used network protocols or services use unicast transmission, such as all TCP-based protocols.

Multicast: Also called multicast, multicast or multicast. Refers to delivering information to a group of destination addresses at the same time. Its use of policies is the most efficient because messages only need to be delivered once on each network link, and messages are only replicated when a link forks.

Anycast: is a network addressing and routing strategy that allows data to be sent to the "nearest" or "best" destination based on the routing topology.

3. Use C language to write 4 functions to implement the following functions respectively (1) Convert the binary address format representation of IPv6 to colon-hexadecimal representation (2) Convert the IP4 address to the corresponding IPv6 compatible address (3) Convert the IPv4 address to the corresponding IPv6 mapped address (4) For any IPv6 address, display all possible address types of the address
 

Since the author has not written a C language program for a long time, I used python to write four programs.

(1)

"""
将二进制ipv6地址转换为冒号十六进制表示的ipv6地址
"""
ipv6_2_address = input().split(':')
ipv6_16_address_list = []
for num in ipv6_2_address:
    b = hex(int(num)).lstrip('0').strip('x')
    if len(b) != 4:
        b = '0' * (4 - len(b)) + b
    ipv6_16_address_list.append(b)
ipv6_16_address = ":".join(ipv6_16_address_list)
print(ipv6_16_address)

(2)

"""
将ipv4地址转换为ipv6兼容地址
"""
ipv4_address = input().split('.')
ipv6_address_list = ['0', '0', '0', '0', '0', '0']
for num in ipv4_address:
    b = hex(int(num)).lstrip('0').strip('x')
    ipv6_address_list.append(b)
ipv6_compatible_address = ":".join(ipv6_address_list)
print(ipv6_compatible_address)

(3)

"""
将ipv4地址转换为ipv6映射地址
"""
ipv4_address = input().split('.')
ipv6_address = '0:0:0:0:0:FFFF:'
temp_list = []
for num in ipv4_address:
    b = hex(int(num)).lstrip('0').strip('x')
    if len(b) == 1:
        b = '0' + b
    temp_list.append(b)
ipv6_mapped_address = ipv6_address + temp_list[0] + temp_list[1] + ':' + temp_list[2] + temp_list[3]
print(ipv6_mapped_address)

4.11 Exercises

1. Try to compare the characteristics of IPv4 packet header and IPv6 packet basic header.

IPv4 packet header IPv6 packet header
Number and length of fields It consists of 12 fixed-length fields totaling 20B and several options. Fixed header length of only 8 fields 40B
version number Version number is 4 Version number is 6
When Ethernet transmits IPV4/6 packets, the value of the frame type field of the Ethernet frame Hexadecimal number 0x8000 Hexadecimal number 0x86DD
Field adjustments

1) Deletion: The six fields of header length, service type, identifier, flag, fragmentation offset and header checksum have been deleted in IPv6.

2) Modification: The names and some functions of the three fields of total length, protocol type and survival time have been modified, and all option functions have been modified.

3) Newly added: Two new fields have been added, namely the transmission category field and the flow identification field.

2. If the IPv6 packet consists of a basic header and a TCP segment, assuming the total length of the TCP segment is 256B.
Try to represent this packet and give the values ​​of the fields that can be determined.

Version number (4bit) 6 Transmission category (8bit) Stream identifier (20bit)
Payload length (16bit) Next first (8bit) 6 Hop count limit (8bit)
Source address (128bit)
Destination address (128bit)
Data part (256B) TCP message segment


3. Please analyze the difference between the extended header of IPv6 grouping and the options of IPv4 grouping.

There can be some options in the IPv4 header to handle some special situations. These options mainly include specifying source routing options, routing record options, timestamp options and security options.

IPv6 defines several different extension headers, which are identified by the value of the next header field. Except for 59, each extension header has its own header field. Using this structure, IPv6 extension headers can link extension headers like a daisy chain. IPv6 puts all the options in the original IPV4 header into the extended header, and leaves the extended header to be processed by the source and destination hosts at both ends of the path. The routers the packet passes through do not process these extension headers.



4. Please explain the meaning and function of the "next header" field in the IPv6 packet.

The next header occupies 8 bits, which is equivalent to the protocol field or optional field of IPv4 and defines the digital identification number or the protocol type of the data part of the extended header immediately following the IPv6 basic header.

Generally divided into the following two situations:

1) If the IPv6 packet does not have an extended header , the next header field functions as if there is no protocol field in the IPv4 packet. The value of this field indicates to which protocol the value of the data portion should be delivered for processing.

2) If the IPv6 packet has an extended header , this field is used to indicate the digital identification number of the first extended header immediately following the basic header, which is the extended header type.

5.What extension headers are defined in RFC 2460? What is the order in which these extension headers appear in IP6 packets?

There are six types in total, namely: hop option header, routing header, fragmentation header, authentication extension header, encrypted security payload header, and destination option header.

order:

1) IPv6 basic header

2) Jump to the jump option extension header

3) Destination option extension header

4) Routing extension header

5) Sharding extension header

6) Authentication extension header

7) Encapsulate the security payload extension header 

8) Destination option extension header

9) Upper layer protocol header


6. What design ideas need to be considered when designing new TLV options?

(1) Each multi-byte subfield (subfield with a length other than 1) located in the TV optional data field should be aligned on the natural boundaries of the packet. That is, the n-byte field should be placed at an integer multiple byte offset of n from the start of the extended header, where n=1, 2, 4 or 8.
(2) Following the extension header length is an integer multiple of 8 Under the premise of bytes, the jump extension header and destination option extension header occupy as little space as possible.
(3) When an extension header needs to carry TV options, the number of options should be as small as possible, usually limited to one.

7. Under what circumstances are the two padding options pad1 and pad2 used?


8. Give an example to illustrate the change process of the destination address field of the IPv6 basic header and the main fields in the source route extension header during the transmission process of IPv6 packets containing type 0 source route extension header, as shown in Table 4-3

9. Transmit an IP6 packet from source node A to destination node B. In order for IPv6 packets to be delivered through R, R, R; R routers in order, a type 0 source routing extension header needs to be used. During the transmission process of this IPv6 packet, the values ​​of its basic header and type 0 source routing extension header will change. Please complete the following form and fill in the values ​​of relevant fields into the blank cells in the form.


10. What are the advantages of the IPv6 fragmentation mechanism? How is it different from the IPv4 fragmentation mechanism? If an IPv6 packet needs to be fragmented, which parts can be fragmented?


11. Assume that an original IPV6 packet with a payload of 4349B needs to be transmitted from node A to node B. The route MTU from A to B has been detected, that is, the PMTU is 1500B. Therefore, source node A must fragment this IPv6 packet. How many shards need to be divided into? And fill in the blank cells in Table 4-4 according to the situation of each shard.
 

5.7 Exercises

1. What is the purpose of stateless address automatic configuration?

Allows nodes on the local link to configure their own IPv6 unicast addresses based on the network prefix advertised by the router on the local link. Automatic configuration can be achieved without the need for a BOOTP server and a DHCP server. Support plug and play.


2. Please list the main information carried in the router advertisement message when the router advertises a network prefix.

1) Prefix length

2) L bit, "on link" flag bit

3) A bit, "autonomous" address configuration flag

4) Effective survival time

5) Recommended survival time

6) Reserved fields

7) Network prefix


3. What is Duplicate Address Detection (DAD) and why is DAD performed?

DAD is a mechanism used for stateless address autoconfiguration and node startup. After a node obtains an IPv6 unicast address using the stateless address autoconfiguration mechanism, it must verify on the local link that the temporary address to be used is unique and not in use before the address is officially used.

(1) Not all node IP addresses on the link are configured with stateless addresses. There may be nodes with stateful address configurations, so the addresses may be repeated.
(2) When the subnet prefix is ​​very long and the MAC address added later does not require 48 bits, but only a part of the MAC address is obtained (for example, only the product serial number is intercepted), duplicate addresses may occur, which rarely happens. .

4. Please fill in Table 5-8 to give the type of multicast address used by each NDP mechanism.

6. Assume that nodes A and B are on the same Ethernet link and both support the IP6 protocol mechanism. The local site address of node A is FEC0:2:0:0:2:A, and the link layer address is 00-50-3E-E4-4C-00; the local site address of node B is FEC0::2: 0:0:2:B, the link layer address is 00-50-3E-E4-4B-01. Please describe the process by which node A resolves the MAC address of node B.

6.5 Exercises


1. Try to compare the characteristics of three technologies: dual protocol stack, tunnel, network address and protocol conversion.

1) Dual protocol stack: The dual protocol stack host uses IPv4 addresses to communicate with IPv4 hosts, and uses IPv6 addresses to communicate with IPv6 hosts.

2) Tunnel: There is no need to upgrade all protocols to dual protocol stacks. Only the edge devices of the IPv4/IPv6 network are required to implement dual protocol stack and tunnel functions.

3) Protocol conversion: No dual protocol stack and tunnel support is required.

7.13 Exercises

1. What problems need to be solved to implement IP multicast function?

1) There needs to be a unique mechanism to identify the multicast group
2) There needs to be a mechanism for multicast group members to join or exit the multicast group
3) A router protocol that can enable routers to efficiently transmit multicast packets to each group member on the IP network is needed


2. Why are multicast functions using unicast and broadcast methods not as efficient as IP multicast technology?

(1) Implement multicast function in repeated unicast technology. This increases the burden on the source host because it has to copy one data packet for each group member. And it is very likely that multiple different packets will be transmitted along the same path, wasting network bandwidth. Especially when there are many members in the group, network efficiency will decrease.

(2) Using broadcast to implement multicast, non-group member hosts must filter and discard unnecessary packets through upper-layer application protocols, which will increase the burden on the receiving host. Broadcasting wastes network bandwidth and does not broadcast P packets to another network.


4. Please describe the characteristics of IP multicast

1) Multicast group address. Each multicast group has a unique multicast address.

2) Number of multicast groups. Up to 228 multicast group addresses can be defined.

3) Dynamic multicast group membership. Hosts can join or leave the group at any time. A host can be a member of any number of multicast groups.

4) Use of hardware. If the physical hardware supports multicast, use hardware multicast to send IP multicast. If the hardware does not support multicast, use broadcast or unicast to implement IP multicast.

5) Forwarding between networks. Multicast group members can be connected to multiple physical networks, so a special multicast router is required to forward IP multicast packets.

6) Delivery semantics. IP multicast uses the best-effort service provided by IP. Multicast packets may be lost, delayed, duplicated, and arrive out of order.

7) Membership and transmission. Any host (including non-multicast group members) can send packets to any multicast group: the group relationship is only used to determine whether the host can receive packets sent to that multicast group.


5. Please explain the main applications of IP multicast

1) Information release 2) Video conference 3) Distance learning 4) Internal resource sharing


6. IP4 uses Class D IP addresses to represent multicast groups. Please explain the characteristics of the 3D class P address space of 224.0.0.0~224.0.0.255, 224,.0.1.0~238.255.255.255 and 239.0.0.0~239.255.255.255.

1) 224.0.0.0~224.0.0.255: IANA reserved addresses. 224.0.0.0 is reserved and not allocated. Other addresses are used by routing protocols and topology search and maintenance protocols. Addresses in this range are local and will not be used regardless of the TTL. forwarded by router

2) 224.0.1.0~238.255.255.255: These addresses are user multicast addresses, valid nationwide, among which 233/18 is the GLOP address.
3) 239.0.0.0~239.255.255.255: Local management multicast address, only valid within a specific local range
 

7. What technologies are used to control multicast group scope?

1) Rely on the control range of the TTL field of the IP packet

2) The technique of controlling scope is called determining management scope



8. Give the representation range of Class D IP multicast addresses. How does IP multicast map Class D IP multicast addresses to Ethernet multicast addresses? If an IP multicast address is 226.24,60.9, what is its corresponding Ethernet physical address?

1) Indicates the range 224.0.0.0~239.255.255.255

2) The first 25 bits of Ethernet are fixed 0000 0001 0000 0000 0101 1110 0 , and then copy the lower 23 bits of the multicast group address to the last 23 bits of the multicast address of the Ethernet card

3)01-00-5E-18-3C-09


9. What are the characteristics of IP multicast groups? (Class exercise)


1) A multicast group can span multiple networks
2) There is no limit on the number of hosts in a multicast group.
3) A host can join or leave a multicast group at any time.
4) A host can belong to multiple multicast groups at the same time.
5) Non-member hosts can send IP multicast packets to any multicast group.
6) IP multicast router forwards multicast packets from one network to another network to its destination node.
 

8.6 Exercises


1. The router on the Ethernet receives the multicast IP packet, and its GroupID is 226.17.18.4. This address was found when the host checked its multicast group table.

Please answer the following questions
Chapter 8 Internet Group Management Protocol IGMP
(1) Try to explain how the router encapsulates this IP packet into Ethernet and sends it to each receiving node? Try to give the values ​​of all fields of this Ethernet packet .
(2) The IP address of the router's forwarding interface is 185.22.5.6, and the corresponding physical address is 4A:22:45:12.
E1:E2. Does this router need ARP service?
(3) What happens if the router cannot find the GroupID in its group table?


2. Why does IGMP use the report suppression function? In addition, please explain the process of IGMPv2 group members leaving the multicast group.

In order to improve the efficiency of the IGMP protocol and avoid unnecessary traffic. Using the report response suppression function, you can avoid sending the same membership report message to the router, which helps reduce the number of IGMP messages.
 

Leaving process:
(1) The host that is leaving sends a leaving group message to all routers on the network (destination address is 224.0.0.2)

(2) After receiving the leave group message, the query router immediately sends a specific multicast group query message to the network.

(3) If there are still members of the multicast group on the network, a response message will be sent back: If there are no members of the multicast group, no host will respond, so the router knows that there are no members of the group. Stop forwarding data for this group
 

3. Please explain the position of the IGMP protocol in the TCP/IP protocol stack, and give the IGMP message format. What is the role of the maximum response time in the IGMP message?

The maximum response time is used to specify the maximum waiting time for responding to query messages. Through this value, the router can adjust the departure delay of multicast group members.


4. Explain how IGMP messages are encapsulated in IP packets, and explain the values ​​of key fields (eg protocol field, TTL field, destination IP address) in the IP packet header of the encapsulated ICMP message.

IGMP message encapsulation = IP packet header + IGMP message

1) Protocol field: Its value is 2, which is used to indicate that the IP packet is encapsulated by IGMP

2) TTL field: Its value is 1, indicating that GMP messages can only be transmitted within this network

3) Destination IP address field: Its value varies with the message type. If the membership query message is sent, the destination address is 224.0.0.1, which means that all nodes, hosts and routers on this network will receive this message. If it is a membership message, the destination P address should be the address of the multicast router. If it is a leave group message, the destination address should be 224.0.0.2, indicating all routers on this network.

5. Please explain the mechanism for electing query routers in IGMPv2. (class exercise)

IGMPv2 uses IP addresses and general membership query messages to elect query routers. The process is as follows:

(1) Each router on the network assumes that it is the query router. When the router starts, it sends a general membership query message to all nodes (destination address is 224.0.0.1);

(2) Each router compares its own P address with the source P address of the P packet encapsulating the general query message, and the router with the smallest IP address is elected as the query router;

(3) All non-querying routers start a querier timer, and reset the timer when they receive a general query message from the querying router. If the timer times out, it is considered that the elected query router has failed, and then go to step (1) and restart the election. The value of the timer is generally 2 times the query interval.

6. Compared with IPv4 using ARP, what are the advantages of IPv6 using NDP?

IPv6 uses NDP more efficiently than IPv4 uses ARP

1) In IPv6, only neighboring nodes that care about this mechanism will process neighbor request and notification messages in their protocol stacks. In IPv4, ARP uses broadcast messages to discover a node's link layer address. ARP broadcast causes all nodes on the local link to send ARP broadcast messages to the IPV4 protocol stack.

2) In IPv6, after the nodes complete the neighbor request and neighbor notification messages, they know each other's link layer address and store the link layer address in the neighbor detection table. However, IPV4 requires two ARP messages to obtain the same result.

3) In IPv6, the neighbor detection protocol NDP runs at the network layer and has nothing to do with the physical network. Any physical network can run the same neighbor detection protocol. The ARP of IPV4 runs at the data link layer, and different physical networks require different ARP protocols.
 

9.15 Exercises


1. What is a multicast forwarding tree? What types of multicast routing protocols are divided into? Which routing protocols do the multicast routing protocols DVMRPMOSPF, CBT, PIM-DM and PM-SM belong to?

1. Multicast distribution tree is a tree network structure used for multicast data forwarding. Multicast routing protocols can be divided into: - distance-vector multicast routing protocol: such as DVMRP
- link-state multicast routing protocol: such as MOSPF
- Core-based multicast routing protocol: such as CBT, PIM-DM, PIM-SM2. Multicast routing protocols DVMRP and MOSPF are multicast routing protocols based on distance vector and link status. CBT, PIM-DM and PIM-SM are core-based multicast routing protocols. - DVMRP: Modified based on the RIP routing protocol, using a decrement-based threshold to build a multicast distribution tree, and is a distance vector-based multicast routing protocol.
- MOSPF: Modified based on the OSPF routing protocol to build a multicast distribution tree based on minimum cost. It is a multicast routing protocol based on link status.
- CBT: Taking the first data initiation point of the multicast session as the core and converging to the core to form a distribution tree, it is a core-based multicast routing protocol.
- PIM-DM: Constructs a distribution tree using neighbors in the upstream direction of multicast data reception as upstream nodes. It is a core-based multicast routing protocol. 
- PIM-SM: Builds a distribution tree based on candidate BGP routes, which is a core-based multicast routing protocol.

2. Please explain the difference between the binary group (S, G) and the binary group (*, G).


(S,G):- S represents a specific multicast data source, and G represents the multicast group address.
- (S,G) represents the data stream sent from source S to group G.
- Source S is a unicast address, representing a single multicast source.
- The router maintains a separate distribution tree for each (S,G) entry.

(*,G):- * indicates any source, G indicates the multicast group address.
- (*,G) represents a data stream sent to group G from any source.
- * is not an actual source address, it matches all multicast packets with no source specified.
- The router maintains a separate distribution tree for each (*,G) entry.
- (*,G) distribution tree is usually used for multicast applications in MBONE that do not have a clear source, such as audio and video data streams in MBONE conferences.

8. Please explain the role of Multicast Source Discovery Protocol MSDP and describe the working process of MSDP.


9. Try to compare the MBGP and BGP protocols.


10. Please explain the new features of IPv6 multicast technology
 

2. Class exercises and final review

2.1 Frequently Asked Questions in Class

1. What is TTL?

survival time

2. What is the site?

network

3. What is RFC?

Request review

4. What is Qos?

Quality of service (QoS)

5. A single basic condition for IP multicast

1) There is a unique mechanism for identifying multicast groups

2) Multicast group mechanism for multicast group members to join or exit

3) There is a router protocol that enables routers to efficiently transmit multicast packets to each group member on an IP network.

6. What does IPV6 use instead of ARP?

NDP: Neighbor Detection Protocol

7. What is BGP? BGMP?

Border Gateway Protocol, BGMP: Border Gateway Multicast Protocol

8. What is a link?

network

9. What is an agreement? What is an algorithm?

10. How many types of multicast forwarding trees are there?

Source-based tree (SBT) is also called shortest path tree and shared tree (ST).

11. RPF: Reverse Path Forwarding, RPB: Reverse Path Broadcast, RPM, DVMRP: Distance Vector Multicast Routing Protocol

12. What equipment is used between the two hops?

router

13. Domain: AS is a self-made domain

14. loopback: loopback

15. How many multicast routing algorithms are there?

The multicast routing algorithm is used to establish a multicast tree with good performance and make it meet the quality of service (QoS) requirements of various services. Shortest path algorithm, minimum spanning tree algorithm, Steiner tree algorithm
 

16. RIP: Routing Information Protocol, TRPB: Truncated Reverse Path Broadcast

17. Data-driven multicast tree construction: MOSPF multicast open shortest path first
, DVMRP

Receiver-driven multicast tree construction: CBT

18. Aggregation point related protocols: CBT core tree-based multicast protocol, PIM-SM,

19. PIM-DM: dense mode protocol-independent multicast, PIM-SM: sparse mode protocol-independent multicast

20. What is the difference between Steiner tree and minimum spanning tree?

The minimum spanning tree must include all nodes in the network, while the Steiner tree problem only requires the minimum cost of connecting some nodes (multicast group members) in the network.
 

2.2 Final exam question types and points

Total: 100 points

10 abbreviations - 10 points

10 short answers - 50 points

4 big questions - 40 points

3. Reference

Files shared through Baidu Netdisk: Reference book pdf
link: https://pan.baidu.com/s/1arFzJQvTPBOWPz4nJj_Fhg 
Extraction code: PBrR 
Copy this content and open "Baidu Netdisk APP to obtain"

Guess you like

Origin blog.csdn.net/weixin_45440484/article/details/129699810