- In medium to large networks, a modular design is usually used to split network functions. Within each module, consideration must be given to the flexibility and scalability of the network structure. Genarally, a hierarchical architecture is used, for example, in a campus network that needs to provide access services for a large number of users.
- OSI model: Open System Interconnect Reference ModelThe OSI model is designed to overcome the interconnection difficulties and low efficiency issues associated with using various protocols by defining an open and interconnected network..
- The OSI reference model forms the basis for computer network communications. Its design complies with the following principles:
- There are clear boundaries between layers to facilitate understanding.
- Each layer implements specific functions and does not affect each other.
- Each layer is a service provider and a service user. Specifically, each layer provides services to its upper layer and uses services provided by its lower layer.
- The division of layers encourages the development of standardized protocols.
- There are sufficient layers to ensure that functions of each layer do not overlap.
- The OSI reference model has the following advantages:
- Simplifies network operations.
- Provides standard interfaces that support plug-and-play and are compatible with different vendors.
- Enables vendors to design interoperable network devices and accelerate the development of data communications networks.
- Prevents a change in one area of a network from affecting other areas. Therefore, each area can be updated quickly and independently.
- Simplifies network issues for easier learning and operations.
- In the OSI model, units of data are collectively called Protocol Data Units (PDU). However, each PDU is called a different name according to the layer at which it is sent:
- Application layer (layer 7): data is called an Application Protocol Data Unit (APDU)
- Presentation layer (layer 6): data is called a Presentation Protocol Data Unit (PPDU)
- Session layer (layer 5): data is called a Session Protocol Data Unit (SPDU)
- Transport layer (layer 4): data is called a segment
- Network layer (layer 3): data is called a packet
- Data link layer (layer 2): data is called a frame
- Physical layer: data is called bit stream.
- Each layer of the OSI model encapsulates data to ensure that the data can reach the destination accurately and can be accepted and executed by the terminal host. A node encapsulates the data to be transmitted by using a specific protocol header for transmission. When data is processed at a layer, packets are also added to the tail of the data , which is also called encapsulation.
- The physical layer involves the transmission of bit streams over a transmission medium and is fundamental in the OSI model. It implements the mechanical and electrical features required for data transmission and focuses only on how to transmit bit streams to the peer end through different physical links. The information contained in each bit stream, for example, address or application data, is irrelevant at this layer. Typical devices used at the physical layer include repeaters and hubs.
- The main tasks of the data link layer are to control the physical layer and allow it to present an error-free link to the network layer, detect and correct any errors, and perform traffic control.
- The network layer is responsible for forwarding packets and checks the network topology to determine the optimal route for transmission. It is critical to select a route from the source to the destination for data packets. A network layer device calculates the optimal route to the destination by running a routing protocol (such as RIP), identifies the next network device (hop) to which the data packet should be forwarded, encapsulates the data packet by using the network layer protocol, and sends the data to the next hop by using the service provided by the lower layer.
- The transport layer is responsible for providing effective and reliable services (generally refers to the applications at the application layer) to users.
- In the session layer or upper layers, the data transmission unit is packet. The session layer provides a mechanism for establishing and maintaining communications between applications, including access verification and session management. For example, verification of user logins by a server is completed at the session layer.
- The presentation layer is generally responsible for how user information is represented. It converts data from a given syntax to one that is suitable for use in the OSI system. That is, this layer provides a formatted representation and data conversion service. In addition, this layer is also responsible for data compression, decompression, encryption, and decryption.
- The application layer provides interfaces for operating systems or network applications to access network services.
Application layer
- HyperText Transfer Protocol (HTTP): It is used to access various pages on the web server.
- File Transfer Protocol (FTP): It is used to transfer data from one host to another.
- Domain Name System (DNS): It is used to convert the domain name of the host to an IP address.
Transport layer
- TCP: Provides reliable connection-oriented communications services for applications and applies to applications that require responses.
- User Datagram Protocol (UDP): Provides connectionless communications and does not guarantee reliable transmission of data packets. It is suitable for transmitting a small amount of data at a time, and the application layer is responsible for reliability.
Network layer
- Internet Protocol (IP): The IP protocol and routing protocol work together to find an optimal path that can transmit packets to the destination. The IP protocol is not concerned about the contents of data packets. It is a connectionless and unreliable services.
- Address Resolution Protocol (ARP): Resolves known IP addresses into MAC addresses.
- RARP (Reverse Address Resolution Protocol): It is used to resolve an IP address when a data link layer MAC address is known.
- Internet Control Message Protocol (ICMP): Defines the functions of controlling and transferring messages at the network layer.
- Internet Group Management Protocol (IGMP): Manages multicast group members.
Network access layer
The network access layer consists of two sub-layers: Logic Link Control (LLC) sublayer and Media Access Control (MAC) sublayer.
The sender submits the user data to the application, which then sends the data to the destination. The data encapsulation process is as follows:
- The user data is first transmitted to the application layer, and the application layer information is added.
- After the application layer processing is complete, the data is transmitted to the transport layer. The transport layer information, such as TCP or UDP (the application layer protocol specifies whether to use TCP or UDP) is then added.
- After the processing at the transport layer is complete, the data is transmitted to the Internet layer. The Internet layer information (such as IP address) is then added.
After the data is processed at the Internet layer, the data is transmitted to the network access layer. The network access layer information (such as Ethernet, 802.3, PPP, and HDLC) is added. Then, the data is transmitted to the destination as a bit stream. Processing differs based on different devices. For example, a switch processes only the data link layer information, whereas a router processes the network layer information. The original user data can be restored only when the data reaches the destination.
After the user data arrives at the destination, the decapsulation process is performed as follows.
- Data packets are sent to the network access layer. After the network access layer receives data packets, the data link layer information is removed after packet resolution, and Internet layer information (such as IP address) is obtained.
- After the Internet layer receives data packets, the Internet layer information is removed after packet resolution, and upper-layer protocols (such as TCP) is obtained.
- After the transport layer receives data packets, the transport layer information is removed after packet resolution, and upper-layer protocols (such as HTTP) is obtained.
- After the application layer receives data packets, the application layer information is removed after packet resolution. The data displayed is the same as that received from the host.
The application layer and transport layer provide end-to-end services. The Internet layer and network access layer provide segment-to-segment services
Quintuple structure: Source IP address, destination IP address, protocol in use (for example, 6 indicates TCP, and 17 indicates UDP), source port, and destination port.
Destination port: Generally, well-known application services have standard ports, such as HTTP, FTP, and Telnet. Because some applications are not popular, the applications are usually defined by development vendors to ensure that the service ports registered on the same server are unique.
Source port: Generally, common application services, such as HTTP, FTP, and Telnet, are assigned well-known port numbers (in the range from 0 to 1023). However, some operating systems may use greater port numbers as their initial ports. Because source ports are unpredictable, they are seldom involved in the ACL policy.
A quintuple is a concept. So that an application server can respond to service requests, it must register the port numbers and protocol (TCP or UDP) for the services it hosts. By using the quintuple, the application server can respond to any concurrent service request while ensuring that each link is unique in the system.
- ARP: When a packet is forwarded to a host or gateway in the same network segment, the destination address is known and the MAC address corresponding to the destination address is obtained. In the same network segment, the MAC address is used for communications.
- ICMP: ICMP is used to test network connectivity. Typical applications are Ping and Tracert.
- Routing protocol: Used for communications between users in different network segments.
- SNMP: a network device management protocol
- NetStream: an information sampling protocol. It is usually associated with other devices, such as AntiDDoS.
- By using the ARP protocol, a network device can establish a mapping between a destination IP address and MAC address. After obtaining the destination IP address at the network layer, the network device needs to determine whether the destination MAC address is known.
-a source-ip-address: Specifies the source IP address for sending ICMP Echo Request packets. If the source IP address is not specified, the IP address of the outbound interface is used by default.
-c count: Specifies the number of times that ICMP Echo Request packets are sent. The default value is 5.
-h ttl-value: Specifies the Time To Live (TTL) for ICMP Echo Request packets. The default value is 255.
-t timeout: Specifies the timeout period of waiting for an ICMP Echo Reply packet after an ICMP Echo Request packet is sent.
- -a source-ip-address: Specifies the source address of a tracert packet.
- -f first-ttl: Indicates the initial TTL. The default value is 1.
- -m max-ttl: Indicates the maximum TTL. The default value is 30.
- -name: Displays the host name on each hop.
- -p port: Specifies the UDP port number of the destination host.
- Network segment routes: The destination is a network segment. The subnet mask of an IPv4 destination address is less than 32 bits or the prefix length of an IPv6 destination address is less than 128 bits.
- Host routes: The destination is a host. The subnet mask of an IPv4 destination address is 32 bits or the prefix length of an IPv6 destination address is 128 bits.
- Direct routes: A router is directly connected to the network where the destination is located.
- Indirect routes: A router is indirectly connected to the network where the destination is located.
- Unicast routes: The destination address is a unicast address.
- Multicast routes: The destination address is a multicast address.
- Static routes are easy to configure, have low requirements on the system, and apply to small, simple, and stable networks. However, static routes cannot automatically adapt to network topology changes and manual intervention is required.
- Dynamic routing protocols have their own routing algorithms. Dynamic routes can automatically adapt to network topology changes and apply to networks with a large number of Layer 3 devices. The configurations of dynamic routes are complex. Dynamic routes have higher requirements on the system than static routes do and consume both network and system resources.
- According to the application range, dynamic routing protocols are classified into the following types:
Interior Gateway Protocols (IGP): running in an AS. Common IGPs include the RIP, OSPF, and IS-IS.- Exterior Gateway Protocols (EGP): running in different ASs. BGP is the most frequently used EGP protocol.
- According to the used algorithms, dynamic routing protocols are classified into the following types:
- Distance-vector protocol: includes RIP and BGP. BGP is also called a pathvector protocol.
- Link-state protocol: includes OSPF and IS-IS.
- The NMS sends configuration information to network devices through SNMP.
- The NMS queries and obtains network resource information through SNMP.
- Network devices proactively report alarm messages to the NMS so that network administrators can quickly respond to network issues
- SNMPv1: Easy to implement but has poor security.
- SNMPv2c: The security is low. It is not widely used.
- SNMPv3: Defines a management framework to provide a secure access mechanism for users.
- Traffic visualization: Monitors IP traffic in real time, displays the network traffic trend, and helps administrators detect and handle exceptions in a timely manner.
- Exception detectability: Through the NTA, users can analyze and audit the original IP traffic to identify the root cause of abnormal traffic.
- Proper planning: The traffic trend and customized reports provided by the NTA provide reference for administrators to plan network capacity
- Network management and planning
- Enterprise accounting and departmental charging
- ISP billing report
- Data storage
- Data mining for marketing purposes
- NetStream Data Exporter (NDE): Samples the traffic and exports the traffic statistics.
- NetStream Collector (NSC): Parses packets from the NDE and sends statistics to the database for the NDA to parse.
- NetStream Data Analyzer (NDA): Analyzes and processes the statistics, generates reports, and provides a foundation for various services, such as traffic charging, network planning, and monitoring.
- NDE configured with the NetStream function periodically sends the collected traffic statistics to the NSC.
- NSC processes the traffic statistics, and sends them to the NDA.
- NDA analyzes the data for applications such as charging and network planning.
- When the connection starts, the client sends a SYN to the server. The client sets the SYN's sequence number to a random value a.
- After receiving the SYN, the server replies with a SYN+ACK. The server sets the ACK's acknowledgment number as the received sequence number plus one (that is, a+1), and the SYN's sequence number as a random value b.
- After receiving the SYN+ACK, the client replies with an ACK. The client sets the ACK's acknowledgment number as the received sequence number plus one (that is, b+1).
- The client sends a connection release packet (FIN=1) to the server and stops sending data. The client sets the FIN's sequence number as a (seq=a) and enters the FIN-WAIT-1 state.
- After receiving the FIN, the server replies with an acknowledgement packet (ACK=1). The server sets the ACK's acknowledgement number as the received sequence number plus one (ack=a+1), sets the sequence number as b, and enters the CLOSE-WAIT state.
- After receiving the ACK, the client enters the FIN-WAIT-2 state and waits for the server to send a FIN.
- After the server finishes sending any remaining data, it sends a connection release packet to the client: FIN=1; ack=a+1. Because the connection is in the half-closed state, the server may send more data. Assume that the sequence number is seq=c. The server then enters the LAST-ACK state and waits for acknowledgement from the client.
- After receiving the connection release packet from the server, the client replies with an acknowledgement packet (ACK=1). The client sets the acknowledgement number to ack=c+1 and sequence number to seq=a+1. The client then enters the TIME-WAIT state.
- After receiving the ACK from the client, the server enters the CLOSED state immediately and ends the TCP connection.
- The DNS client queries in recursive mode. The cache server first checks whether the local DNS server has the domain name resolution cache.
- If there is no local cache, the domain name is sent to the root server. After receiving the www.vmall.com request, the root server checks the authorization of the .com and returns the IP address of the top-level domain name server where the .com is located.
- The cache server continues to send a www.vmall.com resolution request to the toplevel domain name server. After receiving the request, the top-level domain name server returns the recursive server IP address of the next-level .vmall.com.
- The cache server continues to send a www.vmall.com resolution request to the recursive server. After receiving the request, the recursive server returns a resolution address of www.vmall.com.If there are a large number of domain names, the recursive server also has multiple levels.
- After obtaining the IP address of www.vmall.com, the cache server sends the IP address to the client and caches the IP address locally.
- If a client requests the domain name resolution of www.vmall.com again, the cache server directly responds with the IP address.
- The server enables port 21 to listen for data and waits to set up a control connection with the client.
- The client initiates a control connection setup request and the server responds.
- The client sends a PORT command through the control connection to notify the server of the temporary port number used for the client data connection.
- The server uses port 20 to establish a data connection with the client.
- The server enables port 21 to listen for data and wait to set up a control connection with the client.
- The client initiates a control connection setup request and the server responds.
- The client sends the PASV command through the control connection to notify the server that the client is in passive mode.
- The server responds and informs the client of the temporary port number used for the data connection.
- A data connection is set up between the client and the temporary port of the server.
- The client (browser) sends a connection request to the web server.
- The server accepts the connection request and establishes a connection. (Steps 1 and 2 are known as TCP three-way handshake.)
- The client sends HTTP commands such as GET (HTTP request packet) to the server through this connection.
- The server receives the command and transmits the required data to the client (HTTP response packets) based on the command.
- The client receives data from the server.
- The server automatically closes the connection after the data is sent (TCP four-way handshake).
- The PC encapsulates the email content into an SMTP message and sends it to the sender's SMTP server.
- The sender sends it to the recipient's SMTP server for storage.
- After receiving the request from the user, the POP3 server obtains the email stored on the SMTP server.
- The POP3 server encapsulates the email into a POP3 message and sends it to the PC.