In the information network system, there are unified rules, standards or conventions that constrain all the connected devices and user terminals involved in communication. The set of these rules, standards or conventions is called protocol. For example, when a terminal user and an operator of a large server communicate in a network, they cannot understand each other’s commands because of the different character sets used by their respective devices, so the communication would not be successful. In order to eliminate this communication barrier, a network device or network terminal is required to convert the characters in its private character set to those in the public standard character set before network transmission, and then further convert to the characters in the private character set of the destination terminal after arrival.

In Chap. 3, the reader is introduced to the common network connection devices in the communication network, as well as their installation, adaptation and networking processes. This chapter will mainly introduce the basic knowledge of network system, including the basic knowledge of communication network and a variety of common protocols, the basic knowledge of network address, virtual local area network (VLAN) technology and IP routing principle.

By the end of this chapter, you will

(1) Master the concept of communication network

(2) Get familiar with the OSI Reference Model

(3) Get familiar with the TCP/IP protocol stack

(4) Master the planning of network address and subnet

(5) Master the concept of VLAN and basic network configuration

(6) Master the principle of routing and static routing

4.1 Basic Knowledge of Communication Network

The so-called communication is the communication and transmission of information between people through some media. A network is a data link that physically connects isolated workstations or hosts. As the physical connection of each isolated device, the communication network is to realize the information exchange and transmission between people, or between human and computers, or between computers, so as to achieve the purpose of information exchange and resource sharing.

4.1.1 Overview of Communication Network

All around us, there are networks all the time, including the telephone network, television network, computer network and so on. One of the most typical is the computer network, which combines the technology of computer and communication. These two fields cooperate closely, and complement and influence each other, promoting the development of computer network together. For the centuries before the birth of modern communication technology, interpersonal communication can only be limited to face-to-face communication, smoke signals, courier stations, flying pigeons and other restricted means. But with today’s advanced technologies, the convenience brought by instant communication is like a “magic” beyond the imagination of ancient people.

Before the advent of computer networks, computers were stand-alone devices that did not cooperate or interact with each other. Later, the combination of computer and communication technologies began to exert profound impact on the way computer systems are organized, making it possible for computers to access each other. In the process that different types of computers communicate with each other through the same type of communication protocol, the computer network arises at the historic moment.

  1. 1.

    The development of computer networks began in the 1960s. At that time, a network was mainly a low-speed serial connection based on the host architecture, which provided application execution, remote printing and data service functions. IBM System Network Architecture (SNA) and the X.25 public data networks offered by enterprises other IBM are typical examples of this type of network. In those days, the US Department of Defense funded the establishment of a packet switching network called ARPANET, which is the prototype of today’s Internet.

  2. 2.

    By the 1970s, a business computing model dominated by the personal computer had emerged. At first, personal computers were stand-alone devices. Later, business computing requires a large number of terminal devices to operate together, so the local area network (LAN) came into being. The LAN greatly reduced the cost of printers and disks for business users.

  3. 3.

    From 1980s to 1990s, the increasing demand for remote computing forced the computer industry to develop a variety of wide-area protocols (including the TCP/IP and IPX/SPX protocol) for remote connections under different computing modes. The Internet technology was booming in this context, accompanied with the widening use of the TCP/IP protocol, becoming the standard protocol of the Internet.

The responsibility of computer network is to, with communication lines, connect computers and special external equipment (routers, switches, etc.) distributed in different geographical areas into a large-scale and powerful network system, so that multitudinous computers can exchange information and share information resources conveniently.

As shown in Fig. 4.1, in general, the communication network can provide the following functions.

  1. 1.

    Resource sharing: The emergence of the network simplifies resource sharing, enables communication to cross spatial barriers, and makes it possible to transmit information anytime and anywhere.

  2. 2.

    Information transmission and centralized processing: Data is transmitted to the server through the network, and then sent back to the terminal after centralized processing by the server.

  3. 3.

    Load balancing and distributed processing: A typical example is that a large Internet content provider that places WWW servers hosting the same content in multiple locations around the world in order to support more users accessing its website. The provider adopts a specific technology to present the same Web pages to users in different geographies, that is, the pages stored on the server closest to the user. In this way, the load balancing of all servers is realized and the access time is saved for the user.

  4. 4.

    Integrated information service: Multiple-dimension is a major development trend of the network, that is, to provide integrated information services on a set of systems, including text and image, voice, video and so on. With the trend of multiple-dimension, new forms of network applications are emerging in an endless stream, such as instant messaging, streaming media, e-commerce, video conferencing, etc.

Fig. 4.1
figure 1

Functions of communication network

