Textbook: Computer Network (7th edition) xie Xiren edition
The network layer
The network layer up only provides simple, flexible, connectionless, best-effort datagram services. The network layer provides no quality-of-service commitment, meaning that packets transmitted may be lost, duplicated, and out of order.
1. Core functions of the network layer: packet forwarding and routing
1.1 Network Protocol IP
Three protocols that are compatible with IP
- Address resolution protocol ARP
- Internet Control Message Protocol, ICMP
- Internet Group management protocol IGMP
1.2 Concepts
Transponder: intermediate device used by the physical layer Bridge or bridge: intermediate device used by the data link layer Router: intermediate device used by the network layer Gateway: intermediate device used above the network layer to connect two incompatible systems using a gateway, which requires protocol translation and forwarding at a high level: Routing: To determine the path taken by a packet from the destination (routing algorithm)
2. Datagram service and virtual circuit service
The network layer provides two types of services
2.1 Virtual circuit network
2.1.1 concept
- Reward a circuit-switched path from the source to the destination. Each router on the path is the connection state of the parent virtual circuit. - Data is transmitted in packet switching mode. Each packet is written to VCID. - Link and router resources (such as bandwidth and cache) can be reserved for virtual circuits.Copy the code
2.1.2 composition
- A path from source to destination (logical connection)
- Virtual circuit number: indicates the number of each link along the path
- Each router along this path forwards a packet and records every virtual circuit that passes through the router.
2.2 Datagram networks
- There is no connection at the network layer
- The packet carries the destination host address
- The router forwards packets based on the packet destination
- Construct forwarding table based on routing selection protocol
- Each group selects routes independently
2.3 Comparison between the Two
3. IP address, subnet mask, classless address, subnet division, and route aggregation
3.1 the IP address
An Internet Protocol Address (IP) is an Internet Protocol Address.
An IP address is a unified address format provided by the IP protocol. It allocates a logical address to each network and each host on the Internet to shield physical address differences.
3.1.1 Basic knowledge
The entire Internet is a single, abstract network. An IP address is a 32-bit unique identifier assigned to every interface on every host (or router) on the Internet that is unique worldwide.
IP addresses are now assigned by ICANN, the Internet’s body for assigning names and numbers.
Historical addressing mode of an IP address
- IP address of the class
- Subnets
- Super net
There are two fields in the IP address
- The first field is the network number: it records class A, B, and C addresses
- The latter field is the host number: identifies the host
IP address ::= {< network number >, < host number >}Copy the code
- The fields of type A, B, and C are 1, 2, and 3 bytes long respectively. The first bits of the network number field are 1 to 3 category bits, which are specified as 0,10,110 respectively
- Class D addresses for multicast (one-to-many communication)
- Class E addresses are reserved for later use
Read the IP addressSpecifies the assignment type of class A, B, and C addresses of IP addressesA special IP address that is not generally applicable
3.1.2 characteristics
- Each IP address consists of a network number and a host number. In this sense, an IP address is a hierarchical address structure. The advantages are as follows:
- When assigning IP addresses, the IP address management organization assigns only network numbers. The unit that obtains the network numbers assigns other host numbers. This facilitates IP address management.
- The router forwards packets only according to the network number connected to the destination. In this way, the number of items in the routing table is greatly reduced, thus reducing the storage space occupied by the routing table and the time for searching the routing table.
- An IP address actually identifies an interface between a host (or router) and a link. When a host is connected to two networks at the same time, the host must have two corresponding IP addresses and different network ids. This type of host is called a multi-host.
- A network is a collection of hosts with the same NET-ID, so several Lans connected by forwarders or Bridges remain one network. Lans with different network numbers must be interconnected using routers.
- In IP addresses, all networks assigned network numbers are equal. The Internet treats every IP address equally.
3.1.3 IP Address and Hardware Address
A physical address is used by the data link layer and the physical layer. An IP address is a logical address used by the network layer and other layers
Therefore, it can be seen from the figure above that the IP layer is the virtual Internet, and what is really transmitted is the transmission of data frames encapsulated with datagram numbers at the lower link layer.
Differences between the two:
- Only IP datagrams are visible on the IP layer abstraction of the Internet
- The router selects routes only according to the network number of the DESTINATION IP address
- At the link layer of the LAN, only MAC frames are visible
- Although the hardware addresses of interconnected networks vary, the Internet’s abstraction at the IP layer hides these intricate details below. As long as we discuss the problem at the network layer, we can study the communication between hosts and hosts or routers with a uniform, abstract IP address.
3.1.4 Differences between 127.0.0.1 and 192.168.1. XXX
- 127.0.0.1 is the local address, ping 127.0.0.1 can be connected
- 192.168.1. XXX is the IP address assigned by the local IP address on the LAN. If there is no LAN, this IP address cannot be pinged through.
- Example: If MY name is Fan yi, 127.0.0.1 is myself, which is what I call myself, and 192.168.1. XXX is Fan Yi, but what other people call me.
3.2 Subnet Mask
A subnet mask is also called a network mask, an address mask, or a subnetwork mask. It is used to specify which bits of an IP address identify the subnet where a host resides, and which bits identify the bitmask of a host. A subnet mask cannot exist alone. It must be used together with an IP address. A subnet mask is used to divide an IP address into a network address and a host address
3.3 Classless Address
A classless network is a network in which the mask of an IP address is of variable length compared with a classless network. On the basis of class-like network, take some host ids as subnet ids.
For example, if the IP address is 192.168.250.44, the subnet mask cannot be smaller than 24 bits. Since this is a Class C network, the subnet mask can only be larger than 24 bits. The mask 255.255.248.0 (21 bits) does not meet the requirements.
3.4 Subnets
Subnet definition: The Internet organization defines five types of IP addresses, including A, B, and C. There are 126 Class A networks, and each class A network may have 16777214 hosts in the same broadcast domain. It would be impossible to have so many nodes in the same broadcast domain, and the network would saturate with broadcast traffic, leaving 16,777,214 addresses largely unassigned. IP networks based on each type can be further divided into smaller networks, with each subnet defined by the router and assigned a new subnet network address, which is created by borrowing the host part based on each type of network address. A subnet mask is used to hide the subnet so that the network does not change from the outside.
3.5 Route Aggregation
Route aggregation (also known as summarization) is the ability of the routing protocol to notify many networks with a single address. The goal is to reduce the size of the routing table in a router, to save memory, and to reduce the time it takes for AN IP to analyze the routing table to find a path to a remote network.
4. The ARP protocol
Address Resolution Protocol (ARP) is a TCP/IP Protocol that obtains physical addresses based on IP addresses. The host broadcasts the ARP request containing the target IP address to all hosts on the LAN and receives the return message to determine the physical address of the target. After receiving the return message, the IP address and physical address are stored in the LOCAL ARP cache for a period of time. In the next request, the IP address and physical address are queried in the ARP cache to save resources.
5. IP datagram format
- version
The value contains four characters and indicates the IP protocol version. The IP protocol version used by the communication parties must be the same. The widely used IP protocol version is 4, that is, IPv4. 2. The header contains four digits. The maximum decimal value that can be expressed is 15. The number represented in this field is in 32-bit word length (a 32-bit word is 4 bytes long). Therefore, when the length of the IP header is 1111 (that is, 15 in decimal), the length of the header reaches 60 bytes. When the header length of an IP packet is not a multiple of 4 bytes, it must be filled with the last fill field. The data portion always starts at a multiple of 4 bytes, which is convenient when implementing the IP protocol. The disadvantage of limiting the header length to 60 bytes is that the length can sometimes be insufficient, and the reason for limiting the header length to 60 bytes is to minimize overhead for users. The most common header length is 20 bytes (that is, 0101), with no options.
- Distinguish between service
Also known as a service type, it is an 8-bit service for better service. This field was called service type in the old standard, but has never actually been used. The IETF renamed this field to Differentiated Services (DS) in 1998. This field is only useful if the discriminating service is used. 4. Total length Sum of header and data, in bytes. The total length field is 16 bits, so the maximum length of the datagram is 2^16-1=65535 bytes. 5. Identification is used to identify the datagram, accounting for 16 bits. The IP protocol maintains a counter in memory. Each time a datagram is generated, the counter is incremented by 1 and assigned to the identity field. When a datagram exceeds the MTU of the network and must be fragmented, the value of this identity field is copied to the identity field of all datagrams. Fragmented packets with the same identifier field value are reassembled into original datagrams. 6. There are three flags. The first digit is unused and has a value of 0. The second, called DF (no sharding), indicates whether sharding is allowed. If the value is 0, sharding is allowed. If the value is 1, sharding is not allowed. The third bit, called MF (more shards), indicates whether any shards are being transmitted, and when set to 0, indicates that no more shards need to be sent, or that the datagram is not shard. 7. Slice offset accounted for 13 bits. After a packet is fragmented, this field marks the relative position of the fragment in the original packet. The offset unit is 8 bytes. Therefore, the offset of all shards except the last shard is an integer multiple of 8 bytes (64 bits). 8. TTL indicates the lifetime of a datagram in the network. It is 8 bits. This field is set by the source host that sent the datagram. Its purpose is to prevent undeliverable datagrams from being transmitted indefinitely on the network, thus consuming network resources. The router decreases the TTL value by one before forwarding the datagram. If the TTL value decreases to 0, the datagram is discarded and not forwarded. Thus, TTL specifies the maximum number of routers a datagram can pass through in a network. The maximum value of TTL is 255. If the initial TTL value is set to 1, this datagram can only be transmitted on the local LAN. 9. Protocol Indicates the protocol type used by the data carried in the data packet. The value is 8 bits. This field enables the IP layer of the destination host to know which protocol is used to process the data part. Different protocols have different protocol numbers. For example, the TCP protocol number is 6, UDP protocol number is 17, and ICMP protocol number is 1. 10. The 16-bit checksum is used to check the header of a datagram. Each time a datagram passes through a router, the header field may change (such as TTL), so it needs to be rechecked. The data part does not change, so there is no need to regenerate the checksum. 11. Source IP Address Indicates the source IP address of the packet. The value contains 32 bits. 12. Destination IP Address Indicates the destination IP address of the datagram, which contains 32 bits. This field is used to verify that the send is correct. 13. Optional Fields This field is used for some optional header Settings, mainly for testing, debugging, and security purposes. These options include strict source routing (datagrams must go through a specified route), Internet timestamps (timestamp records as they pass through each router), and security restrictions. Since the length in the optional field is not fixed, populating the field with several zeros ensures that the entire header length is a multiple of 32 bits. 15. Data represents data at the transport layer, for example, data stored in TCP, UDP, ICMP, or IGMP. The length of the data part is not fixed.
6. IP packet fragments are reassembled
The identifier character is arbitrarily given.
The total length | logo | MF | DF | The offset | |
---|---|---|---|---|---|
Raw datagram | 3840 | 12345 | 0 | 0 | 0 |
Datagram slice 1 | 1420 | 12345 | 1 | 0 | 0 |
Datagram sheet 2 | 1420 | 12345 | 1 | 0 | 175 |
Datagram sheet 3 | 1020 | 12345 | 0 | 0 | 350 |
7. ICMP(Type and Format)
Internet Control Message Protocol (ICMP) Internet Control Message Protocol. As a subprotocol of TCP/IP, it is used to transfer control messages between IP hosts and routers. Control messages refer to the messages about the network itself, such as whether the network is connected, whether the host is reachable, and whether the route is available. Although these control messages do not transmit user data, they play an important role in the transmission of user data.
7.1 type
ICMP Error report and ICMP query packets
- Destination Unreachable: When the router cannot find a route or the host cannot deliver an IP packet, the router or host discards the IP packet and sends a destination unreachable packet to the source of the IP packet.
- If the time exceeds, the value can be divided into two cases. The first case is TTL=0: When an IP packet passes through the router, the TTL field in the IP header is reduced by one. When the router detects that it has received an IP packet with TTL=0, the router discards the packet and sends an ICMP timeout packet to the source site. The second method is that fragments cannot be reassembled. If all fragments that constitute an IP datagram fail to reach the destination host within the specified time limit, fragments cannot be reassembled. The destination host discards the fragments it has received and sends an ICMP timeout packet to the source site.
- Parameter problem: If the router or destination host finds that a field in the HEADER of an IP packet is incorrect, it dismisses the packet and sends an ICMP parameter problem packet to the source.
- Reroute (redirection) : When a router detects that a machine is using a non-optimized route, it sends an ICMP redirection message to the host, requesting the host to change the route. The router also forwards the initial datagram to its destination.
7.2 format
ICMP error report packets should not be sent
- ICMP Error report packet. No ICMP error report packet is sent
- ICMP error report packets are not sent for all subsequent packets of the first fragmented datagram
- For the datagrams with multicast addresses, ICMP error report packets are not sent
- For datagrams with special addresses (127.0.0.1 and 0.0.0.0), ICMP error report packets are not sent.
Common ICMP query messages are as follows:
- Echo request and reply
Is a query made by a host or router to a specific destination host. The host that receives this packet must send an ICMP reply packet to the source host or router. The query message is used to test whether the destination station is reachable and to learn about its status.
- Timestamp request and reply
An ICMP timestamp request packet asks a host or router to answer the current date and time. In the ICMP timestamp reply message, there is a field of 32 in which the written certificate represents the number of seconds since the current time of the line on January 1, 1900. Timestamp requests and replies can be used for clock synchronization and time measurement.
8. Ideal routing algorithm
8.1 the characteristics of
- The algorithm must be correct and complete
- Algorithms should be simple on a computer
- It should be able to adapt to changes in traffic and network topology
- Be stable
- It should be fair
- Should be the best
Two routing algorithms
- Static Route Selection Policy (Non-adaptive Route Selection)
- Dynamic Routing Policy (Adaptive Routing)
8.2 Routing protocol
- Internal gateway protocol IGP
A routing protocol used within an AUTONOMOUS system independent of the sweep routing protocol used by other autonomous systems on the Internet. This type of routing protocol is currently the most widely used. For example, RI and OSPF.
- External gateway protocol (EGP)
If the source host and destination host reside in different aS, a protocol is required to transmit routing information to the other AS when packets are sent to the border of one AS.
9. RIP, OSPF, BGP(Maximum LENGTH of RIP packets)(RIP metric starts from 1)
9.1 RIP(放UDP)
9.1.1 Working Principle
Routing Information Protocol (RIP) is an internal gateway Protocol (IGP) and a dynamic Routing Protocol. RIP is used to transfer Routing Information in AS. RIP uses metric to measure the route distance to a destination address based on DistanceVectorAlgorithms. The router only cares about the world around it, exchanging information with its neighbors within a range of 15 hops (15 degrees) and beyond.
9.1.2 characteristics
- Exchange information only with neighboring routers.
- All the information that a router knows when exchanging information is its current routing table.
- Routing information is exchanged at fixed intervals.
9.1.3 Distance vector algorithm
Receiving a Routing Information Protocol (RIP) packet from the neighboring ROUTER X Change the next-hop address of the RIP packet to X and increase the hop count by one. Perform the following steps for each item
- If the destination network N in RIP does not exist in the original routing table, it is directly added to the original routing table
- If the destination network N in RIP exists in the original routing table, but the next hop address is not X, replace it with the one with fewer hops. If the number of hops is the same, the entries in the original routing table are retained.
- If the destination network N in RIP exists in the original routing table and the next hop address is X, replace it with the received entry. If the router does not receive the updated routing table from the neighboring router within 180s (the default RIP routing table is 180s), the neighboring router is set to unreachable and the hop count is 16
Don’t understand it doesn’t matter, there are examples behind!
9.1.4 Format of RIP Packets
When the network is down, it takes a long time for this information to be sent to all routers.Good news is transmitted quickly, while bad news is transmitted slowly. This is a disadvantage of RIP
9.2 OSPF (Routing IP Datagrams)
9.2.1 profile
Open Shortest Path First (OSPF) is an Interior Gateway Protocol (IGP) used to determine routes within a single Autonomous system (AS). It is an implementation of the link-state routing protocol and belongs to the Internal Gateway Protocol (IGP), so it operates in the autonomous system.
The famous Dijkstra algorithm is used to calculate the shortest path tree. OSPF supports load balancing and route selection based on the service type. It also supports multiple routes, such as specific host routes and subnet routes.
9.2.2 Comparison with RIP
- Sends information to all routers in the autonomous system.
- The information sent is the link state of all routers adjacent to this router
- The router sends this message to all routers only when the link status changes.
9.2.3 Grouping format
- version
- Type: One of five type groups
- Type 1, Hello group, (1) Type 1, Hello (Hello) group, used to discover and maintain the accessibility of neighboring stations.
- Type 2, I1-304-2 Database Description group, which provides summary information of all link state items in its link state Database to neighboring stations.
- Type 3: Link State Request group, which sends detailed information about certain Link State items to each other.
- Type 4, Link State Update group, using flooding method to Update the Link State of the whole network. This grouping is the most complex and the core part of OSPF. Routers use this grouping to inform their neighbors of their link status. There are five different link states in the link state update group [RFC 2328].
- Type 5, Link State Acknowledgment packet, Acknowledgment of a Link update packet.
- Packet length: indicates the packet length, including the OSPF header, in bytes
- Router identifier: Identifies the IP address of the router interface that sends the packet
- Area identifier: The identifier of the area to which the group belongs.
- Checksum: Used to detect errors in grouping.
- Authentication type: currently there are only two types, 0(unused) and 1(password)
- If the authentication type is 0, enter 0; if the authentication type is 1, enter an 8-character password.
9.2.4 characteristics
- OSPF allows administrators to assign different costs to each route
- If the same destination network consists of multiple paths of the same cost, traffic can be allocated to these paths.
- All packets exchanged between OSPF routers have the authentication function, so that only trusted routers can exchange link status information.
- OSPF supports variable-length subnets and classless CIDR
- Because link states on the network may change frequently, OSPF sets each link state with a serial number of 32. The larger the serial number, the newer the state.
9.3 BGP (Sending TCP Packets)
9.3.1 profile
BGP is a routing protocol between autonomous systems. The network reachability information exchanged by BGP provides sufficient information to detect routing loops and make routing decisions based on performance priorities and policy constraints.
The main purpose of the internal gateway protocol (RIP or OSPF) is to allow datagrams to be transmitted AS efficiently AS possible from source to destination within an AS. Within an AS, there is no choice to consider other aspects of strategy. However, BGP is used in a different environment for two reasons.
- The large scale of the Internet makes it difficult to select routes between ass.
- Policies must be considered when selecting routes between ass.
BGP, the border gateway protocol, tries to recruit a good route to the destination network rather than find an optimal route. BGP uses the path vector routing protocol, which is quite different from the distance vector protocol (RIP) and link state protocol (such as OSPF).
The BGP spokesman indicates that this route can exchange routing information with other ass on behalf of the entire ASS.
10. Switch structure of the router
Is a special computer with multiple input ports and multiple output ports, its task is to forward packets. A packet received from an input port of a router is forwarded to the next-hop router based on the destination of the packet.
10.1 Router Composition
The router is divided into two main sectionsroutingandPacket forwarding
The routing control part is also called the control part, and its core component is the routing selection processor. Packet forwarding consists of three parts: switching interface, input port and output port.
When discussing the principle of routing, we often do not distinguish between forwarding table and routing table
10.2 Switching Structure
The switching structure is located at the core of a router. Switching can be done in a variety of ways, such as memory switching, bus switching, switching over the Internet. In the network interface, the specific medium interface performs all the functions of the physical layer and medium access sub-layer, and the switching structure interface performs the early and late work of IP switching. Before exchanging an IP address, the IP packet is divided into some fixed-length cells and attached with internal route identifiers or marking priorities. After the exchange, some received cells with the same identifier are reassembled into an IP packet.
11. Private ADDRESSES, VPN, and NAT
11.1 Private Address
- Private Address (224.0.0.0-224.0.0.255) The address used for the broadcast of the network protocol group.
- Public Address (224.0.1.0-238.255.255.255) Used for other multicast addresses.
11.2 VPN
A virtual private network (VPN) is used to establish a private network on a public network for encrypted communication. It is widely used in enterprise network. The VPN gateway encrypts data packets and translates the destination addresses of data packets to achieve remote access. A VPN can be implemented using servers, hardware, and software.
11.3 NAT
Network Address Translation (NAT) was proposed in 1994. NAT can be used when some hosts on the private network have already been assigned local IP addresses (that is, private addresses for use only on the private network), but now want to communicate with hosts on the Internet (without encryption).
This method requires the installation of NAT software on a router that connects a private network (private IP address) to the Internet (public IP address). A router with NAT software is called a NAT router. It has at least one valid external global IP address (public IP address). In this way, all hosts using local IP addresses (private IP addresses) must translate their local IP addresses into global IP addresses on the NAT router before they can connect to the Internet.
12. IP multicast
IPmulticast (IPmulticasting) is an abstraction from hardware multicast and an extension of the standard IP network layer protocol. It uses a specific IP multicast address to transmit IP packets to a collection of hosts in a multicastgroup on a maximum delivery basis.
Its basic approach is that when someone sends data to a group of people, it doesn’t have to send data to everyone, it just sends data to a specific reserved group address, and everyone who joins the group can receive the data. In this way, the data can be sent to all recipients only once, greatly reducing the network load and the burden of the sender.
13. Choice exercises after class
Question 1 (4-03) What are the differences between intermediate devices, transponders, Bridges, and router gateways?
Forwarder: Intermediate device used by the physical layer
Bridge or bridge: Intermediate device used at the data link layer Router: Intermediate device used at the network layer Gateway: intermediate device used above the network layer to connect two incompatible chests for protocol conversion at a higher level
Question 2 (4-04) briefly explain the functions of the following protocols: IP, ARP, RARP and ICMP
(1)IP protocol: realize network interconnection. Make the networks that participate in interconnecting with different performance appear to be a unified network from the user. IP is one of the two most important protocols in TCP/IP system.
(2)ARP: Resolves the mapping between IP addresses of hosts or routers on the same LAN and hardware addresses. (3)RARP: resolves the mapping problem between the hardware address of the same LAN and the IP address of the host or router. (In contrast to ARP) (4)ICMP: Provides error reports and query messages to improve the chance of successful IP data delivery.
Question 3 (4-05) How many types of IP addresses are there? How are they represented? What are the main features of IP addresses?
Five categories
Type A: The first eight digits are the network id, the last 24 digits are the host ID, and the first digit of the network ID is 0. (32-bit binary) Type B: The first 16 bits are the network number, the last 16 bits are the host number, and the first two bits are 10. Type C: The first 24 digits are the network number, the last 8 digits are the host number, and the first three digits are 110. Type D: The first four bits are 1110, and the next 28 bits are multicast group numbers. Class E: the first 5 digits are 11110, and the last 27 digits are reserved. Features: 1. IP address is a hierarchical address structure. Each type 1 address consists of two fixed-length fields, one of which is the network number net-ID, which identifies the network to which the host (or router) is connected, and the other is the host number host-id. 2. The net-id field that identifies the host (or router) address is 1,2,3,0,0 bytes; The host-ID field is 3 bytes, 2 bytes, 1 byte, 4 bytes, and 4 bytes respectively. 3. All networks assigned a net ID, a small LAN, or a wide area network that may cover a large geographic area, are equal.
The fourth (4-9)
- What does the subnet mask of 255.255.255.0 mean?
- If the current mask of a network is 255.255.255.248, how many hosts can the network connect to?
- The subnet id of A class A network and that of A class B network are 16 ones and 8 ones respectively
- The subnet mask of a class B address is 255.255.240.0. What is the maximum number of hosts in each subnet?
- Example 255.255.0.255 is the valid subnet mask for A class A network
- The hexadecimal representation of an Ip address is C2.2f.14.81. Convert it to dotted decimal notation.
- Is it practical to use a subnet mask for class C networks? Why is that?
Question 5 (4-10) identify the network type ①128.36.199.3 ②21.12.240.17 ③183.194.76.253 ④ 192.12.69.248 ⑤89.3.0.1 ⑥200.3.6.2
1) 128.36.199.3 B
② 21.12.240.17a ③ 183.194.76.253b ④ 192.12.69.248c ⑤ 89.3.0.1a ⑥ 200.3.6.2c
Question 6 (4-15) What is the maximum transmission unit MTU? It depends on which field is in the header of the IP datagram.
Each data link layer below the IP layer specifies the maximum amount of data a frame can transmit. This value is called the maximum transmission unit MTU. When an IP packet is encapsulated as a link layer frame, the total length of the datagram must not exceed the MTU of the following data link layer. MTU is the upper limit of the total length field in the header of an IP packet. The total length field is 16 bits, so the maximum value that this field can represent is 2* 10E16-1, or 65535 bytes. But the underlying data link layer tends to limit the total length of IP packets to much less than this value. Total length in IP datagram header <= min{MTU, 65535}
Question 7 (4-17) A TCP packet with a length of 3200 bits is transmitted to the IP layer and becomes a datagram with a 160-bit header. The Internet below is connected by two lans via routers. But the data portion of the second largest data frame is only 1200 bits. Therefore, datagrams must be sharded at the router. How many bits of data does the second LAN transmit to its upper layer (” data “of course means the data seen by the LAN)?
Question 8 (4-18) (1) Some people think that: “ARP protocol to the network layer provides the service of address conversion, so ARP should belong to the data link layer.” Why is this wrong?
As ARP is part of the network layer, ARP provides IP address translation service. The data link layer uses hardware addresses instead of IP addresses, so it can run normally without ARP. Therefore, ARP is no longer in the data link layer.
(2) Explain why the ARP cache sets a 10-20 minute timeout timer for every entry it stores. What’s wrong with setting this time too large or too small?
Considering that both THE IP address and Mac address may change (replacing a NIC or dynamic host configuration), it is reasonable to replace a NIC within 10 to 20 minutes. If the timeout period is too short, the ARP request and response traffic is too frequent. If the timeout period is too long, the host cannot communicate with other hosts on the network after the nic is replaced.
(3) Name at least two cases where ARP request packets do not need to be sent (that is, there is no need to request a destination IP address to be resolved into the corresponding hardware address).
The destination IP address already exists in the ARP cache of the source host. The source host sends broadcast packets. The source and destination hosts use point-to-point links.
Problem 9 (4-19) Host A sends an IP datagram to host B, passing through five routers on the way. How many times is ARP used in sending IP datagrams?
If the router passes through five routers, the original host uses ARP to find the physical address of the first router. Therefore, the ARP is used for six times in total.
10. (4-20) Suppose a router establishes the following routing table (the three columns are the destination network, subnet mask and next-hop router respectively, and the last column indicates the interface from which the router should be forwarded in case of direct delivery) :
Purpose of the network | Subnet mask | The next-hop |
---|---|---|
128.96.39.0 | 255.255.255.128 | Interface m0 |
128.96.39.128 | 255.255.255.128 | Interface m1 |
128.96.40.0 | 255.255.255.128 | R2 |
192.4.153.0 | 255.255.255.192 | R3 |
* (the default) | – | R4 |
Five packets have been received, and their destination IP addresses are (1)128.96.39.10 (2)128.96.40.12 (3)128.96.40.151 (4)192.4.153.17 (5)192.4.153.90.
Question 11 (4-21) A unit is assigned a Class B IP address whose Net ID is 129.250.0.0. The unit has more than 4,000 computers at 16 different sites. If the subnet mask is 255.255.255.0, assign a subnet number to each site and calculate the maximum and minimum values of host numbers in each subnet.
Problem 11 (4-22) A datagram is 4000 bytes long (fixed header length). It is now being sent over a network that can transmit up to 1500 bytes of data. How many shorter datagrams should be divided? What are the values of the data field length, slice offset field and MF flag of each datagram slice?
Questions 12 (4-24) try to find A subnet mask (using continuous masks) that can produce the following number of class A subnets (1)2; (2) 6; (3) 30; (4) 62; (5), 122; (6), 250,
Problem 13 (4-26) has the following 4 /24 address blocks, try to aggregate the maximum possible 212.56.132.0/24 212.56.133.0/24 212.56.134.0/24 212.56.135.0/24
Problem 14 (4-27) has two CIDR address blocks 208.128/11 and 208.130.28/22. Is there an address block that contains another address? If so, please indicate and explain why.
Problem 15 (4-28)
Question 16 (4-29) An AS has five Lans. Figure 4-55 shows the connection. The number of hosts on LAN2 to LAN5 is 91,150,3, and 15 respectively. The IP address block allocated to the AS is 30.138.118/23. Try to give each LAN address block (including prefix).
Question 17 (4-30) A company has a headquarters and three subordinate departments. The network prefix assigned to the company is 192.77.33/24. Figure 4-56 Shows the corporate network layout. There are five Lans in the headquarters. LAN1 to LAN4 are connected to router R1, which is connected to router R2 through LAN5. R5 is connected to LAN6 to LAN8 of the three remote departments through wan. The number marked next to each LAN is the number of hosts on the LAN. Try to assign an appropriate network prefix to each LAN.
Note that the WAN should also be divided here!! For example, WAN1 should include R2 and R3 networks, plus all zeros and all 1s to make 4 is 2 to the power of 2.
Question 18 (4-31) which of the following addresses matches 86.32/12? Please state the reasons for (1)86.224.123 (2)86.79.65.216 (3)86.58.119.74 (4)86.68.206.154
Which of the following address prefixes in questions 19 (4-32) matches 2.52.90.140? Please explain why. (1) 0/4 (2) 32/4 (3) 4/6 (4) 80/4
Question 20 (4-34) How many bits are the network prefixes corresponding to the following masks? (1) 192.0.0.0; (2) 240.0.0.0; (3) 255.224.0.0; (4) 255.255.255.252;
Question 21 (4-37) A unit is assigned an address block 136.23.12.64/26. Now you need to divide four more subnets of the same size. (1) How long is the prefix of each subnet? (2) How many addresses are there in each subnet? (3) What is the address block of each subnet? (4) What are the minimum and maximum addresses that each subnet can be assigned to hosts?
(Read the answer directly, do not want to write….)
Question 22 (4-38) What are the main differences between IGP and EGP protocols?
IGP: Interior Gateway Protocol
The Internal Gateway Protocol (IGP) is a protocol for exchanging data flow channel information between gateways in an autonomous network system (FOR example, an autonomous network system within a local community). Network IP protocols and other network protocols often use this channel information to determine how to transmit data streams. The two most commonly used internal gateway protocols are routing Information Protocol (RIP) and Shortest Path First Routing Protocol (OSPF).
Exterior Gateway Protocol (EGP)
The External Gateway Protocol (EGP) is a protocol for exchanging routing information between two adjacent gateway hosts in an autonomous system. EGP is typically used to exchange routing table information between Internet hosts. It is a polling protocol that uses the conversion of Hello and I-Heard-you messages to allow each gateway to control and receive network accessibility information at a rate that allows each system to control its own overhead while issuing commands requesting updated responses. The routing table contains a set of known routers and their reachable addresses, as well as the path cost, to select the best route. Each router visits its neighbor every 120 or 480 seconds, and the neighbor responds by sending a complete routing table.
Questions 24 (4-39) describe the main features of RIP, OSPF, and BGP routing protocols
Question 25 (4-40) RIP uses UDP, OSPF uses IP, and BGP uses TCP. What are the advantages of this?
Question 26 (4-41) assumes that router B in the network has the following items in the routing table (the three columns represent the “destination network”, “distance” and “next hop” routers respectively) : N1 7 A N2 2 C N6 8 F N8 4 E N9 4 F B receives the routing information from C: N2 4 N3 8 N6 4 N8 3 N9 5 Try to figure out the updated routing table for router B (detail each step).
A: The updated routing table of Router B is as follows: N17A no new information, do not change N25C same next hop, update N39C New item join routing table N65C Different next hop, select shorter distance, update N84E different next hop, The distance is the same, it doesn’t change the N94F’s next hop is different, the distance is bigger, it doesn’t change
Question 27 (4-42) assumes that router A in the network has the following items in the routing table (the three columns represent “destination network”, “distance” and “next-hop router” respectively) : N1 4 B N2 2 C N3 1 F N4 5 G Router A receives routing information from ROUTER C: N1 2 N2 1 N3 3 N4 7 Try to find the updated routing table of router A (explain each step in detail).
Question 28 (4-54) A unit is assigned an address block starting at 14.24.74.0/24. The unit needs to use three subnets, and the specific requirements of their three sub-address blocks are as follows: subnet N1 needs 120 addresses. Subnet N2 requires 60 addresses. Subnet N3 requires 10 addresses. Please provide the address block allocation scheme.
Question 29 (4-64) try to write the following IPv6 addresses in concise form using zero compression: (1) : 0000-0000 0 f53:6382: AB00:67 db: BB27:7332 (2) 0000:0000-0000:0000-0000:0000-004 – d: ABCD (3), 0000:0000-0000: AF36:7328, 0000:87 aa: 0398, 2819 (4) : 00 af: 0000-0000:0000-0035:0 cb2: B271
(1)0::0 (2)0:AA::0 (3) 0:1234:3 (4)123::1:2