4.1.2 Classification and Basic Concepts of Network

  1. 1.

    Classification by geographical coverage

    In view of the different connection mediums, as well as the different communication protocols, the computer networks can be classified in different manners. But in general, then are divided by geographical coverage into LANs, WANs, and MANs, with the coverage between the former two.

    1. (a)

      An LAN is a network formed through the interconnection of various communication devices in a small area, whose coverage is generally limited to rooms, buildings or parks. The LAN generally refers to a network distributed within a range of several thousand meters, characterized by short distance, low latency, high data rate and reliable transmission.

    2. (b)

      The MAN reaches a medium-scale coverage between the LAN and WAN, and usually functions as a network connection within a city (the distance is about 10 km). At present, the MAN is mainly built with IP technology and ATM technology. A broadband IP MAN is a broadband multimedia communication network within a city (or a county, etc.) that is built according to the needs of business development and competition. It is an extension of the broadband backbone network (such as China Telecom’s IP backbone network, China Unicom’s ATM backbone network, etc.) within the city.

    3. (c)

      The WAN covers a wide area, often a country or even a continent. It provides data communication services over a wide area, primarily for Internet-based LANs. In China, the China Public Packet Switched Data Network (ChinaPAC), China Digital Data Network (ChinaDDN), China Education and Research Network (CERNET) and China Public Computer Internet (ChinaNet), as well as the China Next Generation Internet (CGNI) under building all fall into the category of WANs. The WAN is built to interconnect the LANs scattered over a large area. Its disadvantages are slow data transmission (typical rate from 56 Kbit s to 155 Mbit/s), relatively long delay (millisecond level), and inflexible topology structure, which makes it difficult to carry out topology classification. The WAN relies more on telecommunication data network provided by the telecom operators for network connectivity due to its mesh topology.

  2. 2.

    Classification of network topologies

    When we talk about network topology, we are talking about the physical layout of a computer network, that is, the structure used to connect a group of devices. So it is often referred to as a topology. The basic network topology models include bus topology, ring topology, star topology and mesh topology. Most networks can be formed by one of these topologies or a mixture of several structures, as shown in Fig. 4.2. Understanding these topologies is a prerequisite for designing networks and solving difficult network problems.

    1. (a)

      The bus topology adopts a bus to connect all nodes, and the bus is responsible for completing the communication between all nodes. It was widely used in the early LANs. This structure is characterized by simple structure, low cost, easy installation and use, short length of cable consumption and easy maintenance. But it has a fatal drawback—single point of failure. If the bus fails, the whole network will be paralyzed. Since the entire network shares the bandwidth of the bus, the bus network compensates for network overload, if any, with network performance. To overcome these shortcomings, the industry later invented the star topology.

    2. (b)

      The star topology has a central control point. Devices connected to a LAN communicate with each other through point-to-point connections with hubs or switches. This structure is easy to design and install, allowing a network medium to be connected directly from a central hub or switch to the area where the workstation is located. It is also easy to maintain, and the layout pattern of its network medium makes it easy to modify the network, and to diagnose problems that occur. Therefore, star topology is widely used in LAN construction. However, this structure also inevitably has disadvantages: once the device located at the central control point fails, it is prone to a single point of failure; the network medium can only be connected to one device per segment of the network, so the need for a large number of network mediums drives up the installation costs correspondingly.

    3. (c)

      The tree topology is a logical extension of the bus topology. In this structure, the host is connected hierarchically, not to form a closed loop structure. This structure starts with a leading terminal, and can then have multiple branching points, each of which can spawn more branches, resulting in a complex tree-like topology.

    4. (d)

      The ring topology is a closed ring network, connecting each node through an end-to-end communication line. Each device can only communicate directly with one or two nodes adjacent to it. If you need to communicate with other nodes, the information must pass through each device in between in turn. The ring network supports both unidirectional and bidirectional transmission. Bidirectional transmission is the transmission of data in two directions, where the device can directly communicate with two adjacent nodes. The advantages of the ring topology include: simple structure, assigning equal status to all workstations in the system; easy networking, where only simple connection operations are required for node addition and deletion; and real-time control of data transmission, enabling prediction of network performance. The disadvantage is that in a single-ring topology, the failure of any one node will break the normal connection of all the nodes in the ring. Therefore, in practical application, multi-ring structure is generally adopted, so that in case of a single point of failure, a new ring can be formed to ensure the normal operation of the whole structure. Another disadvantage lies in that when one node sends data to another, all nodes between them are invoked to participate in the transmission, thus spending more time forwarding data than in a bus topology.

    5. (e)

      Mesh topology, also known as full mesh topology, means that any two nodes conducting intercommunication are directly connected through a transmission line. So evidently, this is an extremely safe and reliable solution. The unnecessity for nodes to compete on a common line significantly simplifies communication, so that the intercommunication between any two devices does not involve any other devices. However, a full mesh topology with N nodes requires N(N-1)/2 connections, which makes it extremely expensive to build a full mesh topology between a large number of nodes. In addition, when the traffic between two devices is small, the line between them is underutilized, hence the underutilization of many connections. The full mesh topology is seldom used in LAN because of its high cost, complex structure, and difficult management and maintenance. In practical application, partial mesh topology is preferred. In other words, the full mesh topology is used between important nodes, while some connections are omitted for relatively unimportant nodes.

    6. (f)

      Hybrid topology refers to the mixed use of two or more of the above topology structures, such as star bus + mesh + star ring topology.

  3. 3.

    Circuit switching and packet switching

    Circuit switching and packet switching are a pair of important concepts in communication networks.

    1. (a)

      Circuit switching: The concept of switching originated in the telephone system. What the telephone exchanges adopt is the circuit switching technology. Based on the principle of circuit switching in the telephone network, the circuit switching technology enable the exchange to connect a physical transmission channel between the calling user and the called user when the calling user requests to send data. The advantages of circuit switching are short delay, transparent transmission (namely, no correction or interpretation of the user’s data by the transmission channel), and large throughput of information transmission. However, it also shows the disadvantages of fixed bandwidth and low utilization of network resources. In fact, circuit switching is not suitable for the direct terminal communication in the large-scale computer network, since the computer communication features high frequency, high speed, small data volume, large peak-valley traffic difference, and multi-point communication.

    2. (b)

      Packet switching: Packet switching is a kind of switching for data storage and forwarding. It divides the data to be transmitted into packets of certain length or variable length, so as to store and forward them in the unit of packet. Each packet is marked with the receiving address and the sending address. In this way, a packet is transmitted on the line through the dynamic multiplexing technology, thus the bandwidth being multiplexed and the network resources being utilized more efficiently. Packet switching can prevent any user from monopolizing a transmission line for a long time, so the channel bandwidth can be fully utilized, and the parallel interactive communication can be realized. IP telephony is a new type of telephony that uses the packet switching technology, so it costs much less than traditional telephony to make calls. But packet switching introduces longer end-to-end delays because data is split into packets and consequently network devices need to forward packets one by one. This approach actually requires more bandwidth resources for a certain volume of effective data, because each packet carries additional address information. In addition, data from multiple communication nodes multiplexes the same channel, so a sudden influx of data may cause channel congestion. Due to these characteristics, packet-switched network devices and protocols need to develop the ability to handle addressing, forwarding, congestion, etc., which puts a higher demand on the processing capabilities and complexity of these devices.

  4. 4.

    Protocols and standards

    TCP/IP, IEEE 802.1, G.952 and other such words are certainly familiar to us. What are they? Here are two concepts related to these terms in communication networks, as shown in Fig. 4.3.

    1. (a)

      Protocol A network protocol is a set of formats and conventions that are made in advance for both sides of communication to understand and abide by each other, so as to enable data communication between different devices in a computer network. A network protocol is a normative description of a set of rules and conventions that define the way in which information is exchanged between network devices. Network protocol is the basis of computer network, which requires that only network devices that comply with the corresponding protocol can participate in the communication. Any device that does not support the protocol for network interconnection is ineligible to communicate with other devices.

      There are many kinds of network protocols, including TCP/IP, IPX/SPX protocol of Novell, SNA protocol of IBM, etc. Today the most popular is the TCP/IP protocol cluster , having become the standard protocol of the Internet.

    2. (b)

      Standard A standard is a set of rules and procedures that are widely used or officially prescribed. The standard describes the protocol requirements and sets the minimum performance set to guarantee network communication. The IEEE 802.x standards are the dominant LAN standards. Data communication standards fall into two categories: de facto standards and legal standards.

      1. (i)

        De facto standards: Standards that have not been recognized by the organizations, but are widely used and accepted in application.

      2. (ii)

        Legal standards: Standards developed by an officially recognized body.

      There are many international standardization organizations have made great contributions to the development of computer networks. They unify the standards of the network, so that the products from each network product manufacturer can be connected with each other. At present, there are several standardization organizations that contribute to the development of the network.

      1. (i)

        International Organization for Standardization (ISO): It is responsible for the development of standards for large networks, including standards related to the Internet. ISO proposes the Open System Interconnection (OSI) reference model. This model describes the working mechanism of the network, and constructs an easy-to-understand and clearly hierarchical model for the computer network.

      2. (ii)

        Institute of Electrical and Electronics Engineers (IEEE): It puts forward standards for network hardware, so that network hardware produced by different manufacturers can be connected with each other. IEEE LAN standard, as the dominant LAN standards, mainly defines the IEEE 802.x protocol cluster, among which the IEEE 802.3 is the standard protocol cluster for the Ethernet, the IEEE 802.4 is applicable for the Toking Bus networks, the IEEE 802.5 is for the Toking Ring networks, and the IEEE 802.11 is the WLAN standard.

      3. (iii)

        American National Standards Institute (ANSI): It mainly defines the standards of fiber distributed data interfaces (FDDIs).

      4. (iv)

        Electronic Industries Association/Telecomm Industries Association (EIA/TIA): It standardizes network connection cables, such as the RS-232, CAT 5, HSSI, V.24, etc., and defines the layout standards for these cables, such as EIA/TIA 568B.

      5. (v)

        International Telecom Union (ITU): It introduces the standards of telecommunication network for wide area connection, such as X.25, Frame Relay, etc.

      6. (vi)

        Internet Architecture Board (IAB): Its Internet Engineering Task Force (IETF), Internet Research Task Force (IRTF) and Internet Assigned Numbers Authority (IANA) are responsible for the definition of various Internet standards, forming the most influential international standardization organization at present.

Fig. 4.2
figure 2

Network topologies

Fig. 4.3
figure 3

Standard protocol

4.1.3 OSI Reference Model and TCP/IP Protocol Cluster

  1. 1.

    OSI Reference Model

    Since the advent of computer networks in the 1960s, communication networks have made great strides. In order to conform to the trend of information technology and compete for the leading positions in the field of data communication network, the global major manufacturers have introduced their own network architecture systems and standards, such as IBM’s SNA protocol, Novell’s IPX/SPX protocol, Apple’s AppleChat protocol and DEC’s DECNET protocol. They have also developed different hardware and software for their respective protocols.

    These efforts have undoubtedly promoted the rapid development of network technology and the fast propagation of network equipment types. However, the coexistence of such complex protocols also makes the network society more and more jumbly—most of the network equipment from different manufacturers are not compatible with each other, which makes communication even more difficult. Therefore, the key to solve the compatibility problem between networks is to make the network equipment of each manufacturer compatible with each other. For this reason, ISO put forward the OSI Reference Model in 1984, which soon became the basic model of computer network communication. The OSI Reference Model was designed in line with the following principles.

    1. (a)

      Clear boundaries should be maintained between layers for easy understanding.

    2. (b)

      Each layer should undertake specific functions.

    3. (c)

      The division of layers should facilitate the formulation of international standards and protocols.

    4. (d)

      The sufficient layers should be provided to avoid the function overlapping among the layers.

    The OSI Reference Model consists of seven layers, with the first layer at the bottom and the seventh layer at the top. From bottom to top, there are physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer, as shown in Fig. 4.4.

    The OSI Reference Model is endowed with the following advantages:

    1. (a)

      Simplified network operations;

    2. (b)

      Plug-and-play compatibility and standard interfaces to connect different manufacturers;

    3. (c)

      Support to all manufacturers to design interoperable network devices, promoting network standardization;

    4. (d)

      Separation of the structure to avoid the mutual interference between regional networks due to network changes, so that each regional network can be upgraded separately and quickly;

    5. (e)

      Disassembling of complex network problems into simple problems for easy learning and operation.

  2. 2.

    TCP/IP protocol cluster

    TCP/IP originated from the design and implementation of ARPANET, and then was continuously enriched and improved by the IETF. The name “TCP/IP” is taken from two critical protocols in this protocol cluster: TCP and IP.

    Like the OSI Reference Model, the peer-to-peer TCP/IP Model consists of multiple layers responsible for different communication functions. It is a combination of the OSI Reference Model and TCP/IP standard model, including the physical layer, data link layer, network layer, transport layer and application layer from bottom to top. The TCP/IP protocol cluster maintains a clear correspondence with the OSI Reference Model, as shown in Fig. 4.5, where the application layer embraces all the high-level protocols of the OSI Reference Model. The protocols of each layer of the TCP/IP protocol cluster are shown in Table 4.1.

    1. (a)

      Physical layer and data link layer

      The physical layer and data link layer involve the raw bit stream transmitted over the communication channel. They play the role to realize the mechanical, electrical, functional and process means needed for data transmission, enabling error detection, error correction, synchronization and other measures, so as to show a fault-free line for the network layer, accompanied with additional flow control.

    2. (b)

      Network layer

      The network layer examines the network topology to determine the best route for transmitting packets, and performs data forwarding. It undertakes the key responsibility is to determine how packets are routed from source to destination. The main protocols used in the network layer include IP, Internet Control Message Protocol (ICMP), Internet Group Management Protocol (IGMP), Address Resolution Protocol (ARP), etc.

    3. (c)

      Transport layer

      The basic function of the transport layer is to enable end-to-end communication for applications between two hosts. It receives data from the application layer, and breaks it up into smaller units for passing them on to the network layer when necessary, ensuring that each piece of information that reaches the other side is correct. The main protocols applicable to the transport layer include Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).

    4. (d)

      Application layer

      The application layer handles specific application details, displays received information, and transmits user data to the lower layer, providing network interfaces to the applications. Application layer contains a large number of commonly used applications, such as Hypertext Transfer Protocol (HTTP), Telnet, File Transfer Protocol (FTP), Trivial File Transfer Protocol (TFTP) and so on.

    The similarities and differences between the OSI Reference Model and the TCP/IP protocol cluster are as follows.

    1. (a)

      Similarities

      1. (i)

        Both models adopt layered structure and the same working mode, and both require close collaboration between layers.

      2. (ii)

        Both models include application layer, transport layer, network layer, data link layer and physical layer.

      3. (iii)

        Both models employ the packet switching technology.

    2. (b)

      Differences

      1. (i)

        The TCP/IP protocol cluster classifies the presentation layer and session layer into the application layer.

      2. (ii)

        The TCP/IP protocol cluster has fewer layers, so the structure is relatively simple.

      3. (iii)

        The TCP/IP protocol cluster is established with the development of the Internet, based on practice, which is highly reliable; the OSI Reference Model, on the other hand, is based on theory and is born as a guide.

Fig. 4.4
figure 4

OSI Reference Model

Fig. 4.5
figure 5

The correspondence between the TCP/IP protocol cluster and the OSI Reference Model

Table 4.1 The layers of the TCP/IP protocol cluster

4.2 Basic Knowledge of Network Addresses

Communication network is a generic term for the network formed by the interconnection of network devices. When a networked device communicates on the network, the information sent must contain the location flags of the sending device address and the receiving device address, namely the source address and the destination address. This is just like sending express, to specify the addresses and telephones of the recipient and the sender and other location information. This set of location flags is the MAC address and IP address to be introduced in this section.

4.2.1 MAC Address

This section focuses on the definition and classification of media access control (MAC) addresses. As shown in Fig. 4.6, the MAC address, also known as the physical address or the hardware address, is typically recorded by the network card manufacturer into the EPROM of the network card. It corresponds to the data link layer of the TCP/IP protocol stack and is an address used to define the location of network devices. MAC addresses are used to uniquely identify a network card in the network. If a device has one or more network cards, each card needs a unique MAC address. The MAC address consists of 48 bits, usually represented as a string of 12 hexadecimal digits. Viewed from left to right, the Bits 0 to 23 represent the code applied by a manufacture to an organization such as the IETF to identify the manufacture, known as the organizationally unique identifier (OUI); the Bits 24 to 47 represent the unique number assigned by the manufacture to represents the network card manufactured by this manufacture, known as the extended unique identifier (EUI).

Fig. 4.6
figure 6

MAC address

There are three types of MAC addresses.

  1. 1.

    Physical MAC address: uniquely identifies a terminal in the Ethernet as the globally unique hardware address, also known as unicast MAC address.

  2. 2.

    Broadcast MAC address: consists of all binary 1 s (FF-FF-FF-FF-FF-FF-FF), used to represent all terminal devices in the LAN.

  3. 3.

    Multicast MAC address: the MAC address with Bit 8 as 1 (e.g. 01-00-00-00-00-00) other than broadcast MAC address, which is used to represent a group of terminals in a LAN.

4.2.2 IP Address

This section is a detailed introduction to IP addresses. An IP address is a set of digits used to uniquely identify a device in a computer network. IP addresses can be divided into IPv4 and IPv6 addresses. Unless otherwise stated, all IP addresses mentioned in this book are IPv4 addresses. IPv4 address protocol cluster is the most core class of TCP/IP protocol cluster, which works in the network layer of TCP/IP protocol cluster, also known as logical address.

IPv4 addresses are made up of 32-bit binary digits, but they are represented in dotted decimal notation for ease of identification and memory. This notation represents an IPv4 address as four dotted decimal integers, each of which corresponds to one byte. For example, an IPv4 address represented as 00001010 00000001 00000001 00000010 in binary can be adjusted to 10.1.1.2 in dotted decimal notation.

The network mask, which is of the same length the IP address bit, 32 bits in total and, when represented in binary, consists of a series of consecutive “1 s” and a series of consecutive “0 s”, is also usually represented in dotted decimal notation. The number of “1” in the network mask is regarded as the length of the network mask. For example, the length of the network mask 252.0.0.0 is 6.

A network masks are typically used in conjunction with an IP address. The bit positions with a “1” correspond with the bit positions in the IP address that are part of the NET_ID, and the bit positions with a “0” corresponds the HOST_ID in the IP address. Thus identifying the network ID and host ID in an IP address.

The IP address consists of two parts as shown in Fig. 4.7.

  1. 1.

    Network ID (NET-ID): Used to identify a network. Network ID is the result of converting the IP address and network mask into digits in the binary notation, and then carrying out bitwise calculation.

  2. 2.

    Host ID (HOST-ID): Used to distinguish different hosts within a network. Devices with the same network number are in the same network regardless of their actual physical locations. Host ID is the result of converting the IP address and network mask into digits in the binary notation, performing bitwise NOT operation on the network mask, and then carrying out bitwise calculation.

In order to facilitate IP address management and networking, IP addresses fall into five classes, as shown in Fig. 4.8.

Fig. 4.7
figure 7

Two-level IP address structure

Fig. 4.8
figure 8

Five IP address classes

In Fig. 4.8, Classes A, B and C IP addresses are called host addresses, for identifying devices and hosts in the network; Class D addresses are multicast addresses; and Class E addresses are reserved. The address ranges of different IP address classes is shown in Table 4.2.

Table 4.2 Address ranges of different IP address classes

Some 32-bit IP addresses are reserved for special purposes and are not available to general users. The common special IP addresses are shown in Table 4.3.

Table 4.3 Common special IP addresses

Besides, to address the shortage of IP addresses, some of Class A, B, and C addresses are planned as private IP addresses, that is, the internal network addresses or host addresses that can only be used for the internal networks, rather than public networks. A private IP address can be reused in an internal network, as shown in Table 4.4.

Table 4.4 Private IP addresses

4.3 VLAN

The Ethernet is a CSMA/CD-based data network communication technology that enables sharing communication medium. In case of host gathering, there will be serious problems such as serious conflicts, broadcast flooding, significant performance degradation, and even network unavailability. Although the serious conflicts can be addressed by building LAN interconnection via switches, it still cannot isolate broadcast messages or improve the network quality. In this case, VLAN technology arises at the historic moment. On the basis of not changing the hardware of the switch, it defines the logical grouping in the network by software, becoming the mainstream technology used to divide the broadcast domain.

4.3.1 Ethernet Technology

  1. 1.

    LAN

    In the 1970s, with the reduction of the size and price of computers, there emerged a business computing model dominated by personal computers. The complexity of business computing requires resource sharing and cooperative operation of a large number of terminal devices, which leads to the need for network connection of a large number of computer devices, and hence the emergence of LAN.

    LAN is short for local area network. It is a computer communication network that connects all kinds of computers, peripherals, databases and so on within a local geographic scope (usually limited to a few kilometers).

    The Ethernet is the most common communication protocol for the existing LANs, which defines the cable types and signal processing methods adopted in the LANs. It was first developed by Xerox, and later promoted by Xerox, DEC and Intel to form the DIX (Digital/Intel/Xerox) standard. In 1985, the IEEE 802 Committee incorporated the Ethernet standard into the IEEE 802.3 standard and modified it. Today the Ethernet has formed a series of standards, from the early 10 Mbit/s standard Ethernet, 100 Mbit/s fast Ethernet, 1Gbit/s Ethernet, all the way to 10 Gbit/s Ethernet. With its continuous evolution, the Ethernet technology has become the mainstream of LAN technology.

    In the network, if any node in a domain can receive any frame sent by other nodes in the domain, then the domain is considered as a conflict domain; similarly, if any node in a domain can receive broadcast frames from other nodes in that domain, that domain is a broadcast domain. Common network devices include hubs, switches, routers, etc., as shown in Fig. 4.9. The router is used to isolate both the conflict domain and the broadcast domain. The switch can isolate the conflict domain but not the broadcast domain. The hub can isolate neither the conflict domain nor the broadcast domain.

    Early Ethernets typically used hubs for networking. In such a network, all computers share a conflict domain, so the more computers there are, the more serious the conflicts is, so the network is less efficient. What’s more, such a network is also a broadcast domain, where the more computers that send information in the network, the more bandwidth is consumed by the broadcast traffic. Therefore, this kind of shared Ethernet not only faces both problems of conflict domain and broadcast domain, but also fails to guarantee the security of information transmission. Today, people are using the Ethernet employing switches for networking, so it is called switched Ethernet.

  2. 2.

    Ethernet frame format

    The frame format has evolved several times over the course of Ethernet development. To date, there are two standards for encapsulating Ethernet data frames: the Ethernet II Frame format and the IEEE 802.3 Frame format. They are explained separately in the following sections.

    1. (a)

      Ethernet II Frame format is shown in Fig. 4.10.

      The explanations of the fields are as follows.

      1. (i)

        DMAC (Destination MAC): Destination MAC address, used to determine the recipient of a frame.

      2. (ii)

        SMAC (Source MAC): Source MAC address, used to identify the sender of a frame.

      3. (iii)

        Type: The 2-byte type field, used to identify the upper-layer protocol contained in the data field. That is, the field tells the receiving device how to interpret the data field. Since the Ethernet enables multiple protocols to coexist in a LAN, the hexadecimal values set in the type field of Ethernet II Frame provide a mechanism to support multi-protocol transport over the LAN.

        • The frame with a type field value of “0x0800” represents the IP frame.

        • The frame with a type field value of “0x0806” represents the ARP frame.

      4. (iv)

        Data: Indicates the specific data encapsulated in the frame. The minimum length of the data field is set to 46 bytes to ensure the frame length of at least 64 bytes. This means that even if you transfer 1-byte information, you must use a 46-byte data field. If the information is less than 46 bytes, the rest of the field must be filled. The length of the data field is limited to 1500 bytes.

      5. (v)

        CRC (cyclic redundancy check): Cyclic redundancy check field. It provides an error detection mechanism, where each sender calculates a CRC code containing address field, type field, and data field, and fills the calculated CRC code into a 4-byte CRC field.

    2. (b)

      The IEEE 802.3 Frame format is developed from the Ethernet II Frame, and is seldom used at present. It replaces the type field of the Ethernet II Frame with the length field, and occupies 8 bytes of the data field as the LLC and SNAP fields, as shown in Fig. 4.11.

      The explanations of the fields are as follows.

      1. (i)

        Length: Defines the number of bytes contained in the data field. This field has a value of 1500 or less (that greater than 1500 is identified as the Ethernet II Frame format).

      2. (ii)

        LLC (logical link control): Consists of destination service access point (DSAP), source service access point (SSAP), and control field.

      3. (iii)

        SNAP (sub-network access protocol): Composed of org code and type field. All three bytes of the org code are “0”; the type field holds the same meaning as the type field in an Ethernet II Frame.

      4. (iv)

        For other fields, please refer to the field description of Ethernet II Frame.

      IEEE 802.3 Frames can be divided into different types by the values of the DSAP and SSAP fields. Interested readers may consult the relevant information.

  3. 3.

    How a switch works

    The switch port that detects the bit stream in the network first restores the bit stream to the data frame of the data link layer, and then conducts corresponding operation on the data frame. Similarly, the switch port converts data frame into bit stream before sending data. So the switch is a device that operates at the data link layer and controls data forwarding through information in the frame. The switch addresses through the destination MAC address in the data frame, and builds its own MAC address table after learning the source MAC address of the data frame, which stores the mapping relationship between the MAC addresses and the switch port. There are three kinds of actions by the switch on frames: flooding, forwarding and discarding, as shown in Fig. 4.12.

    1. (a)

      Flooding: The switch forwards the frame coming in from a certain port through all other ports.

    2. (b)

      Forwarding: The switch forwards the frame coming from a certain port through another port.

    3. (c)

      Discarding: The switch discards the frame coming in from a certain port.

    The following is a general description of the basic workings of a switch.

    1. (a)

      When a unicast frame enters the switch, the switch queries the MAC address table about the destination MAC address.

      1. (i)

        If the MAC address cannot be found, the switch performs flooding.

      2. (ii)

        If it is found, the switch checks whether the corresponding port recorded in the MAC address table is the same as the port via which the frame entered the switch. If not the same, the switch performs forwarding; otherwise, it performs discarding.

    2. (b)

      When a broadcast frame enters the switch, the switch performs flooding directly, instead of querying the MAC address table.

    3. (c)

      If it is a multicast frame that enters the switch, the switch has to perform more complex operations, which are beyond the scope of study here, so it will not be described here.

    In addition, switches are capable of learning. When a frame enters the switch, the switch checks the source MAC address of the frame, maps the source MAC address to the port where the frame enters, and stores this mapping in the MAC address table.

    Here is how the switch works.

    1. (a)

      In the initial state, the switch does not know the MAC address of the host it connects to, so the MAC address table is empty. As shown in Fig. 4.13, SW1 is in the initial state, and there is no table entry in the MAC address table until the data frame sent by PC1 is received.

    2. (b)

      When PC1 sends data to PC3, it usually sends ARP request to get the MAC address of PC3 first. The destination MAC address in this ARP request frame is the broadcast address and the source MAC address is the host MAC address. When SW1 receives this frame, it adds the mapping between the source MAC address and the receiver port to the MAC address table. The aging time of MAC address table entry learned by the S Series Switches defaults to 300 s. If the data frame sent by PC1 is received again during the aging time, the aging time of the mapping between the MAC address of PC1 and Port1 stored in SW1 will be refreshed. Thereafter, when the switch receives a data frame with the source MAC address “00-01-02-03-04-AA”, it forwards it through Port1, as shown in Fig. 4.14.

    3. (c)

      As shown in Fig. 4.15, the destination MAC address of the data frame sent by PC1 is the broadcast address, so SW1 forward this data frame to PC2 and PC3 through Port2 and Port3.

    4. (d)

      After PC2 and PC3 receive this data frame, they view this ARP data frame, but PC2 sends no reply to this frame, while PC3 processes it and send an ARP reply. The destination MAC address of this reply data frame is the MAC address of PC1, and the source MAC address is the MAC address of PC3. When SW1 receives the reply data frame, it adds the mapping between the frame and the port to the MAC address table. If this mapping already exists in the MAC address table, it is refreshed. SW1 queries the MAC address table, confirms the corresponding forwarding port according to the destination MAC address of the frame, and then forwards this data frame through Port1. As shown in Fig. 4.16, reply to complete the communication process from PC1 to PC3.

    After receiving the data frame, the switch learns the frame’s source MAC address to maintain its own MAC address table, and query the MAC address table about the frame’s destination MAC address, then forwards the frame from the corresponding port. Also, the MAC table will continue to record and update the correspondence between the MAC address of other devices communicating through the switch and the ports, in order to guarantee information transmission.

Fig. 4.9
figure 9

Broadcast domain and conflict domain

Fig. 4.10
figure 10

Ethernet II Frame format

Fig. 4.11
figure 11

IEEE 802.3 Frame format

Fig. 4.12
figure 12

Actions by the switch on frames

Fig. 4.13
figure 13

Initial state of the switch

Fig. 4.14
figure 14

Learn the MAC address

Fig. 4.15
figure 15

Forward the data frame

Fig. 4.16
figure 16

Reply

4.3.2 VLAN Technology

In order to extend the traditional LAN while avoiding the aggravation of the conflicts as more computers are connected, we chose the switch that effectively isolates the conflict domain. The switch uses the switching method that forwards the information from the incoming port to the outgoing port, which overcomes the problem of access conflicts on the shared medium and demotes the conflict domain to the port level. The problem of conflict domain is solved by the two-layer fast switching realized by the networking through switches, but the problems of broadcast domain and information security still exist.

To reduce the number of broadcast domains, isolation is required between hosts that do not need to visit each other. The router selects the route based on the three-layer IP address information. When connecting two network segments, it effectively suppresses the forwarding of broadcast messages, but costs high. Therefore, people put forward the solution of constructing multiple logic LANs in a physical LAN, namely VLAN.

The solution logically divides a physical LAN into multiple broadcast domains (i.e., multiple VLANs). Hosts within each VLAN can communicate directly with each other, but the communication between VLANs is not supported. In this way, network security is improved by restraining broadcast messaging within a VLAN.

For example, if different enterprises in the same office building establish independent LANs respectively, they must bear high network investment costs; however, if they share the existing LAN in the building, it is difficult the ensure the information security of the enterprises. VLAN allows the enterprises to share LAN facilities, while taking into account their own network information security.

A typical application of a VLAN is shown in Fig. 4.17, where each dotted box represents a VLAN. Three switches are placed in different locations, such as different floors of an office building; each switch is connected to three computers belonging to three different VLANs, respectively, such as different enterprises.

Fig. 4.17
figure 17

Typical application of a VLAN

4.3.3 Principle of VLAN Technology

In order to realize forwarding control, VLAN tags are added to the Ethernet frames to be forwarded, and then the switch port is set up to deal with the tags and frames, for example discarding or forwarding the frames, or adding or removing labels.

When forwarding a frame, the switch checks whether the Ethernet frame can be forwarded from a port by checking whether the VLAN label carried by the Ethernet frame is a label that is allowed to pass through a certain port. In the scenario shown in Fig. 4.18, given that there is a way to label all Ethernet frames sent by PC1 with “VLAN5”, SW1 can query the Layer Two Forwarding table and forward the frame to the port to which PC2 is connected based on the destination MAC address. Since “VLAN1 only” is configured on the SW2 port, frames sent by PC1 will be discarded by SW2. This means that the switch supporting VLAN technology does not only rely on the destination MAC address, but also consider the VLAN configuration of the port when forwarding Ethernet frames, thus realizing the control of the Layer Two Forwarding. The following is an in-depth discussion of VLAN technology.

  1. 1.

    Frame format of VLAN

    The IEEE 802.1q standard modifies the format of Ethernet frames by adding a 4-byte IEEE 802.1q Tag between the source MAC address field and the type field, as shown in Fig. 4.19.

    IEEE 802.1q Tag contains four fields, which have the following meanings.

    1. (a)

      TPID: 2 bytes long, representing the frame type. A value of 0x8100 indicates an IEEE 802.1q Tag frame. If received by a device that does not support the IEEE 802.1q, it will be discarded.

    2. (b)

      PRI: Priority, 3 bits long, representing the priority of the frame. The value ranges from 0 to 7. The higher the value is, the higher the priority is. When congestion occurs to the switch, data frames with higher priority are sent first.

    3. (c)

      CFI: Canonical format indicator with a length of 1 bit, indicating whether the MAC address is in a classic format. A CFI of 0 indicates classic format and a CFI of 1 indicates non-classic format. It is used to distinguish between Ethernet frames, FDDI frames, and Toking Ring frames. In the Ethernet, the CFI has a value of 0.

    4. (d)

      VID: VLAN ID, with a length of 12 bits, representing the VLAN that the frame operates on. The configurable VID value ranges from 0 to 4095, but the values “0” and “4095” are reserved as specified in the protocol, so unavailable to the user.

      With regard to VLAN tags, Ethernet frames come in the following two formats in a switched network environment.

      1. (i)

        Ethernet frames without 4-byte tags are called standard Ethernet frames, which are untagged data frames.

      2. (ii)

        Ethernet frames with 4-byte tags are called tagged Ethernet frames, which are tagged data frames.

  2. 2.

    Allocation of VLANs

    The VLANs can be allocated via the following five approaches, Among which, the port-based approach is the most common way.

    1. (a)

      Port-based approach

      In the port-based approach, VLANs are allocated by the port No. of switching equipment, as shown in Fig. 4.20. The network administrator configures different port default VID (PVID) for each port of the switch. When a data frame without a VLAN tag enters the switch port, if a PVID is configured on the port, the data frame will be labeled with the PVID. If the incoming frame has VLAN tag, the switch will not add VLAN tag, even if the port is configured with a PVID. Handling VLAN frames depends on the port type.

      By allocating the VLANs based on ports, the grouping members can be defined very simply, but VLANs need to be reconfigured whenever members move.

    2. (b)

      MAC address-based approach

      In the MAC address-based approach, VLANs are allocated based on MAC addresses of devices connected to switch ports. After the network administrator configures the mapping table of MAC address and VID, if the switch receives untagged frames (without a VLAN tag), VID will be added according to the table.

      In this way, there is no need to reconfigure the VLAN when the physical location of the end user changes. This improves the security of end users and the flexibility of access.

    3. (c)

      Subnet-based approach

      When the switching equipment receives untagged data frame, the VID to be added is determined according to the IP address information in the packet.

      The subnet-based approach reduces the workload of network administers and improves the convenience of network management by transmitting packets sent from designated network segments or IP addresses in designated VLAN.

    4. (d)

      Protocol-based approach

      According to the protocol (cluster) type and encapsulation format of the packets received by the port, different VIDs are assigned to the packets.

      When VLANs are allocated based on protocol, the service types provided in the network can be bound with VLANs to facilitate management and maintenance.

    5. (e)

      Policy-based approach

      This approach allocates VLANs based on the combination of MAC address, IP address and port. To allocate VLANs in this way, the MAC address and IP address of the terminal must be configured on the switch and associated with the VLAN. Only qualified terminals can join the specified VLAN. It is forbidden to modify the IP address or MAC address after the terminal meeting the policy joins the specified VLAN, otherwise it will cause the terminal to exit from the specified VLAN.

      After VLAN allocation based on policy and successful VLAN allocation, users are forbidden to change IP address or MAC address, hence the high security. Compared with other VLAN allocation methods, VLAN allocation based on policy is the approach of the highest priority.

      When a device supports multiple allocation approaches, the priority of the approaches is as follows: policy-based (highest priority) -> subnet-based -> protocol-based -> MAC address-based -> port-based (lowest priority). The port-based approach is the most common way currently.

  3. 3.

    Forwarding process of VLAN

    VLAN technology realizes the control of packet forwarding through the tags in Ethernet frames and VLAN configuration of switch ports. Suppose the switch has ports A and B, and Port A receives Ethernet frames. If the forwarding table shows that the destination MAC address exists under Port B, whether the frame can be forwarded from Port B after VLAN is introduced depends on the following two key points:

    1. (a)

      whether the VID carried by the frame is created by the switch;

    2. (b)

      whether the destination port allows the frame carrying the VID to pass.

    The forwarding process is shown in Fig. 4.21. In the process of forwarding, tag operation includes the following two types.

    1. (a)

      Tagging: When the port receives untagged data frames, it tag the data frames with PVIDs.

    2. (b)

      Untagging: VLAN tag information in the frames is deleted and sent to the opposite device in the form of untagged data frame.

Note

Under normal circumstances, the switch will not change the VID value in the tagged data frames.However, special services supported by some devices may provide the function of changing VIDs, which is beyond the scope of this book.

Fig. 4.18
figure 18

A VLAN communication scenario

Fig. 4.19
figure 19

IEEE 802.1q-based Ethernet frame format

Fig. 4.20
figure 20

VLAN allocation based on port

Fig. 4.21
figure 21

Forwarding process

4.3.4 VLAN Interface Types

In order to improve the processing efficiency, the switches always use tagged data frames internally and handle them in a unified way. When an untagged data frame enters a switch port, if the port is configured with a PVID, the data frame will be marked with the PVID of the port. If the data frame is tagged, the switch will not tag the data frame with the VLAN tag even if the port is configured with a PVID. Depending on the different port types, the switch processes frames differently. The following will introduce three different VLAN port types (see Fig. 4.22).

  1. 1.

    Access port: Generally used to connect with user terminals (such as user hosts, servers, etc.) that cannot recognize VLAN tags, or when it is not necessary to distinguish different VLAN members. It can only send and receive untagged frames, and can only add unique VLAN tag to untagged frames.

  2. 2.

    Trunk port: Generally used to connect switches, routers, APS and voice terminals that can send and receive both tagged frames and untagged frames. It allows multiple data frames to pass with tags, but only one data frame without tag is allowed when the data frames are sent out from such ports (i.e., to strip the tags).

  3. 3.

    Hybrid port: Used to connect user terminals (such as user hosts, servers, etc.) and network equipment that cannot recognize VLAN tags, or to connect switches and routers, and voice terminals and APS that can send and receive both tagged frames and untagged frames. It allow multiple data frames to pass with tags, and allow frames sent from such ports to be configured as some with VLAN tags (i.e., not to strip the tags) and some without tags (i.e., to strip the tags) as required.

Many application scenarios support the commonality of Hybrid ports and Trunk ports, but some application scenarios only support Hybrid port. For example, in the scenario where one port is connected to different VLAN segments, Hybrid port must be used, because one port needs to add tags to multiple untagged packets.

Fig. 4.22
figure 22

Three different VLAN port types

Table 4.5 compares the above three different VLAN port types.

Table 4.5 Comparison of the three different VLAN port types

4.4 IP Routing Principle

Routing is a different concept from switching, although they are very similar. Chapter 3 tells us that switching occurs in the data link layer, while routing occurs in the network layer. Although they both forward data, the information utilized and the way it is processed is different. This section will describe how routing works and routing protocols.

4.4.1 What Is Routing

Routing is an extremely interesting and complex subject, so what exactly is routing? Routing is the path information that guides an IP message from its source to its destination, as shown in Fig. 4.23. Alternatively, routing can be understood as the process of sending packets from a source to a destination.

Fig. 4.23
figure 23

Routing

As shown in Fig. 4.24, the transmission of packets in the network is like a relay race in sports, where each router is only responsible for forwarding packets through the optimal path at this site, and relaying packets through the optimal path to the destination by multiple routers one stop at a time. Of course, there are some exceptions. Due to the implementation of some routing policies, the path through which packets pass is not necessarily optimal. It should be added that if a router is connected to another router through a network, the two routers, which are one network segment apart, are considered to be adjacent in the Internet. The arrows shown in Fig. 4.24 indicate the network segments. As for which physical links each segment consists of, it is not a matter of concern for the router.

Fig. 4.24
figure 24

Packet transmission in the network

The above simple explanation shows that routers deliver packets on a hop-by-hop basis. Each router sends out the packets it receives according to certain rules, and does not bother about the subsequent sending of packets. This model can be simply understood as the devices are independent of each other for data forwarding and do not interfere with each other.

4.4.2 How Routing Works

We already know the concept of routing and routers. The following two aspects will explain how routing works.

  1. 1.

    Routing table

    Routers work by relying on routing tables for forwarding data. The routing table is like a map containing information about the paths (routing entries) to each destination network, and each entry should contain at least the following information.

    1. (a)

      Destination network: Indicates the address of the network that can be reached by the router.

    2. (b)

      Next hop: Usually, the next hop generally points to the interface address of the next router to the destination network, which is called the next-hop router.

    3. (c)

      Outgoing interface: Indicates from which interface of this router the packet is sent out.

    In the router, you can view the routing table by executing the [display ip routing-table] command, the result of which is shown in Fig. 4.25.

    The routing table contains the following key items.

    1. (a)

      Destination: Destination address, used to identify the destination address or destination network of IP packets.

    2. (b)

      Mask: Network mask, used to identify the address of the network segment where the destination host or router is located together with the destination address.

    3. (c)

      Proto: Protocol, used to generate and maintain the routing protocol or way, such as Static, OSPF, IS-IS, BGP, etc.

    4. (d)

      Pre: Preference, the priority of this route to join the IP routing table. For the same destination, there may be several routes with different next hops and outgoing interfaces, and these different routes may be discovered by different routing protocols, or may be manually configured static routes. The one with higher priority (smaller value) will become the current optimal route.

    5. (e)

      Cost: Routing overhead. When multiple routes to the same destination have the same priority, the one with the lowest routing overhead will be the current optimal route. Preference is used to compare the routing priorities between different routing protocols, and Cost is used to compare the priorities of different routes within the same routing protocol.

    6. (f)

      NextHop: Next-hop IP address, indicating the next device through which the IP packet is routed.

    7. (g)

      Interface: Output interface, indicating the interface on which the IP packet will be forwarded by the router.

    In the subsequent content, we will explain the establishment, update, application and optimization of the routing table in more depth.

  2. 2.

    Routing process

    After introducing the routing table, the next step is to deepen the understanding of the routing process through an example. As shown in Fig. 4.26, the left side of R1 is connected to the 10.3.1.0 network, and the right side of R3 is connected to the 10.4.1.0 network. When there is a packet in the 10.3.1.0 network to be sent to the 10.4.1.0 network, the IP routing process is as follows.

    First, the packet from the 10.3.1.0 network is sent to the E1 interface of R1, which is directly connected to the network. After receiving the packet, the E1 interface looks up its own routing table and finds that the next hop to the destination address is 10.1.2.2, and the outgoing interface is E0, so the packet is sent from the E0 interface to the next hop, 10.1.2.2.

    Second, the 10.1.2.2 (E0) interface of R2 receives the packet and also looks up its own routing table based on the destination address of the packet and finds that the next hop to the destination address is 10.2.1.2 and the outgoing interface is E1, so the packet is sent out from the E1 interface and handed over to the next hop 10.2.1.2.

    Finally, the 10.2.1.2 (E0) interface of R3 receives the data, still looks up its own routing table according to the destination address of the packet, finds that the destination address is its own directly connected segment, and the next hop to the destination address is 10.4.1.1, and the interface is E1, so the packet is sent out from the E1 interface and handed over to the destination address.

Fig. 4.25
figure 25

View the results of the routing table

Fig. 4.26
figure 26

Process of IP routing

4.4.3 Sources of Routing

There are three main sources of routing, which are direct routing, dynamic routing and static routing, and they are described below.

  1. 1.

    Direct routing

    A directly connected route is a routing entry for a network segment that is directly connected to the router. Directly connected routes do not require special configuration, but only need to set the IP address on the router interface, and then discovered by the data link layer (when the data link layer protocol is UP, the corresponding route entry appear in the routing table; when the data link layer protocol is DOWN, the corresponding route entry disappears).

    In the routing table, the Proto field of the direct routing is displayed as Direct, as shown in Fig. 4.27.

    When an IP address is configured for interface Ethernet1/0/0 (data link layer is UP), the corresponding route entry appears in the routing table.

  2. 2.

    Static routing

    Static routing involves routes that are manually configured by the administrator. Although network interoperability can be achieved by configuring static routes as well, this configuration is prone to problems. When a network failure occurs, static routes are not automatically corrected, and the administrator must modify their configuration again. Therefore, static routes are generally used in small-scale networks.

    In the routing table, the Proto field of the static routing is displayed as Static, as shown in Fig. 4.28.

    The advantages and disadvantages of static routing are as follows.

    1. (a)

      Advantages

      1. (i)

        Simple to use and easy to implement.

      2. (ii)

        Precise control on routing direction for optimal adjustment of network.

      3. (iii)

        Lower performance requirements for equipment and no extra link bandwidth consumption.

    2. (b)

      Disadvantages

      1. (i)

        Whether the network is smooth and optimized depends entirely on the administrator’s configuration.

      2. (ii)

        When the network is expanded, the complexity of configuration and the workload of the administrator will be increased due to the increase of routing table entries.

      3. (iii)

        When the network topology is changed, it cannot be automatically adapted and requires the administrator to perform the correction.

    Therefore, static routing is generally used in small-scale networks. In addition, static routing is also often used for path selection control, i.e., controlling the routing direction of certain destination networks.

    Assume that the IP addresses and masks of each interface and host of the router are shown in Fig. 4.29. A static route is required so that any two hosts in the figure can interoperate with each other. At this time, it is necessary to configure the IPv4 static route on the router to reach the destination address, such as a static route with a destination address of 1.1.1.0 and a next hop of 1.1.4.1 for R2, and a static route with a destination address of 1.1.3.0 and a next hop of 1.1.4.6 for R2. As a result, the network belonging to R1 is connected to the network belonging to R3 by the above static route, and the specific configuration and verification process can be referred to Chap. 5.

  3. 3.

    Dynamic routing

    Dynamic routing refers to the route discovered by dynamic routing protocol. When the network topology is very complex, the manual configuration of static routing is very laborious and prone to errors, then dynamic routing protocols can be used to automatically discover and modify routes without manual maintenance, but dynamic routing protocols are overhead and complex to configure. A comparison of static routing and dynamic routing is shown in Fig. 4.30.

    There are multiple routing protocols in the network, such as OSPF protocol, IS-IS protocol, BGP, etc. Each routing protocol has its own characteristics and application environment.

    In the routing table, the Proto field of the dynamic routing is displayed as a specific kind of dynamic routing protocol, as shown in Fig. 4.31.

Fig. 4.27
figure 27

Direct routing

Fig. 4.28
figure 28

Static routing

Fig. 4.29
figure 29

Network topology of static routing

Fig. 4.30
figure 30

Static vs. dynamic routing

Fig. 4.31
figure 31

Dynamic routing

4.5 Summary

This chapter introduces the basics of network systems, focusing on the basics of communication networks, network addresses, VLAN technology, and the principles of IP routing. Through the study of this chapter, readers can understand the basic concepts of network systems, understand network addressing, master the principles of VLAN technology and IP routing, laying a solid theoretical foundation for the subsequent study of specific network operations and maintenance.

4.6 Exercise

  1. 1.

    [Multiple Choice] The following options () are network topologies.

    1. A.

      Bus topology

    2. B.

      Mesh topology

    3. C.

      Star topology

    4. D.

      Tree topology

    5. E.

      Fan topology

  2. 2.

    [Multiple Choice] IP hierarchical structure consists of () two parts.

    1. A.

      Host

    2. B.

      Subnet

    3. C.

      Network

    4. D.

      Mask

  3. 3.

    [Multiple Choice] Huawei sets the interface type of VLAN ().

    1. A.

      Access

    2. B.

      Trunk

    3. C.

      Hybrid

    4. D.

      QinQ

  4. 4.

    [Multiple Choice] The sources of routing are ().

    1. A.

      Direct routing

    2. B.

      Cross routing

    3. C.

      Static routing

    4. D.

      Dynamic routing

  5. 5.

    [Multiple Choice] The advantages static routing are ().

    1. A.

      Simple to use, easy to implement

    2. B.

      Precise control on routing direction for optimal adjustment of network.

    3. C.

      When the network topology is changed, can be automatically adapted and requires no administrator to perform the correction.

    4. D.

      Lower performance requirements for equipment and no extra link bandwidth consumption.